mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
don't destroy and recreate constraints when reinserting rigid body
This commit is contained in:
parent
d42970d480
commit
b4ff3a8691
1 changed files with 0 additions and 8 deletions
|
@ -261,17 +261,9 @@ void PhysicsEngine::reinsertObject(ObjectMotionState* object) {
|
|||
bumpAndPruneContacts(object);
|
||||
btRigidBody* body = object->getRigidBody();
|
||||
if (body) {
|
||||
QList<EntityDynamicPointer> removedDynamics = removeDynamicsForBody(body);
|
||||
_dynamicsWorld->removeRigidBody(body);
|
||||
|
||||
// add it back
|
||||
addObjectToDynamicsWorld(object);
|
||||
foreach(EntityDynamicPointer dynamic, removedDynamics) {
|
||||
bool success = addDynamic(dynamic);
|
||||
if (!success) {
|
||||
qCDebug(physics) << "PhysicsEngine::reinsertObject failed to recreate dynamic";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue