Ejemplo n.º 1
0
 def setUp(self):
     self.step = 1.0 / 60
     self.motion_state1 = bullet.btDefaultMotionState()
     self.motion_state2 = bullet.btDefaultMotionState()
     self.radius = 1.0
     self.inertia = bullet.btVector3(1, 1, 1)
     self.sphere_shape = bullet.btSphereShape(self.radius)
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull = bullet.btConvexHullShape(self.points)
     self.info = bullet.btRigidBodyConstructionInfo(1.0, self.motion_state1,
                                                    self.sphere_shape,
                                                    self.inertia)
     self.v1 = bullet.btVector3(0, 0, 0)
     self.v2 = bullet.btVector3(0, 0, 0)
     self.v3 = bullet.btVector3(0, 0, 0)
     self.t1 = bullet.btTransform.identity
     self.t2 = bullet.btTransform.identity
     self.body1 = bullet.btRigidBody(self.info)
     self.body2 = bullet.btRigidBody(1.0, self.motion_state2, self.hull,
                                     self.v1)
     self.m1 = bullet.btMatrix3x3.identity
     self.m2 = bullet.btMatrix3x3.identity
Ejemplo n.º 2
0
 def setUp(self):
     self.step = 1.0/60
     self.motion_state1 = bullet.btDefaultMotionState()
     self.motion_state2 = bullet.btDefaultMotionState()
     self.radius = 1.0
     self.inertia = bullet.btVector3(1, 1, 1)
     self.sphere_shape = bullet.btSphereShape(self.radius)
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull = bullet.btConvexHullShape(self.points)
     self.info = bullet.btRigidBodyConstructionInfo(
         1.0,
         self.motion_state1,
         self.sphere_shape,
         self.inertia
     )
     self.v1 = bullet.btVector3(0, 0, 0)
     self.v2 = bullet.btVector3(0, 0, 0)
     self.v3 = bullet.btVector3(0, 0, 0)
     self.t1 = bullet.btTransform.identity
     self.t2 = bullet.btTransform.identity
     self.body1 = bullet.btRigidBody(self.info)
     self.body2 = bullet.btRigidBody(1.0, self.motion_state2,
                                     self.hull, self.v1)
     self.m1 = bullet.btMatrix3x3.identity
     self.m2 = bullet.btMatrix3x3.identity
Ejemplo n.º 3
0
 def setUp(self):
     # Describe a cube
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull = bullet.btConvexHullShape(self.points)
Ejemplo n.º 4
0
 def setUp(self):
     # Describe a cube
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull = bullet.btConvexHullShape(self.points)
Ejemplo n.º 5
0
 def setUp(self):
     # tolerance reflects the internal penetration tolerance
     self.tolerance = bullet.btVector3(0.04, 0.04, 0.04)
     # Describe a cube
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull = bullet.btConvexHullShape(self.points)
Ejemplo n.º 6
0
 def setUp(self):
     # tolerance reflects the internal penetration tolerance
     self.tolerance = bullet.btVector3(0.04, 0.04, 0.04)
     # Describe a cube
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull = bullet.btConvexHullShape(self.points)
Ejemplo n.º 7
0
 def setUp(self):
     # Describe a cube
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull = bullet.btConvexHullShape(self.points)
     self.v1 = bullet.btVector3(0, 0, 0)
     self.v2 = bullet.btVector3(0, 0, 0)
     self.v3 = bullet.btVector3(0, 0, 0)
     self.t1 = bullet.btTransform.identity
Ejemplo n.º 8
0
 def setUp(self):
     # Describe a cube
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull = bullet.btConvexHullShape(self.points)
     self.v1 = bullet.btVector3(0, 0, 0)
     self.v2 = bullet.btVector3(0, 0, 0)
     self.v3 = bullet.btVector3(0, 0, 0)
     self.t1 = bullet.btTransform.identity
Ejemplo n.º 9
0
 def setUp(self):
     # Describe a cube
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull1 = bullet.btConvexHullShape(self.points)
     self.hull2 = bullet.btBox2dShape(self.points[4])
     self.shape1 = bullet.btCompoundShape()
     self.plane = bullet.btStaticPlaneShape(bullet.btVector3(0, 0, 0), 1.0)
     self.v1 = bullet.btVector3(0, 0, 0)
     self.v2 = bullet.btVector3(0, 0, 0)
     self.v3 = bullet.btVector3(0, 0, 0)
     self.t1 = bullet.btTransform.identity
Ejemplo n.º 10
0
 def setUp(self):
     # Describe a cube
     self.points = [
         bullet.btVector3(-1, -1, -1),
         bullet.btVector3(-1, 1, -1),
         bullet.btVector3(-1, -1, 1),
         bullet.btVector3(-1, 1, 1),
         bullet.btVector3(1, 1, 1),
         bullet.btVector3(1, -1, 1),
         bullet.btVector3(1, -1, -1),
         bullet.btVector3(1, 1, -1)
     ]
     self.hull1 = bullet.btConvexHullShape(self.points)
     self.hull2 = bullet.btBox2dShape(self.points[4])
     self.shape1 = bullet.btCompoundShape()
     self.plane = bullet.btStaticPlaneShape(bullet.btVector3(0, 0, 0),
                                            1.0)
     self.v1 = bullet.btVector3(0, 0, 0)
     self.v2 = bullet.btVector3(0, 0, 0)
     self.v3 = bullet.btVector3(0, 0, 0)
     self.t1 = bullet.btTransform.identity
Ejemplo n.º 11
0
 def test_array_ctor(self):
     self.hull = bullet.btConvexHullShape(self.points_arr)
     self.assertEquals(self.hull.num_points, len(self.points))
Ejemplo n.º 12
0
 def test_list_ctor(self):
     self.hull = bullet.btConvexHullShape(list(self.points))
     self.assertEquals(self.hull.num_points, len(self.points))
Ejemplo n.º 13
0
 def test_empty_ctor(self):
     self.hull = bullet.btConvexHullShape()
Ejemplo n.º 14
0
 def test_array_ctor(self):
     self.hull = bullet.btConvexHullShape(self.points_arr)
     self.assertEquals(self.hull.num_points, len(self.points))
Ejemplo n.º 15
0
 def test_list_ctor(self):
     self.hull = bullet.btConvexHullShape(list(self.points))
     self.assertEquals(self.hull.num_points, len(self.points))
Ejemplo n.º 16
0
 def test_empty_ctor(self):
     self.hull = bullet.btConvexHullShape()