Name cache (#53)

Removed B3_BODY_NAME_LENGTH and B3_SHAPE_NAME_LENGTH.
Now using a name cache instead to save memory and make recordings more
universal.
This is a recording version bump.
This commit is contained in:
Erin Catto 2026-07-06 17:33:45 -07:00 • committed by GitHub
commit 52f1a254ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 759 additions and 824 deletions

View file

@ -47,6 +47,12 @@ typedef struct b3Shape
void* userData;
void* userShape;
uint32_t nameId;
uint16_t generation;
// b3ShapeFlags
uint8_t flags;
union
{
b3Capsule capsule;
@ -57,10 +63,6 @@ typedef struct b3Shape
const b3CompoundData* compound;
};
uint16_t generation;
// b3ShapeFlags
uint8_t flags;
char name[B3_SHAPE_NAME_LENGTH + 1];
} b3Shape;
// A single material shape keeps its material inline. Multi material meshes and compounds own a heap
@ -134,7 +136,6 @@ static inline int b3GetHeightFieldTriangleCount( const b3HeightFieldData* height
// Mesh
b3Triangle b3GetMeshTriangle( const b3Mesh* mesh, int triangleIndex );
bool b3IsValidMesh( const b3MeshData* meshData );
void b3DumpShape( b3World* world, int shapeIndex );
static inline bool b3ShouldShapesCollide( b3Filter filterA, b3Filter filterB )
{