AGX Dynamics  2.37.2.0
AngularJointBase.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 #ifndef AGX_ANGULAR_JOINT_BASE_H
18 #define AGX_ANGULAR_JOINT_BASE_H
19 
20 #include <agx/Constraint.h>
21 
22 namespace agx
23 {
25 
32  {
33  public:
34 
43  AngularJointBase( CreateElementaryConstraintsFunction createFunc, agx::RigidBody* rb1, agx::Frame* rb1AttachmentFrame, agx::RigidBody* rb2 = nullptr, agx::Frame* rb2AttachmentFrame = nullptr );
44 
48  agx::Lock1D* getLock1D( UInt dof );
49 
53  const agx::Lock1D* getLock1D( UInt dof ) const;
54 
58  agx::Motor1D* getMotor1D( UInt dof );
59 
63  const agx::Motor1D* getMotor1D( UInt dof ) const;
64 
68  agx::ElectricMotorController* getElectricMotorController( UInt dof );
69 
73  const agx::ElectricMotorController* getElectricMotorController( UInt dof ) const;
74 
78  agx::Range1D* getRange1D( UInt dof );
79 
83  const agx::Range1D* getRange1D( UInt dof ) const;
84 
88  agx::Real getAngle( UInt dof ) const;
89 
93  agx::Real getCurrentSpeed( UInt dof ) const;
94 
98  virtual int getNumDOF() const override = 0;
99 
112  virtual UInt getNumControllerOffset() const = 0;
113 
117  virtual int getNumControllers() const = 0;
118 
122  agx::Real getTheta() const;
123 
127  agx::Real getPhi() const;
128 
132  agx::Real getPsi() const;
133 
135 
136  protected:
138  AngularJointBase(bool);
139  virtual ~AngularJointBase();
140 
144  virtual void render(agxRender::RenderManager* mgr, float scale ) const override;
145 
146  protected:
147  class AngularJointBaseImplementation* m_implementation;
148  };
149 
151 
152 
153 
154 } // namespace agx
155 #endif
agx::Bool(* CreateElementaryConstraintsFunction)(class HighLevelConstraintImplementation *)
class AngularJointBaseImplementation * m_implementation
An angular joint is defined by having 2 rotational degrees of freedom.
ref_ptr< AngularJointBase > AngularJointBaseRef
Implementation of a electric motor controller.
bool Bool
Definition: Integer.h:48
#define AGXPHYSICS_EXPORT
The base class for a constraint.
Definition: Constraint.h:88
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
Elementary secondary constraint to keep constraint angle at a given target position.
uint32_t UInt
Definition: Integer.h:34
Elementary secondary constraint to keep constraint angle within two given values. ...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
The object defining a frame of reference and providing transformations operations.
Definition: Frame.h:67
Elementary secondary constraint to drive something given target speed (translational or rotational)...
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Definition: Serializable.h:221
double Real
Definition: Real.h:42
Real getAngle(const Vec3 &a, const Vec3 &b, const Vec3 &c)
a and b should be orthogonal