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

Method doRemoveBody

core/physics/PhysicsWorld.cpp:805–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

803}
804
805void PhysicsWorld::doRemoveBody(PhysicsBody* body)
806{
807 AXASSERT(body != nullptr, "the body can not be nullptr");
808
809 // remove shapes
810 for (auto&& shape : body->getShapes())
811 {
812 removeShape(shape);
813 }
814
815 // remove body
816 if (cpSpaceContainsBody(_cpSpace, body->_cpBody))
817 {
818 cpSpaceRemoveBody(_cpSpace, body->_cpBody);
819 }
820}
821
822void PhysicsWorld::doRemoveJoint(PhysicsJoint* joint)
823{

Callers

nothing calls this directly

Calls 3

cpSpaceContainsBodyFunction · 0.85
cpSpaceRemoveBodyFunction · 0.85
getShapesMethod · 0.80

Tested by

no test coverage detected