From 53e5158b1dd54db29b7cba74aed13d23841aafb8 Mon Sep 17 00:00:00 2001 From: Paul Brzeski Date: Mon, 1 Jul 2024 13:36:38 +0000 Subject: [PATCH] #32 - Fixing camera position when debug is switched off --- client/src/app/scenograph/controls.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/app/scenograph/controls.js b/client/src/app/scenograph/controls.js index c2a93f3b..f6d26578 100644 --- a/client/src/app/scenograph/controls.js +++ b/client/src/app/scenograph/controls.js @@ -98,5 +98,9 @@ export default class Controls { debug_off() { this.orbit.dispose(); this.orbit = false; + + // Reset camera y position after disengaging orbit controls. + l.current_scene.camera.position.copy( l.current_scene.scene_objects.ship.mesh.position ); + l.current_scene.camera.position.y += 10.775 / 4; } }