30 #include "BulletCollision/CollisionShapes/btBoxShape.h"
31 #include "BulletDynamics/Dynamics/btRigidBody.h"
32 #include "LinearMath/btDefaultMotionState.h"
33 #include "LinearMath/btTransform.h"
39 tgBoxGround::Config::Config( btVector3 eulerAngles,
44 m_eulerAngles(eulerAngles),
46 m_restitution(restitution),
50 assert((m_friction >= 0.0) && (m_friction <= 1.0));
51 assert((m_restitution >= 0.0) && (m_restitution <= 1.0));
52 assert((m_size[0] >= 0.0) && (m_size[1] >= 0.0) && (m_size[2] >= 0.0));
59 const btVector3 groundDimensions(m_config.
m_size);
60 pGroundShape =
new btBoxShape(groundDimensions);
67 const btVector3 groundDimensions(m_config.
m_size);
68 pGroundShape =
new btBoxShape(groundDimensions);
75 std::cout <<
"Box Ground" << std::endl;
76 const btScalar mass = 0.0;
78 btTransform groundTransform;
79 groundTransform.setIdentity();
80 groundTransform.setOrigin(m_config.
m_origin);
82 btQuaternion orientation;
86 groundTransform.setRotation(orientation);
90 btDefaultMotionState*
const pMotionState =
91 new btDefaultMotionState(groundTransform);
93 const btVector3 localInertia(0, 0, 0);
95 btRigidBody::btRigidBodyConstructionInfo
const rbInfo(mass, pMotionState, pGroundShape, localInertia);
97 btRigidBody*
const pGroundBody =
new btRigidBody(rbInfo);
virtual btRigidBody * getGroundRigidBody() const
Contains the definition of class tgBoxGround.