aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2018-02-12 15:31:42 -0600
committerSheikh Dawood Abdul Ajees <[email protected]>2018-02-12 15:31:42 -0600
commit52dae55c0c65f42caffa9d803be27be44ac4b8a3 (patch)
treec2fa77a97691d026593fe6aa45f1a56389fc5c70 /PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
parentPhysX 3.4, APEX 1.4 patch release @23472123 (diff)
downloadphysx-3.4-52dae55c0c65f42caffa9d803be27be44ac4b8a3.tar.xz
physx-3.4-52dae55c0c65f42caffa9d803be27be44ac4b8a3.zip
PhysX 3.4, APEX 1.4 patch release @23576764
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp')
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp b/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
index 5f0b20a2..99229dc3 100644
--- a/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMTriangleContactGen.cpp
@@ -32,6 +32,7 @@
#include "GuPCMContactConvexCommon.h"
#include "GuVecTriangle.h"
#include "GuBarycentricCoordinates.h"
+#include "GuConvexEdgeFlags.h"
#if PCM_LOW_LEVEL_DEBUG
#include "PxRenderBuffer.h"
@@ -1153,23 +1154,28 @@ namespace physx
else
{
//ML : defer the contacts generation
- const PxU32 nb = sizeof(PCMDeferredPolyData)/sizeof(PxU32);
- PxU32 newSize = nb + mDeferredContacts->size();
- mDeferredContacts->reserve(newSize);
- PCMDeferredPolyData* PX_RESTRICT data = reinterpret_cast<PCMDeferredPolyData*>(mDeferredContacts->end());
- mDeferredContacts->forceSize_Unsafe(newSize);
-
- data->mTriangleIndex = triangleIndex;
- data->mFeatureIndex = feature1;
- data->triFlags = triFlags;
- data->mInds[0] = triIndices[0];
- data->mInds[1] = triIndices[1];
- data->mInds[2] = triIndices[2];
- V3StoreU(localTriangle.verts[0], data->mVerts[0]);
- V3StoreU(localTriangle.verts[1], data->mVerts[1]);
- V3StoreU(localTriangle.verts[2], data->mVerts[2]);
- return true;
+ if (mSilhouetteEdgesAreActive ||
+ !(triFlags & (ETD_SILHOUETTE_EDGE_01 | ETD_SILHOUETTE_EDGE_12 | ETD_SILHOUETTE_EDGE_20)))
+ {
+ const PxU32 nb = sizeof(PCMDeferredPolyData) / sizeof(PxU32);
+ PxU32 newSize = nb + mDeferredContacts->size();
+ mDeferredContacts->reserve(newSize);
+ PCMDeferredPolyData* PX_RESTRICT data = reinterpret_cast<PCMDeferredPolyData*>(mDeferredContacts->end());
+ mDeferredContacts->forceSize_Unsafe(newSize);
+
+ data->mTriangleIndex = triangleIndex;
+ data->mFeatureIndex = feature1;
+ data->triFlags = triFlags;
+ data->mInds[0] = triIndices[0];
+ data->mInds[1] = triIndices[1];
+ data->mInds[2] = triIndices[2];
+ V3StoreU(localTriangle.verts[0], data->mVerts[0]);
+ V3StoreU(localTriangle.verts[1], data->mVerts[1]);
+ V3StoreU(localTriangle.verts[2], data->mVerts[2]);
+ }
+
+ return true;
}
}
else