30 #include "BulletCollision/CollisionShapes/btBoxShape.h"
31 #include "BulletDynamics/Dynamics/btRigidBody.h"
32 #include "LinearMath/btDefaultMotionState.h"
33 #include "LinearMath/btTransform.h"
38 tgCraterGround::Config::Config( btVector3 eulerAngles,
43 m_eulerAngles(eulerAngles),
45 m_restitution(restitution),
49 assert((m_friction >= 0.0) && (m_friction <= 1.0));
50 assert((m_restitution >= 0.0) && (m_restitution <= 1.0));
51 assert((m_size[0] >= 0.0) && (m_size[1] >= 0.0) && (m_size[2] >= 0.0));
58 const btVector3 groundDimensions(m_config.
m_size);
59 pGroundShape =
new btBoxShape(groundDimensions);
66 const btVector3 groundDimensions(m_config.
m_size);
67 pGroundShape =
new btBoxShape(groundDimensions);
74 const btScalar mass = 0.0;
76 btTransform groundTransform;
77 groundTransform.setIdentity();
78 groundTransform.setOrigin(m_config.
m_origin);
80 btQuaternion orientation;
84 groundTransform.setRotation(orientation);
88 btDefaultMotionState*
const pMotionState =
89 new btDefaultMotionState(groundTransform);
91 const btVector3 localInertia(0, 0, 0);
93 btRigidBody::btRigidBodyConstructionInfo
const rbInfo(mass, pMotionState, pGroundShape, localInertia);
95 btRigidBody*
const pGroundBody =
new btRigidBody(rbInfo);
Contains the definition of class tgCraterGround.
virtual btRigidBody * getGroundRigidBody() const