| 803 | } |
| 804 | |
| 805 | void 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 | |
| 822 | void PhysicsWorld::doRemoveJoint(PhysicsJoint* joint) |
| 823 | { |
nothing calls this directly
no test coverage detected