Tree perf (#179)

- Optimizations for falling trees.
- Increased B3_MAX_MESH_CONTACT_TRIANGLES  from 256 to 512.
This commit is contained in:
Erin Catto 2026-10-06 09:51:48 -07:00 • committed by GitHub
commit 16f7f4cf4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 1926 additions and 1110 deletions

View file

@ -163,6 +163,14 @@ typedef struct b3ContactPrepareSpan
b3ContactSpec* contacts;
} b3ContactPrepareSpan;
typedef struct b3MeshPrepareSpan
{
int start;
int count;
b3ContactSpec* contacts;
int* order;
} b3MeshPrepareSpan;
typedef struct b3JointPrepareSpan
{
int start;
@ -216,16 +224,16 @@ typedef struct b3StepContext
// Flat view of the wide contact constraint array used by prepare and store.
// prepareSpans has activeColorCount + 1 entries, the last being a sentinel
// at wideContactCount. wideContactConstraints is the contiguous base
// pointer; per-color slices live at colors[i].wideConstraints.
// pointer. Per-color slices live at colors[i].wideConstraints.
void* wideConstraints;
b3WidePrepareSpan* widePrepareSpans;
int wideContactCount;
// Similar for mesh/overflow contact constraints
struct b3ManifoldConstraint* manifoldConstraints;
struct b3ContactConstraint* contactConstraints;
b3ContactPrepareSpan* contactPrepareSpans;
// Similar for overflow contact constraints.
b3ContactPrepareSpan* overflowSpans;
void* wideMeshConstraints;
int* wideMeshManifoldStarts;
b3MeshPrepareSpan* meshPrepareSpans;
b3JointPrepareSpan* jointPrepareSpans;
int activeColorCount;