|
@@ -49,14 +49,19 @@ test( "closestPointToPoint", function() {
|
|
|
var a = new THREE.Line3( one3.clone(), new THREE.Vector3( 1, 1, 2 ) );
|
|
|
|
|
|
// nearby the ray
|
|
|
- var b1 = a.closestPointToPoint( zero3.clone() );
|
|
|
+ var b1 = a.closestPointToPoint( zero3.clone(), true );
|
|
|
ok( b1.distanceTo( new THREE.Vector3( 1, 1, 1 ) ) < 0.0001, "Passed!" );
|
|
|
|
|
|
// nearby the ray
|
|
|
- var b = a.closestPointToPoint( new THREE.Vector3( 1, 1, 5 ) );
|
|
|
+ var b2 = a.closestPointToPoint( zero3.clone(), false );
|
|
|
+ console.log( b2 );
|
|
|
+ ok( b2.distanceTo( new THREE.Vector3( 1, 1, 0 ) ) < 0.0001, "Passed!" );
|
|
|
+
|
|
|
+ // nearby the ray
|
|
|
+ var b = a.closestPointToPoint( new THREE.Vector3( 1, 1, 5 ), true );
|
|
|
ok( b.distanceTo( new THREE.Vector3( 1, 1, 2 ) ) < 0.0001, "Passed!" );
|
|
|
|
|
|
// exactly on the ray
|
|
|
- var c = a.closestPointToPoint( one3.clone() );
|
|
|
+ var c = a.closestPointToPoint( one3.clone(), true );
|
|
|
ok( c.distanceTo( one3.clone() ) < 0.0001, "Passed!" );
|
|
|
});
|