32#include "foundation/PxBounds3.h"
33#include "GuBV4Settings.h"
34#include "GuCenterExtents.h"
35#include "GuTriangle.h"
36#include "foundation/PxVecMath.h"
37#include "common/PxPhysXCommonConfig.h"
39#define V4LoadU_Safe physx::aos::V4LoadU
40#define V4LoadA_Safe V4LoadA
41#define V4StoreA_Safe V4StoreA
42#define V4StoreU_Safe V4StoreU
46 class PxSerializationContext;
47 class PxDeserializationContext;
70 mRef[0] = tetrahedron.mRef[0];
71 mRef[1] = tetrahedron.mRef[1];
72 mRef[2] = tetrahedron.mRef[2];
73 mRef[3] = tetrahedron.mRef[3];
89 mRef[0] = tetrahedron.mRef[0];
90 mRef[1] = tetrahedron.mRef[1];
91 mRef[2] = tetrahedron.mRef[2];
92 mRef[3] = tetrahedron.mRef[3];
107 vref0 = tri->mRef[0];
108 vref1 = tri->mRef[1];
109 vref2 = tri->mRef[2];
114 vref0 = tri->mRef[0];
115 vref1 = tri->mRef[1];
116 vref2 = tri->mRef[2];
120 PX_FORCE_INLINE void getVertexReferences(PxU32& vref0, PxU32& vref1, PxU32& vref2, PxU32& vref3, PxU32 index,
const IndTetrahedron32* T32,
const IndTetrahedron16* T16)
124 const IndTetrahedron32*
PX_RESTRICT tet = T32 + index;
125 vref0 = tet->mRef[0];
126 vref1 = tet->mRef[1];
127 vref2 = tet->mRef[2];
128 vref3 = tet->mRef[3];
132 const IndTetrahedron16*
PX_RESTRICT tet = T16 + index;
133 vref0 = tet->mRef[0];
134 vref1 = tet->mRef[1];
135 vref2 = tet->mRef[2];
136 vref3 = tet->mRef[3];
147 FORCE_DWORD = 0x7fffffff
170 virtual PxU32 getNbPrimitives()
const = 0;
171 virtual void remapTopology(
const PxU32* order) = 0;
173 virtual void refit(
const PxU32 primitiveInd,
PxBounds3& refitBox) = 0;
204 virtual PxU32 getNbPrimitives()
const {
return getNbTriangles(); }
205 virtual void remapTopology(
const PxU32* order);
207 virtual void refit(
const PxU32 primitiveInd,
PxBounds3& refitBox);
212 mTriangles32 = tris32;
213 mTriangles16 = tris16;
217 bool isValid()
const;
221 PxU32 VRef0, VRef1, VRef2;
222 getVertexReferences(VRef0, VRef1, VRef2, index, mTriangles32, mTriangles16);
223 vp.Vertex[0] = mVerts + VRef0;
224 vp.Vertex[1] = mVerts + VRef1;
225 vp.Vertex[2] = mVerts + VRef2;
242 PxU32 mNbTetrahedrons;
246 PX_FORCE_INLINE PxU32 getNbTetrahedrons()
const {
return mNbTetrahedrons; }
250 PX_FORCE_INLINE void setNbTetrahedrons(PxU32 nb) { mNbTetrahedrons = nb; }
253 virtual PxU32 getNbPrimitives()
const {
return getNbTetrahedrons(); }
254 virtual void remapTopology(
const PxU32* order);
256 virtual void refit(
const PxU32 primitiveInd,
PxBounds3& refitBox);
261 mTetrahedrons32 = tets32;
262 mTetrahedrons16 = tets16;
266 bool isValid()
const;
270 PxU32 VRef0, VRef1, VRef2, VRef3;
271 getVertexReferences(VRef0, VRef1, VRef2, VRef3, index, mTetrahedrons32, mTetrahedrons16);
272 vp.Vertex[0] = mVerts + VRef0;
273 vp.Vertex[1] = mVerts + VRef1;
274 vp.Vertex[2] = mVerts + VRef2;
275 vp.Vertex[3] = mVerts + VRef3;
287 float mExtentsMagnitude;
293 mExtentsMagnitude = bounds.
getExtents().magnitude();
312 #define GU_BV4_CHILD_OFFSET_SHIFT_COUNT 11
313 static PX_FORCE_INLINE PxU32 getChildOffset(PxU32 data) {
return data>>GU_BV4_CHILD_OFFSET_SHIFT_COUNT; }
314 static PX_FORCE_INLINE PxU32 getChildType(PxU32 data) {
return (data>>1)&3; }
316 template<
class BoxType>
324 PX_FORCE_INLINE PxU32 getChildOffset()
const {
return mData>>GU_BV4_CHILD_OFFSET_SHIFT_COUNT;}
353 bool refit(
PxBounds3& globalBounds,
float epsilon);
372 PxVec3 mExtentsOrMaxCoeff;
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getCenter() const
returns the center of this axis aligned box.
Definition PxBounds3.h:396
PX_CUDA_CALLABLE PX_FORCE_INLINE float getExtents(uint32_t axis) const
get component of the box's extents along a given axis
Definition PxBounds3.h:408
Binary deserialization context class.
Definition PxSerialFramework.h:174
Output stream class for I/O.
Definition PxIO.h:114
Binary serialization context class.
Definition PxSerialFramework.h:99
Definition PxUserAllocated.h:43
3 Element vector class.
Definition PxVec3.h:50
#define PX_RESTRICT
Definition PxPreprocessor.h:355
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#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
PxEMPTY
Definition Px.h:87
Definition GuTriangle.h:48
PxI16 mCenter
Quantized center.
Definition GuBV4.h:304
PxU16 mExtents
Quantized extents.
Definition GuBV4.h:303
Definition PxVecMathAoSScalar.h:65