| 820 | } |
| 821 | |
| 822 | void 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 | |
| 847 | void PhysicsWorld::removeAllBodies() |
| 848 | { |
nothing calls this directly
no test coverage detected