Commit: 47ebf96de47de4ae66cdc0ddf8f72a95ef8dd49d Author: HG1 Date: Tue Dec 2 19:25:06 2014 -0800 Branches: master https://developer.blender.org/rB47ebf96de47de4ae66cdc0ddf8f72a95ef8dd49d
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 =================================================================== M source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp =================================================================== diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index e17d440..38e7df6 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 _______________________________________________ Bf-blender-cvs mailing list [email protected] http://lists.blender.org/mailman/listinfo/bf-blender-cvs
