9 #include "BlMotorizedJoint.h"
10 #include "BlRigidBody.h"
12 #include "BlSimulator.h"
49 {
Std_TraceMsg(0,
"Caught Error in desctructor of BlUniversal/\r\n",
"", -1,
false,
true);}
52 void BlUniversal::SetupPhysics()
59 btTransform mtJointRelParent, mtJointRelChild;
60 CalculateRelativeJointMatrices(mtJointRelParent, mtJointRelChild);
62 m_btSocket =
new btConeTwistConstraint(*m_lpBlParent->Part(), *m_lpBlChild->Part(), mtJointRelParent, mtJointRelChild);
64 GetBlSimulator()->DynamicsWorld()->addConstraint(
m_btSocket,
true);
67 if(m_lpBlParent && m_lpBlParent->Part())
68 m_lpBlParent->Part()->setSleepingThresholds(0, 0);
70 if(m_lpBlChild && m_lpBlChild->Part())
71 m_lpBlChild->Part()->setSleepingThresholds(0, 0);
75 BallSocket::Initialize();
76 BlJoint::Initialize();
85 void BlUniversal::Physics_ResetSimulation()
87 BlJoint::Physics_ResetSimulation();
93 #pragma region DataAccesMethods
96 bool BlUniversal::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
98 if(BlJoint::Physics_SetData(strDataType, strValue))
101 if(BallSocket::SetData(strDataType, strValue,
false))
106 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
111 void BlUniversal::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
113 BlJoint::Physics_QueryProperties(aryProperties);
114 BallSocket::QueryProperties(aryProperties);
btConeTwistConstraint * m_btSocket
The bullet socket class.
BlUniversal()
Default constructor.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
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 void CreateJoint()
Creates the joint.
virtual ~BlUniversal()
Destructor.
Declares the vs universal class.
ConstraintRelaxation * m_aryRelaxations[6]
The relaxations for the constraints.