32#include "foundation/PxMemory.h"
33#include "foundation/PxArray.h"
34#include "foundation/PxBounds3.h"
35#include "foundation/PxUserAllocated.h"
36#include "common/PxPhysXCommonConfig.h"
37#include "GuPrunerTypedef.h"
53#pragma warning( disable : 4251 )
61 mNbPrimitives (nb_prims),
74 mLimit = mNbPrimitives = 0;
83 BVHBuildStrategy mBuildStrategy;
105 PX_FORCE_INLINE PxU32 getNbPrimitives()
const {
return mNbPrimitives; }
107 PX_FORCE_INLINE PxU32 getNbRuntimePrimitives()
const {
return mNbPrimitives; }
108 PX_FORCE_INLINE void setNbRunTimePrimitives(PxU32 val) { mNbPrimitives = val; }
109 PX_FORCE_INLINE const PxU32* getPrimitives(
const PxU32* base)
const {
return base + mNodeIndex; }
110 PX_FORCE_INLINE PxU32* getPrimitives(PxU32* base) {
return base + mNodeIndex; }
112 void subdivide(
const AABBTreeBuildParams& params, BuildStats& stats, NodeAllocator& allocator, PxU32*
const indices);
113 void subdivideSAH(
const AABBTreeBuildParams& params, SAH_Buffers& sah, BuildStats& stats, NodeAllocator& allocator, PxU32*
const indices);
114 void _buildHierarchy(
const AABBTreeBuildParams& params, BuildStats& stats, NodeAllocator& allocator, PxU32*
const indices);
115 void _buildHierarchySAH(
const AABBTreeBuildParams& params, SAH_Buffers& sah, BuildStats& stats, NodeAllocator& allocator, PxU32*
const indices);
131 void init(PxU32 nbPrimitives, PxU32 limit);
145 PxU32 mCurrentSlabIndex;
162 PX_PHYSX_COMMON_API
void flattenTree(
const NodeAllocator& nodeAllocator,
BVHNode* dest,
const PxU32* remap = NULL);
172 BitArray(PxU32 nb_bits) { init(nb_bits); }
175 bool init(PxU32 nb_bits);
180 mBits[bit_number>>5] |= 1<<(bit_number&31);
184 mBits[bit_number>>5] &= ~(1<<(bit_number&31));
188 mBits[bit_number>>5] ^= 1<<(bit_number&31);
194 void resize(PxU32 maxBitNumber);
199 return PxIntBool(
mBits[bit_number>>5] & (1<<(bit_number&31)));
214 AABBTreeMergeData(PxU32 nbNodes,
const BVHNode* nodes, PxU32 nbIndices,
const PxU32* indices, PxU32 indicesOffset) :
253 PX_PHYSX_COMMON_API
void fullRefit(
const PxBounds3* boxes);
268 PX_PHYSX_COMMON_API
void releasePartialRefitData(
bool clearRefitMap);
271 PX_PHYSX_COMMON_API
void markNodeForRefit(TreeNodeIndex nodeIndex);
272 PX_PHYSX_COMMON_API
void refitMarkedNodes(
const PxBounds3* boxes);
280 PxU32 mRefitHighestSetWord;
282 PxU32* getParentIndices();
284 void createUpdateMap(PxU32 nbObjects);
299 PX_PHYSX_COMMON_API
void release(
bool clearRefitMap=
true);
309 PX_PHYSX_COMMON_API
void shiftOrigin(
const PxVec3& shift);
312 PX_PHYSX_COMMON_API
void shiftIndices(PxU32 offset);
Definition GuAABBTree.cpp:491
Definition GuAABBTreeBounds.h:39
AABB tree node used for building.
Definition GuAABBTree.h:88
PxU32 mNodeIndex
Index of node-related primitives (in the tree's mIndices array)
Definition GuAABBTree.h:102
PxBounds3 mBV
Global bounding-volume enclosing all the node-related primitives.
Definition GuAABBTree.h:99
const AABBTreeBuildNode * mPos
"Positive" & "Negative" children
Definition GuAABBTree.h:100
PxU32 mNbPrimitives
Number of primitives for this node.
Definition GuAABBTree.h:103
Contains AABB-tree build parameters.
Definition GuAABBTree.h:57
PxVec3 * mCache
Cache for AABB centers - managed by build code.
Definition GuAABBTree.h:82
PxU32 mLimit
Limit number of primitives / node. If limit is 1, build a complete tree (2*N-1 nodes)
Definition GuAABBTree.h:79
PxU32 mNbPrimitives
Number of (source) primitives.
Definition GuAABBTree.h:80
const AABBTreeBounds * mBounds
Shortcut to an app-controlled array of AABBs.
Definition GuAABBTree.h:81
Contains AABB-tree merge parameters.
Definition GuAABBTree.h:212
PxU32 mNbNodes
Number of nodes of AABB tree merge.
Definition GuAABBTree.h:224
const PxU32 * mIndices
Indices of AABB tree merge.
Definition GuAABBTree.h:228
const BVHNode * mNodes
Nodes of AABB tree merge.
Definition GuAABBTree.h:225
PxU32 mNbIndices
Number of indices of AABB tree merge.
Definition GuAABBTree.h:227
PxU32 mIndicesOffset
Indices offset from pruning pool.
Definition GuAABBTree.h:230
AABB-tree, N primitives/leaf.
Definition GuAABBTree.h:290
Definition GuAABBTree.h:240
PxU32 mNbNodes
Number of nodes in the tree.
Definition GuAABBTree.h:257
PxU32 mNbIndices
Nb indices.
Definition GuAABBTree.h:256
BVHNode * mNodes
Linear pool of nodes.
Definition GuAABBTree.h:258
PxU32 * mIndices
Indices in the app list. Indices are reorganized during build (permutation).
Definition GuAABBTree.h:259
Definition GuAABBTree.h:263
BitArray mRefitBitmask
bit is set for each node index in markForRefit
Definition GuAABBTree.h:279
PxU32 * mParentIndices
PT: hot/cold split, keep parent data in separate array.
Definition GuAABBTree.h:277
PxU32 * mUpdateMap
PT: Local index to tree node index.
Definition GuAABBTree.h:278
Definition GuAABBTree.h:169
PxU32 * mBits
Array of bits.
Definition GuAABBTree.h:206
PxU32 mSize
Size of the array in dwords.
Definition GuAABBTree.h:207
Definition GuAABBTree.h:125
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
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
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PX_FORCE_INLINE void * PxMemSet(void *dest, PxI32 c, PxU32 count)
Sets the bytes of the provided buffer to the specified value.
Definition PxMemory.h:67
PX_FORCE_INLINE void * PxMemZero(void *dest, PxU32 count)
Sets the bytes of the provided buffer to zero.
Definition PxMemory.h:53
Definition GuAABBTreeNode.h:44
Contains AABB-tree build statistics.
Definition GuAABBTreeBuildStats.h:40
Definition GuAABBTree.h:137