8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
13 #include "IPhysicsMovableItem.h"
14 #include "IPhysicsBody.h"
16 #include "MovableItem.h"
93 SetFrictionProperties();
119 SetFrictionProperties();
149 SetFrictionProperties();
183 SetFrictionProperties();
207 SetFrictionProperties();
230 Std_IsAboveMin((
float) 0, fltVal,
true,
"StaticFrictionScale",
true);
233 SetFrictionProperties();
265 if(strType ==
"COEFFICIENT")
271 if(strType ==
"MAXFORCE")
273 MaxForce((
float) atof(strValue.c_str()));
277 if(strType ==
"LOSS")
279 Loss((
float) atof(strValue.c_str()));
283 if(strType ==
"PROPORTIONAL")
289 if(strType ==
"ENABLED")
295 if(strType ==
"STATICFRICTIONSCALE")
303 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
312 aryProperties.Add(
new TypeProperty(
"Coefficient", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
313 aryProperties.Add(
new TypeProperty(
"Enabled", AnimatPropertyType::Boolean, AnimatPropertyDirection::Both));
314 aryProperties.Add(
new TypeProperty(
"MaxForce", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
315 aryProperties.Add(
new TypeProperty(
"Loss", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
316 aryProperties.Add(
new TypeProperty(
"Proportional", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
317 aryProperties.Add(
new TypeProperty(
"StaticFrictionScale", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
320 void ConstraintFriction::Load(
CStdXml &oXml)
virtual float MaxForce()
Gets the MaxForce the friction can apply.
Base class file for all Animat simulation objects.
Declares the simulation recorder class.
Root namespace for the base simulation library for AnimatLab.
virtual float InverseMassUnits()
Gets the inverse mass units.
Declares the body part class.
Simulator * m_lpSim
The pointer to a Simulation.
virtual float Coefficient()
Gets the Coefficient of friction for this constraint.
virtual void CreateDefaultUnits()
This takes the default values defined in the constructor and scales them according to the distance an...
virtual bool IntoElem()
Goes into the next element where the cursor is located.
Class that stores information about types for QueryProperty information.
Declares the key frame class.
virtual float StaticFrictionScale()
Gets the ratio between static and dynamic friction coefficients.
Declares the joint class.
Declares the organism class.
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_fltStaticFrictionScale
The scale ration of static to dynamic friction.
virtual void MassUnits(std::string strUnits)
Sets the mass units.
virtual ~ConstraintFriction()
Destructor.
Declares the activated item class.
Declares a light manager object.
virtual float Loss()
Gets the velocity loss for this constraint.
Declares the bounding box class.
A standard xml manipulation class.
float m_fltCoefficient
The friction coefficient for this constraint.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
bool Std_ToBool(int iVal)
Converts a value toa bool.
virtual void Load(StdUtils::CStdXml &oXml)
Loads the item using an XML data packet.
virtual bool GetChildBool(std::string strElementName)
Gets a bool value from the element with the specified name.
bool m_bProportional
Tells if the friction force should be scaled based on the force applied to the joint.
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
float m_fltMaxForce
The maximum force for this constraint.
virtual bool Enabled()
Tells whether this item is enabled or not. This is not actually used for all objects, only specific ones. I am putting it in the base class though to prevent numerous duplications.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
Declares the sensor class.
Declares the data chart manager class.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
Declares the rigid body class.
ConstraintFriction()
Default constructor.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Declares the structure class.
virtual bool Proportional()
Gets whether the friction force should be scaled based on the amount of force applied to the joint...
Declares the odor type class.
virtual float InverseDistanceUnits()
Gets the inverse distance units.
Declares the simulator class.
Declares the activated item manager class.
float m_fltLoss
The velocity loss for this constraint.
Declares the external stimuli manager class.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
Declares the receptive field class.
virtual float GetChildFloat(std::string strElementName)
Gets a float value from the element with the specified name.