6 #include "VsConstraintRelaxation.h"
7 #include "VsMovableItem.h"
10 #include "VsMotorizedJoint.h"
11 #include "VsRigidBody.h"
13 #include "VsSimulator.h"
14 #include "VsOsgUserData.h"
15 #include "VsOsgUserDataVisitor.h"
16 #include "VsDragger.h"
17 #include "VsSimulator.h"
28 VsConstraintRelaxation::VsConstraintRelaxation()
33 VsConstraintRelaxation::~VsConstraintRelaxation()
72 SetRelaxationProperties();
77 ConstraintRelaxation::Initialize();
79 SetRelaxationProperties();
91 ConstraintRelaxation::CreateDefaultUnits();
100 if(ConstraintRelaxation::SetData(strType, strValue,
false))
103 if(strType ==
"LOSS")
105 Loss((
float) atof(strValue.c_str()));
111 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
116 void VsConstraintRelaxation::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
118 ConstraintRelaxation::QueryProperties(aryProperties);
120 aryProperties.Add(
new TypeProperty(
"Loss", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
123 void VsConstraintRelaxation::Load(CStdXml &oXml)
125 ConstraintRelaxation::Load(oXml);
135 void VsConstraintRelaxation::SetRelaxationProperties()
142 Vx::VxConstraint *vxConstraint = lpJoint->Constraint();
virtual void CreateDefaultUnits()
This takes the default values defined in the constructor and scales them according to the distance an...
virtual float Loss()
Gets the primary linear slip value.
float m_fltLoss
The primary linear slip of the collision between those two materials.
Simulator * m_lpSim
The pointer to a Simulation.
int m_iCoordinateID
The constraint coordinate ID.
virtual void Initialize()
Initializes this object.
A common class for all joint data specific to vortex.
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
float m_fltDamping
The damping of the collision between those two materials.
float m_fltStiffness
The compliance of the collision between those two materials.
virtual void MassUnits(std::string strUnits)
Sets the mass units.
Node * m_lpNode
The pointer to this items parent Node. If this is not relevant for this object then this is NULL...
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Declares the vortex structure class.