Any ways here how I currently setup the physics world.
Using Bullet 2.75
- btDefaultCollisionConfiguration
- btCollisionDispatcher constructed with the above configuration.
- bytDbvtBroadphase
- btSequentialImpulseConstraintsSolver for the solver
- and they dynamics world is btDiscreteDynamicsWorld.
I construct rigid bodies like so where shape is collision Object.
Code: Select all
btVector3 localInertia(0.0f, 0.0f, 0.0f);
if(mass > 0.0f)
{
shape->calculateLocalInertia(mass, localInertia);
}
//set the initial position of the body from the actor
ActorMotionState* const myMotionState = FE_NEW ActorMotionState(actor->VGetMat());
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, myMotionState, shape, localInertia);
//setup material properties
rbInfo.m_restitution = PhysicalProperties::GetMaterial(mat).m_restitution;
rbInfo.m_friction = PhysicalProperties::GetMaterial(mat).m_friction;
//create rigidbody and add it to the world.
btRigidBody* const body = new btRigidBody(rbInfo);
m_dynamicsWorld->addRigidBody(body);
body->setActivationState(ISLAND_SLEEPING);
Am I missing something? Any help would be greatly appreciated.