RavEngine
Loading...
Searching...
No Matches
DySolverContactPF.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_CONTACT_PF_H
30#define DY_SOLVER_CONTACT_PF_H
31
32#include "foundation/PxSimpleTypes.h"
33#include "foundation/PxVec3.h"
34#include "PxvConfig.h"
35#include "foundation/PxVecMath.h"
36
37namespace physx
38{
39
40using namespace aos;
41
42namespace Dy
43{
44
46{
47 PxU8 type; //Note: mType should be first as the solver expects a type in the first byte.
48 PxU8 numNormalConstr;
49 PxU16 frictionOffset; //4
50 //PxF32 restitution;
51 PxF32 angDom0; //8
52 PxF32 dominance0; //12
53 PxF32 dominance1; //16
54 PX_ALIGN(16, PxVec3 normalXYZ); //28
55 PxF32 angDom1; //32
56
57 Sc::ShapeInteraction* shapeInteraction; //36 40
58 PxU8 flags; //37 41
59 PxU8 pad0[3]; //40 44
60#if !PX_P64_FAMILY
61 PxU32 pad1[2]; //48
62#else
63 PxU32 pad1; // 48
64#endif
65
66
67
68 PX_FORCE_INLINE void setDominance0(const FloatV f) {FStore(f, &dominance0);}
69 PX_FORCE_INLINE void setDominance1(const FloatV f) {FStore(f, &dominance1);}
70 PX_FORCE_INLINE void setNormal(const Vec3V n) {V3StoreA(n, normalXYZ);}
71
72 PX_FORCE_INLINE FloatV getDominance0() const {return FLoad(dominance0);}
73 PX_FORCE_INLINE FloatV getDominance1() const {return FLoad(dominance1);}
74 //PX_FORCE_INLINE FloatV getRestitution() const {return FLoad(restitution);}
75 PX_FORCE_INLINE Vec3V getNormal()const {return V3LoadA(normalXYZ);}
76
77
78 PX_FORCE_INLINE void setDominance0(PxF32 f) { dominance0 = f; }
79 PX_FORCE_INLINE void setDominance1(PxF32 f) { dominance1 = f;}
80 //PX_FORCE_INLINE void setRestitution(PxF32 f) { restitution = f;}
81
82 PX_FORCE_INLINE PxF32 getDominance0PxF32() const {return dominance0;}
83 PX_FORCE_INLINE PxF32 getDominance1PxF32() const {return dominance1;}
84 //PX_FORCE_INLINE PxF32 getRestitutionPxF32() const {return restitution;}
85
86};
88
90{
91 PxU8 type; //Note: mType should be first as the solver expects a type in the first byte.
92 PxU8 numNormalConstr;
93 PxU8 numFrictionConstr;
94 PxU8 flags;
95 PxF32 staticFriction;
96 PxF32 invMass0D0;
97 PxF32 invMass1D1;
98 PxF32 angDom0;
99 PxF32 angDom1;
100 PxU32 pad2[2];
101
102 PX_FORCE_INLINE void setStaticFriction(const FloatV f) {FStore(f, &staticFriction);}
103
104 PX_FORCE_INLINE FloatV getStaticFriction() const {return FLoad(staticFriction);}
105
106 PX_FORCE_INLINE void setStaticFriction(PxF32 f) {staticFriction = f;}
107
108 PX_FORCE_INLINE PxF32 getStaticFrictionPxF32() const {return staticFriction;}
109
110 PX_FORCE_INLINE PxU32 getAppliedForcePaddingSize() const {return sizeof(PxU32)*((4 * ((numNormalConstr + 3)/4)));}
111 static PX_FORCE_INLINE PxU32 getAppliedForcePaddingSize(const PxU32 numConstr) {return sizeof(PxU32)*((4 * ((numConstr + 3)/4)));}
112};
113
115
116}
117
118}
119
120#endif
3 Element vector class.
Definition PxVec3.h:50
Definition ScShapeInteraction.h:54
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_ALIGN(alignment, decl)
Definition PxPreprocessor.h:402
#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
Definition DySolverContactPF.h:46
Definition DySolverContactPF.h:90
Definition PxVecMathAoSScalar.h:52
Definition PxVecMathAoSScalar.h:77