8 #include "VsMovableItem.h"
11 #include "VsMotorizedJoint.h"
12 #include "VsRigidBody.h"
15 #include "VsSimulator.h"
16 #include "VsOsgUserData.h"
17 #include "VsOsgUserDataVisitor.h"
18 #include "VsDragger.h"
54 {
Std_TraceMsg(0,
"Caught Error in desctructor of VsDistanceJoint/\r\n",
"", -1,
false,
true);}
69 void VsDistanceJoint::DeletePhysics()
74 if(GetVsSimulator() && GetVsSimulator()->Universe())
76 GetVsSimulator()->Universe()->removeConstraint(
m_vxDistance);
87 void VsDistanceJoint::SetupPhysics()
93 THROW_ERROR(Al_Err_lParentNotDefined, Al_Err_strParentNotDefined);
96 THROW_ERROR(Al_Err_lChildNotDefined, Al_Err_strChildNotDefined);
100 THROW_ERROR(Vs_Err_lUnableToConvertToVsRigidBody, Vs_Err_strUnableToConvertToVsRigidBody);
104 THROW_ERROR(Vs_Err_lUnableToConvertToVsRigidBody, Vs_Err_strUnableToConvertToVsRigidBody);
108 m_vxDistance =
new VxDistanceJoint(lpVsParent->Part(), lpVsChild->Part(), fltDistance);
109 m_vxDistance->setName(
m_strID.c_str());
111 GetVsSimulator()->Universe()->addConstraint(m_vxDistance);
126 #pragma region DataAccesMethods
129 bool VsDistanceJoint::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
131 if(VsJoint::Physics_SetData(strDataType, strValue))
134 if(Joint::SetData(strDataType, strValue,
false))
139 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
144 void VsDistanceJoint::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
146 VsJoint::Physics_QueryProperties(aryProperties);
147 Joint::QueryProperties(aryProperties);
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.
virtual void CreateJoint()
Creates the joint.
std::string m_strID
The unique Id for this object.
virtual void SetupGraphics()
Sets up the graphics for the joint.
virtual CStdFPoint AbsolutePosition()
Gets the absolute position of this body part.
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.
Declares the vortex distance joint class.
VsDistanceJoint()
Default constructor.
Vx::VxDistanceJoint * m_vxDistance
The vortex socket class.
double Std_CalculateDistance(CStdIPoint &ptA, CStdIPoint &ptB)
Calculates the distance between two points.
virtual ~VsDistanceJoint()
Destructor.
Declares the vortex structure class.