277 virtual
void handleGeometryContact(
agxCollide::GeometryContact* gc );
282 INITIALIZED = 1 << 0,
284 using State = agx::BitState<StateEnum, agx::UInt32>;
303 WheelNodeContacts wheelNodeContacts;
304 NodeContacts nodeContacts;
307 struct TrackNodeTriplet
309 agx::Bool isValid()
const {
return prev !=
nullptr && node !=
nullptr && next !=
nullptr; }
321 TrackNodeTriplet findTrackNodeTriplet(
agx::UInt nodeIndex )
const;
322 TrackNodeTriplet findTrackNodeTriplet(
const agx::RigidBody* nodeRb )
const;
324 void onPreStepMergeNodes( TrackWheel& wheel,
const ContactData::NodeContacts* contacts,
agx::UIntVector& mergedNodeIndices );
325 void onPreStepHandleNonMergedNodes( TrackWheel& wheel,
agx::UIntVector& mergedNodeIndices );
326 void onPreStepSplitWheelMergedNodes( TrackWheel& wheel,
agx::UIntVector& mergedNodeIndices );
327 void onPreInternalMergeNodes(
const TrackInternalMergeProperties& properties );
330 void constrain( TrackNode& curr, TrackNode& prev );
331 void merge( TrackWheel& wheel, TrackNode& node );
332 void merge( TrackNode& node1, TrackNode& node2,
agx::MergedBody& mergedBody );
333 void split( TrackNode& node );
334 void transformToWheel( TrackNode& node,
const TrackWheel& wheel )
const;
337 TrackWheelContainer m_wheels;
338 RigidBodyTrackWheelTable m_rbWheelTable;
340 ContactData m_contactData;
342 TrackInternalMergeProperties m_internalMergeProperties;
348 return LinkedStructure::getT<Track>( rb );
353 return LinkedStructure::getT<Track>( rb );
356 inline Track::TrackNodeTriplet Track::findTrackNodeTriplet(
agx::UInt nodeIndex )
const
367 *prevIt, *nodeIt, *nextIt,
368 prevIt.
index(), nodeIt.index(), nextIt.index()
372 inline Track::TrackNodeTriplet Track::findTrackNodeTriplet(
const agx::RigidBody* nodeRb )
const
395 auto node = LinkedStructure::getSegment( obj );
396 return node !=
nullptr ? node->as<
TrackNode>() :
nullptr;
401 return LinkedStructure::getSegmentIndex( rb );
406 return LinkedStructure::getSegmentIterator<TrackNode>( index,
true );
412 return LinkedStructure::getSegmentIterator<TrackNode>( obj,
true );
418 if ( obj ==
nullptr )
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXVEHICLE_EXPORT
Optionally unbounded linked structure segment iterator object to iterate segments in a SegmentStructu...
static LinkedSegmentIterator end(const agxSDK::LinkedSegmentContainer &segments)
Segment range object for linked structure.
agx::RigidBody * getRigidBody() const
Basic implementation of any structure where bodies are linked/constrained together in a well defined ...
const agxSDK::LinkedSegmentContainer & getSegmentsContainer() const
LinkedSegment * getSegment(agx::UInt index) const
agx::UInt getNumSegments() const
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Properties and thresholds for internal merging of nodes in agxVehicle::Track.
Track node initialize callback, called when a track node has been created and is about to be added to...
Node/segment/shoe object in agxVehicle::Track.
Object containing properties of an agxVehicle::Track.
Track route object to initialize tracks.
Wheel used in tracked vehicles.
Assembly object representing a continuous track with a given number of shoes (nodes).
void setProperties(agxVehicle::TrackProperties *properties)
Assign properties to this track.
static Track * find(agxSDK::Simulation *simulation, const agx::Name &name)
Find track instance given simulation and name.
agxVehicle::TrackWheel * findReferenceWheel() const
Reference wheel's rotation axis is defining the plane in which this track will be created.
const agxVehicle::Track::TrackWheelContainer & getWheels() const
agx::UInt getNumNodes() const
agxVehicle::TrackProperties * getProperties() const
virtual void onPreStep() override
Called on simulation pre step event - after user preStep.
static agxVehicle::TrackPtrVector findAll(agxSDK::Simulation *simulation, const agx::Name &name)
Finds all track instances given simulation and name.
Track(agxVehicle::TrackRoute *route)
Construct given a track route.
virtual agx::Bool initialize(TrackNodeOnInitializeCallback *onInitializeCallback=nullptr)
Initialize this track given already assigned route, added wheels, number of nodes and an initialize n...
virtual void onPostStep() override
Called on simulation post step event - after user postStep.
agx::UInt getNodeIndex(const agx::RigidBody *rb) const
agxVehicle::TrackInternalMergeProperties * getInternalMergeProperties() const
agx::Bool add(agxVehicle::TrackWheelRef wheel)
Add track wheel to this track before this track has been initialized.
agx::Bool remove(agxVehicle::TrackWheelRef wheel)
Remove track wheel.
Track(agx::UInt numberOfNodes, agx::Real width, agx::Real thickness, agx::Real initialDistanceTension=agx::Real(0))
Construct track given number of nodes, size and initial tension distance.
TrackNodeIterator Iterator
static Track * get(Wheel *wheel)
virtual void onAddNotification(agxSDK::Simulation *simulation) override
Called when addNotification is executed when this linked structure is added to the simulation.
Iterator getIterator(const T *obj) const
agxVehicle::TrackNode * getNode(const T *obj) const
static Track * find(agxSDK::Simulation *simulation, const agx::Uuid &uuid)
Find track instance given simulation and unique id.
std::function< void(const TrackNode &)> OnNodeInitializeCallback
agxVehicle::TrackWheel * getWheel(const agx::RigidBody *rb) const
Iterator getIterator(agx::UInt index) const
agx::UInt32Vector onPreGetNodeContacts(const agxVehicle::TrackWheel *wheel) const
agxVehicle::TrackNode * getNode(agx::UInt index) const
static Track * get(agx::RigidBody *rb)
static const Track * get(const Wheel *wheel)
static agxVehicle::TrackPtrVector findAll(agxSDK::Simulation *simulation)
Finds all agxVehicle::Track instances in the given simulation.
NodeRange nodes(IndexRange range) const
agxVehicle::TrackRoute * getRoute() const
virtual void onRemoveNotification(agxSDK::Simulation *simulation) override
Called when removeNotification is executed when this linked structure is removed from the simulation.
virtual agx::Bool initialize(OnNodeInitializeCallback onInitializeCallback)
Initialize this track given already assigned route, added wheels, number of nodes and an initialize n...
agx::BitState< StateEnum, agx::UInt32 > State
virtual void onPreCollideStep() override
Called on simulation pre-collide step event - after user preCollide.
Abstraction of a wheel of arbitrary geometry.
const ValueT get_or_return_default(const KeyT &k) const
Inheritance with partial specialization due to bug with ref_ptr containers.
Structure holding several "normal" rigid bodies.
Representation of a name string.
T * as()
Subclass casting.
The rigid body class, combining a geometric model and a frame of reference.
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Vector containing 'raw' data.
Smart pointer for handling referenced counted objects.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
This namespace consists of a set of classes for handling geometric intersection tests including boole...
agx::UInt nextIndex(agx::UInt index, agx::UInt size)
agx::UInt prevIndex(agx::UInt index, agx::UInt size)
This namespace contains classes related to vehicles dynamics.
agx::ref_ptr< TrackRoute > TrackRouteRef
agx::ref_ptr< TrackProperties > TrackPropertiesRef
agxSDK::LinkedSegmentRange< TrackNode > TrackNodeRange
Node range object for tracks.
agx::ref_ptr< TrackNode > TrackNodeRef
agxSDK::LinkedSegmentIterator< TrackNode > TrackNodeIterator
Optionally unbounded track node iterator object to iterate nodes in a track.
const Node * getNode(const IteratorCompatibleContainer &container, agx::Real distanceFromStart)
Finds the wire node given current distance from the start of the wire (wire defined to be iterator co...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex