aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp')
-rw-r--r--PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp b/PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp
index 8b07c702..c736b3d8 100644
--- a/PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp
+++ b/PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp
@@ -267,7 +267,17 @@ void Sc::ShapeSim::onFlagChange(PxShapeFlags oldFlags)
if(oldBp != newBp)
{
if(!oldBp && newBp)
- internalAddToBroadPhase();
+ {
+ // A.B. if a trigger was removed and inserted within the same frame we need to reinsert
+ if(hasTriggerFlags(newFlags) && getScene().getAABBManager()->isMarkedForRemove(getElementID()))
+ {
+ reinsertBroadPhase();
+ }
+ else
+ {
+ internalAddToBroadPhase();
+ }
+ }
else
internalRemoveFromBroadPhase();
}