AGX Dynamics  2.35.0.1
ThreeBodyTire.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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_THREE_BODY_TIRE_H
18 #define AGXMODEL_THREE_BODY_TIRE_H
19 
20 
21 #include <agxModel/TwoBodyTire.h>
22 
23 namespace agxModel
24 {
25 
39  {
40  public:
55  ThreeBodyTire(agx::RigidBody* tireBodyCollision, agx::RigidBody* tireBodyVisual, agx::Real outerRadius,
56  agx::RigidBody* hubBody, agx::Real innerRadius,
57  const agx::AffineMatrix4x4& localTransform = agx::AffineMatrix4x4() );
58 
63 
68 
69 
79 
87  virtual bool setStiffness(const agx::Real stiffness, DeformationMode mode) override;
88 
95  virtual agx::Real getStiffness(DeformationMode mode) override;
96 
104  virtual bool setDampingCoefficient(const agx::Real dampingCoefficient, DeformationMode mode) override;
105 
113 
114 
116 
117  protected:
119 
120  virtual ~ThreeBodyTire();
121 
122  virtual bool isValid() const override;
123 
124  // Contact events.
126 
129 
132 
135 
137  const agx::TimeStamp&,
139  bool impact);
140 
141  void reduceContacts(agxCollide::LocalGeometryContact& gc);
142 
143  // Step events.
145 
146  virtual void post( const agx::TimeStamp& ) override;
147 
148 
149  protected:
150 
151  // Adding to/removing from simulation.
152  virtual void addNotification(agxSDK::Simulation* simulation) override;
153 
155 
156  virtual void removeNotification(agxSDK::Simulation* simulation)override;
157 
159 
160  // More persistent variables, will be serialized.
163 
164  };
165 }
166 
167 #endif // AGXMODEL_THREE_BODY_TIRE_H
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
#define AGXMODEL_EXPORT
A contact between two geometries.
Definition: Contacts.h:270
void separation(const agx::TimeStamp &, agxCollide::GeometryPair &)
const agx::RigidBody * getTireCollisionRigidBody() const
virtual agx::Real getDampingCoefficient(DeformationMode mode) override
Gets the damping coefficient for a deformation mode.
virtual bool setDampingCoefficient(const agx::Real dampingCoefficient, DeformationMode mode) override
Sets the damping coefficient for a deformation mode.
ThreeBodyTire(agx::RigidBody *tireBodyCollision, agx::RigidBody *tireBodyVisual, agx::Real outerRadius, agx::RigidBody *hubBody, agx::Real innerRadius, const agx::AffineMatrix4x4 &localTransform=agx::AffineMatrix4x4())
Construct tire given rigid body (with wheel geometry/geometries) and radius.
agx::Hinge * getOuterHinge()
Gets the hinge (with active Lock1D) connecting the tire to the hub.
virtual bool setStiffness(const agx::Real stiffness, DeformationMode mode) override
Sets the stiffness for a deformation mode.
agx::RigidBodyObserver m_tireVisualBody
agxSDK::ContactEventListener::KeepContactPolicy handleContacts(const agx::TimeStamp &, agxCollide::GeometryContact *gc, bool impact)
agx::RigidBody * getTireVisualRigidBody()
virtual void removeNotification(agxSDK::Simulation *simulation) override
Called when this assembly is removed from a simulation.
agxSDK::ContactEventListener::KeepContactPolicy contact(const agx::TimeStamp &, agxCollide::GeometryContact *gc)
virtual agx::Real getStiffness(DeformationMode mode) override
Gets the stiffness for a deformation mode.
virtual void post(const agx::TimeStamp &) override
agx::HingeRef m_outerHinge
agxSDK::ContactEventListener::KeepContactPolicy impact(const agx::TimeStamp &, agxCollide::GeometryContact *gc)
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).
virtual void removeNotification(agxSDK::Simulation *)
Called when this assembly is removed from a simulation.
Definition: Assembly.h:618
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:613
KeepContactPolicy
Defines whether contact should be kept or removed after contact/impact methods returns.
virtual KeepContactPolicy impact(const agx::TimeStamp &time, agxCollide::GeometryContact *geometryContact)
Called upon impact event if getFilter() contain IMPACT.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
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 hinge constraint between two rigid bodies or one rigid body and the world.
Definition: Hinge.h:104
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
agx::SymmetricPair< agx::Physics::GeometryPtr > GeometryPair
Definition: Geometry.h:66
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