Browse Source

mention another possible optimization of Raycaster if input ray is normalized

Ben Houston 12 years ago
parent
commit
c027f3f286
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/core/Raycaster.js

+ 2 - 0
src/core/Raycaster.js

@@ -140,6 +140,7 @@
 							// Optimization: if input ray was guarrented to be normalized, we can just set distance = planeDistance
 							// Optimization: if input ray was guarrented to be normalized, we can just set distance = planeDistance
 							distance = raycaster.ray.origin.distanceTo( point );
 							distance = raycaster.ray.origin.distanceTo( point );
 
 
+							// Optimization: clipping based on distance can be done earlier if plane is normalized.
 							if ( distance < raycaster.near || distance > raycaster.far ) continue;
 							if ( distance < raycaster.near || distance > raycaster.far ) continue;
 
 
 							intersects.push( {
 							intersects.push( {
@@ -167,6 +168,7 @@
 							// Optimization: if input ray was guarrented to be normalized, we can just set distance = planeDistance
 							// Optimization: if input ray was guarrented to be normalized, we can just set distance = planeDistance
 							distance = raycaster.ray.origin.distanceTo( point );
 							distance = raycaster.ray.origin.distanceTo( point );
 
 
+							// Optimization: clipping based on distance can be done earlier if plane is normalized.
 							if ( distance < raycaster.near || distance > raycaster.far ) continue;
 							if ( distance < raycaster.near || distance > raycaster.far ) continue;
 
 
 							intersects.push( {
 							intersects.push( {