Fixes 03 (#40)

Fixes #33, #34, #35, #37, #39, #41, #42, #43

Also fixes b3Body_SetMassData inertia tensor.
This commit is contained in:
Erin Catto 2026-07-03 17:15:03 -07:00 • committed by GitHub
commit 655799893a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 771 additions and 151 deletions

View file

@ -733,6 +733,10 @@ static void b3FinalizeBodiesTask( int startIndex, int endIndex, int workerIndex,
sim->force = b3Vec3_zero;
sim->torque = b3Vec3_zero;
// If you hit this then it means you deferred mass computation but never called b3Body_ApplyMassFromShapes
// or b3Body_SetMassData.
B3_ASSERT( ( body->flags & b3_dirtyMass ) == 0 );
body->flags &= ~b3_bodyTransientFlags;
body->flags |= ( sim->flags & ( b3_isSpeedCapped | b3_hadTimeOfImpact ) );
body->flags |= ( state->flags & ( b3_isSpeedCapped | b3_hadTimeOfImpact ) );