AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxVehicle::TrackWheelSensorData Class Reference

Additional data for wheels and segments between wheels of a track where the nodes aren't simulated. More...

#include <TrackWheelSensorData.h>

+ Inheritance diagram for agxVehicle::TrackWheelSensorData:

Public Member Functions

 TrackWheelSensorData (TrackWheel *wheel, agx::RigidBody *wheelSensor, agx::Real wheelSensorRadius)
 Construct given track wheel wheel, a track segment sensor wheelSensor and the radius wheelSensorRadius of the wheel sensor.
 
void addGroup (const agxSDK::LinkedStructure::IdData &group)
 Assigns the given collision group to the bodies representing the track.
 
TrackSegmentData & getTrackSegmentData ()
 
const TrackSegmentData & getTrackSegmentData () const
 
agx::Real getTrackThickness () const
 
TrackWheel * getWheel () const
 
agx::Real getWheelRadius () const
 
agx::Real getWheelRotationSpeed () const
 
agx::RigidBody * getWheelSensor () const
 
agxCollide::Geometry * getWheelSensorGeometry () const
 
agx::Real getWheelSensorRadius () const
 
void removeGroup (const agxSDK::LinkedStructure::IdData &group)
 Removes the given collision group from the bodies representing the track.
 
void setEnableCollisions (agxCollide::Geometry *geometry, bool enable)
 Enable/disable collisions with the given geometry.
 
void setMaterial (agx::Material *material)
 Assigns the given material material to all bodies/geometries representing the track.
 
void setTrackSegmentData (const TrackSegmentData &trackSegmentData)
 Assign track segment data when initialized.
 
WheelTangentData tangentTo (const TrackWheelSensorData &next, agx::Real wrapSign=-1.0) const
 Finds the external tangent between this wheel and the given next wheel next.
 
- 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- 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
 

Detailed Description

Additional data for wheels and segments between wheels of a track where the nodes aren't simulated.

This data is created for each wheel of a track. An additional cylinder body of radius wheel radius + track thickness is created and merged to the original track wheel. The track segment from this wheel to the next wheel is represented by a rigid body "sensor" that is attached to the chassis and this wheel and the next.

Definition at line 52 of file TrackWheelSensorData.h.

Constructor & Destructor Documentation

◆ TrackWheelSensorData()

agxVehicle::TrackWheelSensorData::TrackWheelSensorData ( TrackWheel *  wheel,
agx::RigidBody *  wheelSensor,
agx::Real  wheelSensorRadius 
)

Construct given track wheel wheel, a track segment sensor wheelSensor and the radius wheelSensorRadius of the wheel sensor.

The segment sensor represents track between this wheel and the next, i.e., this instance holds the data for the wheel pair.

Parameters
wheel- track wheel instance
wheelSensor- additional wheel sensor with extended radius, i.e., track thickness = wheel sensor radius - wheel radius
wheelSensorRadius- radius of the given wheelSensor

Member Function Documentation

◆ addGroup()

void agxVehicle::TrackWheelSensorData::addGroup ( const agxSDK::LinkedStructure::IdData &  group)

Assigns the given collision group to the bodies representing the track.

Parameters
group- group name/id to add

◆ getTrackSegmentData() [1/2]

TrackSegmentData & agxVehicle::TrackWheelSensorData::getTrackSegmentData ( )
Returns
the track segment data, valid when initialized

◆ getTrackSegmentData() [2/2]

const TrackSegmentData & agxVehicle::TrackWheelSensorData::getTrackSegmentData ( ) const
Returns
the track segment data, valid when initialized

◆ getTrackThickness()

agx::Real agxVehicle::TrackWheelSensorData::getTrackThickness ( ) const
Returns
the thickness of the track

◆ getWheel()

TrackWheel * agxVehicle::TrackWheelSensorData::getWheel ( ) const
Returns
the track wheel instance

◆ getWheelRadius()

agx::Real agxVehicle::TrackWheelSensorData::getWheelRadius ( ) const
Returns
the track wheel radius, short for getWheel()->getRadius()

◆ getWheelRotationSpeed()

agx::Real agxVehicle::TrackWheelSensorData::getWheelRotationSpeed ( ) const
Returns
the rotation speed of the track wheel, short for getWheel()->getRotationAxis() * getWheel()->getRigidBody()->getAngularVelocity()

◆ getWheelSensor()

agx::RigidBody * agxVehicle::TrackWheelSensorData::getWheelSensor ( ) const
Returns
the wheel sensor rigid body, merged with the track wheel

◆ getWheelSensorGeometry()

agxCollide::Geometry * agxVehicle::TrackWheelSensorData::getWheelSensorGeometry ( ) const
Returns
the wheel sensor geometry, added to the wheel sensor rigid body

◆ getWheelSensorRadius()

agx::Real agxVehicle::TrackWheelSensorData::getWheelSensorRadius ( ) const
Returns
the wheel sensor radius = wheel radius + track thickness

◆ removeGroup()

void agxVehicle::TrackWheelSensorData::removeGroup ( const agxSDK::LinkedStructure::IdData &  group)

Removes the given collision group from the bodies representing the track.

Parameters
group- group name/id to remove

◆ setEnableCollisions()

void agxVehicle::TrackWheelSensorData::setEnableCollisions ( agxCollide::Geometry *  geometry,
bool  enable 
)

Enable/disable collisions with the given geometry.

Note
The agxSDK::LinkedStructure::setEnableCollisions method is adding/removing the "disabled group id" to/from geometry and our bodies, representing the track, has the id of the track so it's already enabled/disabled.
Parameters
geometry- geometry to enable/disable
enable- true to enable, false to disable

◆ setMaterial()

void agxVehicle::TrackWheelSensorData::setMaterial ( agx::Material *  material)

Assigns the given material material to all bodies/geometries representing the track.

Parameters
material- material instance to assign to the bodies representing the track

◆ setTrackSegmentData()

void agxVehicle::TrackWheelSensorData::setTrackSegmentData ( const TrackSegmentData &  trackSegmentData)

Assign track segment data when initialized.

Parameters
trackSegmentData- initialized track segment data

◆ tangentTo()

WheelTangentData agxVehicle::TrackWheelSensorData::tangentTo ( const TrackWheelSensorData &  next,
agx::Real  wrapSign = -1.0 
) const

Finds the external tangent between this wheel and the given next wheel next.

This is short for getWheel()->tangentTo( next.getWheel(), 0.5 * getTrackThickness() ).

Parameters
next- next wheel data
wrapSign- defining if the tangent is on the upper or lower side of the wheels, default -1 which follows the "outer" path of the track with respect to the wheels
Returns
the tangent between this and next wheel

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