Delete a sphere collision shape * @param sphereShape A pointer to the sphere collision shape to destroy */
| 298 | * @param sphereShape A pointer to the sphere collision shape to destroy |
| 299 | */ |
| 300 | void PhysicsCommon::deleteSphereShape(SphereShape* sphereShape) { |
| 301 | |
| 302 | // If the shape is still part of some colliders |
| 303 | if (sphereShape->mColliders.size() > 0) { |
| 304 | |
| 305 | RP3D_LOG("PhysicsCommon", Logger::Level::Error, Logger::Category::PhysicCommon, |
| 306 | "Error when destroying the SphereShape because it is still used by some colliders", __FILE__, __LINE__); |
| 307 | } |
| 308 | |
| 309 | // Call the destructor of the shape |
| 310 | sphereShape->~SphereShape(); |
| 311 | |
| 312 | // Release allocated memory |
| 313 | mMemoryManager.release(MemoryManager::AllocationType::Pool, sphereShape, sizeof(SphereShape)); |
| 314 | } |
| 315 | |
| 316 | // Create and return a box collision shape |
| 317 | /** |
nothing calls this directly
no test coverage detected