30 #include "BulletDynamics/Dynamics/btRigidBody.h"
31 #include "btBulletDynamicsCommon.h"
36 tgBaseRigid::tgBaseRigid(btRigidBody* pRigidBody,
39 m_pRigidBody(pRigidBody),
40 m_mass((m_pRigidBody->getInvMass() > 0.0) ?
41 1.0 / (m_pRigidBody->getInvMass()) :
44 if (pRigidBody == NULL)
46 throw std::invalid_argument(
"Pointer to btRigidBody is NULL");
51 assert(m_pRigidBody == pRigidBody);
54 (void) btInfinityMask;
79 btTransform transform;
80 m_pRigidBody->getMotionState()->getWorldTransform(transform);
81 const btVector3& result = transform.getOrigin();
96 btMatrix3x3 rot = btMatrix3x3(
m_pRigidBody->getOrientation());
100 rot.getEulerYPR(yaw, pitch, roll);
101 btVector3 *result =
new btVector3(yaw, pitch, roll);
105 bool tgBaseRigid::invariant()
const
btRigidBody * m_pRigidBody
Create a box shape as an obstacle or add it to your tensegrity.
virtual void onVisit(const tgModelVisitor &v) const
virtual btVector3 centerOfMass() const
virtual void render(const tgRod &rod) const
Contains the definition of interface class tgModelVisitor.
virtual btVector3 orientation() const