Bläddra i källkod

Merge pull request #6625 from WestLangley/dev-raycast

Removed Raycaster.precision
Ricardo Cabello 10 år sedan
förälder
incheckning
ccd22a46b7
4 ändrade filer med 5 tillägg och 11 borttagningar
  1. 0 5
      docs/api/core/Raycaster.html
  2. 0 1
      src/core/Raycaster.js
  3. 3 5
      src/objects/Mesh.js
  4. 2 0
      src/objects/PointCloud.js

+ 0 - 5
docs/api/core/Raycaster.html

@@ -98,11 +98,6 @@
 		This value shouldn't be negative and should be larger than the near property. 
 		This value shouldn't be negative and should be larger than the near property. 
 		</div>
 		</div>
 
 
-		<h3>[property:float precision]</h3>
-		<div>
-		The precision factor of the raycaster when intersecting [page:Mesh] objects. 
-		</div>
-
 		<h3>.[page:float linePrecision]</h3>
 		<h3>.[page:float linePrecision]</h3>
 		<div>
 		<div>
 		The precision factor of the raycaster when intersecting [page:Line] objects. 
 		The precision factor of the raycaster when intersecting [page:Line] objects. 

+ 0 - 1
src/core/Raycaster.js

@@ -54,7 +54,6 @@
 
 
 		constructor: THREE.Raycaster,
 		constructor: THREE.Raycaster,
 
 
-		precision: 0.0001,
 		linePrecision: 1,
 		linePrecision: 1,
 
 
 		set: function ( origin, direction ) {
 		set: function ( origin, direction ) {

+ 3 - 5
src/objects/Mesh.js

@@ -107,7 +107,6 @@ THREE.Mesh.prototype.raycast = ( function () {
 			var attributes = geometry.attributes;
 			var attributes = geometry.attributes;
 
 
 			var a, b, c;
 			var a, b, c;
-			var precision = raycaster.precision;
 
 
 			if ( attributes.index !== undefined ) {
 			if ( attributes.index !== undefined ) {
 
 
@@ -153,7 +152,7 @@ THREE.Mesh.prototype.raycast = ( function () {
 
 
 						var distance = raycaster.ray.origin.distanceTo( intersectionPoint );
 						var distance = raycaster.ray.origin.distanceTo( intersectionPoint );
 
 
-						if ( distance < precision || distance < raycaster.near || distance > raycaster.far ) continue;
+						if ( distance < raycaster.near || distance > raycaster.far ) continue;
 
 
 						intersects.push( {
 						intersects.push( {
 
 
@@ -199,7 +198,7 @@ THREE.Mesh.prototype.raycast = ( function () {
 
 
 					var distance = raycaster.ray.origin.distanceTo( intersectionPoint );
 					var distance = raycaster.ray.origin.distanceTo( intersectionPoint );
 
 
-					if ( distance < precision || distance < raycaster.near || distance > raycaster.far ) continue;
+					if ( distance < raycaster.near || distance > raycaster.far ) continue;
 
 
 					intersects.push( {
 					intersects.push( {
 
 
@@ -221,7 +220,6 @@ THREE.Mesh.prototype.raycast = ( function () {
 			var objectMaterials = isFaceMaterial === true ? this.material.materials : null;
 			var objectMaterials = isFaceMaterial === true ? this.material.materials : null;
 
 
 			var a, b, c;
 			var a, b, c;
-			var precision = raycaster.precision;
 
 
 			var vertices = geometry.vertices;
 			var vertices = geometry.vertices;
 
 
@@ -294,7 +292,7 @@ THREE.Mesh.prototype.raycast = ( function () {
 
 
 				var distance = raycaster.ray.origin.distanceTo( intersectionPoint );
 				var distance = raycaster.ray.origin.distanceTo( intersectionPoint );
 
 
-				if ( distance < precision || distance < raycaster.near || distance > raycaster.far ) continue;
+				if ( distance < raycaster.near || distance > raycaster.far ) continue;
 
 
 				intersects.push( {
 				intersects.push( {
 
 

+ 2 - 0
src/objects/PointCloud.js

@@ -54,6 +54,8 @@ THREE.PointCloud.prototype.raycast = ( function () {
 
 
 				var distance = raycaster.ray.origin.distanceTo( intersectPoint );
 				var distance = raycaster.ray.origin.distanceTo( intersectPoint );
 
 
+				if ( distance < raycaster.near || distance > raycaster.far ) return;
+
 				intersects.push( {
 				intersects.push( {
 
 
 					distance: distance,
 					distance: distance,