Skip to content

Instantly share code, notes, and snippets.

@robksawyer
Created September 25, 2020 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robksawyer/d0ab7f790b25460f4f09360c90c29197 to your computer and use it in GitHub Desktop.
Save robksawyer/d0ab7f790b25460f4f09360c90c29197 to your computer and use it in GitHub Desktop.
function initDebug() {(
_debug = new Mesh(
new BoxGeometry(.25, .25, .5, 1, 1, 5),
new Shader("DebugCamera", {
uColor: {
value: new Color,
transparent: !0,
depthTest: !1
}
})
)
).renderOrder = 9999,
World.SCENE.add(_debug),
_worldCamera = new PerspectiveCamera;
let p = Global.PLAYGROUND || "m";
p += Utils.query("wasd") ? "wasd" : "orbit";
let pos = Storage.get("debugCameraPos_" + p) || World.CAMERA.position.toArray();
World.CAMERA.position.fromArray(pos),
World.CAMERA.position.debug = !0,
Global.DEBUG_CAMERA_POS = pos,
World.CONTROLS.onChange = _ => Storage.set("debugCameraPos_" + p, World.CAMERA.position.toArray())
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment