////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// * Builds an AABB-tree for objects in the pruning pool. * \return true if success */ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
| 733 | */ |
| 734 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 735 | bool AABBPruner::fullRebuildAABBTree() |
| 736 | { |
| 737 | PX_PROFILE_ZONE("SceneQuery.prunerFullRebuildAABBTree", mContextID); |
| 738 | |
| 739 | // Release possibly already existing tree |
| 740 | PX_DELETE_AND_RESET(mAABBTree); |
| 741 | |
| 742 | // Don't bother building an AABB-tree if there isn't a single static object |
| 743 | const PxU32 nbObjects = mPool.getNbActiveObjects(); |
| 744 | if(!nbObjects) |
| 745 | return true; |
| 746 | |
| 747 | bool Status; |
| 748 | { |
| 749 | // Create a new tree |
| 750 | mAABBTree = PX_NEW(AABBTree); |
| 751 | |
| 752 | AABBTreeBuildParams TB; |
| 753 | TB.mNbPrimitives = nbObjects; |
| 754 | TB.mAABBArray = mPool.getCurrentWorldBoxes(); |
| 755 | TB.mLimit = NB_OBJECTS_PER_NODE; |
| 756 | Status = mAABBTree->build(TB); |
| 757 | } |
| 758 | |
| 759 | // No need for the tree map for static pruner |
| 760 | if(mIncrementalRebuild) |
| 761 | mTreeMap.initMap(PxMax(nbObjects,mNbCachedBoxes),*mAABBTree); |
| 762 | |
| 763 | return Status; |
| 764 | } |
| 765 | |
| 766 | // called in the end of commit(), but only if mIncrementalRebuild is true |
| 767 | void AABBPruner::updateBucketPruner() |
nothing calls this directly
no test coverage detected