From 2a8d5faa66ddedc4bc64e323265543fed57644ea Mon Sep 17 00:00:00 2001 From: Tanish Manku <-h> Date: Tue, 22 Apr 2025 01:16:26 -0700 Subject: [PATCH] Bandaid-fix freecam signal spam from render loop when nothing changes --- .../editor3d/app/src/pages/PageEnigma/Editor/free_cam.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/free_cam.ts b/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/free_cam.ts index 1f2674dcd7..5878047c2c 100644 --- a/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/free_cam.ts +++ b/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/free_cam.ts @@ -220,8 +220,12 @@ class FreeCam extends EventDispatcher { this.updateMovementVector(); } + isStationary() { + return this.moveVector.distanceTo(new Vector3(0, 0, 0)) === 0; + } + update(delta: number) { - if (!this.enabled) { + if (!this.enabled || this.isStationary()) { return; }