
Excuse the non-existent lighting and lack of detail, I'm using the default setup copy-pasted from the BasicDemo code, and adopted to my engine.
Here's the code, just in case:
Code: Select all
///collision configuration contains default setup for memory, collision setup. Advanced users can create their own configuration.
mColCfg = new btDefaultCollisionConfiguration();
///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
mColDispatcher= new btCollisionDispatcher(mColCfg);
///btDbvtBroadphase is a good general purpose broadphase. You can also try out btAxis3Sweep.
mBroadphase = new btDbvtBroadphase();
///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
mConstraintSolver = new btSequentialImpulseConstraintSolver;
Code: Select all
world = new btDiscreteDynamicsWorld
( mPhysicsSys->getCollisionDispatcher()
, mPhysicsSys->getBroadphaseInterface()
, mPhysicsSys->getConstraintSolver()
, mPhysicsSys->getCollisionConfig());
world->setGravity(btVector3(0,-10,0));
Code: Select all
world->stepSimulation(timeSinceLastUpdate, 5);
Here's my object creation:
Code: Select all
btTransform bulletTrans;
bulletTrans.setOrigin(toBullet(trans->getPosition()));
bulletTrans.setRotation(toBullet(trans->getOrientation()));
mMotionState = new MotionState(trans, bulletTrans);
BoxParams params = dynamic_cast<BoxParams&>(geometryParams);
mShape = new btBoxShape(toBullet(params.halfExtents)); // halfExtents is Vector3(1, 1, 1)
btVector3 inertia(0,0,0);
mShape->calculateLocalInertia(mass, inertia);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, mMotionState, mShape, inertia);
rbInfo.m_restitution = 0.2f;
rbInfo.m_friction = 1.5f;
mBody = new btRigidBody(rbInfo);
