Ejemplo n.º 1
0
            def ray_2():
                aabb = numpy.array( [ [-1.0,-1.0,-1.0 ], [ 1.0, 1.0, 1.0 ] ] )
                ray = numpy.array( [ [2.0, 2.0, 2.0 ], [ -1.0, -1.0, -1.0 ] ] )
                expected = numpy.array( [1.0, 1.0, 1.0] )

                result = gt.ray_intersect_aabb( ray, aabb )

                self.assertTrue(
                    numpy.array_equal( result, expected ),
                    "Ray vs AABB intersection incorrect: expected %s, got %s" % (
                        expected, result
                        )
                    )
Ejemplo n.º 2
0
 def test_ray_intersect_aabb_invalid_1(self):
     a = np.array([[-1.0,-1.0,-1.0], [ 1.0, 1.0, 1.0]])
     r = np.array([[2.0, 2.0, 2.0], [ 1.0, 1.0, 1.0]])
     result = gt.ray_intersect_aabb(r, a)
     self.assertEqual(result, None)
Ejemplo n.º 3
0
 def test_ray_intersect_aabb_valid_2(self):
     a = np.array([[-1.0,-1.0,-1.0], [ 1.0, 1.0, 1.0]])
     r = np.array([[2.0, 2.0, 2.0], [ -1.0, -1.0, -1.0]])
     result = gt.ray_intersect_aabb(r, a)
     self.assertTrue(np.array_equal(result, [1.0, 1.0, 1.0]))
Ejemplo n.º 4
0
 def test_ray_intersect_aabb_invalid_1(self):
     a = np.array([[-1.0,-1.0,-1.0], [ 1.0, 1.0, 1.0]])
     r = np.array([[2.0, 2.0, 2.0], [ 1.0, 1.0, 1.0]])
     result = gt.ray_intersect_aabb(r, a)
     self.assertEqual(result, None)
Ejemplo n.º 5
0
 def test_ray_intersect_aabb_valid_2(self):
     a = np.array([[-1.0,-1.0,-1.0], [ 1.0, 1.0, 1.0]])
     r = np.array([[2.0, 2.0, 2.0], [ -1.0, -1.0, -1.0]])
     result = gt.ray_intersect_aabb(r, a)
     self.assertTrue(np.array_equal(result, [1.0, 1.0, 1.0]))