raycaster speedup - Geometry / BufferGeometry / Indexed-BufferGeometry

Here is the new pull request. 
This version uses the hitbox for all geometry types.
I included the chnages that you suggested in your comments.  

I found a problem in some cases with floating point roundings. 
(http://en.wikipedia.org/wiki/Round-off_error)
I solved it by just expanding the hitbox by 0.0001.

I have the new test cases here:

Geometry:
http://www.gsx.de/threejs_test/raycast/webgl_interactive_draggablecubes.html

BufferGeometry:
http://www.gsx.de/threejs_test/raycast/webgl_interactive_draggablecubes_bufferGeometry.html

Speedtest with Indexed-BufferGeometry:
http://www.gsx.de/threejs_test/raycast/index.php?NormalThreeJS=0&ModelSmall=1&countIterations=100


best regards 
Benedikt 


 



This would not be a problem. 
Worst case is that the hitbox is too big. 
(And for that the speedup is not as high as it could be. )  


The Problem i am solving is the basic floating point problem.  
0.1 + 0.2 = 0.2999999999997
(http://floating-point-gui.de/) 
(http://en.wikipedia.org/wiki/Round-off_error)

So in our case it could happen that the hit box should be hit at the position 20.0.
But the float that represents that position is 19.9999999999999999997.
After that we test if 20.0 <= 19.9999999999999999997 and get FALSE.

So i only have to get rid of the floating point error.  A too big hit box is only a decrease in speed.