stephengold / Libbulletjme

A JNI interface to Bullet Physics and V-HACD
https://stephengold.github.io/Libbulletjme/lbj-en/English/overview.html
Other
84 stars 10 forks source link

GenericJointDemo Support Problem #3

Closed waveware4ai closed 4 years ago

waveware4ai commented 4 years ago

Hello stephengold. :-)

I am trying to implement a legdoll using excellent 'Libbulletjme' project, (ex, https://github.com/kripken/bullet/blob/master/Demos/GenericJointDemo/Ragdoll.cpp) It does not appear to have the following features. (like a btRigidBodyConstructionInfo, shape->calculateLocalInertia function etc ...) I am wondering if it is possible to apply in the current situation, or if you can support this function in the future.

have a nice day, stephengold ~

stephengold commented 4 years ago

Thanks for the inquiry. I'll investigate.

stephengold commented 4 years ago

A 7-year-old fork of Bullet might not be the best place to find examples. The current/authoritative Bullet repo is the one at https://github.com/bulletphysics/bullet3

Many Bullet examples use the btRigidBodyConstructionInfo struct to construct rigid bodies. However, it's not necessary. In Libbulletjme, you construct a rigid body using the PhysicsRigidBody constructor, specifying its shape and mass. The constructor sets the local inertia vector for you. All other parameters of the rigid body can be set after construction, using the setters of PhysicsRigidBody.

stephengold commented 4 years ago

So, to answer your questions:

  1. Yes, it's possible to create ragdolls using Libbulletjme.
  2. Libbulletjme won't support btRigidBodyConstructionInfo, because it would be redundant.
  3. Libbulletjme sets the local inertia of rigid bodies for you. It doesn't provide access to calculateLocalIntertia(), but could in the future if there were a need for it.

Please let me know: is this issue resolved to your satisfaction?

waveware4ai commented 4 years ago

I think need to provide func calculateLocalIntertia() ... :-) Thanks you very much ~ have a nice day !

stephengold commented 4 years ago

Ragdoll.cpp uses calculateLocalInertia() only to create a rigid body. As I pointed out, Libbulletjme does this automatically when you create a rigid body.

Is there some other use case for calculateLocalIntertia()?

waveware4ai commented 4 years ago

Libbulletjme does this automatically when you create a rigid body. <-- Thank you, your advice ...