MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / fullRebuildAABBTree

Method fullRebuildAABBTree

physx/source/scenequery/src/SqAABBPruner.cpp:735–764  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// * Builds an AABB-tree for objects in the pruning pool. * \return true if success */ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

733 */
734///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
735bool 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
767void AABBPruner::updateBucketPruner()

Callers

nothing calls this directly

Calls 5

PxMaxFunction · 0.85
getNbActiveObjectsMethod · 0.80
getCurrentWorldBoxesMethod · 0.80
initMapMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected