don't assign null Shape to RigidBody already in physics simulation

This commit is contained in:
Andrew Meadows 2018-11-05 11:13:32 -08:00
parent d0181283dd
commit c6cde2d412

View file

@ -305,7 +305,7 @@ bool ObjectMotionState::handleHardAndEasyChanges(uint32_t& flags, PhysicsEngine*
} }
return true; return true;
} }
} } else {
if (_shape == newShape) { if (_shape == newShape) {
// the shape didn't actually change, so we clear the DIRTY_SHAPE flag // the shape didn't actually change, so we clear the DIRTY_SHAPE flag
flags &= ~Simulation::DIRTY_SHAPE; flags &= ~Simulation::DIRTY_SHAPE;
@ -316,6 +316,7 @@ bool ObjectMotionState::handleHardAndEasyChanges(uint32_t& flags, PhysicsEngine*
setShape(newShape); setShape(newShape);
} }
} }
}
if (flags & EASY_DIRTY_PHYSICS_FLAGS) { if (flags & EASY_DIRTY_PHYSICS_FLAGS) {
handleEasyChanges(flags); handleEasyChanges(flags);
} }