Browse Source

Quaternion: Use Number.EPSILON in setFromUnitVectors(). (#21484)

Michael Herzog 4 năm trước cách đây
mục cha
commit
a3114f0e3d
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      src/math/Quaternion.js

+ 3 - 3
src/math/Quaternion.js

@@ -363,11 +363,11 @@ class Quaternion {
 
 
 		// assumes direction vectors vFrom and vTo are normalized
 		// assumes direction vectors vFrom and vTo are normalized
 
 
-		const EPS = 0.000001;
-
 		let r = vFrom.dot( vTo ) + 1;
 		let r = vFrom.dot( vTo ) + 1;
 
 
-		if ( r < EPS ) {
+		if ( r < Number.EPSILON ) {
+
+			// vFrom and vTo point in opposite directions
 
 
 			r = 0;
 			r = 0;