diff --git a/build/three.cjs b/build/three.cjs index 7551a6408fef09..06f863f70b4466 100644 --- a/build/three.cjs +++ b/build/three.cjs @@ -4160,17 +4160,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; diff --git a/build/three.js b/build/three.js index 4e64bbf4a723f9..d060d4a8a67154 100644 --- a/build/three.js +++ b/build/three.js @@ -4165,17 +4165,17 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated 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; diff --git a/build/three.module.js b/build/three.module.js index 4981fd1ed9b671..1dab4000b43b42 100644 --- a/build/three.module.js +++ b/build/three.module.js @@ -4158,17 +4158,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;