| 221 | } |
| 222 | |
| 223 | void Space::removeBody( Body* body ) { |
| 224 | if ( NULL != body ) { |
| 225 | cpSpaceRemoveBody( mSpace, body->getBody() ); |
| 226 | |
| 227 | auto foundIt = std::find( mBodys.begin(), mBodys.end(), body ); |
| 228 | if ( foundIt != mBodys.end() ) |
| 229 | mBodys.erase( foundIt ); |
| 230 | |
| 231 | PhysicsManager::instance()->removeBodyFree( body ); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | void Space::removeConstraint( Constraint* constraint ) { |
| 236 | if ( NULL != constraint ) { |