Ejemplo n.º 1
0
 def test_addCollisionObject(self):
     world = CollisionWorld()
     obj = CollisionObject()
     shape = SphereShape(3)
     obj.setCollisionShape(shape)
     world.addCollisionObject(obj)
     self.assertEqual(world.getNumCollisionObjects(), 1)
Ejemplo n.º 2
0
 def test_setCollisionShape(self):
     obj = CollisionObject()
     # Let go of the shape reference, it shouldn't matter.
     obj.setCollisionShape(SphereShape(3))
     shape = obj.getCollisionShape()
     self.assertTrue(isinstance(shape, SphereShape))
     self.assertEquals(shape.getRadius(), 3)
Ejemplo n.º 3
0
 def test_addCollisionObject(self):
     world = CollisionWorld()
     obj = CollisionObject()
     shape = SphereShape(3)
     obj.setCollisionShape(shape)
     world.addCollisionObject(obj)
     self.assertEqual(world.getNumCollisionObjects(), 1)
Ejemplo n.º 4
0
 def test_setCollisionShape(self):
     obj = CollisionObject()
     # Let go of the shape reference, it shouldn't matter.
     obj.setCollisionShape(SphereShape(3))
     shape = obj.getCollisionShape()
     self.assertTrue(isinstance(shape, SphereShape))
     self.assertEquals(shape.getRadius(), 3)
Ejemplo n.º 5
0
 def test_lines(self):
     """
     Some lines are drawn using the debug drawer when
     L{CollisionWorld.debugDrawWorld} is called.
     """
     obj = CollisionObject()
     shape = BoxShape(Vector3(1, 2, 3))
     obj.setCollisionShape(shape)
     self.world.addCollisionObject(obj)
     self.world.debugDrawWorld()
     self.assertTrue(len(self.recorder.lines) > 0)
     for line in self.recorder.lines:
         self.assertEquals(len(line), 9)
Ejemplo n.º 6
0
 def test_lines(self):
     """
     Some lines are drawn using the debug drawer when
     L{CollisionWorld.debugDrawWorld} is called.
     """
     obj = CollisionObject()
     shape = BoxShape(Vector3(1, 2, 3))
     obj.setCollisionShape(shape)
     self.world.addCollisionObject(obj)
     self.world.debugDrawWorld()
     self.assertTrue(len(self.recorder.lines) > 0)
     for line in self.recorder.lines:
         self.assertEquals(len(line), 9)
Ejemplo n.º 7
0
 def test_addBoxShape(self):
     world = CollisionWorld()
     obj = CollisionObject()
     shape = BoxShape(Vector3(2, 3, 4))
     obj.setCollisionShape(shape)
     world.addCollisionObject(obj)
Ejemplo n.º 8
0
 def test_addBoxShape(self):
     world = CollisionWorld()
     obj = CollisionObject()
     shape = BoxShape(Vector3(2, 3, 4))
     obj.setCollisionShape(shape)
     world.addCollisionObject(obj)