def test_test10(self): p1 = create_xy_plane(0) p2 = create_xy_plane(1e-5) result = p1.has_collisions(p2, atol=1e-4) self.assertEqual(result['collision'], True)
def test_test1(self): p1 = create_xy_plane(0) p2 = create_xy_plane(1) result = p1.has_collisions(p2) self.assertEqual(result['collision'], False)
def test_test1(self): p1 = create_xy_plane(1) v = np.array([0., 0., 1.]) self.assertEqual(p1.distance, 1.) self.assertEqual(np.all(p1.norm_vector == v), True)
demonstration of the Plane handling and collision detection """ from pycollision.objects import Sphere, Plane, Box from pycollision.planes import create_xy_plane, create_xz_plane, \ create_yz_plane from pycollision.rotation import * import numpy as np if __name__ == '__main__': p1 = create_xy_plane(1) p1.rotation = create_rotation_Y(90) print(p1.norm_vector) p1.translation = [1, 10, -10] print(p1.distance) # plane / sphere s1 = Sphere([0, 0, 0], 1.) p1 = create_xy_plane(1) p1.translation = [1, 0, 0] result = s1.has_collisions(p1, verbose=True) print(result)
def test_test2(self): p1 = create_xy_plane(0) p2 = create_yz_plane(1) result = p1.has_collisions(p2)
def test_test100(self): p1 = create_xy_plane(0) i = 1 # int object with self.assertRaises(ValueError) as context: result = p1.has_collisions(i)
def test_test20(self): p1 = create_xy_plane(0) p2 = create_yz_plane(1) result = p1.has_collisions(p2, verbose=True, item='value')