AGXDynamics
2.35.0.2
GeometryContactMergeSplitAlgorithm.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
19
#include <
agxSDK/MergeSplitAlgorithm.h
>
20
#include <
agxSDK/MergeSplitThresholds.h
>
21
22
#include <
agx/IndexLambdaKernel.h
>
23
24
namespace
agxSDK
25
{
26
AGX_DECLARE_POINTER_TYPES
(
GeometryContactMergeSplitAlgorithm
);
27
28
class
AGXPHYSICS_EXPORT
GeometryContactMergeSplitAlgorithm
:
public
MergeSplitAlgorithm
29
{
30
public
:
31
enum
EContactState
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
{
43
ComputeData
()
44
: mergedState( (
agx
::RigidBody*)nullptr, nullptr, nullptr ) {}
45
46
MergedState
mergedState
;
47
ContactState
contactState
;
48
};
49
using
ComputeDataContainer
=
agx::VectorPOD<ComputeData>
;
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
:
71
GeometryContactMergeSplitAlgorithm
();
72
77
const
ComputeDataContainer
& getComputeData()
const
;
78
79
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxSDK::GeometryContactMergeSplitAlgorithm
);
80
81
protected
:
85
virtual
~
GeometryContactMergeSplitAlgorithm
();
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
:
94
agx::IndexLambdaKernelRef
m_kernel;
95
ComputeDataContainer
m_result;
96
};
97
}
agxSDK::GeometryContactMergeSplitAlgorithm::ComputeData::ComputeData
ComputeData()
Definition:
GeometryContactMergeSplitAlgorithm.h:43
MergeSplitThresholds.h
agxSDK::MergeSplitPostSolveData
Definition:
MergeSplitPostSolveData.h:37
IndexLambdaKernel.h
agxSDK::MergeSplitAlgorithm
Stateless base class for merge and split of interactions.
Definition:
MergeSplitAlgorithm.h:32
agxSDK::GeometryContactMergeSplitAlgorithm::EContactState
EContactState
Definition:
GeometryContactMergeSplitAlgorithm.h:31
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
agx::VectorPOD< ComputeData >
agxSDK::GeometryContactMergeSplitAlgorithm::ComputeData::contactState
ContactState contactState
Definition:
GeometryContactMergeSplitAlgorithm.h:47
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition:
AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxSDK::MergeSplitHandler
Base class for a merge split algorithm handling a set of merged bodies.
Definition:
MergeSplitHandler.h:34
agxSDK::MergedState
Object holding merged bodies and state given a pair of rigid bodies.
Definition:
MergedState.h:28
agx::ref_ptr< IndexLambdaKernel >
agxSDK::GeometryContactMergeSplitAlgorithm::ComputeData::mergedState
MergedState mergedState
Definition:
GeometryContactMergeSplitAlgorithm.h:46
agxSDK::GeometryContactMergeSplitAlgorithm::ComputeData
Definition:
GeometryContactMergeSplitAlgorithm.h:41
agxSDK::GeometryContactMergeSplitAlgorithm
Definition:
GeometryContactMergeSplitAlgorithm.h:28
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition:
Referenced.h:248
agxCollide::GeometryContact
A contact between two geometries.
Definition:
Contacts.h:269
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition:
Constraint.h:30
MergeSplitAlgorithm.h
agxSDK::GeometryContactMergeSplitAlgorithm::ContactState
agx::BitState< EContactState, agx::Int32 > ContactState
Definition:
GeometryContactMergeSplitAlgorithm.h:39
agxSDK::MergeSplitActionContainer
Object containing merge-split actions to be processed by the agxSDK::MergeSplitHandler.
Definition:
MergeSplitAction.h:115
include
agxSDK
GeometryContactMergeSplitAlgorithm.h
Generated on Mon Jan 30 2023 15:44:12 for AGXDynamics by
1.8.17