AGX Dynamics  2.38.0.2
OneBodyTire.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx 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 
26 namespace agxModel
27 {
28  class TireConstraintImplementation;
29 
30 
32 
44  {
45  public:
55  OneBodyTire( agx::RigidBody* rigidBody, agx::Real radius, agx::Frame* referenceFrame=nullptr );
56 
60  agx::RigidBody* getRigidBody();
61 
65  const agx::RigidBody* getRigidBody() const;
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 
84  const ContactInfoVector& getContacts();
85 
86  protected:
87  OneBodyTire();
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 
114  void finalize( agx::Real h );
115 
116  protected:
117  virtual ~TireConstraintController();
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 
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
agxModel::OneBodyTire::contact
virtual agxSDK::ContactEventListener::KeepContactPolicy contact(const agx::TimeStamp &, agxCollide::GeometryContact *gc)
Definition: OneBodyTire.h:139
agxSDK::StepEventListener::pre
virtual void pre(const agx::TimeStamp &time)
Called before a step is taken in the simulation Implement this method in the derived class to get cal...
Definition: StepEventListener.h:106
agx::Real
double Real
Definition: Real.h:42
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
agxData::GeometryPair
agx::SymmetricPair< agx::Physics::GeometryPtr > GeometryPair
Definition: Geometry.h:65
agxUtil::GeneralStepListener
Utility class to get step event callbacks to any class having the methods implemented.
Definition: agxUtil.h:524
agx::Vector
Templated vector class.
Definition: Vector.h:52
agxModel::OneBodyTire::ContactInfo::getBody
agx::RigidBody * getBody()
Definition: OneBodyTire.h:74
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
agxModel::OneBodyTire::m_radius
agx::Real m_radius
Definition: OneBodyTire.h:148
agxModel::OneBodyTire::m_stepCallback
agx::ref_ptr< agxUtil::GeneralStepListener< OneBodyTire > > m_stepCallback
Definition: OneBodyTire.h:144
export.h
agxUtil::ConstraintHolder
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:463
agxSDK::StepEventListener::post
virtual void post(const agx::TimeStamp &time)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
Definition: StepEventListener.h:107
agxModel::OneBodyTire::ContactInfo::ContactInfo
ContactInfo()
Definition: OneBodyTire.h:71
Assembly.h
agxModel::OneBodyTire::ContactInfo::getContactPoints
agxCollide::LocalContactPointVector * getContactPoints()
Definition: OneBodyTire.h:75
agxModel::OneBodyTire::m_contacts
agx::Vector< ContactInfo > m_contacts
Definition: OneBodyTire.h:151
AGXSTREAM_DECLARE_SERIALIZABLE
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
agx::VectorPOD< LocalContactPoint >
agxUtil::GeneralContactEventListener
Utility class to get contact event callbacks to any class having the methods implemented.
Definition: agxUtil.h:572
agxModel::OneBodyTire::TireConstraintController
Class holding the constraints between ONE tire and an arbitrary number of other bodies.
Definition: OneBodyTire.h:91
agx::ref_ptr< TireConstraintController >
agxModel::OneBodyTire::m_constraintController
TireConstraintControllerRef m_constraintController
Definition: OneBodyTire.h:150
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:125
agxSDK::ContactEventListener::KeepContactPolicy
KeepContactPolicy
Defines whether contact should be kept or removed after contact/impact methods returns.
Definition: ContactEventListener.h:59
Tire.h
agxModel::OneBodyTire::ContactInfo
Definition: OneBodyTire.h:68
agxModel::OneBodyTire::m_refFrame
agx::FrameRef m_refFrame
Definition: OneBodyTire.h:149
agxModel::OneBodyTire::m_rigidBody
agx::RigidBodyRef m_rigidBody
Definition: OneBodyTire.h:147
agxModel::OneBodyTire::ContactInfo::ContactInfo
ContactInfo(agx::RigidBody *body, agxCollide::LocalContactPointVector *contacts)
Definition: OneBodyTire.h:72
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agxModel::OneBodyTire::m_contactCallback
agx::ref_ptr< agxUtil::GeneralContactEventListener< OneBodyTire > > m_contactCallback
Definition: OneBodyTire.h:145
agxModel::OneBodyTire::ContactInfoVector
agx::Vector< ContactInfo > ContactInfoVector
Definition: OneBodyTire.h:82
agxModel::OneBodyTire::TireConstraintControllerRef
agx::ref_ptr< TireConstraintController > TireConstraintControllerRef
Definition: OneBodyTire.h:120
agxCollide::GeometryContact
A contact between two geometries.
Definition: Contacts.h:270
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxModel::OneBodyTire::separation
virtual void separation(const agx::TimeStamp &, agxCollide::GeometryPair &)
Definition: OneBodyTire.h:140
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxModel::OneBodyTire
Definition: OneBodyTire.h:43
agx::Frame
The object defining a frame of reference and providing transformations operations.
Definition: Frame.h:67
agxSDK::Assembly::removeNotification
virtual void removeNotification(agxSDK::Simulation *)
Called when this assembly is removed from a simulation.
Definition: Assembly.h:657
agxSDK::StepEventListener::preCollide
virtual void preCollide(const agx::TimeStamp &time)
Called before collision detection is performed in the simulation Implement this method in the derived...
Definition: StepEventListener.h:105
agxModel::Tire
Definition: Tire.h:36
agxModel::OneBodyTire::impact
virtual agxSDK::ContactEventListener::KeepContactPolicy impact(const agx::TimeStamp &, agxCollide::GeometryContact *gc)
Definition: OneBodyTire.h:138
agxUtil.h
agxSDK::Assembly::addNotification
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