|
@@ -45,6 +45,12 @@ THREE.Ray.prototype = {
|
|
|
|
|
|
},
|
|
|
|
|
|
+ lookAt: function ( v ) {
|
|
|
+
|
|
|
+ this.direction.copy( v ).sub( this.origin ).normalize();
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
recast: function () {
|
|
|
|
|
|
var v1 = new THREE.Vector3();
|
|
@@ -239,11 +245,8 @@ THREE.Ray.prototype = {
|
|
|
return function ( sphere, optionalTarget ) {
|
|
|
|
|
|
v1.subVectors( sphere.center, this.origin );
|
|
|
-
|
|
|
var tca = v1.dot( this.direction );
|
|
|
-
|
|
|
var d2 = v1.dot( v1 ) - tca * tca;
|
|
|
-
|
|
|
var radius2 = sphere.radius * sphere.radius;
|
|
|
|
|
|
if ( d2 > radius2 ) return null;
|