AGX Dynamics  2.35.0.1
GranularContactMergeSplitAlgorithm.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 
21 
22 namespace agxSDK
23 {
25 
27  {
28  public:
30  {
31  VALID = 1 << 0,
32  IMPACTING = 1 << 1,
33  SLIDING = 1 << 2,
34  ROLLING = 1 << 3,
35  RESTING = 1 << 4
36  };
37  typedef agx::BitState<EContactState, agx::Int32> ContactState;
38 
39  public:
44 
46 
48 
49  protected:
50 
52  const agx::Vec3f& normal, const agx::Vec3& cmPos1, const agx::Vec3& cmPos2, const agx::Vec3& v1,
53  const agx::Vec3& v2, const agx::Vec3& a1, const agx::Vec3& a2, const agx::Vec3f& u, const agx::Vec3f& v);
54 
56 
58 
60 
62 
64 
67 
69 
71 
76 
77  private:
79 
81  // Variables
83  protected:
84  agx::HashSet<agx::Index> m_particlesToDestroy; // Contains particles that are marked for merge and should be removed replaced with rigid bodies
85  };
86 }
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
#define AGXPHYSICS_EXPORT
virtual ~GranularContactMergeSplitAlgorithm()
Reference counted object, protected destructor.
GranularContactMergeSplitAlgorithm::ContactState findContactState(const agx::Physics::ParticlePairContactPtr &contact)
const agxSDK::Simulation * getSimulation() const
GranularContactMergeSplitAlgorithm::ContactState findContactState(const agx::Physics::ParticleGeometryContactPtr &contact)
GranularContactMergeSplitAlgorithm::ContactState findContactState(const agx::Vec3 &point, const agx::Vec3f &normal, const agx::Vec3 &cmPos1, const agx::Vec3 &cmPos2, const agx::Vec3 &v1, const agx::Vec3 &v2, const agx::Vec3 &a1, const agx::Vec3 &a2, const agx::Vec3f &u, const agx::Vec3f &v)
void postSolveParticlePairContact(const agx::Physics::ParticlePairContactPtr &contact, const agxSDK::MergedState &mergedState, agxSDK::MergeSplitActionContainer &actions)
agx::RigidBody * createRigidBodyFromGranulate(agx::Physics::GranularBodyPtr gptr)
GranularContactMergeSplitAlgorithm()
Default constructor.
static agx::Physics::GranularBodyPtr ConvertRigidBodyGranulateToGranularBody(agxSDK::Simulation *simulation, agx::RigidBody *rb)
agx::BitState< EContactState, agx::Int32 > ContactState
agx::Physics::GranularBodySystem * getGranularBodySystem()
void postSolveParticleGeometryContact(const agx::Physics::ParticleGeometryContactPtr &contact, const agxSDK::MergedState &mergedState, agxSDK::MergeSplitActionContainer &actions)
Object containing merge-split actions to be processed by the agxSDK::MergeSplitHandler.
Stateless base class for merge and split of interactions.
Base class for a merge split algorithm handling a set of merged bodies.
Object holding merged bodies and state given a pair of rigid bodies.
Definition: MergedState.h:29
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Pointer to a entity instance of type Physics.GranularBody.
Pointer to a entity instance of type Physics.ParticleGeometryContact.
Pointer to a entity instance of type Physics.ParticlePairContact.
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31