Browse Source

Added .setPrecision() to Ray. Fixes #1328.

Mr.doob 13 years ago
parent
commit
73283a606f
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/core/Ray.js

+ 9 - 1
src/core/Ray.js

@@ -24,6 +24,14 @@ THREE.Ray = function ( origin, direction ) {
 
 	};
 
+	var precision = 0.0001;
+
+	this.setPrecision = function ( value ) {
+
+		precision = value;
+
+	};
+
 	var a = new THREE.Vector3();
 	var b = new THREE.Vector3();
 	var c = new THREE.Vector3();
@@ -101,7 +109,7 @@ THREE.Ray = function ( origin, direction ) {
 
 				// bail if ray and plane are parallel
 
-				if ( Math.abs( dot ) < 0.0001 ) continue;
+				if ( Math.abs( dot ) < precision ) continue;
 
 				// calc distance to plane