AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agx::Angle Class Reference

Constraint angle class. More...

#include <ConstraintAngle.h>

+ Inheritance diagram for agx::Angle:

Public Types

enum  Axis { U , V , N }
 Axis this constraint angle is defined about or along. More...
 
enum  Type { TRANSLATIONAL , ROTATIONAL }
 Type, i.e., defines Axis as 'along' or 'about'. More...
 

Public Member Functions

 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agx::Angle)
 
agx::Angle::Axis getAxis () const
 
virtual const agx::Vec3 & getDir (const agx::AttachmentPair &ap, agx::UInt index) const
 
agx::Angle::Type getType () const
 
agx::Real getValue () const
 
virtual void onPostSolve (const agx::AttachmentPair &ap, agx::Real dt)
 Post solvers, velocity dependent variables should be updated.
 
virtual void restore (agxStream::InputArchive &in) override
 Restore given stream.
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore structural independent data from stream.
 
virtual void store (agxStream::OutputArchive &out) const override
 Store given stream.
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store structural independent data to stream.
 
virtual void transform (const agx::AttachmentPair &ap)
 Transform method to update the value of this angle.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Protected Member Functions

 Angle (agx::Angle::Axis axis, agx::Angle::Type type, agx::Real initialAngle=agx::Real(0))
 Construct given axis and initial angle.
 
virtual ~Angle ()
 Reference counted object, protected destructor.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

Axis m_axis
 
Type m_type
 
agx::Real m_value
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Constraint angle class.

Definition at line 31 of file ConstraintAngle.h.

Member Enumeration Documentation

◆ Axis

Axis this constraint angle is defined about or along.

Enumerator
U 

Constraint x axis.

V 

Constraint y axis.

N 

Constraint z axis.

Definition at line 37 of file ConstraintAngle.h.

◆ Type

Type, i.e., defines Axis as 'along' or 'about'.

Enumerator
TRANSLATIONAL 

Axis is along U, V or N.

ROTATIONAL 

Axis is about U, V or N.

Definition at line 47 of file ConstraintAngle.h.

Constructor & Destructor Documentation

◆ Angle()

agx::Angle::Angle ( agx::Angle::Axis  axis,
agx::Angle::Type  type,
agx::Real  initialAngle = agx::Real(0) 
)
protected

Construct given axis and initial angle.

◆ ~Angle()

virtual agx::Angle::~Angle ( )
protectedvirtual

Reference counted object, protected destructor.

Member Function Documentation

◆ AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE()

agx::Angle::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE ( agx::Angle  )

◆ getAxis()

agx::Angle::Axis agx::Angle::getAxis ( ) const
Returns
the axis this constraint angle is defined about or along

◆ getDir()

virtual const agx::Vec3 & agx::Angle::getDir ( const agx::AttachmentPair &  ap,
agx::UInt  index 
) const
virtual
Parameters
ap- attachment pair
index- which attachment (0,1)
Returns
the world direction of the axis given the attachment pair

Reimplemented in agxopenplx::DistanceAngle, and agx::ConeLimitAngle.

Referenced by agx::ConstraintAngleBasedData::getDir1(), and agx::ConstraintAngleBasedData::getDir2().

◆ getType()

agx::Angle::Type agx::Angle::getType ( ) const
Returns
the type of this constraint angle (i.e., if Axis is 'along' or 'about')

◆ getValue()

Real agx::Angle::getValue ( ) const
inline
Returns
const reference to value (so it may be used by elementary constraints that works on this angle)

Definition at line 345 of file ConstraintAngle.h.

References m_value.

◆ onPostSolve()

virtual void agx::Angle::onPostSolve ( const agx::AttachmentPair &  ap,
agx::Real  dt 
)
virtual

Post solvers, velocity dependent variables should be updated.

Parameters
ap- attachment pair this angle is part of
dt- time step size

Reimplemented in agx::RotationalAngle.

◆ restore()

virtual void agx::Angle::restore ( agxStream::InputArchive &  in)
overridevirtual

Restore given stream.

◆ restoreLightData()

virtual void agx::Angle::restoreLightData ( agxStream::StorageStream &  str)
overridevirtual

Restore structural independent data from stream.

Reimplemented in agx::RotationalAngle.

◆ store()

virtual void agx::Angle::store ( agxStream::OutputArchive &  out) const
overridevirtual

Store given stream.

◆ storeLightData()

virtual void agx::Angle::storeLightData ( agxStream::StorageStream &  str) const
overridevirtual

Store structural independent data to stream.

Reimplemented in agx::RotationalAngle.

◆ transform()

virtual void agx::Angle::transform ( const agx::AttachmentPair &  ap)
virtual

Transform method to update the value of this angle.

Parameters
ap- attachment pair this angle is part of

Reimplemented in agx::RotationalAngle, agx::SeparationAngle, agxopenplx::DistanceAngle, and agx::ConeLimitAngle.

Member Data Documentation

◆ m_axis

Axis agx::Angle::m_axis
protected

Definition at line 123 of file ConstraintAngle.h.

◆ m_type

Type agx::Angle::m_type
protected

Definition at line 124 of file ConstraintAngle.h.

◆ m_value

agx::Real agx::Angle::m_value
protected

Definition at line 125 of file ConstraintAngle.h.

Referenced by getValue(), and agxopenplx::DistanceAngle::transform().


The documentation for this class was generated from the following file: