AGX Dynamics  2.37.2.0
ConstraintMergeSplitAlgorithm.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 #include <agxUtil/agxUtil.h>
22 
23 #include <agx/IndexLambdaKernel.h>
24 
25 namespace agxSDK
26 {
28 
30  {
31  public:
33  {
34  REL_VELOCITIES_BELOW_THRESHOLD = 1 << 0,
35  DRIVER_ACTIVE = 1 << 1,
36  SPLIT_FIRST_DUE_TO_CONSTRAINT_FORCES = 1 << 2,
37  SPLIT_SECOND_DUE_TO_CONSTRAINT_FORCES = 1 << 3,
38  ACTIVE_TOGGLED = 1 << 4,
39  DIFF_ABOVE_THRESHOLD = 1 << 5
40  };
41  typedef agx::BitState<EConstraintState, agx::Int32> ConstraintState;
42 
43  struct ComputeData
44  {
46  : mergedState( ConstraintMergedState::invalid() )
47  {
48  }
49 
51  ConstraintState constraintState;
52  };
54 
56  {
58  : ComputeData() {}
59 
61  };
63 
65  {
67  };
69 
70  public:
75 
80  const PostSolveComputeDataContainer& getPostSolveComputeData() const;
81 
83 
84  protected:
89 
90  virtual void onPreStepCompute() override;
91  virtual void onPreStepActions( agxSDK::MergeSplitActionContainer& actions ) override;
92 
93  virtual void onPostSolveCompute( const agxSDK::MergeSplitPostSolveData& postSolveData ) override;
94  virtual void onPostSolveComputeEx( const agxSDK::MergeSplitPostSolveData& postSolveData,
95  const agxSDK::MergedBodyMergeSplitAlgorithm& mergedBodyAlgorithm ) override;
96  virtual void onPostSolveActions( const agxSDK::MergeSplitPostSolveData& postSolveData, agxSDK::MergeSplitActionContainer& actions ) override;
97 
98  private:
99  void propagateSplit( const agx::HighLevelConstraintImplementation& implementation,
100  const agxSDK::ConstraintMergedState& mergedState,
102 
103  private:
104  agx::IndexLambdaKernelRef m_kernel;
105  ComputeDataContainer m_preStepResult;
106  PostSolveComputeDataContainer m_postSolveResult;
107  PostSolveComputeExDataContainer m_postSolveExResult;
108  };
109 }
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::BitState< EConstraintState, agx::Int32 > ConstraintState
Object containing merge-split actions to be processed by the agxSDK::MergeSplitHandler.
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