AGX Dynamics  2.38.0.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 }
agxSDK::GeometryContactMergeSplitThresholds::SplitThresholds
SplitThresholds
Indices to the threshold values when a body should be split.
Definition: GeometryContactMergeSplitThresholds.h:48
agx::UInt
uint64_t UInt
Definition: Integer.h:27
agxSDK::GeometryContactMergeSplitThresholds::MAX_RELATIVE_NORMAL_SPEED
@ MAX_RELATIVE_NORMAL_SPEED
If the speed along a contact normal is less than this value, the object may be merged.
Definition: GeometryContactMergeSplitThresholds.h:36
MergeSplitThresholds.h
agxSDK::GeometryContactMergeSplitThresholds::MAX_RELATIVE_TANGENT_SPEED
@ MAX_RELATIVE_TANGENT_SPEED
If the speed along a contact tangent is less than this value, the object may be merged.
Definition: GeometryContactMergeSplitThresholds.h:38
agx::Real
double Real
Definition: Real.h:42
agxSDK::GeometryContactMergeSplitThresholds::MAX_ROLLING_SPEED
@ MAX_ROLLING_SPEED
If the relative rolling speed is less than this the object may be merged.
Definition: GeometryContactMergeSplitThresholds.h:40
agxSDK::GeometryContactMergeSplitThresholds
Specific thresholds used to merge and split given geometry contacts.
Definition: GeometryContactMergeSplitThresholds.h:28
agx::ICloneable
Interface class for a cloneable reference counted object.
Definition: ICloneable.h:29
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
agxSDK::GeometryContactMergeSplitThresholds::getMaxRelativeNormalSpeed
agx::Real getMaxRelativeNormalSpeed(const GeometryContactMergeSplitThresholds *other=nullptr) const
Definition: GeometryContactMergeSplitThresholds.h:209
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxSDK::GeometryContactMergeSplitThresholds::MAY_SPLIT_IN_GRAVITY_FIELD
@ MAY_SPLIT_IN_GRAVITY_FIELD
Check split given external forces for all objects merged (i.e., rb->getForce() the sum of rb->addForc...
Definition: GeometryContactMergeSplitThresholds.h:54
agxSDK::GeometryContactMergeSplitThresholds::TANGENTIAL_ADHESION
@ TANGENTIAL_ADHESION
Adhesive force in the tangential directions preventing the object to split (if > 0).
Definition: GeometryContactMergeSplitThresholds.h:58
agxSDK::GeometryContactMergeSplitThresholds::MAX_IMPACT_SPEED
@ MAX_IMPACT_SPEED
If the impact speed (approaching each other) is higher than this value, the objects may split.
Definition: GeometryContactMergeSplitThresholds.h:50
agxSDK::MergeSplitThresholds
Base class for thresholds/constants/values used in agxSDK::MergeSplitAlgorithm.
Definition: MergeSplitThresholds.h:33
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxSDK::GeometryContactMergeSplitThresholds::getSplitOnLogicalImpact
agx::Bool getSplitOnLogicalImpact(const GeometryContactMergeSplitThresholds *other=nullptr) const
Definition: GeometryContactMergeSplitThresholds.h:229
agxSDK::GeometryContactMergeSplitThresholds::getMaxImpactSpeed
agx::Real getMaxImpactSpeed(const GeometryContactMergeSplitThresholds *other=nullptr) const
Definition: GeometryContactMergeSplitThresholds.h:224
agxSDK::GeometryContactMergeSplitThresholds::getMaxRelativeTangentSpeed
agx::Real getMaxRelativeTangentSpeed(const GeometryContactMergeSplitThresholds *other=nullptr) const
Definition: GeometryContactMergeSplitThresholds.h:214
agxSDK::MergeSplitThresholds::get
agx::Real get(const agx::UInt index) const
Definition: MergeSplitThresholds.h:133
agxSDK::GeometryContactMergeSplitThresholds::getTangentialAdhesion
agx::Real getTangentialAdhesion(const GeometryContactMergeSplitThresholds *other=nullptr) const
Definition: GeometryContactMergeSplitThresholds.h:239
agxSDK::GeometryContactMergeSplitThresholds::getMaySplitInGravityField
agx::Bool getMaySplitInGravityField(const GeometryContactMergeSplitThresholds *other=nullptr) const
Definition: GeometryContactMergeSplitThresholds.h:234
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::Bool
bool Bool
Definition: Integer.h:40
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agxSDK::GeometryContactMergeSplitThresholds::getMaxRollingSpeed
agx::Real getMaxRollingSpeed(const GeometryContactMergeSplitThresholds *other=nullptr) const
Definition: GeometryContactMergeSplitThresholds.h:219
agxSDK::GeometryContactMergeSplitThresholds::NORMAL_ADHESION
@ NORMAL_ADHESION
Adhesive force in the normal direction preventing the object to split (if > 0).
Definition: GeometryContactMergeSplitThresholds.h:60
agx::max
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:855
agxSDK::GeometryContactMergeSplitThresholds::LOGICAL_IMPACT
@ LOGICAL_IMPACT
Split when the state of the geometry contact is agxCollide::GeometryContact::IMPACT_STATE.
Definition: GeometryContactMergeSplitThresholds.h:52
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
agxSDK::GeometryContactMergeSplitThresholds::MergeThresholds
MergeThresholds
Indices to the threshold values when a body should be merged.
Definition: GeometryContactMergeSplitThresholds.h:34
agxSDK::GeometryContactMergeSplitThresholds::getNormalAdhesion
agx::Real getNormalAdhesion(const GeometryContactMergeSplitThresholds *other=nullptr) const
Definition: GeometryContactMergeSplitThresholds.h:244