AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WheelJoint.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agx/Constraint.h>
20 
21 
22 namespace agx
23 {
24 
26 
27 
31  class CALLABLE AGXPHYSICS_EXPORT WheelJointFrame : public ConstraintFrame
32  {
33  public:
34 
45  WheelJointFrame( agx::Vec3 point, agx::Vec3 wheelAxle, agx::Vec3 steeringAxle );
46 
47  };
48 
49 
50 
70  public:
71 
78  WheelJoint( const WheelJointFrame& wjf, RigidBody* rb1, RigidBody* rb2 );
79 
88  WheelJoint(RigidBody* rb1, RigidBody* rb2, const Vec3& center, const Vec3& axis);
89 
90 
103  WheelJoint(RigidBody* rb1, Frame* rb1AttachmentFrame, RigidBody* rb2 = nullptr,
104  Frame* rb2AttachmentFrame = nullptr);
105 
106 
111  RigidBody* getWheelRigidBody();
112 
117  RigidBody* getChassisRigidBody();
118 
123  enum DOF {
124  ALL_DOF = -1,
125  TRANSLATIONAL_1 = 0,
126  TRANSLATIONAL_2 = 1,
127  ROTATIONAL_1 = 3,
128  NUM_DOF = 3
129  };
130 
135  STEERING = 0,
136  WHEEL = 1,
137  SUSPENSION = 2,
139  STEERINGCONSTRAINT_BOUNDS = 3,
142  NUM_FREEDOF = 3
143  };
144 
148  int getNumDOF() const override;
149 
153  Motor1D* getMotor1D(SecondaryConstraint sc);
154 
158  Lock1D* getLock1D(SecondaryConstraint sc);
159 
163  Range1D* getRange1D(SecondaryConstraint sc);
164 
165 
169  Real getAngle( SecondaryConstraint sc = STEERING ) const;
170 
171 
173 
174  protected:
175  WheelJoint();
176 
177  virtual ~WheelJoint();
178 
182  void render(class agxRender::RenderManager* mgr, float scale) const override;
183 
184  private:
185  class WheelJointImplementation* m_implementation;
186  };
187 
188 } //namespace agx
189 
#define AGXPHYSICS_EXPORT
The base class for a constraint.
Definition: Constraint.h:86
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
Elementary secondary constraint to keep constraint angle at a given target position.
SecondaryConstraint
Enum for specifying which secondary constraint to access.
Definition: WheelJoint.h:134
Elementary secondary constraint to keep constraint angle within two given values. ...
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:52
#define CALLABLE
Definition: Object.h:76
The object defining a frame of reference and providing transformations operations.
Definition: Frame.h:67
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:206
Elementary secondary constraint to drive something given target speed (translational or rotational)...
Helper class to define reference frames for WheelJoint.
Definition: WheelJoint.h:31
double Real
Definition: Real.h:42
Real getAngle(const Vec3 &a, const Vec3 &b, const Vec3 &c)
a and b should be orthogonal
The wheel constraint is designed to attach two bodies such that one of them is free to rotate about a...
Definition: WheelJoint.h:69
DOF
Enum used for specifying which Degree of Freedom (DOF) that should be accessed in calls to for exampl...
Definition: WheelJoint.h:123