aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp
diff options
context:
space:
mode:
authorAles Borovicka <[email protected]>2017-03-15 15:20:53 +0100
committerAles Borovicka <[email protected]>2017-03-15 15:20:53 +0100
commit2398860b2b9bd6d9ec55a4b1cfddbcf1f6e4ebf6 (patch)
tree31a4af0fa12e07fc3a90477a1e3cadaba91cfe05 /PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp
parentPhysX 3.4, APEX 1.4 final release @21757769 (diff)
downloadphysx-3.4-2398860b2b9bd6d9ec55a4b1cfddbcf1f6e4ebf6.tar.xz
physx-3.4-2398860b2b9bd6d9ec55a4b1cfddbcf1f6e4ebf6.zip
PhysX 3.4, APEX 1.4 patch release @21821222
Diffstat (limited to 'PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp')
-rw-r--r--PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp b/PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp
index 288f17ad..70d24cc0 100644
--- a/PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp
+++ b/PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp
@@ -1478,9 +1478,10 @@ void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, bool disableR
b->mCCD->mOverlappingObjects = NULL;
b->mCCD->mUpdateCount = 0;
b->mCCD->mHasAnyPassDone = false;
-
+ b->mCCD->mNbInteractionsThisPass = 0;
}
b->mCCD->mPassDone = 0;
+ b->mCCD->mNbInteractionsThisPass++;
}
if(ba0 && ba1)
{
@@ -1591,7 +1592,10 @@ void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, bool disableR
for (PxU32 j = 0; j < ccdBodyCount; j++)
{
//If the body has already been labelled or if it is kinematic, continue
- if (islandLabels[j] != noLabelYet || mCCDBodies[j].mBody->isKinematic())
+ //Also, if the body has no interactions this pass, continue. In single-pass CCD, only bodies with interactions would be part of the CCD. However,
+ //with multi-pass CCD, we keep all bodies that interacted in previous passes. If the body now has no interactions, we skip it to ensure that island grouping doesn't fail in
+ //later stages by assigning an island ID to a body with no interactions
+ if (islandLabels[j] != noLabelYet || mCCDBodies[j].mBody->isKinematic() || mCCDBodies[j].mNbInteractionsThisPass == 0)
continue;
top = &mCCDBodies[j];
@@ -1899,6 +1903,7 @@ void PxsCCDContext::postCCDDepenetrate(PxBaseTask* /*continuation*/)
for (PxU32 j = 0; j < mCCDBodies.size(); j ++)
{
mCCDBodies[j].mOverlappingObjects = NULL;
+ mCCDBodies[j].mNbInteractionsThisPass = 0;
}
mCCDOverlaps.clear_NoDelete();