コード例 #1
0
ファイル: test_geometric_tests.py プロジェクト: jstasiak/Pyrr
            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
                        )
                    )
コード例 #2
0
ファイル: test_geometric_tests.py プロジェクト: RazerM/Pyrr
 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)
コード例 #3
0
ファイル: test_geometric_tests.py プロジェクト: RazerM/Pyrr
 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]))
コード例 #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)
コード例 #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]))