Create and return a sphere collision shape * @param radius The radius of the sphere collision shape * @return A pointer to the created sphere shape */
| 269 | * @return A pointer to the created sphere shape |
| 270 | */ |
| 271 | SphereShape* PhysicsCommon::createSphereShape(const decimal radius) { |
| 272 | |
| 273 | if (radius <= decimal(0.0)) { |
| 274 | |
| 275 | RP3D_LOG("PhysicsCommon", Logger::Level::Error, Logger::Category::PhysicCommon, |
| 276 | "Error when creating a SphereShape: radius must be a positive value", __FILE__, __LINE__); |
| 277 | } |
| 278 | |
| 279 | SphereShape* shape = new (mMemoryManager.allocate(MemoryManager::AllocationType::Pool, sizeof(SphereShape))) SphereShape(radius, mMemoryManager.getHeapAllocator()); |
| 280 | mSphereShapes.add(shape); |
| 281 | |
| 282 | return shape; |
| 283 | } |
| 284 | |
| 285 | // Destroy a sphere collision shape |
| 286 | /** |