RavEngine
Loading...
Searching...
No Matches
PxcNpWorkUnit.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 PXC_NP_WORK_UNIT_H
30#define PXC_NP_WORK_UNIT_H
31
32#include "PxcNpThreadContext.h"
33#include "PxcMaterialMethodImpl.h"
34#include "PxcNpCache.h"
35
36namespace physx
37{
38struct PxsRigidCore;
39struct PxsShapeCore;
40
42{
43 enum Enum
44 {
45 eOUTPUT_CONTACTS = 1 << 0,
46 eOUTPUT_CONSTRAINTS = 1 << 1,
47 eDISABLE_STRONG_FRICTION = 1 << 2,
48 eARTICULATION_BODY0 = 1 << 3,
49 eARTICULATION_BODY1 = 1 << 4,
50 eDYNAMIC_BODY0 = 1 << 5,
51 eDYNAMIC_BODY1 = 1 << 6,
52 eSOFT_BODY = 1 << 7,
53 eMODIFIABLE_CONTACT = 1 << 8,
54 eFORCE_THRESHOLD = 1 << 9,
55 eDETECT_DISCRETE_CONTACT = 1 << 10,
56 eHAS_KINEMATIC_ACTOR = 1 << 11,
57 eDISABLE_RESPONSE = 1 << 12,
58 eDETECT_CCD_CONTACTS = 1 << 13,
59 };
60};
61
63{
64 enum Enum
65 {
66 eHAS_NO_TOUCH = (1 << 0),
67 eHAS_TOUCH = (1 << 1),
68 //eHAS_SOLVER_CONSTRAINTS = (1 << 2),
69 eREQUEST_CONSTRAINTS = (1 << 3),
70 eHAS_CCD_RETOUCH = (1 << 4), // Marks pairs that are touching at a CCD pass and were touching at discrete collision or at a previous CCD pass already
71 // but we can not tell whether they lost contact in a pass before. We send them as pure eNOTIFY_TOUCH_CCD events to the
72 // contact report callback if requested.
73 eDIRTY_MANAGER = (1 << 5),
74 eREFRESHED_WITH_TOUCH = (1 << 6),
75 eTOUCH_KNOWN = eHAS_NO_TOUCH | eHAS_TOUCH // The touch status is known (if narrowphase never ran for a pair then no flag will be set)
76 };
77};
78
79// PT: TODO: fix the inconsistent namings (mXXX) in this class
81{
82 const PxsRigidCore* rigidCore0; // INPUT //4 //8
83 const PxsRigidCore* rigidCore1; // INPUT //8 //16
84
85 const PxsShapeCore* shapeCore0; // INPUT //12 //24
86 const PxsShapeCore* shapeCore1; // INPUT //16 //32
87
88 PxU8* ccdContacts; // OUTPUT //20 //40
89
90 PxU8* frictionDataPtr; // INOUT //24 //48
91
92 PxU16 flags; // INPUT //26 //50
93 PxU8 frictionPatchCount; // INOUT //27 //51
94 PxU8 statusFlags; // OUTPUT (see PxcNpWorkUnitStatusFlag) //28 //52
95
96 PxU8 dominance0; // INPUT //29 //53
97 PxU8 dominance1; // INPUT //30 //54
98 PxU8 geomType0; // INPUT //31 //55
99 PxU8 geomType1; // INPUT //32 //56
100
101 PxU32 index; // INPUT //36 //60
102
103 PxReal restDistance; // INPUT //40 //64
104
105 PxU32 mTransformCache0; // //44 //68
106 PxU32 mTransformCache1; // //48 //72
107
108 PxU32 mEdgeIndex; //inout the island gen edge index //52 //76
109 PxU32 mNpIndex; //INPUT //56 //80
110
111 PxReal mTorsionalPatchRadius; //60 //84
112 PxReal mMinTorsionalPatchRadius; //64 //88
113 PxReal mOffsetSlop; //68 //92
114
115 PX_FORCE_INLINE void clearCachedState()
116 {
117 frictionDataPtr = NULL;
118 frictionPatchCount = 0;
119 ccdContacts = NULL;
120 }
121};
122
123//#if !defined(PX_P64)
124//PX_COMPILE_TIME_ASSERT(0 == (sizeof(PxcNpWorkUnit) & 0x0f));
125//#endif
126
127#if !defined(PX_P64)
128//PX_COMPILE_TIME_ASSERT(sizeof(PxcNpWorkUnit)==128);
129#endif
130}
131
132#endif
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Definition PxcNpWorkUnit.h:42
Definition PxcNpWorkUnit.h:63
Definition PxcNpWorkUnit.h:81
Definition PxvDynamics.h:48
Definition PxvGeometry.h:221