|
@@ -93,10 +93,9 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
raycast: function ( raycaster, intersects ) {
|
|
raycast: function ( raycaster, intersects ) {
|
|
|
|
|
|
- var precision = raycaster.linePrecision;
|
|
|
|
-
|
|
|
|
var geometry = this.geometry;
|
|
var geometry = this.geometry;
|
|
var matrixWorld = this.matrixWorld;
|
|
var matrixWorld = this.matrixWorld;
|
|
|
|
+ var threshold = raycaster.params.Line.threshold;
|
|
|
|
|
|
// Checking boundingSphere distance to ray
|
|
// Checking boundingSphere distance to ray
|
|
|
|
|
|
@@ -104,7 +103,7 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
_sphere.copy( geometry.boundingSphere );
|
|
_sphere.copy( geometry.boundingSphere );
|
|
_sphere.applyMatrix4( matrixWorld );
|
|
_sphere.applyMatrix4( matrixWorld );
|
|
- _sphere.radius += precision;
|
|
|
|
|
|
+ _sphere.radius += threshold;
|
|
|
|
|
|
if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;
|
|
if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;
|
|
|
|
|
|
@@ -113,8 +112,8 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
_inverseMatrix.getInverse( matrixWorld );
|
|
_inverseMatrix.getInverse( matrixWorld );
|
|
_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );
|
|
_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );
|
|
|
|
|
|
- var localPrecision = precision / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );
|
|
|
|
- var localPrecisionSq = localPrecision * localPrecision;
|
|
|
|
|
|
+ var localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );
|
|
|
|
+ var localThresholdSq = localThreshold * localThreshold;
|
|
|
|
|
|
var vStart = new Vector3();
|
|
var vStart = new Vector3();
|
|
var vEnd = new Vector3();
|
|
var vEnd = new Vector3();
|
|
@@ -142,7 +141,7 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
var distSq = _ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
|
|
var distSq = _ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
|
|
|
|
|
|
- if ( distSq > localPrecisionSq ) continue;
|
|
|
|
|
|
+ if ( distSq > localThresholdSq ) continue;
|
|
|
|
|
|
interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation
|
|
interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation
|
|
|
|
|
|
@@ -174,7 +173,7 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
var distSq = _ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
|
|
var distSq = _ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
|
|
|
|
|
|
- if ( distSq > localPrecisionSq ) continue;
|
|
|
|
|
|
+ if ( distSq > localThresholdSq ) continue;
|
|
|
|
|
|
interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation
|
|
interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation
|
|
|
|
|
|
@@ -208,7 +207,7 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
var distSq = _ray.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment );
|
|
var distSq = _ray.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment );
|
|
|
|
|
|
- if ( distSq > localPrecisionSq ) continue;
|
|
|
|
|
|
+ if ( distSq > localThresholdSq ) continue;
|
|
|
|
|
|
interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation
|
|
interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation
|
|
|
|
|