8 #include "RbMovableItem.h"
11 #include "RbMotorizedJoint.h"
12 #include "RbPrismaticLimit.h"
13 #include "RbRigidBody.h"
15 #include "RbSimulator.h"
64 {
Std_TraceMsg(0,
"Caught Error in desctructor of RbPrismatic/\r\n",
"", -1,
false,
true);}
70 Prismatic::EnableLimits(bVal);
75 void RbPrismatic::SetLimitValues()
122 #pragma region DataAccesMethods
124 float *RbPrismatic::GetDataPointer(
const std::string &strDataType)
129 if(strType ==
"JOINTROTATION")
131 else if(strType ==
"JOINTPOSITION")
133 else if(strType ==
"JOINTACTUALVELOCITY")
135 else if(strType ==
"JOINTFORCE")
137 else if(strType ==
"JOINTDESIREDPOSITION")
139 else if(strType ==
"JOINTSETPOSITION")
141 else if(strType ==
"JOINTDESIREDVELOCITY")
143 else if(strType ==
"JOINTSETVELOCITY")
145 else if(strType ==
"ENABLE")
147 else if(strType ==
"CONTACTCOUNT")
148 THROW_PARAM_ERROR(Al_Err_lMustBeContactBodyToGetCount, Al_Err_strMustBeContactBodyToGetCount,
"JointID",
m_strName);
151 lpData = RbMotorizedJoint::Physics_GetDataPointer(strType);
152 if(lpData)
return lpData;
154 lpData = Prismatic::GetDataPointer(strType);
155 if(lpData)
return lpData;
157 THROW_TEXT_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"JointID: " + STR(
m_strName) +
" DataType: " + strDataType);
163 bool RbPrismatic::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
168 if(Prismatic::SetData(strDataType, strValue,
false))
173 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
178 void RbPrismatic::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
181 Prismatic::QueryProperties(aryProperties);
183 aryProperties.Add(
new TypeProperty(
"JointRotation", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
184 aryProperties.Add(
new TypeProperty(
"JointPosition", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
185 aryProperties.Add(
new TypeProperty(
"JointActualVelocity", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
186 aryProperties.Add(
new TypeProperty(
"JointForce", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
187 aryProperties.Add(
new TypeProperty(
"JointRotationDeg", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
188 aryProperties.Add(
new TypeProperty(
"JointDesiredPosition", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
189 aryProperties.Add(
new TypeProperty(
"JointSetPosition", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
190 aryProperties.Add(
new TypeProperty(
"JointDesiredVelocity", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
191 aryProperties.Add(
new TypeProperty(
"JointSetVelocity", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
192 aryProperties.Add(
new TypeProperty(
"Enable", AnimatPropertyType::Boolean, AnimatPropertyDirection::Get));
203 void RbPrismatic::Physics_EnableLock(
bool bOn,
float fltPosition,
float fltMaxLockForce)
221 void RbPrismatic::Physics_EnableMotor(
bool bOn,
float fltDesiredVelocity,
float fltMaxForce,
bool bForceWakeup)
260 void RbPrismatic::Physics_MaxForce(
float fltVal)
266 void RbPrismatic::TurnMotorOff()
284 void RbPrismatic::SetConstraintFriction()
292 Prismatic::ResetSimulation();
virtual ~RbPrismatic()
Destructor.
virtual float LimitPos()
Gets the limit position.
virtual void UpdateData()
Called to collect any body data for this part.
virtual void StepSimulation()
Step the simulation for this object.
RbPrismatic()
Default constructor.
float m_fltEnabled
This is used for reporting the enabled state in a GetDataPointer call.
virtual void IsShowPosition(bool bVal)
Sets whether this contstraint is actually just being used to show the current position of the joint...
ConstraintLimit * m_lpUpperLimit
Upper limit constring pointer.
virtual void CreateJoint()
Creates the joint.
Declares the vs prismatic class.
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 ResetSimulation()
Resets the simulation back to time 0.
ConstraintLimit * m_lpLowerLimit
Lower limit constring pointer.
float m_fltForce
The current force being applied to the joint by the motor.
float m_fltReportSetPosition
This is the variable that is reported to AnimatLab on what the set position was.
float m_fltReportSetVelocity
This is the variable that is reported to AnimatLab on what the set veloicty was.
ConstraintLimit * m_lpPosFlap
Pointer to a constraint that is used to represent the position flap.
virtual void SetVelocityToDesired()
Sets the desired velocity to use for the motor.
virtual float JointPosition()
Gets the joint position.
virtual void Color(float fltR, float fltG, float fltB, float fltA)
Sets the color to use when displaying this contraint.
virtual void IsLowerLimit(bool bVal)
Sets whether this is a lower limit or not..
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
virtual bool EnableLimits()
Tells if ConstraintLimits are enabled.
std::string m_strName
The name for this object.