AGX Dynamics  2.37.3.2
agx::ConeLimitAngle Class Reference

Implementation of angle for the cone limit. More...

#include <ConstraintAngle.h>

+ Inheritance diagram for agx::ConeLimitAngle:

Public Member Functions

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

Static Public Member Functions

static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
- 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. More...
 

Protected Attributes

bool m_useRotAngle
 
- Protected Attributes inherited from agx::Angle
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

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

Detailed Description

Implementation of angle for the cone limit.

The Angle is defined around the n-axis, but only the friction controller for rotation on the axis actually uses that axis. In the case of the friction along the limit, another direction is calculated, so that it is along the limit. For the ConeLimit itself, the direction is not used at all, the angle is however used to save the limits so that the FrictionController along the limit also can use it.

Definition at line 250 of file ConstraintAngle.h.

Constructor & Destructor Documentation

◆ ConeLimitAngle() [1/2]

agx::ConeLimitAngle::ConeLimitAngle ( bool  useRotAngle)

Constructor for cone limit angle.

Parameters
useRotAngle- Set to true to remove the special direction along the cone limit

◆ ConeLimitAngle() [2/2]

agx::ConeLimitAngle::ConeLimitAngle ( )

Default constructor.

Member Function Documentation

◆ create() [1/2]

static agxStream::Serializable* agx::ConeLimitAngle::create ( )
inlinestatic

Definition at line 292 of file ConstraintAngle.h.

◆ create() [2/2]

static agxStream::Serializable* agx::ConeLimitAngle::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 292 of file ConstraintAngle.h.

◆ getClassName()

const char* agx::ConeLimitAngle::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 292 of file ConstraintAngle.h.

◆ getConeLimitRange()

Vec2 agx::ConeLimitAngle::getConeLimitRange ( ) const

Get the ConeLimit range, in radians.

Note that if this Angle is not the same as in the ConeLimit, this will not return the correct limit.

Returns
Vec2 containing the two limit angles, in radians

◆ getConstructClassId()

static const char* agx::ConeLimitAngle::getConstructClassId ( )
inlinestatic

Definition at line 292 of file ConstraintAngle.h.

◆ getDir()

virtual const Vec3& agx::ConeLimitAngle::getDir ( const AttachmentPair &  ap,
agx::UInt  index 
) const
overridevirtual

Get the direction along the cone limit or of the axis given the attachment pair, depending on the case the Angle is used in.

Parameters
ap- attachment pair
index- which attachment (0,1)
Returns
Vec3 describing the direction, in the world

Reimplemented from agx::Angle.

◆ getStorageAgent()

agxStream::StorageAgent* agx::ConeLimitAngle::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 292 of file ConstraintAngle.h.

◆ restore()

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

Restore given stream.

Reimplemented from agx::Angle.

◆ setConeLimitRange()

void agx::ConeLimitAngle::setConeLimitRange ( Vec2  limit)

Set the ConeLimit range, in radians.

Note that if this Angle is not the same as in the ConeLimit, this will not set the limit.

Parameters
limit- Vec2 containing the two limit angles, in radians

◆ store()

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

Store given stream.

Reimplemented from agx::Angle.

◆ transform()

virtual void agx::ConeLimitAngle::transform ( const AttachmentPair &  ap)
overridevirtual

Transform method to update the values of this Angle.

Reimplemented from agx::Angle.

Member Data Documentation

◆ m_useRotAngle

bool agx::ConeLimitAngle::m_useRotAngle
protected

Definition at line 292 of file ConstraintAngle.h.


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