provides direct access to PhysX' Spatial Query engine More...
#include <PxSpatialIndex.h>
Public Member Functions | |
virtual PxSpatialIndexItemId | insert (PxSpatialIndexItem &item, const PxBounds3 &bounds)=0 |
insert a bounding box into a spatial index More... | |
virtual void | update (PxSpatialIndexItemId id, const PxBounds3 &bounds)=0 |
update a bounding box in a spatial index More... | |
virtual void | remove (PxSpatialIndexItemId id)=0 |
remove an item from a spatial index More... | |
virtual void | overlap (const PxBounds3 &aabb, PxSpatialOverlapCallback &callback) const =0 |
make an overlap query against a spatial index More... | |
virtual void | raycast (const PxVec3 &origin, const PxVec3 &unitDir, PxReal maxDist, PxSpatialLocationCallback &callback) const =0 |
make a raycast query against a spatial index More... | |
virtual void | sweep (const PxBounds3 &aabb, const PxVec3 &unitDir, PxReal maxDist, PxSpatialLocationCallback &callback) const =0 |
make a sweep query against a spatial index More... | |
virtual void | flush ()=0 |
force an immediate update of the internal structures of the index More... | |
virtual void | rebuildFull ()=0 |
force a full optimized rebuild of the index. More... | |
virtual void | setIncrementalRebuildRate (PxU32 rate)=0 |
set the incremental rebuild rate for the index. More... | |
virtual void | rebuildStep ()=0 |
take one step in rebuilding the tree. See setIncrementalRebuildRate() More... | |
virtual void | release ()=0 |
release this object More... | |
Protected Member Functions | |
virtual | ~PxSpatialIndex () |
provides direct access to PhysX' Spatial Query engine
This class allows bounding boxes to be inserted, and then queried using sweep, raycast and overlap checks.
It is not thread-safe and defers handling some updates until queries are invoked, so care must be taken when calling any methods in parallel. Specifically, to call query methods (raycast, overlap, sweep) in parallel, first call flush() to force immediate update of internal structures.
|
inlineprotectedvirtual |
|
pure virtual |
force an immediate update of the internal structures of the index
For reasons of efficiency an index structure may be lazily updated at the point of query if this method is not called. Once this method has been called, subsequent queries (sweeps, overlaps, raycasts) may be executed in parallel until the next write call to the index (insertion, removal, update, rebuild)
|
pure virtual |
insert a bounding box into a spatial index
[in] | item | the item to be inserted |
[in] | bounds | the bounds of the new item |
|
pure virtual |
make an overlap query against a spatial index
[in] | aabb | the axis aligned bounding box for the query |
[in] | callback | the callback to invoke when an overlap is found |
|
pure virtual |
make a raycast query against a spatial index
[in] | origin | the origin of the ray |
[in] | unitDir | a unit vector in the direction of the ray |
[in] | maxDist | the maximum distance to cast the ray |
[in] | callback | the callback to invoke when an item is hit by the ray |
|
pure virtual |
force a full optimized rebuild of the index.
|
pure virtual |
take one step in rebuilding the tree. See setIncrementalRebuildRate()
|
pure virtual |
release this object
|
pure virtual |
remove an item from a spatial index
[in] | id | the id of the item to be removed |
|
pure virtual |
set the incremental rebuild rate for the index.
The index builds gradually in the background each time a rebuild step is taken; this value determines the number of steps required to rebuild the index.
See PxScene::setDynamicTreeRebuildRateHint() for more information.
[in] | rate | the rebuild rate |
|
pure virtual |
make a sweep query against a spatial index
[in] | aabb | the axis aligned bounding box to sweep |
[in] | unitDir | a unit vector in the direction of the sweep |
[in] | maxDist | the maximum distance to apply the sweep |
[in] | callback | the callback to invoke when an item is hit by the sweep |
|
pure virtual |
update a bounding box in a spatial index
[in] | id | the id of the item to be updated |
[in] | bounds | the new bounds of the item |