From 3f9977d72f8a481e76b6ad643a3d312a8cf9b551 Mon Sep 17 00:00:00 2001 From: Sheikh Dawood Date: Mon, 13 Aug 2018 13:37:04 -0500 Subject: PhysX 3.4, APEX 1.4 patch release @24698370 --- PhysX_3.4/Source/SceneQuery/src/SqIncrementalAABBTree.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'PhysX_3.4/Source/SceneQuery/src/SqIncrementalAABBTree.h') diff --git a/PhysX_3.4/Source/SceneQuery/src/SqIncrementalAABBTree.h b/PhysX_3.4/Source/SceneQuery/src/SqIncrementalAABBTree.h index 803ac060..41c7721d 100644 --- a/PhysX_3.4/Source/SceneQuery/src/SqIncrementalAABBTree.h +++ b/PhysX_3.4/Source/SceneQuery/src/SqIncrementalAABBTree.h @@ -133,6 +133,8 @@ namespace physx IncrementalAABBTreeNode mNode1; }; + typedef Ps::Array NodeList; + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // incremental AABB tree, all changes are immediatelly reflected to the tree class IncrementalAABBTree : public Ps::UserAllocated @@ -144,13 +146,13 @@ namespace physx // Build the tree for the first time bool build(AABBTreeBuildParams& params, Ps::Array& mapping); - // insert a new index into the tre - IncrementalAABBTreeNode* insert(const PoolIndex index, const PxBounds3* bounds, bool& split); + // insert a new index into the tree + IncrementalAABBTreeNode* insert(const PoolIndex index, const PxBounds3* bounds, NodeList& changedLeaf); // update the object in the tree - full update insert/remove - IncrementalAABBTreeNode* update(IncrementalAABBTreeNode* node, const PoolIndex index, const PxBounds3* bounds, bool& split, IncrementalAABBTreeNode*& removedNode); + IncrementalAABBTreeNode* update(IncrementalAABBTreeNode* node, const PoolIndex index, const PxBounds3* bounds, NodeList& changedLeaf); // update the object in the tree, faster method, that may unballance the tree - IncrementalAABBTreeNode* updateFast(IncrementalAABBTreeNode* node, const PoolIndex index, const PxBounds3* bounds, bool& split, IncrementalAABBTreeNode*& removedNode); + IncrementalAABBTreeNode* updateFast(IncrementalAABBTreeNode* node, const PoolIndex index, const PxBounds3* bounds, NodeList& changedLeaf); // remove object from the tree IncrementalAABBTreeNode* remove(IncrementalAABBTreeNode* node, const PoolIndex index, const PxBounds3* bounds); @@ -169,7 +171,9 @@ namespace physx // paranoia checks void hierarchyCheck(PoolIndex maxIndex, const PxBounds3* bounds); + void hierarchyCheck(const PxBounds3* bounds); void checkTreeLeaf(IncrementalAABBTreeNode* leaf, PoolIndex h); + PxU32 getTreeLeafDepth(IncrementalAABBTreeNode* leaf); void release(); @@ -181,6 +185,8 @@ namespace physx // split leaf node, the newly added object does not fit in IncrementalAABBTreeNode* splitLeafNode(IncrementalAABBTreeNode* node, const PoolIndex index, const Vec4V& minV, const Vec4V& maxV, const PxBounds3* bounds); + void rotateTree(IncrementalAABBTreeNode* node, NodeList& changedLeaf, PxU32 largesRotateNode, const PxBounds3* bounds, bool rotateAgain); + void releaseNode(IncrementalAABBTreeNode* node); private: Ps::Pool mIndicesPool; -- cgit v1.2.3