From 7e44b9b3ae282f4fac7a1c4d75c675c3a09eef2d Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 31 May 2018 10:23:49 -0700 Subject: [PATCH] motionState needs correct region when adding to physics --- libraries/physics/src/PhysicalEntitySimulation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index 0ab757df51..ab6c543b17 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -275,6 +275,9 @@ void PhysicalEntitySimulation::getObjectsToAddToPhysics(VectorOfMotionStates& re _physicalObjects.insert(motionState); result.push_back(motionState); entityItr = _entitiesToAddToPhysics.erase(entityItr); + + // make sure the motionState's region is up-to-date before it is actually added to physics + motionState->setRegion(_space->getRegion(entity->getSpaceIndex())); } else { //qWarning() << "Failed to generate new shape for entity." << entity->getName(); ++entityItr;