From 87d9c0361d99892e1dceb39989bf22fc86bf2a7b Mon Sep 17 00:00:00 2001 From: RGBCube Date: Tue, 19 Dec 2023 16:20:55 +0300 Subject: [PATCH] Uninline rotation --- cube.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cube.js b/cube.js index 52b3d3f..e939868 100644 --- a/cube.js +++ b/cube.js @@ -162,7 +162,9 @@ const orientation = { angularMomentum.z = 0; } - if (!mouse.down) orientation.set(Quat.mul(Quat.fromAngleAxis(theta, axis), orientation.get())); + const rotation = Quat.fromAngleAxis(theta, axis); + + if (!mouse.down) orientation.set(Quat.mul(rotation, orientation.get())); requestAnimationFrame(updateFrame); };