aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2017-09-15 15:41:57 -0500
committerSheikh Dawood Abdul Ajees <[email protected]>2017-09-15 15:41:57 -0500
commitd1c812f1162e5fdb13c215792725b2591d7428f5 (patch)
tree407056c45c7e9320c48fca6a3697d81a061c4ea0 /PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
parentPhysX 3.4, APEX 1.4 patch release @22121272 (diff)
downloadphysx-3.4-d1c812f1162e5fdb13c215792725b2591d7428f5.tar.xz
physx-3.4-d1c812f1162e5fdb13c215792725b2591d7428f5.zip
PhysX 3.4.1, APEX 1.4.1 Release @22845541v3.4.1
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp')
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp b/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
index fde67300..7a0e68a2 100644
--- a/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
@@ -689,23 +689,26 @@ namespace physx
points1In0[i] = V3SetZ(points1In0[i], d);
iPolygonMin = V3Min(iPolygonMin, points1In0[i]);
iPolygonMax = V3Max(iPolygonMax, points1In0[i]);
- if(FAllGrtr(rd, z))
+
+ bool penetrated = false;
+
+ if (FAllGrtr(rd, z))
{
- points1In0Penetration[i] = true;
+ penetrated = true;
- if(contains(points0In0, 3, points1In0[i], rPolygonMin, rPolygonMax))
+ if (contains(points0In0, 3, points1In0[i], rPolygonMin, rPolygonMax))
{
inside++;
-
+
//add this contact to the buffer
const FloatV t = V3Dot(contactNormal, V3Sub(triangle.verts[0], vert1));
- const Vec3V projectPoint = V3ScaleAdd(contactNormal, t, vert1);
+ const Vec3V projectPoint = V3ScaleAdd(contactNormal, t, vert1);
const Vec4V localNormalPen = V4SetW(Vec4V_From_Vec3V(contactNormal), FNeg(t));
numManifoldContacts = addMeshContacts(manifoldContacts, vert1, projectPoint, localNormalPen, triangleIndex, numManifoldContacts);
-
+
//if the numContacts are more than GU_MESH_CONTACT_REDUCTION_THRESHOLD, we need to do contact reduction
const PxU32 numContacts = numManifoldContacts - previousContacts;
- if(numContacts >= GU_MESH_CONTACT_REDUCTION_THRESHOLD)
+ if (numContacts >= GU_MESH_CONTACT_REDUCTION_THRESHOLD)
{
//a polygon has more than GU_MESH_CONTACT_REDUCTION_THRESHOLD(16) contacts with this triangle, we will reduce
//the contacts to GU_SINGLE_MANIFOLD_SINGLE_POLYGONE_CACHE_SIZE(4) points
@@ -714,7 +717,8 @@ namespace physx
}
}
}
-
+
+ points1In0Penetration[i] = penetrated;
}