Set mass data consistent velocity (#45)

- Rename b3Body_GetWorldCenterOfMass to b3Body_GetWorldCenter.
- Rename b3Body_GetLocalCenterOfMass to b3Body_GetLocalCenter.
- Fixed b3Body_SetMassData to correct velocity when local center moves.
This commit is contained in:
Erin Catto 2026-07-04 11:22:29 -07:00 • committed by GitHub
commit 0f6fdad541
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 94 additions and 30 deletions

View file

@ -636,10 +636,10 @@ B3_API float b3Body_GetInverseMass( b3BodyId bodyId );
B3_API b3Matrix3 b3Body_GetWorldInverseRotationalInertia( b3BodyId bodyId );
/// Get the center of mass position of the body in local space
B3_API b3Vec3 b3Body_GetLocalCenterOfMass( b3BodyId bodyId );
B3_API b3Vec3 b3Body_GetLocalCenter( b3BodyId bodyId );
/// Get the center of mass position of the body in world space
B3_API b3Pos b3Body_GetWorldCenterOfMass( b3BodyId bodyId );
B3_API b3Pos b3Body_GetWorldCenter( b3BodyId bodyId );
/// Override the body's mass properties. Normally this is computed automatically using the
/// shape geometry and density. This information is lost if a shape is added or removed or if the