Is it possible to read the mass of a rigid body?
-
- Posts: 5
- Joined: Tue Apr 02, 2019 9:11 am
Is it possible to read the mass of a rigid body?
This seems like it should be simple, but I don't see any way to do it in the API.
-
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: Is it possible to read the mass of a rigid body?
The btRigidBody class does not store mass. Instead it has a data member called m_inverseMass. This because it never actually multiplies by mass - it always divides instead.
You can use btRigidBody::getInvMass() to get the inverse mass, and then you can invert that to get mass.
You can use btRigidBody::getInvMass() to get the inverse mass, and then you can invert that to get mass.