예제 #1
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))
예제 #2
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))
예제 #3
0
파일: aambb.py 프로젝트: jstasiak/Pyrr
def clamp_points( bb, points ):
    """Takes a list of points and modifies them to
    fit within the AABB.
    """
    # use the same function as present in AABB
    aabb.clamp_points( bb, points )