Hull sharing (#13)

Save memory when there are many duplicate hulls. Can improve performance
in some cases.

For consistency with b3MeshData, b3Hull is renamed to b3HullData.
This commit is contained in:
Erin Catto 2026-06-11 22:39:26 -07:00 • committed by GitHub
commit a252f03b19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 881 additions and 549 deletions

View file

@ -1332,7 +1332,7 @@ public:
b3ShapeDef shapeDef = b3DefaultShapeDef();
b3Hull* hull = b3CreateCylinder( 0.25f, 0.4f, 0.0f, 12 );
b3HullData* hull = b3CreateCylinder( 0.25f, 0.4f, 0.0f, 12 );
// b3BoxHull box = b3MakeBoxHull( 0.5f, 1.5f, 0.25f );
b3CreateHullShape( m_bodyId, &shapeDef, hull );
b3DestroyHull( hull );
@ -2310,7 +2310,7 @@ public:
bodyDef.allowFastRotation = true;
bodyDef.rotation = b3ComputeQuatBetweenUnitVectors( b3Vec3_axisY, b3Vec3_axisZ );
// b3Hull* hull = b3CreateCylinder( 0.25f, 0.4f, 0.0f, 16 );
// b3HullData* hull = b3CreateCylinder( 0.25f, 0.4f, 0.0f, 16 );
b3WheelJointDef jointDef = b3DefaultWheelJointDef();
jointDef.base.bodyIdA = m_chassisId;