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

@ -21,7 +21,7 @@ static void CreateGroup( FallingRagdollData* data, b3WorldId worldId, int rowInd
float span = RAGDOLL_GRID_COUNT * GRID_SIZE;
float groupDistance = 1.0f * span / RAGDOLL_GRID_COUNT;
b3Vec3 position;
b3Pos position;
position.x = -0.5f * span + groupDistance * ( columnIndex + 0.5f );
position.y = 15.0f;
position.z = -0.5f * span + groupDistance * ( rowIndex + 0.5f );
@ -98,8 +98,8 @@ bool UpdateFallingRagdolls( b3WorldId worldId, FallingRagdollData* data )
for ( int b = 0; b < bone_count; ++b )
{
b3BodyId bodyId = human->bones[b].bodyId;
b3Transform xf = b3Body_GetTransform( bodyId );
data->hash = b3Hash( data->hash, (uint8_t*)( &xf ), sizeof( b3Transform ) );
b3WorldTransform xf = b3Body_GetTransform( bodyId );
data->hash = b3Hash( data->hash, (uint8_t*)( &xf ), sizeof( b3WorldTransform ) );
}
}
}