AGX Dynamics 2.41.2.0
Loading...
Searching...
No Matches
CylindricalJoint.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16#pragma once
17
18#include <agx/Constraint.h>
19
20namespace agxUtil
21{
22 class Spline;
23}
24
25namespace agx
26{
30 class CALLABLE AGXPHYSICS_EXPORT CylindricalJointFrame : public ConstraintFrame
31 {
32 public:
35
36 // Constructor providing a point and an axis
37 CylindricalJointFrame( const Vec3& point, const Vec3& axis );
38
42 void setAxis( const Vec3& axis );
43
47 void setPoint( const Vec3& point );
48
53 void set(const Vec3 & point, const Vec3& axis );
54
55 const Vec3& getAxis() const;
56 };
57
59
65 {
66 public:
74
82 CylindricalJoint( RigidBody* rb1, Frame* rb1AttachmentFrame, RigidBody* rb2 = nullptr, Frame* rb2AttachmentFrame = nullptr );
83
88 enum DOF
89 {
90 ALL_DOF=-1,
91 ROTATIONAL_1=0,
92 ROTATIONAL_2=1,
93 TRANSLATIONAL_1=2,
94 TRANSLATIONAL_2=3,
95 NUM_DOF=4
96 };
97
101 virtual int getNumDOF() const override;
102
104
105 protected:
108
112 virtual void render( agxRender::RenderManager *mgr, float scale ) const override;
113
114 private:
115 class CylindricalJointImplementation* m_implementation;
116 };
117
118} // namespace agx
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#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:208
#define AGXPHYSICS_EXPORT
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
Base class for splines.
Definition: Spline.h:32
Specialization for constraints that have two degree of freedom such as Cylindrical.
Definition: Constraint.h:798
Helper function to define the reference frame used by the prismatic constraint.
void setPoint(const Vec3 &point)
Provide a point lying on the axis.
CylindricalJointFrame()
Default constructor.
void setAxis(const Vec3 &axis)
Set the translational axis.
const Vec3 & getAxis() const
void set(const Vec3 &point, const Vec3 &axis)
Configure everything at once by providing a line with given axis, passing through given point.
CylindricalJointFrame(const Vec3 &point, const Vec3 &axis)
A cylindrical joint is similar to a prismatic joint but with an extra degree of freedom free (rotatio...
virtual ~CylindricalJoint()
virtual void render(agxRender::RenderManager *mgr, float scale) const override
Internal method used for debug rendering.
CylindricalJoint(RigidBody *rb1, Frame *rb1AttachmentFrame, RigidBody *rb2=nullptr, Frame *rb2AttachmentFrame=nullptr)
Create Cylindrical joint given one or two rigid bodies with corresponding attachment frames.
DOF
Enum used for specifying which Degree of Freedom (DOF) that should be accessed in calls to for exampl...
virtual int getNumDOF() const override
CylindricalJoint(const CylindricalJointFrame &cf, RigidBody *rb1, RigidBody *rb2=0)
Create Cylindrical joint given a cylindrical joint frame (line defined in world coordinates)
The object defining a frame of reference and providing transformations operations.
Definition: agx/Frame.h:68
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:52
#define CALLABLE
Definition: macros.h:72
The agxUtil namespace contain classes and methods for utility functionality.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.