AGX Dynamics  2.35.0.1
DistanceJoint.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_DISTANCEJOINT_H
18 #define AGX_DISTANCEJOINT_H
19 
20 #include <agx/Constraint.h>
21 
22 namespace agx
23 {
28  {
29  public:
36  DistanceJoint( RigidBody* rb1, Frame* rb1AttachmentFrame, const Vec3& worldAttach );
37 
45  DistanceJoint( RigidBody* rb1, Frame* rb1AttachmentFrame, RigidBody* rb2, Frame* rb2AttachmentFrame );
46 
54  DistanceJoint( RigidBody* rb1, const Vec3& localAttachRB1, RigidBody* rb2, const Vec3& localAttachRB2 );
55 
62  DistanceJoint( RigidBody* rb1, const Vec3& localAttachRB1, const Vec3& worldAttach );
63 
71 
75  virtual void setCompliance( Real compliance, agx::Int index = -1 ) override;
76 
80  virtual Real getCompliance( agx::UInt index ) const override;
81 
85  virtual void setDamping( Real damping, agx::Int index = -1 ) override;
86 
90  virtual Real getDamping( agx::UInt index ) const override;
91 
95  virtual int getNumDOF() const override;
96 
98 
99  protected:
101  virtual ~DistanceJoint();
102 
106  virtual void render( agxRender::RenderManager *mgr, float scale ) const override;
107 
108  private:
109  class DistanceJointImplementation *m_implementation;
110  };
111 
113 } // namespace agx
114 
115 #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
This joint will preserve the initial distance between a body and a point in world coordinate or betwe...
Definition: DistanceJoint.h:28
virtual Real getDamping(agx::UInt index) const override
DistanceJoint(RigidBody *rb1, Frame *rb1AttachmentFrame, const Vec3 &worldAttach)
Create a Distance joint given an attachment frame on a rigid body and a fixed point (in world).
virtual ~DistanceJoint()
virtual Real getCompliance(agx::UInt index) const override
virtual RegularizationParameters * getRegularizationParameters(agx::UInt i) override
This is a 1D constraint, i.e., only index i = 0 is valid.
DistanceJoint(RigidBody *rb1, const Vec3 &localAttachRB1, RigidBody *rb2, const Vec3 &localAttachRB2)
Create a Distance joint given two rigid bodies and local attachment points.
virtual void render(agxRender::RenderManager *mgr, float scale) const override
Internal method used for debug rendering.
DistanceJoint(RigidBody *rb1, const Vec3 &localAttachRB1, const Vec3 &worldAttach)
Create a Distance joint given one rigid body, a local attach point and a world attach point.
virtual void setCompliance(Real compliance, agx::Int index=-1) override
Set compliance for this distance joint.
virtual int getNumDOF() const override
DistanceJoint(RigidBody *rb1, Frame *rb1AttachmentFrame, RigidBody *rb2, Frame *rb2AttachmentFrame)
Create a Distance joint given attachment frames and two rigid bodies.
virtual const RegularizationParameters * getRegularizationParameters(agx::UInt i) const override
virtual void setDamping(Real damping, agx::Int index=-1) override
Set damping for this distance joint.
The object defining a frame of reference and providing transformations operations.
Definition: agx/Frame.h:68
All ghost variables have compliance and damping attributes.
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< DistanceJoint > DistanceJointRef
int32_t Int
Definition: Integer.h:35
uint32_t UInt
Definition: Integer.h:34
double Real
Definition: Real.h:42