Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
| Show First 20 Lines • Show All 498 Lines • ▼ Show 20 Lines | |||||
| bool CcdPhysicsEnvironment::RemoveCcdPhysicsController(CcdPhysicsController* ctrl) | bool CcdPhysicsEnvironment::RemoveCcdPhysicsController(CcdPhysicsController* ctrl) | ||||
| { | { | ||||
| //also remove constraint | //also remove constraint | ||||
| btRigidBody* body = ctrl->GetRigidBody(); | btRigidBody* body = ctrl->GetRigidBody(); | ||||
| if (body) | 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); | m_dynamicsWorld->removeConstraint(con); | ||||
| body->removeConstraintRef(con); | body->removeConstraintRef(con); | ||||
| //delete con; //might be kept by python KX_ConstraintWrapper | //delete con; //might be kept by python KX_ConstraintWrapper | ||||
| } | } | ||||
| m_dynamicsWorld->removeRigidBody(ctrl->GetRigidBody()); | m_dynamicsWorld->removeRigidBody(ctrl->GetRigidBody()); | ||||
| // Handle potential vehicle constraints | // Handle potential vehicle constraints | ||||
| int numVehicles = m_wrapperVehicles.size(); | int numVehicles = m_wrapperVehicles.size(); | ||||
| ▲ Show 20 Lines • Show All 3,041 Lines • Show Last 20 Lines | |||||