Added a compile time option to use double precision body positions. Most
math remains single precision with minimal performance loss.

`BOX3D_DOUBLE_PRECISION`

Improved accuracy of body inertia computation when shapes are far from
the body origin.

WARNING: several APIs changed but migration should be straight forward
if doubles are not enabled.
This commit is contained in:
Erin Catto 2026-06-18 20:51:16 -07:00 • committed by GitHub
commit 09c65b08ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
115 changed files with 7591 additions and 5295 deletions

View file

@ -148,7 +148,7 @@ static bool b3SensorQueryCallback( int proxyId, uint64_t userData, void* context
}
}
b3Transform otherTransform = b3GetBodyTransform( world, otherShape->bodyId );
b3Transform otherTransform = b3ToRelativeTransform( b3GetBodyTransform( world, otherShape->bodyId ), b3Pos_zero );
bool overlap = b3OverlapSensor( sensorShape, queryContext->transform, otherShape, otherTransform );
if ( overlap == false )
@ -217,7 +217,7 @@ static void b3SensorTask( int startIndex, int endIndex, int workerIndex, void* c
continue;
}
b3Transform transform = b3GetBodyTransformQuick( world, body );
b3Transform transform = b3ToRelativeTransform( b3GetBodyTransformQuick( world, body ), b3Pos_zero );
b3SensorQueryContext queryContext = {
.world = world,