diff options
author | HG1 <HG1_public@gmx.net> | 2014-12-03 06:25:06 +0300 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-12-03 06:26:06 +0300 |
commit | 47ebf96de47de4ae66cdc0ddf8f72a95ef8dd49d (patch) | |
tree | e6ee7530191df3011250a6977e12b0f88e591767 /source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | |
parent | 5996ad2fd48536c9e38f7ca4329d3dd19364ee39 (diff) |
BGE: Fix Rigid body constraint deletion
Fix for T41294.
Rigid body constraints are not deleted, if the corresponding game objects are deleted.
Reviewers: moguri
Differential Revision: https://developer.blender.org/D701
Diffstat (limited to 'source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index e17d4402556..38e7df6c573 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -504,9 +504,9 @@ bool CcdPhysicsEnvironment::RemoveCcdPhysicsController(CcdPhysicsController* ctr btRigidBody* body = ctrl->GetRigidBody(); if (body) { - for (int i=body->getNumConstraintRefs()-1;i>=0;i--) + for (int i = m_dynamicsWorld->getNumConstraints()-1;i>=0;i--) { - btTypedConstraint* con = body->getConstraintRef(i); + btTypedConstraint *con = m_dynamicsWorld->getConstraint(i); m_dynamicsWorld->removeConstraint(con); body->removeConstraintRef(con); //delete con; //might be kept by python KX_ConstraintWrapper |