17 #ifndef AGX_CONSTRAINT_H
18 #define AGX_CONSTRAINT_H
25 #pragma warning( push )
26 #pragma warning( disable : 4589 ) // Disable: 4589: Constructor of abstract class 'agx::FrictionModel' ignores initializer for virtual base class 'agxStream::Serializable'
45 class ConstraintImplementation;
46 class DebugRendererCache;
49 class RigidBodyAttachment;
51 class RegularizationParameters;
94 DIRECT_AND_ITERATIVE = (DIRECT | ITERATIVE)
142 virtual void setElasticity(
agx::Real elasticity);
260 virtual void setEnable(
agx::Bool enable );
275 virtual int getNumDOF()
const = 0;
309 void setEnableDebugRendering(
agx::Bool enable );
314 bool getEnableDebugRendering()
const;
322 void setEnableComputeForces(
agx::Bool enable );
327 agx::Bool getEnableComputeForces()
const;
424 void setEnableLinearization(
bool enable);
430 bool getEnableLinearization()
const;
505 agx::UInt getNumElementaryConstraints()
const;
510 agx::UInt getNumSecondaryConstraints()
const;
518 agx::UInt calculateNumActiveRows()
const;
584 template<
typename T >
596 template<
typename T >
600 template<
typename T >
604 template<
typename T >
628 virtual void addNotification()
override;
629 virtual void removeNotification()
override;
652 void setInternalData( agx::
Referenced* data );
656 agx::
Bool m_debugRenderingEnable;
751 virtual ~Constraint1DOF();
857 virtual ~ConstraintFrame();
859 Vec3& operator [] (
const unsigned int& i );
860 const Vec3& operator [] (
const unsigned int& i )
const;
862 void setTranslate(
const Vec3& translate );
863 const Vec3& getTranslate()
const;
872 return m_implementation;
877 return m_implementation;
880 template<
typename T >
890 template<
typename T >
901 template<
typename T >
904 return dynamic_cast<T*
>(
this);
908 template<
typename T >
911 return dynamic_cast<const T*
>(
this);
916 #if defined(_MSC_VER)
917 #pragma warning( pop )
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
static agx::ref_ptr< T > createFromBody(agx::Vec3 bodyPoint, agx::Vec3 bodyAxis, agx::RigidBody *rb1, agx::RigidBody *rb2=nullptr)
Creates a constraint given a point and an axis in rb1 model frame.
AGXFMI_EXPORT InputVariable_Real * setCompliance(agx::Constraint *constraint)
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
Elementary constraint base class with interface and global constraint functionality.
Implementation of a electric motor controller.
static agx::Bool calculateFramesFromBody(agx::Vec3 bodyPoint, agx::Vec3 bodyAxis, const agx::RigidBody *body, agx::Frame *bodyFrame, const agx::RigidBody *otherBody, agx::Frame *otherFrame)
Calculates the constraint attachment frames given point and axis in body coordinates of body...
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic...
#define AGXPHYSICS_EXPORT
The base class for a constraint.
#define AGX_DECLARE_POINTER_TYPES(type)
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic...
Constraint attachment class for agx::RigidBody.
Representation of a name string.
Translational or rotational friction controller for Hinge, Prismatic and CylindricalJoint.
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
Base class providing referencing counted objects.
The base class for interactions.
Elementary secondary constraint to keep constraint angle at a given target position.
Constraint attachment pair class.
virtual void setSystem(agx::DynamicsSystem *)
Constraint attachment base class for any type of frame.
Elementary secondary constraint to keep constraint angle within two given values. ...
DOF
Specifies a selected degree of freedom.
static agx::Bool calculateFramesFromWorld(agx::Vec3 worldPoint, agx::Vec3 worldAxis, const agx::RigidBody *rb1, agx::Frame *rb1Frame, const agx::RigidBody *rb2, agx::Frame *rb2Frame)
Given a point and an axis in world, this function calculates each local attachment frame for one or t...
Smart pointer for handling referenced counted objects.
The rigid body class, combining a geometric model and a frame of reference.
Internal data for any object, ObjT, with methods: agx::Referenced* ObjT::getInternalData() const; voi...
The complete physical system with bodies, interactions, data layout, time stepper, and solver.
Abstract base class for storing/restoring a line/drums with version control.
agx::ConstraintImplementation * m_implementation
All ghost variables have compliance and damping attributes.
SolveType
Specifies in what solvers the constraint will be solved.
The object defining a frame of reference and providing transformations operations.
agx::ConstraintImplementation * getRep()
AGXFMI_EXPORT InputVariable_Real * setDamping(agx::Constraint *constraint)
Elementary secondary constraint to drive something given target speed (translational or rotational)...
Class for writing serialized data in binary format to a stream.
static agx::ref_ptr< T > createFromWorld(agx::Vec3 worldPoint, agx::Vec3 worldAxis, agx::RigidBody *rb1, agx::RigidBody *rb2=nullptr)
Creates a constraint given a point and an axis in world frame.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Real getAngle(const Vec3 &a, const Vec3 &b, const Vec3 &c)
a and b should be orthogonal
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
T * as()
Try to do dynamic_cast on the constraint and return a pointer to the casted constraint.
AGX_DECLARE_VECTOR_TYPES(Clock)