aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp')
-rw-r--r--PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp53
1 files changed, 42 insertions, 11 deletions
diff --git a/PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp b/PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp
index d18961e2..0760d911 100644
--- a/PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp
+++ b/PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp
@@ -859,18 +859,49 @@ void Sc::ShapeInteraction::updateState(const PxU8 externalDirtyFlags)
else if (readInteractionFlag(InteractionFlag::eIS_ACTIVE)) // only re-create the manager if the pair is active
{
PX_ASSERT(mManager); // if the pair is active, there has to be a manager
- PX_ASSERT(activeManagerAllowed());
- // A) This is a newly created pair
- //
- // B) The contact notification or processing state has changed.
- // All existing managers need to be deleted and recreated with the correct flag set
- // These flags can only be set at creation in LL
- //KS - added this code here because it is no longer done in destroyManager() - a side-effect of the parallelization of the interaction management code
- if (mEdgeIndex != IG_INVALID_EDGE)
- scene.getSimpleIslandManager()->clearEdgeRigidCM(mEdgeIndex);
- destroyManager();
- createManager(NULL);
+ if (dirtyFlags & InteractionDirtyFlag::eBODY_KINEMATIC)
+ {
+ //Kinematic->dynamic transition
+ //Kinematic->dynamic transition
+ const IG::IslandSim& islandSim = getScene().getSimpleIslandManager()->getSpeculativeIslandSim();
+
+ //
+ //check whether active in the speculative sim!
+ const BodySim* bodySim0 = getShape0().getBodySim();
+ const BodySim* bodySim1 = getShape1().getBodySim();
+
+ if (!islandSim.getNode(bodySim0->getNodeIndex()).isActiveOrActivating() &&
+ (bodySim1 == NULL || !islandSim.getNode(bodySim1->getNodeIndex()).isActiveOrActivating()))
+ {
+ onDeactivate(0);
+ scene.notifyInteractionDeactivated(this);
+ }
+ else
+ {
+ //Else we are allowed to be active, so recreate
+ if (mEdgeIndex != IG_INVALID_EDGE)
+ scene.getSimpleIslandManager()->clearEdgeRigidCM(mEdgeIndex);
+ destroyManager();
+ createManager(NULL);
+ }
+ }
+ else
+ {
+
+ PX_ASSERT(activeManagerAllowed());
+
+ // A) This is a newly created pair
+ //
+ // B) The contact notification or processing state has changed.
+ // All existing managers need to be deleted and recreated with the correct flag set
+ // These flags can only be set at creation in LL
+ //KS - added this code here because it is no longer done in destroyManager() - a side-effect of the parallelization of the interaction management code
+ if (mEdgeIndex != IG_INVALID_EDGE)
+ scene.getSimpleIslandManager()->clearEdgeRigidCM(mEdgeIndex);
+ destroyManager();
+ createManager(NULL);
+ }
}
}