17#ifndef AGX_CONSTRAINTANGLE_H
18#define AGX_CONSTRAINTANGLE_H
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
Class for writing serialized data in binary format to a stream.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Abstract base class for storing/restoring a line/drums with version control.
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agx::Angle)
virtual void storeLightData(agxStream::StorageStream &str) const override
Store structural independent data to stream.
Angle(agx::Angle::Axis axis, agx::Angle::Type type, agx::Real initialAngle=agx::Real(0))
Construct given axis and initial angle.
virtual void transform(const agx::AttachmentPair &ap)
Transform method to update the value of this angle.
virtual const agx::Vec3 & getDir(const agx::AttachmentPair &ap, agx::UInt index) const
virtual void restore(agxStream::InputArchive &in) override
Restore given stream.
virtual void onPostSolve(const agx::AttachmentPair &ap, agx::Real dt)
Post solvers, velocity dependent variables should be updated.
virtual ~Angle()
Reference counted object, protected destructor.
agx::Angle::Type getType() const
Type
Type, i.e., defines Axis as 'along' or 'about'.
@ TRANSLATIONAL
Axis is along U, V or N.
Axis
Axis this constraint angle is defined about or along.
agx::Real getValue() const
agx::Angle::Axis getAxis() const
virtual void store(agxStream::OutputArchive &out) const override
Store given stream.
virtual void restoreLightData(agxStream::StorageStream &str) override
Restore structural independent data from stream.
Constraint attachment pair class.
Implementation of angle for the cone limit.
ConeLimitAngle(bool useRotAngle)
Constructor for cone limit angle.
virtual const Vec3 & getDir(const AttachmentPair &ap, agx::UInt index) const override
Get the direction along the cone limit or of the axis given the attachment pair, depending on the cas...
void setConeLimitRange(Vec2 limit)
Set the ConeLimit range, in radians.
ConeLimitAngle()
Default constructor.
Vec2 getConeLimitRange() const
Get the ConeLimit range, in radians.
virtual void transform(const AttachmentPair &ap) override
Transform method to update the values of this Angle.
Base class providing referencing counted objects.
Implementation of constraint angle ABOUT an axis.
virtual void storeLightData(agxStream::StorageStream &str) const override
Store structural independent data to stream.
virtual ~RotationalAngle()
Reference counted object, protected destructor.
RotationalAngle(agx::Angle::Axis axis, agx::Real initialAngle=agx::Real(0))
Construct given axis and initial angle.
void setWindingNumber(agx::Int windingNumber)
Use with caution since each values of windingNumber represent plus or minus 360 degrees of the joint ...
static agx::RotationalAngle * safeCast(const agx::Angle *angle)
Utility cast method.
agx::Real getLastAngle() const
virtual void stepBy(agx::Real deltaAngle)
Integrate/step parameters given a delta angle.
virtual void onPostSolve(const agx::AttachmentPair &ap, agx::Real dt) override
Updates winding number given angular speed about our axis.
virtual void transform(const agx::AttachmentPair &ap) override
Update value given constraint pair.
virtual void restoreLightData(agxStream::StorageStream &str) override
Restore structural independent data from stream.
virtual void stepAbout(const agx::Vec3 &worldAxis, const AttachmentPair &ap, agx::Real dt)
Integrate/step parameters given world axis.
RotationalAngle()
Default constructor used during restore.
agx::Int getWindingNumber() const
void setLastAngle(agx::Real lastAngle)
Set the last angle between (-pi, +pi) (winding number NOT included)
virtual void transformImpl(const agx::AttachmentPair &ap, bool firstIsReference)
The default behavior is that the first attachment is the reference frame.
Implementation of constraint angle ALONG an axis.
virtual ~SeparationAngle()
Reference counted object, protected destructor.
SeparationAngle()
Default constructor used during restore.
SeparationAngle(agx::Angle::Axis axis, agx::Real initialAngle=agx::Real(0))
Construct given axis and initial angle.
virtual void transform(const agx::AttachmentPair &ap) override
Update value given constraint pair.
static agx::SeparationAngle * safeCast(const agx::Angle *angle)
Utility cast method.
Smart pointer for handling referenced counted objects.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::Vector< AngleRef > AngleContainer
agx::ref_ptr< RotationalAngle > RotationalAngleRef
agx::ref_ptr< Angle > AngleRef
agx::ref_ptr< SeparationAngle > SeparationAngleRef
ref_ptr< ConeLimitAngle > ConeLimitAngleRef