AnimatLab  2
Test
Joint.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "ConstraintFriction.h"
10 #include "ConstraintRelaxation.h"
11 
12 namespace AnimatSim
13 {
14  namespace Environment
15  {
16 
40  class ANIMAT_PORT Joint : public BodyPart
41  {
42  protected:
45 
48 
52 
56 
58  float m_fltForce;
59 
61  float m_fltSize;
62 
64  ConstraintRelaxation *m_aryRelaxations[6];
65 
68 
69  virtual ConstraintRelaxation *LoadConstraintRelaxation(CStdXml &oXml, std::string strName);
70  virtual ConstraintFriction *LoadConstraintFriction(CStdXml &oXml);
71  virtual void ClearRelaxations();
72 
73  public:
74  Joint();
75  virtual ~Joint();
76 
77  static Joint *CastToDerived(AnimatBase *lpBase) {return static_cast<Joint*>(lpBase);}
78 
79  virtual bool UsesRadians();
80 
81  virtual float Size();
82  virtual void Size(float fltVal, bool bUseScaling = true);
83 
84  virtual bool EnableLimits();
85  virtual void EnableLimits(bool bVal);
86 
87  virtual ConstraintRelaxation *Relaxation1();
88  virtual void Relaxation1(ConstraintRelaxation *lpRelax);
89  virtual void Relaxation1(std::string strXml);
90 
91  virtual ConstraintRelaxation *Relaxation2();
92  virtual void Relaxation2(ConstraintRelaxation *lpRelax);
93  virtual void Relaxation2(std::string strXml);
94 
95  virtual ConstraintRelaxation *Relaxation3();
96  virtual void Relaxation3(ConstraintRelaxation *lpRelax);
97  virtual void Relaxation3(std::string strXml);
98 
99  virtual ConstraintRelaxation *Relaxation4();
100  virtual void Relaxation4(ConstraintRelaxation *lpRelax);
101  virtual void Relaxation4(std::string strXml);
102 
103  virtual ConstraintRelaxation *Relaxation5();
104  virtual void Relaxation5(ConstraintRelaxation *lpRelax);
105  virtual void Relaxation5(std::string strXml);
106 
107  virtual ConstraintRelaxation *Relaxation6();
108  virtual void Relaxation6(ConstraintRelaxation *lpRelax);
109  virtual void Relaxation6(std::string strXml);
110 
111  virtual ConstraintFriction *Friction();
112  virtual void Friction(ConstraintFriction *lpFriction);
113  virtual void Friction(std::string strXml);
114 
115  virtual float GetPositionWithinLimits(float fltPos);
116  virtual float GetLimitRange();
117 
118  virtual int VisualSelectionType();
119 
120  virtual RigidBody *Child();
121  virtual void Child(RigidBody *lpValue);
122 
123  virtual float JointPosition();
124  virtual void JointPosition(float fltPos);
125  virtual float JointVelocity();
126  virtual void JointVelocity(float fltVel);
127  virtual float JointForce();
128  virtual void JointForce(float fltForce);
129 
130  virtual void WakeDynamics();
131 
132  virtual void CreateJoint();
133  virtual void UpdatePhysicsPosFromGraphics();
134  virtual void Initialize();
135 
136  virtual float *GetDataPointer(const std::string &strDataType);
137  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
138  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
139 
140  virtual void AddExternalNodeInput(int iTargetDataType, float fltInput);
141  virtual void ResetSimulation();
142  virtual void AfterResetSimulation();
143  virtual void StepSimulation();
144  virtual void Load(CStdXml &oXml);
145  };
146 
147  } // Environment
148 } //AnimatSim
The base class for all of the joint type of objects.
Definition: Joint.h:40
Root namespace for the base simulation library for AnimatLab.
ConstraintFriction * m_lpFriction
The friction for this joint.
Definition: Joint.h:67
Declares the material pair class.
RigidBody * m_lpChild
The child rigid body for this joint.
Definition: Joint.h:44
Base class for all body parts and joints.
Definition: BodyPart.h:25
bool m_bEnableLimits
If true then any ConstraintLimits for this joint are enabled.
Definition: Joint.h:47
float m_fltForce
The current force being applied to the joint by the motor.
Definition: Joint.h:58
Declares the material pair class.
Animat base class.
Definition: AnimatBase.h:36
float m_fltSize
Scales the size of the graphics for this joint.
Definition: Joint.h:61
The base class for all of the basic rigid body type of objects.
Definition: RigidBody.h:66