Skip to content

Commit

Permalink
Added remaining test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Oct 12, 2018
1 parent 5c35170 commit 2385e74
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/unit_test/perception/Obstalce.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ describe( 'Obstacle', function () {
const geometry = new MeshGeometry( vertices, indices );
const obstacle = new Obstacle( geometry );
const intersectionPoint = new Vector3();
const normal = new Vector3();

const ray = new Ray( new Vector3( 0.5, 1, 0.5 ), new Vector3( 0, - 1, 0 ) );

const result = obstacle.intersectRay( ray, intersectionPoint );
const result = obstacle.intersectRay( ray, intersectionPoint, normal );

expect( result ).not.to.be.null;
expect( intersectionPoint ).to.deep.equal( { x: 0.5, y: 0, z: 0.5 } );
expect( normal ).to.deep.equal( { x: 0, y: 1, z: 0 } );

} );

Expand All @@ -60,13 +62,15 @@ describe( 'Obstacle', function () {
const geometry = new MeshGeometry( vertices );
const obstacle = new Obstacle( geometry );
const intersectionPoint = new Vector3();
const normal = new Vector3();

const ray = new Ray( new Vector3( 0.5, 1, 0.5 ), new Vector3( 0, - 1, 0 ) );

const result = obstacle.intersectRay( ray, intersectionPoint );
const result = obstacle.intersectRay( ray, intersectionPoint, normal );

expect( result ).not.to.be.null;
expect( intersectionPoint ).to.deep.equal( { x: 0.5, y: 0, z: 0.5 } );
expect( normal ).to.deep.equal( { x: 0, y: 1, z: 0 } );

} );

Expand Down

0 comments on commit 2385e74

Please sign in to comment.