mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 03:48:44 +02:00
motionState needs correct region when adding to physics
This commit is contained in:
parent
addbb597fc
commit
7e44b9b3ae
1 changed files with 3 additions and 0 deletions
|
@ -275,6 +275,9 @@ void PhysicalEntitySimulation::getObjectsToAddToPhysics(VectorOfMotionStates& re
|
||||||
_physicalObjects.insert(motionState);
|
_physicalObjects.insert(motionState);
|
||||||
result.push_back(motionState);
|
result.push_back(motionState);
|
||||||
entityItr = _entitiesToAddToPhysics.erase(entityItr);
|
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 {
|
} else {
|
||||||
//qWarning() << "Failed to generate new shape for entity." << entity->getName();
|
//qWarning() << "Failed to generate new shape for entity." << entity->getName();
|
||||||
++entityItr;
|
++entityItr;
|
||||||
|
|
Loading…
Reference in a new issue