AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
MergedState.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agx/MergedBody.h>
20
21namespace agxSDK
22{
23 class MergeSplitProperties;
24
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
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:
57
58 public:
65
72
76 State getState() const;
77
81 Actions getAllowedActions() const;
82
87
92
97
102
107
112
117
122
127
132
136 agx::Bool isValid() const;
137
142
143 protected:
148
149 protected:
150 agx::MergedBody* m_mergedBody[2];
152 agx::RigidBody* m_rigidBodies[2];
153 const agxSDK::MergeSplitProperties* m_properties[2];
156 };
157
185
190
195
197 {
198 return m_state.Is( VALID );
199 }
200}
#define AGXPHYSICS_EXPORT
The geometry representation used by the collision detection engine.
Definition Geometry.h:92
static ConstraintMergedState invalid()
Creates an invalid merged state.
const agxSDK::MergeSplitProperties * getConstraintProperties() const
const agxSDK::MergeSplitProperties * m_constraintProperties
ConstraintMergedState(const agx::HighLevelConstraintImplementation *constraint, const agxSDK::MergeSplitHandler *handler)
Find merged state given constraint.
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
agx::BitState< EState, agx::Int32 > State
Definition MergedState.h:42
MergedState(agxCollide::Geometry *geometry1, agxCollide::Geometry *geometry2, const agxSDK::MergeSplitHandler *handler)
Find merged state given two geometries.
agx::Bool isValid() const
State getState() const
@ VALID
Valid state.
Definition MergedState.h:33
static MergedState invalid()
Creates an invalid merged state.
const agxSDK::MergeSplitProperties * getProperties2() const
const agxSDK::MergeSplitProperties * getProperties1() const
agx::MergedBody * getMergedBody() const
agx::Bool firstIsMerged() const
agx::BitState< ActionType, agx::Int16 > Actions
Definition MergedState.h:50
agx::MergedBody * getMergedBody2() const
agx::Bool secondIsMerged() const
agx::MergedBody * m_preferredMergedBody
agx::RigidBody * getRigidBody2() const
MergedState(agx::RigidBody *rb1, agx::RigidBody *rb2, const agxSDK::MergeSplitHandler *handler)
Find merged state given two rigid bodies.
agx::RigidBody * getRigidBody1() const
agx::MergedBody * getMergedBody1() const
agx::MergedBody * getOtherMergedBody() const
MergedState & update()
Update the current state of how the bodies are merged and return this.
Actions getAllowedActions() const
void construct(agx::RigidBody *rb1, agx::RigidBody *rb2)
Delegating constructor.
Structure holding several "normal" rigid bodies.
Definition MergedBody.h:56
The rigid body class, combining a geometric model and a frame of reference.
Definition RigidBody.h:52
#define AGX_FORCE_INLINE
Definition macros.h:58
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition Constraint.h:31
bool Bool
Definition Integer.h:40
int16_t Int16
Definition Integer.h:36