32#include "foundation/PxSimpleTypes.h"
33#include "foundation/PxVec4.h"
34#include "foundation/PxBounds3.h"
35#include "foundation/PxAssert.h"
36#include "common/PxSerialFramework.h"
37#include "geometry/PxTriangleMesh.h"
39#include "foundation/PxUserAllocated.h"
40#include "foundation/PxAlignedMalloc.h"
42#include "foundation/PxVecMath.h"
53#pragma warning(disable: 4324)
61 typedef PxF32 RTreeValue;
67 RTreeValue minx, miny, minz, maxx, maxy, maxz;
70 PX_FORCE_INLINE void setLeaf(
bool set) {
if (set) ptr |= 1;
else ptr &= ~1; }
91 static const RTreeValue MN, MX;
93 RTreeValue minx[RTREE_N];
94 RTreeValue miny[RTREE_N];
95 RTreeValue minz[RTREE_N];
96 RTreeValue maxx[RTREE_N];
97 RTreeValue maxy[RTREE_N];
98 RTreeValue maxz[RTREE_N];
103 PX_FORCE_INLINE bool isEmpty(PxU32 index)
const {
return minx[index] > maxx[index]; }
112 PX_FORCE_INLINE PxU32 isLeaf(PxU32 index)
const {
return ptrs[index] & 1; }
113 } PX_ALIGN_SUFFIX(16);
138 bool load(
PxInputStream& stream, PxU32 meshVersion,
bool mismatch);
146 virtual bool processResults(PxU32 count, PxU32* buf) = 0;
147 virtual void profile() {}
157 virtual bool processResults(PxU32 count, PxU32* buf, PxF32& newMaxT) = 0;
165 const PxU32 maxResultsPerBlock, PxU32* resultsBlockBuf,
Callback* processResultsBlockCallback)
const;
168 const PxU32 maxResultsPerBlock, PxU32* resultsBlockBuf,
Callback* processResultsBlockCallback)
const;
170 template <
int inflate>
173 const PxU32 maxResults, PxU32* resultsPtr,
175 const PxVec3* inflateAABBs,
176 PxF32 maxT = PX_MAX_F32
193 void closeTextDump();
194 void textDump(
const char* prefix);
195 void maxscriptExport();
196 PxU32 computeBottomLevelCount(PxU32 storedToMemMultiplier)
const;
201 PxVec4 mBoundsMin, mBoundsMax, mInvDiagonal, mDiagonalScaler;
207 PxU32 mFlags;
enum { USER_ALLOCATED = 0x1, IS_EDGE_SET = 0x2 };
211 typedef PxU32 NodeHandle;
215 } PX_ALIGN_SUFFIX(16);
217#if PX_SUPPORT_EXTERN_TEMPLATE
243 if ((mFlags & USER_ALLOCATED) == 0 && mPages)
253 minx = miny = minz = RTreePage::MX;
254 maxx = maxy = maxz = RTreePage::MN;
259 PX_FORCE_INLINE PxU32 LeafGetNbTriangles(PxU32 Data) {
return ((Data>>1) & 15)+1; }
260 PX_FORCE_INLINE PxU32 LeafGetTriangleIndex(PxU32 Data) {
return Data>>5; }
263 PX_ASSERT(nb>0 && nb<=16); PX_ASSERT(index < (1<<27));
264 return (index<<5)|(((nb-1)&15)<<1) | 1;
272 PX_FORCE_INLINE PxU32 GetNbTriangles()
const {
return LeafGetNbTriangles(Data); }
275 PX_FORCE_INLINE PxU32 GetTriangleIndex()
const {
return LeafGetTriangleIndex(Data); }
276 PX_FORCE_INLINE void SetData(PxU32 nb, PxU32 index) { Data = LeafSetData(nb, index); }
Represents an oriented bounding box.
Definition GuBox.h:72
Definition PxAlignedMalloc.h:54
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
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
3 Element vector class.
Definition PxVec3.h:50
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
#define PX_INLINE
Definition PxPreprocessor.h:320
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 PxVecMathAoSScalar.h:77