MCPcopy Create free account
hub / github.com/crownengine/crown / init

Function init

src/world/physics_world_bullet.cpp:249–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247 static btSequentialImpulseConstraintSolver *_bt_solver;
248
249 void init(Allocator &linear, Allocator &heap, ConsoleServer &cs, const PhysicsSettings *settings)
250 {
251 _linear_allocator = CE_NEW(linear, ProxyAllocator)(linear, "physics");
252 _heap_allocator = CE_NEW(*_linear_allocator, ProxyAllocator)(heap, "physics");
253 _debug_enabled = false;
254 _debug_scale = 0.0f;
255 _debug_flags = DebugFlags::COLLISION_SHAPES
256 | DebugFlags::JOINT_LOCAL_POSES
257 | DebugFlags::JOINT_LIMITS
258 ;
259
260 btAlignedAllocSetCustom(alloc_func, free_func);
261 btAlignedAllocSetCustomAligned(aligned_alloc_func, aligned_free_func);
262
263 btSetCustomEnterProfileZoneFunc(profile_scope_enter_func);
264 btSetCustomLeaveProfileZoneFunc(profile_scope_leave_func);
265
266 _settings = *settings;
267 _bt_configuration = CE_NEW(*_linear_allocator, btDefaultCollisionConfiguration);
268 _bt_dispatcher = CE_NEW(*_linear_allocator, btCollisionDispatcher)(_bt_configuration);
269 _bt_interface = CE_NEW(*_linear_allocator, btDbvtBroadphase);
270 _bt_solver = CE_NEW(*_linear_allocator, btSequentialImpulseConstraintSolver);
271
272 cs.register_command_name("physics", "Configure physics debug visualization.", console_command_physics, NULL);
273 }
274
275 void shutdown(Allocator &linear, Allocator &heap)
276 {

Callers

nothing calls this directly

Tested by

no test coverage detected