提交 0a10d079 编写于 作者: M Mr.doob

Removing position behind origin check.

上级 8476b81c
......@@ -56,7 +56,7 @@ THREE.Ray = function ( origin, direction ) {
var distance = distanceFromIntersection( this.origin, this.direction, object.matrixWorld.getPosition() );
if ( distance === null || distance > object.scale.x ) {
if ( distance > object.scale.x ) {
return [];
......@@ -79,7 +79,7 @@ THREE.Ray = function ( origin, direction ) {
var distance = distanceFromIntersection( this.origin, this.direction, object.matrixWorld.getPosition() );
if ( distance === null || distance > object.geometry.boundingSphere.radius * Math.max( object.scale.x, Math.max( object.scale.y, object.scale.z ) ) ) {
if ( distance > object.geometry.boundingSphere.radius * Math.max( object.scale.x, Math.max( object.scale.y, object.scale.z ) ) ) {
return intersects;
......@@ -179,8 +179,6 @@ THREE.Ray = function ( origin, direction ) {
v0.sub( position, origin );
dot = v0.dot( direction );
if ( dot <= 0 ) return null; // check if position behind origin.
intersect = v1.add( origin, v2.copy( direction ).multiplyScalar( dot ) );
distance = position.distanceTo( intersect );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册