MCPcopy Create free account
hub / github.com/axmolengine/axmol / doRemoveJoint

Method doRemoveJoint

core/physics/PhysicsWorld.cpp:822–845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820}
821
822void PhysicsWorld::doRemoveJoint(PhysicsJoint* joint)
823{
824 for (auto&& constraint : joint->_cpConstraints)
825 {
826 cpSpaceRemoveConstraint(_cpSpace, constraint);
827 }
828 _joints.remove(joint);
829 joint->_world = nullptr;
830
831 if (joint->getBodyA())
832 {
833 joint->getBodyA()->removeJoint(joint);
834 }
835
836 if (joint->getBodyB())
837 {
838 joint->getBodyB()->removeJoint(joint);
839 }
840
841 if (joint->_destroyMark)
842 {
843 delete joint;
844 }
845}
846
847void PhysicsWorld::removeAllBodies()
848{

Callers

nothing calls this directly

Calls 3

cpSpaceRemoveConstraintFunction · 0.85
removeMethod · 0.45
removeJointMethod · 0.45

Tested by

no test coverage detected