MCPcopy Create free account
hub / github.com/melonjs/melonJS / createBroadphase

Function createBroadphase

packages/melonjs/src/physics/broadphase/factory.ts:34–46  ·  view source on GitHub ↗
(world: World)

Source from the content-addressed store, hash-verified

32 * @param world - the world this broadphase will index
33 */
34export function createBroadphase(world: World): Broadphase {
35 if (world.sortOn === "depth") {
36 const aabb = new AABB3d();
37 aabb.setMinMax(-10000, -10000, -10000, 10000, 10000, 10000);
38 return new Octree(world, aabb, collision.maxChildren, collision.maxDepth);
39 }
40 return new QuadTree(
41 world,
42 world.getBounds().clone(),
43 collision.maxChildren,
44 collision.maxDepth,
45 );
46}

Callers 2

constructorMethod · 0.90
sortOnMethod · 0.90

Calls 3

setMinMaxMethod · 0.95
cloneMethod · 0.65
getBoundsMethod · 0.65

Tested by

no test coverage detected