Delete a box collision shape * @param boxShape A pointer to the box shape to destroy */
| 348 | * @param boxShape A pointer to the box shape to destroy |
| 349 | */ |
| 350 | void PhysicsCommon::deleteBoxShape(BoxShape* boxShape) { |
| 351 | |
| 352 | // If the shape is still part of some colliders |
| 353 | if (boxShape->mColliders.size() > 0) { |
| 354 | |
| 355 | RP3D_LOG("PhysicsCommon", Logger::Level::Error, Logger::Category::PhysicCommon, |
| 356 | "Error when destroying the BoxShape because it is still used by some colliders", __FILE__, __LINE__); |
| 357 | } |
| 358 | |
| 359 | // Call the destructor of the shape |
| 360 | boxShape->~BoxShape(); |
| 361 | |
| 362 | // Release allocated memory |
| 363 | mMemoryManager.release(MemoryManager::AllocationType::Pool, boxShape, sizeof(BoxShape)); |
| 364 | } |
| 365 | |
| 366 | // Create and return a capsule shape |
| 367 | /** |