AGX Dynamics  2.37.3.2
GeometryContactMergeSplitAlgorithm.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 
21 
22 #include <agx/IndexLambdaKernel.h>
23 
24 namespace agxSDK
25 {
27 
29  {
30  public:
32  {
33  VALID = 1 << 0,
34  IMPACTING = 1 << 1,
35  SLIDING = 1 << 2,
36  ROLLING = 1 << 3,
37  RESTING = 1 << 4
38  };
39  typedef agx::BitState<EContactState, agx::Int32> ContactState;
40 
41  struct ComputeData
42  {
44  : mergedState( (agx::RigidBody*)nullptr, nullptr, nullptr ) {}
45 
47  ContactState contactState;
48  };
50 
51  public:
55  static ContactState findImpactingContactState( const agxCollide::GeometryContact& geometryContact,
56  const agxSDK::MergedState& mergedState,
57  const agxSDK::MergeSplitHandler& handler );
58 
62  static ContactState findContactState( const agxCollide::GeometryContact& geometryContact,
63  const agxSDK::MergedState& mergedState,
64  const agxSDK::MergeSplitPostSolveData& postSolveData,
65  const agxSDK::MergeSplitHandler& handler );
66 
67  public:
72 
77  const ComputeDataContainer& getComputeData() const;
78 
80 
81  protected:
86 
87  virtual void onPreStepCompute() override;
88  virtual void onPreStepActions( agxSDK::MergeSplitActionContainer& actions ) override;
89 
90  virtual void onPostSolveCompute( const agxSDK::MergeSplitPostSolveData& postSolveData ) override;
91  virtual void onPostSolveActions( const agxSDK::MergeSplitPostSolveData& postSolveData, agxSDK::MergeSplitActionContainer& actions ) override;
92 
93  private:
95  ComputeDataContainer m_result;
96  };
97 }
Base class for a merge split algorithm handling a set of merged bodies.
A contact between two geometries.
Definition: Contacts.h:270
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Object containing merge-split actions to be processed by the agxSDK::MergeSplitHandler.
Object holding merged bodies and state given a pair of rigid bodies.
Definition: MergedState.h:28
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::BitState< EContactState, agx::Int32 > ContactState
Stateless base class for merge and split of interactions.
#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
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30