Game Development Reference
In-Depth Information
Creating the Bullet components
Contrary to what the laborious explanations in the previous section might have you
believe, creating the necessary Bullet objects is relatively simple. Our application lay-
er class contains a handful of pointers that all the derived classes can use:
btBroadphaseInterface* m_pBroadphase;
btCollisionConfiguration*
m_pCollisionConfiguration;
btCollisionDispatcher* m_pDispatcher;
btConstraintSolver* m_pSolver;
btDynamicsWorld* m_pWorld;
Meanwhile, the code to initialize Bullet can be found in BasicDemo and looks as
shown in the following code snippet:
m_pCollisionConfiguration = new
btDefaultCollisionConfiguration();
m_pDispatcher = new
btCollisionDispatcher(m_pCollisionConfiguration);
m_pBroadphase = new btDbvtBroadphase();
m_pSolver = new
btSequentialImpulseConstraintSolver();
m_pWorld = new
btDiscreteDynamicsWorld(m_pDispatcher,
m_pBroadphase, m_pSolver,
m_pCollisionConfiguration);
Search WWH ::




Custom Search