AGX Dynamics  2.37.3.2
TrackProperties.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 #pragma once
18 
19 #include <agxVehicle/export.h>
20 
21 #include <agx/Hinge.h>
22 #include <agx/BitState.h>
23 #include <agx/agx_vector_types.h>
24 
25 namespace agxVehicle
26 {
28 
33  {
34  public:
39 
44  void setHingeCompliance( agx::Real compliance );
45 
51  void setHingeCompliance( agx::Real compliance, agx::Hinge::DOF dof );
52 
57  void setHingeComplianceTranslational( agx::Real compliance );
58 
63  void setHingeComplianceRotational( agx::Real compliance );
64 
68  agx::Real getHingeCompliance( agx::Hinge::DOF dof ) const;
69 
74  void setHingeDamping( agx::Real damping );
75 
81  void setHingeDamping(agx::Real damping, agx::Hinge::DOF dof);
82 
87  void setHingeDampingTranslational(agx::Real damping);
88 
93  void setHingeDampingRotational(agx::Real damping);
94 
98  agx::Real getHingeDamping( agx::Hinge::DOF dof ) const;
99 
105  void setEnableHingeRange( agx::Bool enable );
106 
110  agx::Bool getEnableHingeRange() const;
111 
117  void setHingeRangeRange( agx::Real lowerAngle, agx::Real upperAngle );
118 
122  agx::RangeReal getHingeRangeRange() const;
123 
131  void setEnableOnInitializeMergeNodesToWheels( agx::Bool enable );
132 
136  agx::Bool getEnableOnInitializeMergeNodesToWheels() const;
137 
144  void setEnableOnInitializeTransformNodesToWheels( agx::Bool enable );
145 
149  agx::Bool getEnableOnInitializeTransformNodesToWheels() const;
150 
155  void setTransformNodesToWheelsOverlap( agx::Real overlap );
156 
160  agx::Real getTransformNodesToWheelsOverlap() const;
161 
170  void setNodesToWheelsMergeThreshold( agx::Real mergeThreshold );
171 
175  agx::Real getNodesToWheelsMergeThreshold() const;
176 
185  void setNodesToWheelsSplitThreshold( agx::Real splitThreshold );
186 
190  agx::Real getNodesToWheelsSplitThreshold() const;
191 
198  void setNumNodesIncludedInAverageDirection( agx::UInt numIncludedNodes );
199 
203  agx::UInt getNumNodesIncludedInAverageDirection() const;
204 
212  void setMinStabilizingHingeNormalForce( agx::Real minNormalForce );
213 
217  agx::Real getMinStabilizingHingeNormalForce() const;
218 
226  void setStabilizingHingeFrictionParameter( agx::Real frictionParameter );
227 
231  agx::Real getStabilizingHingeFrictionParameter() const;
232 
236  void resetToDefault();
237 
242  void updateComplianceDamping( agx::Hinge& hinge ) const;
243 
244  public:
246 
247  protected:
249  {
250  ON_INITIALIZE_MERGE_NODES_TO_WHEELS = 1 << 0,
251  ON_INITIALIZE_TRANSFORM_NODES_TO_WHEELS = 1 << 1,
252  HINGE_RANGE_ENABLED = 1 << 2,
253  };
254  using Flags = agx::BitState<FlagsEnum, agx::UInt32>;
255 
257  {
266  NUM_REAL_VALUES
267  };
269 
270  protected:
274  virtual ~TrackProperties();
275 
276  private:
277  Flags m_flags;
278  RealValues m_realValues;
279  agx::Real m_hingeCompliance[ 5 ];
280  agx::Real m_hingeDamping[ 5 ];
281  };
282 
284  {
285  return m_hingeCompliance[ (agx::UInt)std::max<int>( dof, 0 ) ];
286  }
287 
289  {
290  return m_hingeDamping[ (agx::UInt)std::max<int>( dof, 0 ) ];
291  }
292 
294  {
295  return m_flags.Is( HINGE_RANGE_ENABLED );
296  }
297 
299  {
300  return agx::RangeReal{ m_realValues[ HINGE_RANGE_LOWER ], m_realValues[ HINGE_RANGE_UPPER ] };
301  }
302 }
Object containing properties of an agxVehicle::Track.
DOF
Enum used for specifying which Degree of Freedom (DOF) that should be accessed in calls to for exampl...
Definition: Hinge.h:151
#define AGXVEHICLE_EXPORT
bool Bool
Definition: Integer.h:48
VectorPOD< Real > RealVector
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Base class providing referencing counted objects.
Definition: Referenced.h:119
agx::Real getHingeDamping(agx::Hinge::DOF dof) const
uint32_t UInt
Definition: Integer.h:34
agx::RangeReal getHingeRangeRange() const
The hinge constraint between two rigid bodies or one rigid body and the world.
Definition: Hinge.h:103
This namespace contains classes related to vehicles dynamics.
agx::Real getHingeCompliance(agx::Hinge::DOF dof) const
#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
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
agx::Bool getEnableHingeRange() const
double Real
Definition: Real.h:42
agx::BitState< FlagsEnum, agx::UInt32 > Flags
uint32_t UInt32
Definition: Integer.h:40