Optimizations (#161)

- cache body sim indices and split out fat aabb
- deferred restitution
- the manifold point normal velocity is only computed for restitution or
hit events, otherwise it is zero
This commit is contained in:
Erin Catto 2026-09-20 15:54:52 -07:00 • committed by GitHub
commit 9e5a4cde86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 3395 additions and 864 deletions

View file

@ -33,6 +33,7 @@ b3DeclareArray( b3SolverSet );
b3DeclareArray( b3Joint );
b3DeclareArray( b3Contact );
b3DeclareArray( b3Island );
b3DeclareArray( b3AABB );
b3DeclareArray( b3Shape );
b3DeclareArray( b3Sensor );
b3DeclareArray( b3SensorTaskContext );
@ -176,6 +177,9 @@ typedef struct b3World
// These are sparse arrays that point into the pools above
b3Array( b3Shape ) shapes;
// This follows the shape array and is split out for the hot path in the narrow phase.
b3Array( b3AABB ) fatAABBs;
// Compound shapes are static only, so only the broad-phase static pass can meet one. This
// lets a world without compounds skip the shape type read in the pair batch.
int compoundShapeCount;