示例#1
0
 def __init__(self):
     self.color = Color(0.0, 0.0, 0.0)
     self.aabb = aabb.create_from_bounds([0.0, 0.0, 0.0], [0.5, 0.5, 0.5])
     self.translation_matrix = Matrix44.identity()
     self.scale_matrix = Matrix44.identity()
     self.rotation_matrix = Matrix44.identity()
     self.selected = False
示例#2
0
 def test_clamp_points_list(self):
     a = aabb.create_from_bounds([-1, -1, -1], [1, 1, 1])
     points = np.array([
         [1, 1, 1],
         [2, 1, 1],
         [-1, -1, -1],
         [-2, -2, -2],
     ])
     result = aabb.clamp_points(a, points)
     expected = np.array([[1, 1, 1], [1, 1, 1], [-1, -1, -1], [-1, -1, -1]])
     self.assertTrue(np.array_equal(result, expected))
示例#3
0
文件: test_aabb.py 项目: RazerM/Pyrr
 def test_clamp_points_list(self):
     a = aabb.create_from_bounds([-1,-1,-1],[1,1,1])
     points = np.array([
         [1,1,1],
         [2,1,1],
         [-1,-1,-1],
         [-2,-2,-2],
     ])
     result = aabb.clamp_points(a, points)
     expected = np.array([[1,1,1],[1,1,1],[-1,-1,-1],[-1,-1,-1]])
     self.assertTrue(np.array_equal(result, expected))
示例#4
0
 def test_maximum(self):
     a = aabb.create_from_bounds([-1, -1, -1], [1, 1, 1])
     result = aabb.maximum(a)
     self.assertTrue(np.array_equal(result, [1, 1, 1]))
示例#5
0
 def test_create_from_bounds(self):
     result = aabb.create_from_bounds([-1, -1, -1], [1, 1, 1])
     self.assertTrue(np.array_equal(result, [[-1, -1, -1], [1, 1, 1]]))
示例#6
0
文件: box.py 项目: ksons/ln.py
 def __init__(self, min, max):
     self._box = aabb.create_from_bounds(min, max)
示例#7
0
文件: test_aabb.py 项目: RazerM/Pyrr
 def test_create_from_bounds(self):
     result = aabb.create_from_bounds([-1,-1,-1],[1,1,1])
     self.assertTrue(np.array_equal(result, [[-1,-1,-1],[1,1,1]]))
示例#8
0
文件: test_aabb.py 项目: RazerM/Pyrr
 def test_maximum(self):
     a = aabb.create_from_bounds([-1,-1,-1],[1,1,1])
     result = aabb.maximum(a)
     self.assertTrue(np.array_equal(result, [1,1,1]))