From e886bb1f4d980aa0296c9df1c488c72d21acbedf Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 9 Jan 2023 14:47:38 +0100 Subject: [PATCH] Eww mutable state --- scene/10-lobby.pr | 9 +++------ src/engine.ts | 4 ++-- src/index.ts | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/scene/10-lobby.pr b/scene/10-lobby.pr index a923d8d..95311d1 100644 --- a/scene/10-lobby.pr +++ b/scene/10-lobby.pr @@ -36,12 +36,9 @@ - - >>>>>> + + >>>> { - this.xr.baseExperience.camera.position = this.options.initialPos; + this.xr.baseExperience.camera.position = this.options.initialPos.clone(); this.xr.baseExperience.camera.rotation = this.options.initialRotation; this.xr.baseExperience.sessionManager.session.onselect = () => this.xrTeleport(); }); diff --git a/src/index.ts b/src/index.ts index c908547..b395708 100644 --- a/src/index.ts +++ b/src/index.ts @@ -66,7 +66,7 @@ async function enterScene( const camera = runningEngine.camera; camera.applyGravity = false; - camera.position = runningEngine.options.initialPos; + camera.position = runningEngine.options.initialPos.clone(); let lastTouchTime = 0; let lastTouchSpriteName = "";