AGXDynamics  2.35.0.2
BallJoint.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_BALLJOINT_H
18 #define AGX_BALLJOINT_H
19 
20 #include <agx/Constraint.h>
21 
22 namespace agx
23 {
27  class CALLABLE AGXPHYSICS_EXPORT BallJointFrame : public ConstraintFrame
28  {
29  public:
31 
35  BallJointFrame( const Vec3& center );
36 
38  ~BallJointFrame();
39 
40  void setCenter( const Vec3& center );
41  const Vec3& getCenter() const;
42  };
43 
48  {
49  public:
56  BallJoint( const BallJointFrame& bf, RigidBody* rb1, RigidBody* rb2 = 0 );
57 
72  BallJoint( RigidBody* rb1, Frame* rb1AttachmentFrame, RigidBody* rb2 = nullptr, Frame* rb2AttachmentFrame = nullptr );
73 
82  BallJoint( RigidBody* rb1, const Vec3& rb1LocalAttachPoint, RigidBody* rb2 = nullptr, const Vec3& rb2LocalAttachPoint = Vec3() );
83 
88  enum DOF {
89  ALL_DOF = -1,
90  TRANSLATIONAL_1 = 0,
91  TRANSLATIONAL_2 = 1,
92  TRANSLATIONAL_3 = 2,
93  NUM_DOF = 3
94  };
95 
99  virtual int getNumDOF() const override;
100 
102 
103  protected:
104  BallJoint();
105  BallJoint( class BallJointImplementation* impl );
106  virtual ~BallJoint();
107 
108  virtual void render( agxRender::RenderManager* mgr, float scale ) const override;
109 
110  private:
111  class BallJointImplementation* m_implementation;
112  };
113 
115 
125  {
126  public:
141  WorldFrameBallJoint( RigidBody* rb1, Frame* rb1AttachmentFrame, RigidBody* rb2 = nullptr, Frame* rb2AttachmentFrame = nullptr );
142 
144 
145  protected:
147  virtual ~WorldFrameBallJoint();
148 
149  private:
150  class WorldFrameBallJointImplementation* m_implementation;
151  };
152 
154 
155 } // namespace agx
156 
157 #endif // AGX_BALLJOINT_H
agx::BallJointRef
ref_ptr< BallJoint > BallJointRef
Definition: BallJoint.h:114
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
CALLABLE
#define CALLABLE
Definition: macros.h:72
agxRender::RenderManager
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
Definition: RenderManager.h:106
Constraint.h
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agx::Vec3
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Definition: Vec3.h:36
agxModel::getCenter
AGXMODEL_EXPORT agx::Vec3 getCenter(const agxCollide::Mesh::Triangle &triangle)
agx::WorldFrameBallJointRef
ref_ptr< WorldFrameBallJoint > WorldFrameBallJointRef
Definition: BallJoint.h:153
agx::BallJoint
Constraint that removes the three translation DOF between two bodies (or one and the world).
Definition: BallJoint.h:47
agx::WorldFrameBallJoint
Special version of a ball joint where the spatial reference frame is world for the body/bodies.
Definition: BallJoint.h:124
agx::BallJoint::DOF
DOF
Enum used for specifying which Degree of Freedom (DOF) that should be accessed in calls to for exampl...
Definition: BallJoint.h:88
agx::BallJointFrame
Class for storing the geometric information of a BallJoint.
Definition: BallJoint.h:27
agx::Constraint
The base class for a constraint.
Definition: Constraint.h:88
agx::Vec3T< Real >
agx::Frame
The object defining a frame of reference and providing transformations operations.
Definition: Frame.h:67