Page 1 of 1

Any better documentation?

Posted: Fri Aug 12, 2022 12:53 pm
by kkirbatski
Hello,

I'm pretty new to physics. I'm using Ammo.js (which is Bullet compiled to WebAssembly, so the API is the same.) I'm finding that I know very little about the API and the documentation doesn't really say what certain things are. For example, when dealing with soft bodies, there are nodes, and the node API has a ton of properties on it that are undocumented: m_f, m_im, m_n, m_q, m_v. And I'm also really confused as to what the m prefix even means in the API.

I'm wondering if there is any better documentation about the API.

Thanks

Re: Any better documentation?

Posted: Fri Aug 12, 2022 1:56 pm
by drleviathan
According to the ammo.js github README there exists an IRC channel for discussion:
Discussion takes place on IRC at #emscripten on Mozilla's server (irc.mozilla.org)
You might be able to get help there.

Since javascript must be downloaded before the page is fully working it is common practice to shorten the variable names used in large JS scripts. I would guess that is what is happening here: it is a trade off between fast load and readable code.

The m_ prefix is a common coding style used in C++ and other object oriented languages to denote class data members.

Re: Any better documentation?

Posted: Fri Aug 12, 2022 3:11 pm
by kkirbatski
drleviathan wrote: Fri Aug 12, 2022 1:56 pm According to the ammo.js github README there exists an IRC channel for discussion:
Discussion takes place on IRC at #emscripten on Mozilla's server (irc.mozilla.org)
You might be able to get help there.

Since javascript must be downloaded before the page is fully working it is common practice to shorten the variable names used in large JS scripts. I would guess that is what is happening here: it is a trade off between fast load and readable code.

The m_ prefix is a common coding style used in C++ and other object oriented languages to denote class data members.
I'm not talking about minified variables, I'm talking about the Bullet API. For the btSoftBody::Node, there are properties that are undocumented but are public: x, q, v, f, n, im. You can see the API for that class here: https://pybullet.org/Bullet/BulletFull/ ... 1Node.html

And where is it documented that stuff like kAHR stands for anchor hardness??

-- edit --

Found my answer. It's written inline in the header file. That's ... counterintuitive.