diff options
| author | Sheikh Dawood <[email protected]> | 2018-04-09 10:13:48 -0500 |
|---|---|---|
| committer | Sheikh Dawood <[email protected]> | 2018-04-09 10:13:48 -0500 |
| commit | 238605d8225a9135d6b60646e05d066e25424eee (patch) | |
| tree | 2b013bd4946bb3c699d7a06ef1f21be85d367f63 /PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp | |
| parent | Add ParamTool.exe (diff) | |
| download | physx-3.4-238605d8225a9135d6b60646e05d066e25424eee.tar.xz physx-3.4-238605d8225a9135d6b60646e05d066e25424eee.zip | |
PhysX 3.4, APEX 1.4 patch release @23879214
Diffstat (limited to 'PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp')
| -rw-r--r-- | PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp | 53 |
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); + } } } |