Move set is now a bitset to support large worlds (#5)

Added supporting benchmark
This commit is contained in:
Erin Catto 2026-05-13 21:01:34 -07:00 • committed by GitHub
commit aedb0e34aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 187 additions and 37 deletions

View file

@ -2115,8 +2115,12 @@ void b3World_DumpMemoryStats( b3WorldId worldId )
fprintf( file, "static tree: %d\n", b3DynamicTree_GetByteCount( world->broadPhase.trees + b3_staticBody ) );
fprintf( file, "kinematic tree: %d\n", b3DynamicTree_GetByteCount( world->broadPhase.trees + b3_kinematicBody ) );
fprintf( file, "dynamic tree: %d\n", b3DynamicTree_GetByteCount( world->broadPhase.trees + b3_dynamicBody ) );
b3HashSet* moveSet = &world->broadPhase.moveSet;
fprintf( file, "moveSet: %d (%d, %d)\n", b3GetHashSetBytes( moveSet ), moveSet->count, moveSet->capacity );
int movedBytes = 0;
for ( int i = 0; i < b3_bodyTypeCount; ++i )
{
movedBytes += b3GetBitSetBytes( &world->broadPhase.movedProxies[i] );
}
fprintf( file, "movedProxies: %d\n", movedBytes );
fprintf( file, "moveArray: %d\n", b3Array_ByteCount( world->broadPhase.moveArray ) );
b3HashSet* pairSet = &world->broadPhase.pairSet;
fprintf( file, "pairSet: %d (%d, %d)\n", b3GetHashSetBytes( pairSet ), pairSet->count, pairSet->capacity );