Esempio n. 1
0
 def createGround(self):
     if not self.world:
         return
     groundShape = bullet.btBoxShape((50.0, 50.0, 50.0));
     groundTransform=bullet.btTransform();
     groundTransform.setIdentity();
     groundTransform.setOrigin((0,-50,0));
     self.world.localCreateRigidBody(0.0, groundTransform, groundShape)
Esempio n. 2
0
    def createCubes(self):
        if not self.world:
            return
        colShape = bullet.btBoxShape((SCALING*1,SCALING*1,SCALING*1));
        startTransform=bullet.btTransform();
        startTransform.setIdentity();

        start_x = START_POS_X - ARRAY_SIZE_X/2;
        start_y = START_POS_Y;
        start_z = START_POS_Z - ARRAY_SIZE_Z/2;
        for k in range(ARRAY_SIZE_Y):
            for i in range(ARRAY_SIZE_X):
                for j in range(ARRAY_SIZE_Z):
                    startTransform.setOrigin(
                            Vector3(
                                (2.0*i + start_x),
                                (20+2.0*k + start_y),
                                (2.0*j + start_z)
                                )*
                            SCALING);
                    self.world.localCreateRigidBody(1.0, startTransform, colShape)
Esempio n. 3
0
 def setShootBoxShape(self):
     if self.m_shootBoxShape:
         return
     box = bullet.btBoxShape((0.5,0.5,0.5));
     box.initializePolyhedralFeatures();
     self.m_shootBoxShape = box;
Esempio n. 4
0
 def __init__(self):
     self.m_shootBoxShape=None
     self.m_ShootBoxInitialSpeed=40.0
     box = bullet.btBoxShape((0.5, 0.5, 0.5))
     box.initializePolyhedralFeatures()
     self.m_shootBoxShape=box