AGX Dynamics  2.35.0.1
SlackHingeJoint.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 #include <agx/Hinge.h>
21 
22 namespace agx
23 {
24 
25 
39  {
40  public:
50  SlackHingeJoint( const HingeFrame& hf, RigidBody* rb1, RigidBody* rb2 = 0 );
51 
65  SlackHingeJoint( RigidBody* rb1, Frame* rb1AttachmentFrame, RigidBody* rb2 = nullptr, Frame* rb2AttachmentFrame = nullptr );
66 
67 
72  enum DOF
73  {
74  ALL_DOF=-1,
75  TRANSLATIONAL_1=0,
76  TRANSLATIONAL_2=1,
77  TRANSLATIONAL_3=2,
78  ROTATIONAL_1=3,
79  ROTATIONAL_2=4,
80  NUM_DOF=5
81  };
82 
86  int getNumDOF() const override;
87 
88 
102  bool setSlackParameters( agx::Vec3 pos_uvn, agx::Real rot );
103 
108  bool getSlackParameters( agx::Vec3& pos_uvn, agx::Real& rot ) const;
109 
111 
112  protected:
117 
118  virtual ~SlackHingeJoint();
119 
123  virtual void render( class agxRender::RenderManager *mgr, float scale ) const override;
124 
125  private:
126  class SlackHingeJointImplementation *m_implementation;
127  };
128 
130 
131  typedef SlackHingeJoint SlackHinge; // Hinge does not use Joint in its name, mimic naming
132 
133 } //namespace agx
134 
#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:207
#define AGXPHYSICS_EXPORT
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic.
Definition: Constraint.h:677
The object defining a frame of reference and providing transformations operations.
Definition: agx/Frame.h:68
Specialization for the constraint frame class that add convenient accessors/mutator methods for manip...
Definition: Hinge.h:29
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
A constraint that is equal to the.
bool getSlackParameters(agx::Vec3 &pos_uvn, agx::Real &rot) const
Read the current slack parameters.
SlackHingeJoint(const HingeFrame &hf, RigidBody *rb1, RigidBody *rb2=0)
Create hinge given a hinge frame (world coordinates) and one or two rigid bodies.
SlackHingeJoint(RigidBody *rb1, Frame *rb1AttachmentFrame, RigidBody *rb2=nullptr, Frame *rb2AttachmentFrame=nullptr)
Create hinge given attachment frames and one or two rigid bodies.
DOF
Enum used for specifying which Degree of Freedom (DOF) that should be accessed in calls to for exampl...
int getNumDOF() const override
SlackHingeJoint()
Default constructor.
bool setSlackParameters(agx::Vec3 pos_uvn, agx::Real rot)
Set slack range parameters.
virtual void render(class agxRender::RenderManager *mgr, float scale) const override
Used internally for debug rendering.
virtual ~SlackHingeJoint()
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
#define CALLABLE
Definition: macros.h:72
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
ref_ptr< SlackHingeJoint > SlackHingeJointRef
SlackHingeJoint SlackHinge
double Real
Definition: Real.h:42