8 #include "VsMovableItem.h"
11 #include "VsMotorizedJoint.h"
12 #include "VsRigidBody.h"
14 #include "VsSimulator.h"
15 #include "VsDragger.h"
51 {
Std_TraceMsg(0,
"Caught Error in desctructor of VsRPRO\r\n",
"", -1,
false,
true);}
54 void VsRPRO::DeletePhysics()
59 if(GetVsSimulator() && GetVsSimulator()->Universe())
61 GetVsSimulator()->Universe()->removeConstraint(
m_vxSocket);
72 void VsRPRO::SetupPhysics()
78 THROW_ERROR(Al_Err_lParentNotDefined, Al_Err_strParentNotDefined);
81 THROW_ERROR(Al_Err_lChildNotDefined, Al_Err_strChildNotDefined);
85 THROW_ERROR(Vs_Err_lUnableToConvertToVsRigidBody, Vs_Err_strUnableToConvertToVsRigidBody);
89 THROW_ERROR(Vs_Err_lUnableToConvertToVsRigidBody, Vs_Err_strUnableToConvertToVsRigidBody);
91 CStdFPoint vGlobal = this->GetOSGWorldCoords();
94 VxOSG::copyOsgMatrix_to_VxReal44(this->GetOSGWorldMatrix(), vMT);
95 Vx::VxTransform vTrans(vMT);
97 VxVector3 vPos((
double) vGlobal.x, (
double) vGlobal.y, (
double) vGlobal.z);
101 m_vxSocket->setParts(lpVsParent->Part(), lpVsChild->Part());
105 aryStrength[0] = aryStrength[1] = aryStrength[2] = VX_INFINITY;
113 GetVsSimulator()->Universe()->addConstraint(
m_vxSocket);
128 #pragma region DataAccesMethods
130 bool VsRPRO::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
132 if(VsJoint::Physics_SetData(strDataType, strValue))
135 if(RPRO::SetData(strDataType, strValue,
false))
140 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
145 void VsRPRO::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
147 VsJoint::Physics_QueryProperties(aryProperties);
148 RPRO::QueryProperties(aryProperties);
virtual void CreateJoint()
Creates the joint.
virtual void DisableCollision(RigidBody *lpBody)
Disables collision between the past-in object and this object.
virtual void EnableCollision(RigidBody *lpBody)
Enables collision between the past-in object and this object.
A common class for all rigid body data specific to vortex.
Declares the vortex relative position, relative orientation class.
Vx::VxRPRO * m_vxSocket
The vortex socket class.
virtual ~VsRPRO()
Destructor.
VsRPRO()
Default constructor.
std::string m_strID
The unique Id for this object.
RigidBody * m_lpChild
The child rigid body for this joint.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
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 SetupGraphics()
Sets up the graphics for the joint.