Public Member Functions | Protected Member Functions | List of all members
PxSpatialIndex Class Referenceabstract

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 ()
 

Detailed Description

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.

See Also
PxCreateSpatialIndex

Constructor & Destructor Documentation

virtual PxSpatialIndex::~PxSpatialIndex ( )
inlineprotectedvirtual

Member Function Documentation

virtual void PxSpatialIndex::flush ( )
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)

virtual PxSpatialIndexItemId PxSpatialIndex::insert ( PxSpatialIndexItem item,
const PxBounds3 bounds 
)
pure virtual

insert a bounding box into a spatial index

Parameters
[in]itemthe item to be inserted
[in]boundsthe bounds of the new item
virtual void PxSpatialIndex::overlap ( const PxBounds3 aabb,
PxSpatialOverlapCallback callback 
) const
pure virtual

make an overlap query against a spatial index

Parameters
[in]aabbthe axis aligned bounding box for the query
[in]callbackthe callback to invoke when an overlap is found
virtual void PxSpatialIndex::raycast ( const PxVec3 origin,
const PxVec3 unitDir,
PxReal  maxDist,
PxSpatialLocationCallback callback 
) const
pure virtual

make a raycast query against a spatial index

Parameters
[in]originthe origin of the ray
[in]unitDira unit vector in the direction of the ray
[in]maxDistthe maximum distance to cast the ray
[in]callbackthe callback to invoke when an item is hit by the ray
virtual void PxSpatialIndex::rebuildFull ( )
pure virtual

force a full optimized rebuild of the index.

virtual void PxSpatialIndex::rebuildStep ( )
pure virtual

take one step in rebuilding the tree. See setIncrementalRebuildRate()

virtual void PxSpatialIndex::release ( )
pure virtual

release this object

virtual void PxSpatialIndex::remove ( PxSpatialIndexItemId  id)
pure virtual

remove an item from a spatial index

Parameters
[in]idthe id of the item to be removed
virtual void PxSpatialIndex::setIncrementalRebuildRate ( PxU32  rate)
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.

Parameters
[in]ratethe rebuild rate
See Also
PxScene::setDynamicTreeRebuildRateHint()
virtual void PxSpatialIndex::sweep ( const PxBounds3 aabb,
const PxVec3 unitDir,
PxReal  maxDist,
PxSpatialLocationCallback callback 
) const
pure virtual

make a sweep query against a spatial index

Parameters
[in]aabbthe axis aligned bounding box to sweep
[in]unitDira unit vector in the direction of the sweep
[in]maxDistthe maximum distance to apply the sweep
[in]callbackthe callback to invoke when an item is hit by the sweep
virtual void PxSpatialIndex::update ( PxSpatialIndexItemId  id,
const PxBounds3 bounds 
)
pure virtual

update a bounding box in a spatial index

Parameters
[in]idthe id of the item to be updated
[in]boundsthe new bounds of the item

The documentation for this class was generated from the following file:


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com