AGX Dynamics
2.37.2.0
MergedState.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 <
agx/MergedBody.h
>
20
21
namespace
agxSDK
22
{
23
class
MergeSplitProperties;
24
28
class
AGXPHYSICS_EXPORT
MergedState
29
{
30
public
:
31
enum
EState
32
{
33
VALID = 1 << 0,
34
BOTH_ARE_NULL = 1 << 1,
35
ONE_IS_NULL = 1 << 2,
36
BOTH_ARE_VALID = 1 << 3,
37
MERGED_BODIES_ARE_SAME = 1 << 4,
38
MERGED_BODIES_ARE_DIFFERENT = 1 << 5,
39
WIRE_BODY_INCLUDED = 1 << 6,
40
GRANULATE_BODY_INCLUDED = 1 << 7
41
};
42
typedef
agx::BitState< EState, agx::Int32 >
State
;
43
44
enum
ActionType
:
agx::Int16
45
{
46
MERGE = 1 << 0,
47
SPLIT_FIRST = 1 << 1,
48
SPLIT_SECOND = 1 << 2
49
};
50
typedef
agx::BitState< ActionType, agx::Int16 >
Actions
;
51
52
public
:
56
static
MergedState
invalid();
57
58
public
:
64
MergedState
(
agx::RigidBody
* rb1,
agx::RigidBody
* rb2,
const
agxSDK::MergeSplitHandler
* handler );
65
71
MergedState
(
agxCollide::Geometry
* geometry1,
agxCollide::Geometry
* geometry2,
const
agxSDK::MergeSplitHandler
* handler );
72
76
State getState()
const
;
77
81
Actions getAllowedActions()
const
;
82
86
agx::MergedBody
* getMergedBody()
const
;
87
91
agx::MergedBody
* getOtherMergedBody()
const
;
92
96
agx::MergedBody
* getMergedBody1()
const
;
97
101
agx::MergedBody
* getMergedBody2()
const
;
102
106
agx::RigidBody
* getRigidBody1()
const
;
107
111
agx::RigidBody
* getRigidBody2()
const
;
112
116
const
agxSDK::MergeSplitProperties
* getProperties1()
const
;
117
121
const
agxSDK::MergeSplitProperties
* getProperties2()
const
;
122
126
agx::Bool
firstIsMerged()
const
;
127
131
agx::Bool
secondIsMerged()
const
;
132
136
agx::Bool
isValid()
const
;
137
141
MergedState
& update();
142
143
protected
:
147
void
construct(
agx::RigidBody
* rb1,
agx::RigidBody
* rb2 );
148
149
protected
:
150
agx::MergedBody
* m_mergedBody[2];
151
agx::MergedBody
*
m_preferredMergedBody
;
152
agx::RigidBody
* m_rigidBodies[2];
153
const
agxSDK::MergeSplitProperties
* m_properties[2];
154
State
m_state
;
155
Actions
m_allowedActions
;
156
};
157
158
class
AGXPHYSICS_EXPORT
ConstraintMergedState
:
public
MergedState
159
{
160
public
:
164
static
ConstraintMergedState
invalid();
165
166
public
:
172
ConstraintMergedState
(
const
agx::HighLevelConstraintImplementation
* constraint,
const
agxSDK::MergeSplitHandler
* handler );
173
177
const
agxSDK::MergeSplitProperties
* getConstraintProperties()
const
;
178
179
protected
:
180
const
agxSDK::MergeSplitProperties
*
m_constraintProperties
;
181
182
private
:
183
ConstraintMergedState
();
184
};
185
186
AGX_FORCE_INLINE
MergedState::State
MergedState::getState
()
const
187
{
188
return
m_state;
189
}
190
191
AGX_FORCE_INLINE
MergedState::Actions
MergedState::getAllowedActions
()
const
192
{
193
return
m_allowedActions;
194
}
195
196
AGX_FORCE_INLINE
agx::Bool
MergedState::isValid
()
const
197
{
198
return
m_state.Is( VALID );
199
}
200
}
agxSDK::MergedState::isValid
agx::Bool isValid() const
Definition:
MergedState.h:196
agxSDK::MergeSplitProperties
Definition:
MergeSplitProperties.h:38
agxSDK::MergedState::m_allowedActions
Actions m_allowedActions
Definition:
MergedState.h:155
MergedBody.h
agx::HighLevelConstraintImplementation
Definition:
ConstraintImplementation.h:1028
agx::Bool
bool Bool
Definition:
Integer.h:48
agxSDK::MergeSplitHandler
Base class for a merge split algorithm handling a set of merged bodies.
Definition:
MergeSplitHandler.h:34
agxSDK::MergedState::EState
EState
Definition:
MergedState.h:31
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxSDK::ConstraintMergedState::m_constraintProperties
const agxSDK::MergeSplitProperties * m_constraintProperties
Definition:
MergedState.h:180
agxSDK::ConstraintMergedState
Definition:
MergedState.h:158
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition:
Object.h:59
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition:
Geometry.h:92
agx::MergedBody
Structure holding several "normal" rigid bodies.
Definition:
MergedBody.h:55
agxSDK::MergedState
Object holding merged bodies and state given a pair of rigid bodies.
Definition:
MergedState.h:28
agxSDK::MergedState::m_state
State m_state
Definition:
MergedState.h:154
agxSDK::MergedState::getAllowedActions
Actions getAllowedActions() const
Definition:
MergedState.h:191
agxSDK::MergedState::m_preferredMergedBody
agx::MergedBody * m_preferredMergedBody
Definition:
MergedState.h:151
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition:
RigidBody.h:54
agxSDK::MergedState::State
agx::BitState< EState, agx::Int32 > State
Definition:
MergedState.h:42
agx::Int16
int16_t Int16
Definition:
Integer.h:44
agxSDK::MergedState::Actions
agx::BitState< ActionType, agx::Int16 > Actions
Definition:
MergedState.h:50
agxSDK::MergedState::getState
State getState() const
Definition:
MergedState.h:186
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition:
Constraint.h:30
agxSDK::MergedState::ActionType
ActionType
Definition:
MergedState.h:44
include
agxSDK
MergedState.h
Generated on Sun Jan 28 2024 11:19:31 for AGX Dynamics by
1.8.13