Exemplo n.º 1
0
    def initPhysics(self):
        self.setTexturing(True)
        #self.setShadows(True);
        #self.setDebugMode(bullet.btIDebugDraw.DBG_NoHelpText)

        self.setCameraDistance(SCALING * 50.0)

        # collision configuration contains default setup for memory, collision setup
        self.m_collisionConfiguration = bullet.btDefaultCollisionConfiguration(
        )

        # use the default collision dispatcher.
        # For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
        self.m_dispatcher = bullet.btCollisionDispatcher(
            self.m_collisionConfiguration)

        self.m_broadphase = bullet.btDbvtBroadphase()

        # the default constraint solver.
        # For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
        self.m_solver = bullet.btSequentialImpulseConstraintSolver()

        self.m_dynamicsWorld = bullet.btDiscreteDynamicsWorld(
            self.m_dispatcher, self.m_broadphase, self.m_solver,
            self.m_collisionConfiguration)
        self.m_dynamicsWorld.setGravity((0, -10, 0))

        self.initGroundShape()
        self.initRigidBodies()
Exemplo n.º 2
0
    def	initPhysics(self):
        self.setTexturing(True);
        #self.setShadows(True);
        #self.setDebugMode(bullet.btIDebugDraw.DBG_NoHelpText)

        self.setCameraDistance(SCALING*50.0);

        # collision configuration contains default setup for memory, collision setup
        self.m_collisionConfiguration = bullet.btDefaultCollisionConfiguration();

        # use the default collision dispatcher. 
        # For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
        self.m_dispatcher = bullet.btCollisionDispatcher(self.m_collisionConfiguration);

        self.m_broadphase = bullet.btDbvtBroadphase();

        # the default constraint solver. 
        # For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
        self.m_solver = bullet.btSequentialImpulseConstraintSolver();

        self.m_dynamicsWorld = bullet.btDiscreteDynamicsWorld(
                self.m_dispatcher,
                self.m_broadphase,
                self.m_solver,
                self.m_collisionConfiguration);
        self.m_dynamicsWorld.setGravity((0,-10,0));

        self.initGroundShape()
        self.initRigidBodies()
 def setUp(self):
     self.time_step = 1.0 / 60.0
     self.broadphase = bullet.btDbvtBroadphase()
     self.collision_configuration = bullet.btDefaultCollisionConfiguration()
     self.dispatcher = bullet.btCollisionDispatcher(
         self.collision_configuration)
     self.solver = bullet.btSequentialImpulseConstraintSolver()
     self.dynamics_world = bullet.btDiscreteDynamicsWorld(
         self.dispatcher, self.broadphase, self.solver,
         self.collision_configuration)
Exemplo n.º 4
0
 def setUp(self):
     self.solver = bullet.btSequentialImpulseConstraintSolver()
     self.cinfo = bullet.btDefaultCollisionConstructionInfo()
     self.collision_config = \
         bullet.btDefaultCollisionConfiguration(self.cinfo)
     self.broadphase = bullet.btDbvtBroadphase()
     self.dispatcher = bullet.btCollisionDispatcher(self.collision_config)
     self.gravity = bullet.btVector3(0, -9.8, 0)
     self.time_step = 1.0 / 60
     self.collision_object = bullet.btCollisionObject()
     self.v1 = bullet.btVector3(0, 0, 0)
Exemplo n.º 5
0
 def setUp(self):
     self.solver = bullet.btSequentialImpulseConstraintSolver()
     self.cinfo = bullet.btDefaultCollisionConstructionInfo()
     self.collision_config = \
         bullet.btDefaultCollisionConfiguration(self.cinfo)
     self.broadphase = bullet.btDbvtBroadphase()
     self.dispatcher = bullet.btCollisionDispatcher(self.collision_config)
     self.gravity = bullet.btVector3(0, -9.8, 0)
     self.time_step = 1.0/60
     self.collision_object = bullet.btCollisionObject()
     self.v1 = bullet.btVector3(0, 0, 0)
 def setUp(self):
     self.time_step = 1.0/60.0
     self.broadphase = bullet.btDbvtBroadphase()
     self.collision_configuration = bullet.btDefaultCollisionConfiguration()
     self.dispatcher = bullet.btCollisionDispatcher(
         self.collision_configuration
     )
     self.solver = bullet.btSequentialImpulseConstraintSolver()
     self.dynamics_world = bullet.btDiscreteDynamicsWorld(
         self.dispatcher,
         self.broadphase,
         self.solver,
         self.collision_configuration
     )
Exemplo n.º 7
0
 def setUp(self):
     self.cinfo = bullet.btDefaultCollisionConstructionInfo()
     self.config = bullet.btDefaultCollisionConfiguration(self.cinfo)
     self.cd = bullet.btCollisionDispatcher(self.config)
Exemplo n.º 8
0
import bullet

if __name__=="__main__":
    broadphase = bullet.btDbvtBroadphase();
    collisionConfiguration = bullet.btDefaultCollisionConfiguration();
    dispatcher = bullet.btCollisionDispatcher(collisionConfiguration);

    solver = bullet.btSequentialImpulseConstraintSolver();
    dynamicsWorld = bullet.btDiscreteDynamicsWorld(
            dispatcher, broadphase, solver, collisionConfiguration);

    dynamicsWorld.setGravity((0,-10,0));

    groundShape = bullet.btStaticPlaneShape((0,1,0), 1);

    fallShape = bullet.btSphereShape(1);

    groundMotionState = bullet.btDefaultMotionState(
            bullet.btTransform(
                bullet.btQuaternion(0,0,0,1),
                (0,-1,0)
                )
            );

    groundRigidBodyCI=bullet.btRigidBodyConstructionInfo(0,
            groundMotionState, groundShape, (0,0,0));
    groundRigidBody = bullet.btRigidBody(groundRigidBodyCI);
    dynamicsWorld.addRigidBody(groundRigidBody);
 
    fallMotionState = bullet.btDefaultMotionState(
            bullet.btTransform(
Exemplo n.º 9
0
import bullet

if __name__ == "__main__":
    broadphase = bullet.btDbvtBroadphase()
    collisionConfiguration = bullet.btDefaultCollisionConfiguration()
    dispatcher = bullet.btCollisionDispatcher(collisionConfiguration)

    solver = bullet.btSequentialImpulseConstraintSolver()
    dynamicsWorld = bullet.btDiscreteDynamicsWorld(dispatcher, broadphase,
                                                   solver,
                                                   collisionConfiguration)

    dynamicsWorld.setGravity((0, -10, 0))

    groundShape = bullet.btStaticPlaneShape((0, 1, 0), 1)

    fallShape = bullet.btSphereShape(1)

    groundMotionState = bullet.btDefaultMotionState(
        bullet.btTransform(bullet.btQuaternion(0, 0, 0, 1), (0, -1, 0)))

    groundRigidBodyCI = bullet.btRigidBodyConstructionInfo(
        0, groundMotionState, groundShape, (0, 0, 0))
    groundRigidBody = bullet.btRigidBody(groundRigidBodyCI)
    dynamicsWorld.addRigidBody(groundRigidBody)

    fallMotionState = bullet.btDefaultMotionState(
        bullet.btTransform(bullet.btQuaternion(0, 0, 0, 1), (0, 50, 0)))

    mass = 1
    fallInertia = (0, 0, 0)