|
AGX Dynamics 2.42.3.1
|
Abstraction of a wheel of arbitrary geometry. More...
#include <Wheel.h>
Inheritance diagram for agxVehicle::Wheel:Public Types | |
| using | ConstraintContainer = agx::Vector< agx::ConstraintRef > |
Public Member Functions | |
| Wheel (agx::Real radius, agx::RigidBody *rb, agx::AffineMatrix4x4 rbRelTransform) | |
| Construct wheel given radius, wheel body and transform defining wheel center, up and rotation axes in the rigid body frame. | |
| Wheel (agx::Real radius, agx::RigidBody *rb, agx::Frame *rbRelFrame=nullptr) | |
| Construct wheel given radius, wheel body and frame defining wheel center, up and rotation axes in the rigid body frame. | |
| AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxVehicle::Wheel) | |
| template<typename T > | |
| agx::ref_ptr< T > | attachConstraint (const agx::Name &name, agx::RigidBody *other, agx::Real wheelCenterOffset) |
| Create constraint with this wheel and some other rigid body. | |
| agx::Hinge * | attachHinge (const agx::Name &name, agx::RigidBody *other, agx::Real wheelCenterOffset) |
Specialized version of attachConstraint to create a hinge with this wheel body and other. | |
| agx::Vec3 | getCenterPosition () const |
| agx::Constraint * | getConstraint () const |
| agx::Constraint * | getConstraint (const agx::Name &name) const |
| const ConstraintContainer & | getConstraints () const |
| agx::Frame * | getLocalFrame () const |
| agx::Real | getRadius () const |
| agx::RigidBody * | getRigidBody () const |
| agx::Vec3 | getRotationAxis () const |
| agx::Plane | getRotationAxisPlane () const |
| agx::AffineMatrix4x4 | getTransform () const |
| agx::Vec3 | getUpAxis () const |
| WheelTangentData | tangentFrom (const agx::Vec3 &point, agx::Real offsetFromSurface=0.0, agx::Real wrapSign=-1.0) const |
| Calculates tangent from the given world point to wheel. | |
| WheelTangentData | tangentTo (const agx::Vec3 &point, agx::Real offsetFromSurface=0.0, agx::Real wrapSign=-1.0) const |
| Calculates tangent from this wheel to a world point. | |
| WheelTangentData | tangentTo (const Wheel &other, agx::Real offsetFromSurface=0.0, agx::Real wrapSign=-1.0) const |
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. | |
Static Public Member Functions | |
| static agxStream::Serializable * | create (agxStream::InputArchive &) |
| static agx::AffineMatrix4x4 | findRelativeTransform (const agx::RigidBody *wheelBody, const agx::Hinge *hinge, agx::Real sign=1.0) |
| Calculates a transformation such that, when applied to a wheel with the given rigid body, the wheel's transformation becomes aligned with the hinge's transformation. | |
| static agx::AffineMatrix4x4 | findRelativeTransform (const agx::RigidBody *wheelBody, const agx::Vec3 &rotationAxis) |
| Calculates a transformation such that, when applied to a wheel with the given rigid body, the wheel's transformation becomes aligned with the given axis. | |
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. | |
Protected Member Functions | |
| Wheel () | |
| Default constructor used only when this object is restored. | |
| virtual | ~Wheel () |
| 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 () |
Additional Inherited Members | |
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. | |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Abstraction of a wheel of arbitrary geometry.
The wheel has a well defined center, rotation axis and radius.
| agxVehicle::Wheel::Wheel | ( | agx::Real | radius, |
| agx::RigidBody * | rb, | ||
| agx::Frame * | rbRelFrame = nullptr |
||
| ) |
Construct wheel given radius, wheel body and frame defining wheel center, up and rotation axes in the rigid body frame.
Rotation axis is by definition the y axis in rbRelFrame (if given, otherwise y axis of rb).
Up axis is by definition the z axis in rbRelFrame (if given, otherwise z axis of rb).
| radius | - radius of the wheel |
| rb | - wheel body |
| rbRelFrame | - relative frame defining center and rotation axis of this wheel, given in rb frame. |
| agxVehicle::Wheel::Wheel | ( | agx::Real | radius, |
| agx::RigidBody * | rb, | ||
| agx::AffineMatrix4x4 | rbRelTransform | ||
| ) |
Construct wheel given radius, wheel body and transform defining wheel center, up and rotation axes in the rigid body frame.
Rotation axis is by definition the y axis in rbRelFrame (if given, otherwise y axis of rb).
Up axis is by definition the z axis in rbRelFrame (if given, otherwise z axis of rb).
| radius | - radius of the wheel |
| rb | - wheel body |
| rbRelTransform | - relative transform defining center and rotation axis of this wheel, given in rb frame. |
|
protected |
Default constructor used only when this object is restored.
|
protectedvirtual |
Reference counted object - protected destructor.
| agxVehicle::Wheel::AGXSTREAM_DECLARE_SERIALIZABLE_BASE | ( | agxVehicle::Wheel | ) |
| agx::ref_ptr< T > agxVehicle::Wheel::attachConstraint | ( | const agx::Name & | name, |
| agx::RigidBody * | other, | ||
| agx::Real | wheelCenterOffset | ||
| ) |
Create constraint with this wheel and some other rigid body.
The constraint axis will point along the rotation axis and it's possible to offset the center along that same axis.
The constraint is stored and accessible through the given name. The constraint will be added to the simulation when this wheel is used in an agxVehicle object.
| name | - name of the constraint |
| other | - other rigid body |
| wheelCenterOffset | - offset along the rotation axis (from center of this wheel) |
other as second body in the constraint Definition at line 252 of file Wheel.h.
References getCenterPosition(), getRotationAxis(), agx::RigidBody::getTransform(), getUpAxis(), agx::AffineMatrix4x4T< T >::inverse(), and agx::Vec3T< T >::x().
| agx::Hinge * agxVehicle::Wheel::attachHinge | ( | const agx::Name & | name, |
| agx::RigidBody * | other, | ||
| agx::Real | wheelCenterOffset | ||
| ) |
Specialized version of attachConstraint to create a hinge with this wheel body and other.
| name | - name of the hinge |
| other | - other rigid body |
| wheelCenterOffset | - offset along the rotation axis (from center if this wheel) |
other as second body in the hinge
|
inlinestatic |
|
static |
Calculates a transformation such that, when applied to a wheel with the given rigid body, the wheel's transformation becomes aligned with the hinge's transformation.
| wheelBody | - The rigid body that is or will be associated with a Wheel. |
| hinge | - A hinge defining the wheel's rotation axis. Preferably this is the hinge located on the wheel axis. |
| sign | - If positive then the relative transform will transform the wheel so the wheel local Y-axis is parallell with the hinge rotation axis. If negative then the Y-axis is anti parallell to the hinge rotation axis. |
|
static |
Calculates a transformation such that, when applied to a wheel with the given rigid body, the wheel's transformation becomes aligned with the given axis.
| wheelBody | - The rigid body that is or will be associated with a Wheel. |
| rotationAxis | - The rotation axis for the wheel. |
| agx::Vec3 agxVehicle::Wheel::getCenterPosition | ( | ) | const |
Referenced by attachConstraint().
| agx::Constraint * agxVehicle::Wheel::getConstraint | ( | ) | const |
| agx::Constraint * agxVehicle::Wheel::getConstraint | ( | const agx::Name & | name | ) | const |
| name | - name of the constraint to find |
| const ConstraintContainer & agxVehicle::Wheel::getConstraints | ( | ) | const |
| agx::Frame * agxVehicle::Wheel::getLocalFrame | ( | ) | const |
| agx::Real agxVehicle::Wheel::getRadius | ( | ) | const |
| agx::RigidBody * agxVehicle::Wheel::getRigidBody | ( | ) | const |
| agx::Vec3 agxVehicle::Wheel::getRotationAxis | ( | ) | const |
Referenced by attachConstraint().
| agx::Plane agxVehicle::Wheel::getRotationAxisPlane | ( | ) | const |
| agx::AffineMatrix4x4 agxVehicle::Wheel::getTransform | ( | ) | const |
| agx::Vec3 agxVehicle::Wheel::getUpAxis | ( | ) | const |
Referenced by attachConstraint().
| WheelTangentData agxVehicle::Wheel::tangentFrom | ( | const agx::Vec3 & | point, |
| agx::Real | offsetFromSurface = 0.0, |
||
| agx::Real | wrapSign = -1.0 |
||
| ) | const |
Calculates tangent from the given world point to wheel.
The point is projected to the rotation plane of this wheel.
| point | - world point, begin of the tangent |
| offsetFromSurface | - offset from each wheel (e.g., half thickness of a track) |
| wrapSign | - rotation (to begin and end) sign about the rotation axes |
point | WheelTangentData agxVehicle::Wheel::tangentTo | ( | const agx::Vec3 & | point, |
| agx::Real | offsetFromSurface = 0.0, |
||
| agx::Real | wrapSign = -1.0 |
||
| ) | const |
Calculates tangent from this wheel to a world point.
The point is projected to the rotation plane of this wheel.
| point | - world point, end of the tangent |
| offsetFromSurface | - offset from each wheel (e.g., half thickness of a track) |
| wrapSign | - rotation (to begin and end) sign about the rotation axes |
point | WheelTangentData agxVehicle::Wheel::tangentTo | ( | const Wheel & | other, |
| agx::Real | offsetFromSurface = 0.0, |
||
| agx::Real | wrapSign = -1.0 |
||
| ) | const |
| other | - other wheel where the tangent ends |
| offsetFromSurface | - offset from each wheel (e.g., half thickness of a track) |
| wrapSign | - rotation (to begin and end) sign about the rotation axes |
other wheel