浏览代码

Make comments more explicit (#27025)

WestLangley 1 年之前
父节点
当前提交
e1f5e9c18d
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/math/Vector3.js

+ 3 - 3
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;