From e1f5e9c18d81569bc635f377ff08f29f6fb62c4b Mon Sep 17 00:00:00 2001 From: WestLangley Date: Sat, 21 Oct 2023 22:43:16 -0400 Subject: [PATCH] Make comments more explicit (#27025) --- src/math/Vector3.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/math/Vector3.js b/src/math/Vector3.js index bac1bdccf8a746..09f56ab9034c1e 100644 --- a/src/math/Vector3.js +++ b/src/math/Vector3.js @@ -251,17 +251,17 @@ class Vector3 { applyQuaternion( q ) { - // Derived from https://raw.org/proof/vector-rotation-using-quaternions/ + // quaternion q is assumed to have unit length const vx = this.x, vy = this.y, vz = this.z; const qx = q.x, qy = q.y, qz = q.z, qw = q.w; - // t = 2q x v + // t = 2 * cross( q.xyz, v ); const tx = 2 * ( qy * vz - qz * vy ); const ty = 2 * ( qz * vx - qx * vz ); const tz = 2 * ( qx * vy - qy * vx ); - // v + w t + q x t + // v + q.w * t + cross( q.xyz, t ); this.x = vx + qw * tx + qy * tz - qz * ty; this.y = vy + qw * ty + qz * tx - qx * tz; this.z = vz + qw * tz + qx * ty - qy * tx;