9 #include "BlMotorizedJoint.h"
10 #include "BlRigidBody.h"
12 #include "BlSimulator.h"
48 {
Std_TraceMsg(0,
"Caught Error in desctructor of BlDistanceJoint/\r\n",
"", -1,
false,
true);}
63 void BlDistanceJoint::SetupPhysics()
72 osg::Matrix jointMT = this->GetOSGWorldMatrix();
73 osg::Matrix parentMT = m_lpBlParent->GetOSGWorldMatrix();
74 osg::Matrix osgJointRelParent = jointMT * osg::Matrix::inverse(parentMT);
76 btTransform tmJointRelParent = osgbCollision::asBtTransform(osgJointRelParent);
77 btTransform tmJointRelChild = osgbCollision::asBtTransform(m_osgMT->getMatrix());
79 m_btDistance =
new btGeneric6DofConstraint(*m_lpBlParent->Part(), *m_lpBlChild->Part(), tmJointRelParent, tmJointRelChild,
true);
81 GetBlSimulator()->DynamicsWorld()->addConstraint(m_btDistance,
true);
82 m_btDistance->setDbgDrawSize(btScalar(5.f));
89 BlJoint::Initialize();
98 #pragma region DataAccesMethods
101 bool BlDistanceJoint::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
103 if(BlJoint::Physics_SetData(strDataType, strValue))
106 if(Joint::SetData(strDataType, strValue,
false))
111 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
116 void BlDistanceJoint::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
118 BlJoint::Physics_QueryProperties(aryProperties);
119 Joint::QueryProperties(aryProperties);
virtual void SetupGraphics()
Sets up the graphics for the joint.
BlDistanceJoint()
Default constructor.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
btGeneric6DofConstraint * m_btDistance
The bullet socket class.
Declares the vortex distance joint class.
RigidBody * m_lpChild
The child rigid body for this joint.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
virtual ~BlDistanceJoint()
Destructor.
ConstraintRelaxation * m_aryRelaxations[6]
The relaxations for the constraints.
virtual void CreateJoint()
Creates the joint.