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;