AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
OneBodyTire.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXMODEL_ONE_BODY_TIRE_H
18#define AGXMODEL_ONE_BODY_TIRE_H
19
20#include <agxModel/export.h>
21
22#include <agxModel/Tire.h>
23#include <agxSDK/Assembly.h>
24#include <agxUtil/agxUtil.h>
25
26namespace agxModel
27{
28 class TireConstraintImplementation;
29
30
32
44 {
45 public:
55 OneBodyTire( agx::RigidBody* rigidBody, agx::Real radius, agx::Frame* referenceFrame=nullptr );
56
61
66
67 // Only used for external queries
69 {
70 public:
72 ContactInfo(agx::RigidBody *body, agxCollide::LocalContactPointVector *contacts) : m_body(body), m_contacts(contacts) {}
73
74 agx::RigidBody *getBody() { return m_body; }
76
77 private:
78 agx::RigidBody *m_body;
80 };
81
83
85
86 protected:
92 {
93 public:
95
102 TireConstraintImplementation* getOrCreateConstraint( agx::RigidBody* rbTire, agx::RigidBody* rbOther );
103
109 void prepare( const agx::Frame* refFrame, agx::Real radius );
110
115
116 protected:
118 };
119
121
122 public:
124 protected:
125 virtual ~OneBodyTire();
126
127 virtual void addNotification( agxSDK::Simulation* simulation ) override;
129 virtual void removeNotification( agxSDK::Simulation* simulation ) override;
131
133 virtual void preCollide( const agx::TimeStamp& );
134 virtual void pre( const agx::TimeStamp& );
135 virtual void post( const agx::TimeStamp& );
136
140 virtual void separation( const agx::TimeStamp&, agxCollide::GeometryPair& ) {}
142
143 protected:
146
151 agx::Vector<ContactInfo> m_contacts; // Only used for external queries
152 };
153}
154
155#endif // AGXMODEL_ONE_BODY_TIRE_H
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXMODEL_EXPORT
A contact between two geometries.
Definition Contacts.h:271
ContactInfo(agx::RigidBody *body, agxCollide::LocalContactPointVector *contacts)
Definition OneBodyTire.h:72
agxCollide::LocalContactPointVector * getContactPoints()
Definition OneBodyTire.h:75
Class holding the constraints between ONE tire and an arbitrary number of other bodies.
Definition OneBodyTire.h:92
TireConstraintImplementation * getOrCreateConstraint(agx::RigidBody *rbTire, agx::RigidBody *rbOther)
Creates and initializes a constraint between the two bodies, or returns an already existing tire cons...
void finalize(agx::Real h)
Clears and collects values that are used over time.
void prepare(const agx::Frame *refFrame, agx::Real radius)
All sub-constraints will be created.
virtual void addNotification(agxSDK::Simulation *simulation) override
Called when this assembly is added to a simulation (given that it not already is in the simulation).
const agx::RigidBody * getRigidBody() const
virtual agxSDK::ContactEventListener::KeepContactPolicy impact(const agx::TimeStamp &, agxCollide::GeometryContact *gc)
agx::ref_ptr< TireConstraintController > TireConstraintControllerRef
virtual agxSDK::ContactEventListener::KeepContactPolicy contact(const agx::TimeStamp &, agxCollide::GeometryContact *gc)
const ContactInfoVector & getContacts()
agx::Vector< ContactInfo > ContactInfoVector
Definition OneBodyTire.h:82
TireConstraintControllerRef m_constraintController
virtual void separation(const agx::TimeStamp &, agxCollide::GeometryPair &)
agx::Vector< ContactInfo > m_contacts
agx::ref_ptr< agxUtil::GeneralStepListener< OneBodyTire > > m_stepCallback
agx::RigidBody * getRigidBody()
virtual agxSDK::ContactEventListener::KeepContactPolicy handleContact(agxCollide::GeometryContact *gc)
agx::RigidBodyRef m_rigidBody
virtual void preCollide(const agx::TimeStamp &)
agx::FrameRef m_refFrame
OneBodyTire(agx::RigidBody *rigidBody, agx::Real radius, agx::Frame *referenceFrame=nullptr)
Construct tire given rigid body (with wheel geometry/geometries) and radius.
virtual void pre(const agx::TimeStamp &)
agx::ref_ptr< agxUtil::GeneralContactEventListener< OneBodyTire > > m_contactCallback
virtual void removeNotification(agxSDK::Simulation *)
Called when this assembly is removed from a simulation.
Definition Assembly.h:657
virtual void addNotification(agxSDK::Simulation *)
Called when this assembly is added to a simulation (given that it not already is in the simulation).
Definition Assembly.h:652
KeepContactPolicy
Defines whether contact should be kept or removed after contact/impact methods returns.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition Simulation.h:126
Utility class to hold custom implementations of constraints.
Definition agxUtil.h:464
Utility class to get contact event callbacks to any class having the methods implemented.
Definition agxUtil.h:573
Utility class to get step event callbacks to any class having the methods implemented.
Definition agxUtil.h:525
The object defining a frame of reference and providing transformations operations.
Definition agx/Frame.h:68
The rigid body class, combining a geometric model and a frame of reference.
Definition RigidBody.h:52
Templated vector class.
Definition agx/Vector.h:53
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition FlowUnit.h:37
double Real
Definition Real.h:42
agx::Real TimeStamp
Definition TimeStamp.h:26