AGX Dynamics  2.37.3.2
GeometryContactMergeSplitThresholds.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 
20 
21 namespace agxSDK
22 {
24 
29  {
30  public:
35  {
36  MAX_RELATIVE_NORMAL_SPEED,
38  MAX_RELATIVE_TANGENT_SPEED,
40  MAX_ROLLING_SPEED,
42  NUM_MERGE_THRESHOLDS
43  };
44 
49  {
50  MAX_IMPACT_SPEED = NUM_MERGE_THRESHOLDS,
52  LOGICAL_IMPACT,
54  MAY_SPLIT_IN_GRAVITY_FIELD,
58  TANGENTIAL_ADHESION,
60  NORMAL_ADHESION,
62  NUM_THRESHOLDS
63  };
64 
65  public:
70 
75  void setMaxRelativeNormalSpeed( agx::Real value );
76 
84  agx::Real getMaxRelativeNormalSpeed( const GeometryContactMergeSplitThresholds* other = nullptr ) const;
85 
90  void setMaxRelativeTangentSpeed( agx::Real value );
91 
99  agx::Real getMaxRelativeTangentSpeed( const GeometryContactMergeSplitThresholds* other = nullptr ) const;
100 
105  void setMaxRollingSpeed( agx::Real value );
106 
113  agx::Real getMaxRollingSpeed( const GeometryContactMergeSplitThresholds* other = nullptr ) const;
114 
119  void setMaxImpactSpeed( agx::Real value );
120 
129  agx::Real getMaxImpactSpeed( const GeometryContactMergeSplitThresholds* other = nullptr ) const;
130 
136  void setSplitOnLogicalImpact( agx::Bool value );
137 
144  agx::Bool getSplitOnLogicalImpact( const GeometryContactMergeSplitThresholds* other = nullptr ) const;
145 
152  void setMaySplitInGravityField( agx::Bool maySplitInGravityField );
153 
159  agx::Bool getMaySplitInGravityField( const GeometryContactMergeSplitThresholds* other = nullptr ) const;
160 
166  void setTangentialAdhesion( agx::Real value );
167 
173  agx::Real getTangentialAdhesion( const GeometryContactMergeSplitThresholds* other = nullptr ) const;
174 
180  void setNormalAdhesion( agx::Real value );
181 
187  agx::Real getNormalAdhesion( const GeometryContactMergeSplitThresholds* other = nullptr ) const;
188 
189  public:
191 
195  virtual agx::ICloneableRef clone( agx::ICloneable* child = nullptr ) override;
196 
200  virtual void resetToDefault() override;
201 
202  protected:
207  };
208 
210  {
211  return get( MAX_RELATIVE_NORMAL_SPEED, other, []( agx::Real a, agx::Real b ) -> agx::Real { return std::max( a, b ); } );
212  }
213 
215  {
216  return get( MAX_RELATIVE_TANGENT_SPEED, other, []( agx::Real a, agx::Real b ) -> agx::Real { return std::max( a, b ); } );
217  }
218 
220  {
221  return get( MAX_ROLLING_SPEED, other, []( agx::Real a, agx::Real b ) -> agx::Real { return std::max( a, b ); } );
222  }
223 
225  {
226  return get( MAX_IMPACT_SPEED, other, []( agx::Real a, agx::Real b ) -> agx::Real { return std::max( a, b ); } );
227  }
228 
230  {
231  return get( LOGICAL_IMPACT, other, []( agx::Real a, agx::Real b ) -> agx::Real { return std::max( a, b ); } ) > agx::Real( 0.5 );
232  }
233 
235  {
236  return get( MAY_SPLIT_IN_GRAVITY_FIELD, other, []( agx::Real a, agx::Real b ) -> agx::Real { return std::max( a, b ); } ) > agx::Real( 0.5 );
237  }
238 
240  {
241  return get( TANGENTIAL_ADHESION, other, []( agx::Real a, agx::Real b ) -> agx::Real { return std::max( a, b ); } );
242  }
243 
245  {
246  return get( NORMAL_ADHESION, other, []( agx::Real a, agx::Real b ) -> agx::Real { return std::max( a, b ); } );
247  }
248 }
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:855
bool Bool
Definition: Integer.h:48
SplitThresholds
Indices to the threshold values when a body should be split.
agx::Real getMaxRelativeTangentSpeed(const GeometryContactMergeSplitThresholds *other=nullptr) const
#define AGXPHYSICS_EXPORT
agx::Real getMaxRollingSpeed(const GeometryContactMergeSplitThresholds *other=nullptr) const
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGX_FORCE_INLINE
Definition: Object.h:59
uint32_t UInt
Definition: Integer.h:34
Specific thresholds used to merge and split given geometry contacts.
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
MergeThresholds
Indices to the threshold values when a body should be merged.
agx::Bool getMaySplitInGravityField(const GeometryContactMergeSplitThresholds *other=nullptr) 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
agx::Real getMaxRelativeNormalSpeed(const GeometryContactMergeSplitThresholds *other=nullptr) const
Base class for thresholds/constants/values used in agxSDK::MergeSplitAlgorithm.
agx::Real getTangentialAdhesion(const GeometryContactMergeSplitThresholds *other=nullptr) const
agx::Bool getSplitOnLogicalImpact(const GeometryContactMergeSplitThresholds *other=nullptr) const
Interface class for a cloneable reference counted object.
Definition: ICloneable.h:29
agx::Real getMaxImpactSpeed(const GeometryContactMergeSplitThresholds *other=nullptr) const
agx::Real getNormalAdhesion(const GeometryContactMergeSplitThresholds *other=nullptr) const
double Real
Definition: Real.h:42
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30