9 #include "BlMotorizedJoint.h"
10 #include "BlRigidBody.h"
12 #include "BlSimulator.h"
48 {
Std_TraceMsg(0,
"Caught Error in desctructor of BlBallSocket\r\n",
"", -1,
false,
true);}
51 void BlBallSocket::SetupPhysics()
58 btTransform mtJointRelParent, mtJointRelChild;
59 CalculateRelativeJointMatrices(mtJointRelParent, mtJointRelChild);
61 m_btSocket =
new btConeTwistConstraint(*m_lpBlParent->Part(), *m_lpBlChild->Part(), mtJointRelParent, mtJointRelChild);
63 GetBlSimulator()->DynamicsWorld()->addConstraint(
m_btSocket,
true);
66 if(m_lpBlParent && m_lpBlParent->Part())
67 m_lpBlParent->Part()->setSleepingThresholds(0, 0);
69 if(m_lpBlChild && m_lpBlChild->Part())
70 m_lpBlChild->Part()->setSleepingThresholds(0, 0);
74 BallSocket::Initialize();
75 BlJoint::Initialize();
84 void BlBallSocket::Physics_ResetSimulation()
86 BlJoint::Physics_ResetSimulation();
92 #pragma region DataAccesMethods
94 bool BlBallSocket::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
96 if(BlJoint::Physics_SetData(strDataType, strValue))
99 if(BallSocket::SetData(strDataType, strValue,
false))
104 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
109 void BlBallSocket::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
111 BlJoint::Physics_QueryProperties(aryProperties);
112 BallSocket::QueryProperties(aryProperties);
Declares the vortex ball socket class.
virtual ~BlBallSocket()
Destructor.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
btConeTwistConstraint * m_btSocket
The bullet socket class.
RigidBody * m_lpChild
The child rigid body for this joint.
BlBallSocket()
Default constructor.
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.
ConstraintRelaxation * m_aryRelaxations[6]
The relaxations for the constraints.
virtual void CreateJoint()
Creates the joint.