the-world-engine
Version:
three.js based, unity like game engine for browser
16 lines (15 loc) • 454 B
JavaScript
const debugObjectName = "physics_debug_object";
export function getOrCreatePhysicsDebugRenderObject(e) {
let t = null;
e.scene.iterateChild((e => {
if (e.gameObject.name === debugObjectName && e.gameObject.exists) {
t = e.gameObject;
return false;
}
return true;
}));
if (!t) {
t = e.scene.addChildFromBuilder(e.instantiater.buildGameObject(debugObjectName));
}
return t;
}