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

@ -2,7 +2,6 @@
// SPDX-License-Identifier: MIT
#include "gfx/debug_adapter.h"
#include "gfx/draw.h"
#include "gfx/keycodes.h"
#include "imgui.h"
#include "mesh_loader.h"
@ -10,6 +9,8 @@
#include "box3d/box3d.h"
#include <stdio.h>
class CardHouseThick : public Sample
{
public:
@ -451,13 +452,9 @@ public:
b3ShapeDef shapeDef = b3DefaultShapeDef();
shapeDef.baseMaterial.rollingResistance = 0.1f;
#if B3_SHAPE_NAME_LENGTH > 0
char buffer[B3_SHAPE_NAME_LENGTH + 1];
snprintf( buffer, sizeof( buffer ), "box_%d", i );
char buffer[16];
snprintf( buffer, sizeof( buffer ), "box_%.3d", i );
shapeDef.name = buffer;
#endif
b3CreateHullShape( bodyId, &shapeDef, &cube.base );
}