RavEngine
Loading...
Searching...
No Matches
DySolverContact4.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 DY_SOLVER_CONTACT4_H
30#define DY_SOLVER_CONTACT4_H
31
32#include "foundation/PxSimpleTypes.h"
33#include "foundation/PxVec3.h"
34#include "PxvConfig.h"
35#include "foundation/PxVecMath.h"
36#include "DySolverContact.h"
37
38namespace physx
39{
40
41struct PxcNpWorkUnit;
42struct PxSolverBody;
43struct PxSolverBodyData;
44struct PxSolverConstraintDesc;
45
46namespace Sc
47{
48 class ShapeInteraction;
49}
50
51namespace Dy
52{
53
54
55
56
61{
62 enum
63 {
64 eHAS_MAX_IMPULSE = 1 << 0,
65 eHAS_TARGET_VELOCITY = 1 << 1
66 };
67
68 PxU8 type; //Note: mType should be first as the solver expects a type in the first byte.
69 PxU8 numNormalConstr;
70 PxU8 numFrictionConstr;
71 PxU8 flag;
72
73 PxU8 flags[4];
74 //These counts are the max of the 4 sets of data.
75 //When certain pairs have fewer patches/contacts than others, they are padded with 0s so that no work is performed but
76 //calculations are still shared (afterall, they're computationally free because we're doing 4 things at a time in SIMD)
77
78 //KS - used for write-back only
79 PxU8 numNormalConstr0, numNormalConstr1, numNormalConstr2, numNormalConstr3;
80 PxU8 numFrictionConstr0, numFrictionConstr1, numFrictionConstr2, numFrictionConstr3;
81
82 Vec4V restitution;
83 Vec4V staticFriction;
84 Vec4V dynamicFriction;
85 //Technically, these mass properties could be pulled out into a new structure and shared. For multi-manifold contacts,
86 //this would save 64 bytes per-manifold after the cost of the first manifold
87 Vec4V invMass0D0;
88 Vec4V invMass1D1;
89 Vec4V angDom0;
90 Vec4V angDom1;
91 //Normal is shared between all contacts in the batch. This will save some memory!
92 Vec4V normalX;
93 Vec4V normalY;
94 Vec4V normalZ;
95
96 Sc::ShapeInteraction* shapeInteraction[4]; //192 or 208
97};
98
99#if !PX_P64_FAMILY
101#else
103#endif
104
105
110{
111 Vec4V raXnX;
112 Vec4V raXnY;
113 Vec4V raXnZ;
114 Vec4V velMultiplier;
115 Vec4V scaledBias;
116 Vec4V biasedErr;
117 Vec4V impulseMultiplier;
118};
120
126{
127 Vec4V rbXnX;
128 Vec4V rbXnY;
129 Vec4V rbXnZ;
130};
132
137{
138 BoolV broken;
139 PxU8* frictionBrokenWritebackByte[4];
140 Vec4V normalX[2];
141 Vec4V normalY[2];
142 Vec4V normalZ[2];
143};
144#if !PX_P64_FAMILY
146#endif
147
148
153{
154 Vec4V raXnX;
155 Vec4V raXnY;
156 Vec4V raXnZ;
157 Vec4V scaledBias;
158 Vec4V velMultiplier;
159 Vec4V targetVelocity;
160};
162
168{
169 Vec4V rbXnX;
170 Vec4V rbXnY;
171 Vec4V rbXnZ;
172};
174
175}
176
177}
178
179#endif
Definition ScShapeInteraction.h:54
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
This represents a batch of 4 contacts with static rolled into a single structure.
Definition DySolverContact4.h:110
Contains the additional data required to represent 4 contacts between 2 dynamic bodies.
Definition DySolverContact4.h:126
This represents a batch of 4 friction constraints with static rolled into a single structure.
Definition DySolverContact4.h:153
Contains the additional data required to represent 4 friction constraints between 2 dynamic bodies.
Definition DySolverContact4.h:168
Batched SOA contact data. Note, we don't support batching with extended contacts for the simple reaso...
Definition DySolverContact4.h:61
This represents the shared information of a batch of 4 friction constraints.
Definition DySolverContact4.h:137
Definition PxVecMathAoSScalar.h:90
Definition PxVecMathAoSScalar.h:65