cache snap

This commit is contained in:
Erin Catto 2026-10-31 17:26:28 -07:00
commit a3418cc9d1
4 changed files with 14 additions and 9 deletions

View file

@ -55,7 +55,7 @@ void b3BuildTriangleAndCapsuleFaceContact( b3LocalManifold* manifold, const b3Ve
const b3Capsule* capsule );
void b3BuildTriangleAndHullFaceContact( b3LocalManifold* manifold, int capacity, const b3Vec3* triangle, int triangleFlags,
const b3HullData* hull, bool enableSpeculative );
const b3HullData* hull, b3SATCache* cache, bool enableSpeculative );
b3AxisQuery b3ComputeSeparatingAxisW4( const b3HullData* hullA, const b3HullData* hullB, b3Transform xfB, bool earlyReturn );
b3AxisQuery b3ComputeSeparatingAxisW8( const b3HullData* hullA, const b3HullData* hullB, b3Transform xfB, bool earlyReturn );

View file

@ -1088,8 +1088,8 @@ bool b3ComputeMeshManifolds( b3World* world, int workerIndex, b3Contact* contact
}
else if ( result == b3_neighborSnap && shapeB->type == b3_hullShape )
{
b3BuildTriangleAndHullFaceContact( manifold, pointCapacity, vertices,
triangle.flags, hullB, enableSpeculative );
b3BuildTriangleAndHullFaceContact( manifold, pointCapacity, vertices, triangle.flags, hullB,
&cache->satCache, enableSpeculative );
if ( keepDeep && manifold->pointCount == 0 )
{

View file

@ -955,7 +955,7 @@ static void b3CollideTriangleAndHullEdges( b3LocalManifold* manifold, int capaci
// Triangle face contact wrapper.
void b3BuildTriangleAndHullFaceContact( b3LocalManifold* manifold, int capacity, const b3Vec3* triangle, int triangleFlags,
const b3HullData* hull, bool enableSpeculative )
const b3HullData* hull, b3SATCache* cache, bool enableSpeculative )
{
manifold->pointCount = 0;
@ -971,8 +971,13 @@ void b3BuildTriangleAndHullFaceContact( b3LocalManifold* manifold, int capacity,
};
b3SeparatingAxis query = b3QueryTriangleFace( &triangleData, hull );
b3SATCache cache = { 0 };
b3CollideTriangleFace( manifold, capacity, &triangleData, hull, query, &cache, enableSpeculative );
b3SATCache faceCache = { 0 };
b3CollideTriangleFace( manifold, capacity, &triangleData, hull, query, &faceCache, enableSpeculative );
if ( manifold->pointCount > 0 )
{
*cache = faceCache;
}
}
b3AtomicInt b3_triangleConvexCalls;

View file

@ -32,14 +32,14 @@
#else
#define RAGDOLL_SLEEP_STEP 289
#define RAGDOLL_HASH 0xF290ED4B
#define WAVE_PILE_SLEEP_STEP 291
#define WAVE_PILE_HASH 0x3137D79A
#define WAVE_PILE_SLEEP_STEP 296
#define WAVE_PILE_HASH 0x8A4A5802
#define QUERY_SPAWN_SLEEP_STEP 242
#define QUERY_SPAWN_HASH 0xF3AD9BA6
#define QUERY_SPAWN_HIT_COUNT 59
#define QUERY_SPAWN_QUERY_HASH 0xE3271F3D
#define MESH_DROP_SLEEP_STEP 197
#define MESH_DROP_HASH 0xA4184C4B
#define MESH_DROP_HASH 0x70483620
#endif
// The goldens above pin exact values for the default four point manifold. A build that