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

@ -101,7 +101,7 @@ public:
// Height of the top box above the ground, measured in the offset's own frame. This holds
// steady at any offset under double precision and drifts once float runs out of resolution.
b3Vec3 top = b3SubPos( b3Body_GetWorldCenterOfMass( m_topBodyId ), m_base );
b3Vec3 top = b3SubPos( b3Body_GetWorldCenter( m_topBodyId ), m_base );
DrawTextLine( "double precision: %s", b3IsDoublePrecision() ? "ON" : "OFF" );
DrawTextLine( "world offset: %.1f km", m_offsetKilometers );