Create and return an instance of PhysicsWorld * @param worldSettings The settings of the physics world * @return A pointer to the created physics world */
| 219 | * @return A pointer to the created physics world |
| 220 | */ |
| 221 | PhysicsWorld* PhysicsCommon::createPhysicsWorld(const PhysicsWorld::WorldSettings& worldSettings) { |
| 222 | |
| 223 | Profiler* profiler = nullptr; |
| 224 | |
| 225 | #ifdef IS_RP3D_PROFILING_ENABLED |
| 226 | |
| 227 | |
| 228 | profiler = createProfiler(); |
| 229 | |
| 230 | // Add a destination file for the profiling data |
| 231 | profiler->addFileDestination("rp3d_profiling_" + worldSettings.worldName + ".txt", Profiler::Format::Text); |
| 232 | |
| 233 | #endif |
| 234 | |
| 235 | PhysicsWorld* world = new(mMemoryManager.allocate(MemoryManager::AllocationType::Heap, sizeof(PhysicsWorld))) PhysicsWorld(mMemoryManager, *this, worldSettings, profiler); |
| 236 | |
| 237 | mPhysicsWorlds.add(world); |
| 238 | |
| 239 | return world; |
| 240 | } |
| 241 | |
| 242 | // Destroy an instance of PhysicsWorld |
| 243 | /** |
no test coverage detected