add feature filtering for collision between spheres and meshes
This commit is contained in:
@ -46,18 +46,10 @@ b3GJKOutput b3GJK(const b3Transform& xfA, const b3GJKProxy& proxyA,
|
||||
// with the closest points.
|
||||
struct b3GJKFeaturePair
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
e_unknown = 0,
|
||||
e_vertex = 1,
|
||||
e_edge = 2,
|
||||
e_face = 3
|
||||
};
|
||||
|
||||
Type typeA; // number of vertices on proxy A
|
||||
Type typeB; // number of vertices on proxy B
|
||||
u32 indexA[3]; // vertices on proxy A
|
||||
u32 countA; // number of vertices on proxy A
|
||||
u32 indexB[3]; // vertices on proxy B
|
||||
u32 countB; // number of vertices on proxy B
|
||||
};
|
||||
|
||||
// Identify the vertices of the features that the closest points between two
|
||||
|
@ -58,6 +58,8 @@ private:
|
||||
|
||||
void Collide();
|
||||
|
||||
void CollideSphere();
|
||||
|
||||
void SynchronizeShapes();
|
||||
|
||||
bool MoveAABB(const b3AABB3& aabb, const b3Vec3& displacement);
|
||||
|
@ -54,13 +54,13 @@ public:
|
||||
{
|
||||
b3GJKFeaturePair featurePair = b3GetFeaturePair(m_cache);
|
||||
|
||||
for (u32 i = 0; i < (u32)featurePair.typeA; ++i)
|
||||
for (u32 i = 0; i < featurePair.countA; ++i)
|
||||
{
|
||||
u32 index = featurePair.indexA[i];
|
||||
g_debugDraw->DrawPoint(m_xfA * m_proxyA.GetVertex(index), b3Color(1.0f, 1.0f, 0.0f));
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < (u32)featurePair.typeB; ++i)
|
||||
for (u32 i = 0; i < featurePair.countB; ++i)
|
||||
{
|
||||
u32 index = featurePair.indexB[i];
|
||||
g_debugDraw->DrawPoint(m_xfB * m_proxyB.GetVertex(index), b3Color(1.0f, 1.0f, 0.0f));
|
||||
@ -133,4 +133,4 @@ public:
|
||||
b3SimplexCache m_cache;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
Reference in New Issue
Block a user