AGX Dynamics
2.37.2.0
GranularContactMergeSplitAlgorithm.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
19
#include <
agxSDK/MergeSplitAlgorithm.h
>
20
#include <
agx/Physics/GranularBodySystem.h
>
21
22
namespace
agxSDK
23
{
24
AGX_DECLARE_POINTER_TYPES
(
GranularContactMergeSplitAlgorithm
);
25
26
class
AGXPHYSICS_EXPORT
GranularContactMergeSplitAlgorithm
:
public
MergeSplitAlgorithm
27
{
28
public
:
29
enum
EContactState
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
:
43
GranularContactMergeSplitAlgorithm
();
44
45
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxSDK::GranularContactMergeSplitAlgorithm
);
46
47
static
agx::Physics::GranularBodyPtr
ConvertRigidBodyGranulateToGranularBody(
agxSDK::Simulation
* simulation,
agx::RigidBody
* rb);
48
49
protected
:
50
51
GranularContactMergeSplitAlgorithm::ContactState
findContactState(
const
agx::Vec3
& point,
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
55
GranularContactMergeSplitAlgorithm::ContactState
findContactState(
const
agx::Physics::ParticleGeometryContactPtr
& contact);
56
57
GranularContactMergeSplitAlgorithm::ContactState
findContactState(
const
agx::Physics::ParticlePairContactPtr
& contact);
58
59
void
postSolveParticlePairContact(
const
agx::Physics::ParticlePairContactPtr
& contact,
const
agxSDK::MergedState
& mergedState,
agxSDK::MergeSplitActionContainer
& actions);
60
61
void
postSolveParticleGeometryContact(
const
agx::Physics::ParticleGeometryContactPtr
& contact,
const
agxSDK::MergedState
& mergedState,
agxSDK::MergeSplitActionContainer
& actions);
62
63
agx::RigidBody
* createRigidBodyFromGranulate(
agx::Physics::GranularBodyPtr
gptr);
64
65
agxSDK::Simulation
* getSimulation();
66
const
agxSDK::Simulation
* getSimulation()
const
;
67
68
agx::Physics::GranularBodySystem
* getGranularBodySystem();
69
70
void
destroyMergedParticles();
71
75
virtual
~
GranularContactMergeSplitAlgorithm
();
76
77
private
:
78
friend
class
agxSDK::MergeSplitHandler
;
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
}
agx::Physics::ParticleGeometryContactPtr
Pointer to a entity instance of type Physics.ParticleGeometryContact.
Definition:
ParticleGeometryContactEntity.h:267
agx::HashSet< agx::Index >
agx::Physics::ParticlePairContactPtr
Pointer to a entity instance of type Physics.ParticlePairContact.
Definition:
ParticlePairContactEntity.h:240
agxSDK::MergeSplitHandler
Base class for a merge split algorithm handling a set of merged bodies.
Definition:
MergeSplitHandler.h:34
agx::Physics::GranularBodyPtr
Pointer to a entity instance of type Physics.GranularBody.
Definition:
GranularBodyEntity.h:190
agx::Physics::GranularBodySystem
Definition:
GranularBodySystem.h:32
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition:
Referenced.h:254
agxSDK::GranularContactMergeSplitAlgorithm::m_particlesToDestroy
agx::HashSet< agx::Index > m_particlesToDestroy
Definition:
GranularContactMergeSplitAlgorithm.h:84
agxSDK::GranularContactMergeSplitAlgorithm
Definition:
GranularContactMergeSplitAlgorithm.h:26
agxSDK::MergeSplitActionContainer
Object containing merge-split actions to be processed by the agxSDK::MergeSplitHandler.
Definition:
MergeSplitAction.h:115
agxSDK::MergedState
Object holding merged bodies and state given a pair of rigid bodies.
Definition:
MergedState.h:28
agxSDK::GranularContactMergeSplitAlgorithm::ContactState
agx::BitState< EContactState, agx::Int32 > ContactState
Definition:
GranularContactMergeSplitAlgorithm.h:37
MergeSplitAlgorithm.h
GranularBodySystem.h
agxSDK::MergeSplitAlgorithm
Stateless base class for merge and split of interactions.
Definition:
MergeSplitAlgorithm.h:32
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition:
RigidBody.h:54
agx::Vec3T< Real >
agxSDK::GranularContactMergeSplitAlgorithm::EContactState
EContactState
Definition:
GranularContactMergeSplitAlgorithm.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::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition:
Simulation.h:126
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition:
Constraint.h:30
include
agxSDK
GranularContactMergeSplitAlgorithm.h
Generated on Sun Jan 28 2024 11:19:28 for AGX Dynamics by
1.8.13