| 197 | } |
| 198 | |
| 199 | void Space::removeShape( Shape* shape ) { |
| 200 | if ( NULL != shape ) { |
| 201 | cpSpaceRemoveShape( mSpace, shape->getShape() ); |
| 202 | |
| 203 | auto foundIt = std::find( mShapes.begin(), mShapes.end(), shape ); |
| 204 | if ( foundIt != mShapes.end() ) |
| 205 | mShapes.erase( foundIt ); |
| 206 | |
| 207 | PhysicsManager::instance()->addShapeFree( shape ); |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | void Space::removeStaticShape( Shape* shape ) { |
| 212 | if ( NULL != shape ) { |