From 2385e748ee532b3a968f46a16795bcf4ae4b294c Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Fri, 12 Oct 2018 21:10:24 +0200 Subject: [PATCH] Added remaining test --- test/unit_test/perception/Obstalce.tests.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/unit_test/perception/Obstalce.tests.js b/test/unit_test/perception/Obstalce.tests.js index 3ebcd935..787e1531 100644 --- a/test/unit_test/perception/Obstalce.tests.js +++ b/test/unit_test/perception/Obstalce.tests.js @@ -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 } ); } ); @@ -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 } ); } );