mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 12:53:12 +02:00
don't assign null Shape to RigidBody already in physics simulation
This commit is contained in:
parent
d0181283dd
commit
c6cde2d412
1 changed files with 9 additions and 8 deletions
|
@ -305,15 +305,16 @@ bool ObjectMotionState::handleHardAndEasyChanges(uint32_t& flags, PhysicsEngine*
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (_shape == newShape) {
|
|
||||||
// the shape didn't actually change, so we clear the DIRTY_SHAPE flag
|
|
||||||
flags &= ~Simulation::DIRTY_SHAPE;
|
|
||||||
// and clear the reference we just created
|
|
||||||
getShapeManager()->releaseShape(_shape);
|
|
||||||
} else {
|
} else {
|
||||||
_body->setCollisionShape(const_cast<btCollisionShape*>(newShape));
|
if (_shape == newShape) {
|
||||||
setShape(newShape);
|
// the shape didn't actually change, so we clear the DIRTY_SHAPE flag
|
||||||
|
flags &= ~Simulation::DIRTY_SHAPE;
|
||||||
|
// and clear the reference we just created
|
||||||
|
getShapeManager()->releaseShape(_shape);
|
||||||
|
} else {
|
||||||
|
_body->setCollisionShape(const_cast<btCollisionShape*>(newShape));
|
||||||
|
setShape(newShape);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags & EASY_DIRTY_PHYSICS_FLAGS) {
|
if (flags & EASY_DIRTY_PHYSICS_FLAGS) {
|
||||||
|
|
Loading…
Reference in a new issue