AGX Dynamics  2.35.0.1
Prismatic.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 #ifndef AGX_PRISMATIC_H
18 #define AGX_PRISMATIC_H
19 
20 #include <agx/Constraint.h>
21 
22 namespace agx
23 {
27  class CALLABLE AGXPHYSICS_EXPORT PrismaticFrame : public ConstraintFrame
28  {
29  public:
34 
37 
43  PrismaticFrame( const Vec3& point, const Vec3& axis );
44 
46  void setAxis( const Vec3& axis );
47 
49  void setPoint( const Vec3& point );
50 
56  void set(const Vec3& point, const Vec3& axis );
57 
59  const Vec3& getAxis() const;
60  };
61 
68  {
69  public:
77  Prismatic( const PrismaticFrame& pf, RigidBody* rb1, RigidBody* rb2 = 0 );
78 
87  Prismatic( RigidBody* rb1, Frame* rb1AttachmentFrame, RigidBody* rb2 = nullptr, Frame* rb2AttachmentFrame = nullptr );
88 
95  Prismatic( const Vec3& axis, RigidBody* rb1, RigidBody* rb2 = nullptr );
96 
101  enum DOF {
102  ALL_DOF = -1,
103  ROTATIONAL_1 = 0,
104  ROTATIONAL_2 = 1,
105  ROTATIONAL_3 = 2,
106  TRANSLATIONAL_1 = 3,
107  TRANSLATIONAL_2 = 4,
108  NUM_DOF = 5
109  };
110 
114  virtual int getNumDOF() const override;
115 
117 
118  protected:
120  virtual ~Prismatic();
121 
125  virtual void render(agxRender::RenderManager* mgr, float scale ) const override;
126 
127  private:
128  class PrismaticImplementation* m_implementation;
129  };
130 
132 
133 
134 
135 } // namespace agx
136 #endif
#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
Helper function to define the reference frame used by the prismatic constraint.
Definition: Prismatic.h:28
PrismaticFrame()
Default constructor: translational axis is along Z.
~PrismaticFrame()
Destructor.
void setPoint(const Vec3 &point)
Provide a point lying on the axis.
const Vec3 & getAxis() const
PrismaticFrame(const Vec3 &point, const Vec3 &axis)
Constructor.
void set(const Vec3 &point, const Vec3 &axis)
Configure everything at once by providing a line with given axis, passing through given point.
void setAxis(const Vec3 &axis)
Set the translational axis.
A prismatic joint keeps a fixed relative orientation between the attached bodies but allows them to s...
Definition: Prismatic.h:68
Prismatic(const PrismaticFrame &pf, RigidBody *rb1, RigidBody *rb2=0)
Create a Prismatic joint given a prismatic frame (world coordinates) 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...
Definition: Prismatic.h:101
Prismatic(RigidBody *rb1, Frame *rb1AttachmentFrame, RigidBody *rb2=nullptr, Frame *rb2AttachmentFrame=nullptr)
Create a Prismatic joint given attachment frames and one or two rigid bodies.
virtual void render(agxRender::RenderManager *mgr, float scale) const override
Used internally for debug rendering.
virtual int getNumDOF() const override
Prismatic(const Vec3 &axis, RigidBody *rb1, RigidBody *rb2=nullptr)
Create a Prismatic joint given the prismatic axis and one or two rigid bodies.
virtual ~Prismatic()
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
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< Prismatic > PrismaticRef
Definition: Prismatic.h:131