MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / createPhysicsWorld

Method createPhysicsWorld

src/engine/PhysicsCommon.cpp:221–240  ·  view source on GitHub ↗

Create and return an instance of PhysicsWorld * @param worldSettings The settings of the physics world * @return A pointer to the created physics world */

Source from the content-addressed store, hash-verified

219 * @return A pointer to the created physics world
220 */
221PhysicsWorld* 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/**

Callers 1

mainFunction · 0.45

Calls 3

addFileDestinationMethod · 0.45
allocateMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected