예제 #1
0
파일: shape.py 프로젝트: 5l1v3r1/ModelPlane
 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]))