AGX Dynamics  2.35.0.1
TrackInternalMergeProperties.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 #pragma once
18 
19 #include <agxVehicle/export.h>
20 
21 #include <agx/BitState.h>
22 
23 namespace agxVehicle
24 {
29  {
30  public:
36  {
37  NONE,
40  AGGRESSIVE
41  };
42 
43  public:
55 
60  void setEnableMerge( agx::Bool enable );
61 
66 
71  void setNumNodesPerMergeSegment( agx::UInt numNodesPerMergeSegment );
72 
77 
82  void setContactReduction( ContactReduction contactReductionLevel );
83 
88 
93 
98 
104 
109 
115 
120 
126 
131 
137  void setMaxAngleMergeCondition( agx::Real maxAngleToMerge );
138 
143 
148 
149  public:
154  void store( agxStream::OutputArchive& out ) const;
155 
159  void restore( agxStream::InputArchive& in );
160 
166  agx::Bool getAndResetSplitRelatedDataDirtyFlag();
168 
169  private:
170  enum StateEnum : agx::UInt32
171  {
172  MERGE_ENABLE = 1 << 0,
173  CONTACT_REDUCTION_LEVEL_AGGRESSIVE = 1 << 1,
174  CONTACT_REDUCTION_LEVEL_MODERATE = 1 << 2,
175  CONTACT_REDICTION_LEVEL_MINIMAL = 1 << 3,
176  LOCK_TO_REACH_MERGE_CONDITION = 1 << 4,
177  SPLIT_RELATED_DATA_DIRTY = 1 << 5
178  };
179  using State = agx::BitState<StateEnum, agx::UInt32>;
180 
181  private:
182  State m_state;
183  agx::UInt m_numNodesPerMergeSegment;
184  agx::Real m_lockToReachMergeConditionCompliance;
185  agx::Real m_lockToReachMergeConditionDamping;
186  agx::Real m_maxAngleMergeCondition;
187  };
188 }
#define AGXVEHICLE_EXPORT
Properties and thresholds for internal merging of nodes in agxVehicle::Track.
void setNumNodesPerMergeSegment(agx::UInt numNodesPerMergeSegment)
Assign number of nodes in a row that may merge together.
void setMaxAngleMergeCondition(agx::Real maxAngleToMerge)
Assign maximum angle > 0 to trigger merge between nodes.
void setLockToReachMergeConditionCompliance(agx::Real compliance)
Assign compliance of the hinge lock used to reach merge condition.
void setEnableMerge(agx::Bool enable)
Enable/disable merge of nodes to segments in the track.
void resetToDefault()
Resets all values to default (see default constructor).
ContactReduction getContactReduction() const
agx::UInt getContactReductionBinResolution() const
ContactReduction
Contact reduction of merged nodes in contact with other objects such as ground.
@ MODERATE
Contact reduction enabled with bin resolution = 2.
@ MINIMAL
Contact reduction enabled with bin resolution = 3.
agx::Bool getEnableLockToReachMergeCondition() const
void setEnableLockToReachMergeCondition(agx::Bool enable)
Enable/disable the usage of hinge lock to reach merge condition (angle close to zero).
agx::Real getLockToReachMergeConditionDamping() const
void setContactReduction(ContactReduction contactReductionLevel)
Set contact reduction level of merged nodes against other objects.
void setLockToReachMergeConditionDamping(agx::Real damping)
Assign damping of the hinge lock used to reach merge condition.
agx::Real getLockToReachMergeConditionCompliance() const
TrackInternalMergeProperties()
Default constructor: merge enabled = false number of nodes per merge segment = 3 contact reduction = ...
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:400
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
This namespace contains classes related to vehicles dynamics.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
uint32_t UInt32
Definition: Integer.h:40
bool Bool
Definition: Integer.h:48
uint32_t UInt
Definition: Integer.h:34
double Real
Definition: Real.h:42