RavEngine
Loading...
Searching...
No Matches
PxsIslandManagerTypes.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef PXS_ISLAND_MANAGER_TYPES_H
30#define PXS_ISLAND_MANAGER_TYPES_H
31
32namespace physx
33{
34
35class PxsContactManager;
36class PxsRigidBody;
37namespace Dy
38{
39 struct Constraint;
40 class Articulation;
41}
42
43typedef PxU32 NodeType;
44typedef PxU32 EdgeType;
45typedef PxU32 IslandType;
46#define INVALID_NODE 0xffffffff
47#define INVALID_EDGE 0xffffffff
48#define INVALID_ISLAND 0xffffffff
49
50//----------------------------------------------------------------------------//
51
52template <class T, T INVLD> class PxsIslandManagerHook
53{
54 friend class PxsIslandManager;
55 T index;
56
57public:
58
59 static const T INVALID = INVLD;
60
61 PX_FORCE_INLINE PxsIslandManagerHook(): index(INVLD) {}
62 PX_FORCE_INLINE PxsIslandManagerHook(const T id): index(id) {}
65
66 PX_FORCE_INLINE bool isManaged() const { return index!=INVLD; }
67
68private:
69};
70
74
75//----------------------------------------------------------------------------//
76
78{
79public:
80
83
84 NodeType bodies;
85 NodeType articulations;
86 EdgeType contactManagers;
87 EdgeType constraints;
88};
89
90//----------------------------------------------------------------------------//
91
92typedef PxU64 PxsNodeType;
93
94
101{
106 enum Enum
107 {
108 eBODY = 0,
109 eKINEMATIC = 1,
110 eARTICULATION = 2,
111 eWORLD = 3
112 };
113
126 union
127 {
128 PxsNodeType solverBody0;
129 PxsNodeType articulation0;
130 };
131
144 union
145 {
146 PxsNodeType solverBody1;
147 PxsNodeType articulation1;
148 };
149
154
159
160 PxU8 pad[2];
161};
162
175#if !PX_X64
176PX_COMPILE_TIME_ASSERT(0==(sizeof(PxsIndexedContactManager) & 0x0f));
177#endif
178
191#if !PX_P64_FAMILY
192PX_COMPILE_TIME_ASSERT(0==(sizeof(PxsIndexedConstraint) & 0x0f));
193#endif
194
195//----------------------------------------------------------------------------//
196
207{
215
224 EdgeType mSolverCMId; //Keeps a track of which entries in the solver islands temporarily have a null contact manager
225
230};
231
232
233} //namespace physx
234
235
236#endif //PXS_ISLAND_MANAGER_TYPES_H
Definition PxsContactManager.h:77
Definition PxsIslandManagerTypes.h:78
Definition PxsIslandManagerTypes.h:53
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
EdgeType
Definition GuEdgeList.h:43
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Definition DyConstraint.h:53
Definition PxsIslandManagerTypes.h:183
Dy::Constraint * constraint
The constraint corresponds to the value set in PxsIslandManager::setEdgeConstraint.
Definition PxsIslandManagerTypes.h:187
Definition PxsIslandManagerTypes.h:167
PxsContactManager * contactManager
The contact manager corresponds to the value set in PxsIslandManager::setEdgeRigidCM.
Definition PxsIslandManagerTypes.h:171
Each contact manager or constraint references two separate bodies, where a body can be a dynamic rigi...
Definition PxsIslandManagerTypes.h:101
PxU8 indexType1
The type (eBODY, eKINEMATIC etc) of body1.
Definition PxsIslandManagerTypes.h:158
PxU8 indexType0
The type (eBODY, eKINEMATIC etc) of body0.
Definition PxsIslandManagerTypes.h:153
Enum
An enumerated list of all possible body types. A body type is stored for each body in the pair.
Definition PxsIslandManagerTypes.h:107
Any sleeping contact pair that finds itself in an awake island after 1st pass island gen must partici...
Definition PxsIslandManagerTypes.h:207
PxsContactManager * mCM
The contact manager that is to participate in 2nd pass narrowphase.
Definition PxsIslandManagerTypes.h:214
EdgeType mSolverCMId
The corresponding entry in PxsIslandObjects::contactManagers.
Definition PxsIslandManagerTypes.h:224
EdgeType mEdgeId
The internal id of the corresponding edge.
Definition PxsIslandManagerTypes.h:229