mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 21:30:33 +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);
|
bumpAndPruneContacts(object);
|
||||||
btRigidBody* body = object->getRigidBody();
|
btRigidBody* body = object->getRigidBody();
|
||||||
if (body) {
|
if (body) {
|
||||||
QList<EntityDynamicPointer> removedDynamics = removeDynamicsForBody(body);
|
|
||||||
_dynamicsWorld->removeRigidBody(body);
|
_dynamicsWorld->removeRigidBody(body);
|
||||||
|
|
||||||
// add it back
|
// add it back
|
||||||
addObjectToDynamicsWorld(object);
|
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