|
@@ -36,16 +36,18 @@ THREE.Line.prototype.raycast = ( function () {
|
|
|
|
|
|
var geometry = this.geometry;
|
|
var geometry = this.geometry;
|
|
|
|
|
|
|
|
+ // Checking boundingSphere distance to ray
|
|
|
|
+
|
|
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
|
|
|
|
- // Checking boundingSphere distance to ray
|
|
|
|
|
|
+ var matrixWorld = this.matrixWorld;
|
|
|
|
|
|
sphere.copy( geometry.boundingSphere );
|
|
sphere.copy( geometry.boundingSphere );
|
|
- sphere.applyMatrix4( this.matrixWorld );
|
|
|
|
|
|
+ sphere.applyMatrix4( matrixWorld );
|
|
|
|
|
|
if ( raycaster.ray.intersectsSphere( sphere ) === false ) return;
|
|
if ( raycaster.ray.intersectsSphere( sphere ) === false ) return;
|
|
|
|
|
|
- inverseMatrix.getInverse( this.matrixWorld );
|
|
|
|
|
|
+ inverseMatrix.getInverse( matrixWorld );
|
|
ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
|
|
ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
|
|
|
|
|
|
var vStart = new THREE.Vector3();
|
|
var vStart = new THREE.Vector3();
|