PxSpatialIndex Class Reference
[Physics]

provides direct access to PhysX' Spatial Query engine More...

#include <PxSpatialIndex.h>

List of all members.

Public Member Functions

virtual PxSpatialIndexItemId insert (PxSpatialIndexItem &item, const PxBounds3 &bounds)=0
 insert a bounding box into a spatial index
virtual void update (PxSpatialIndexItemId id, const PxBounds3 &bounds)=0
 update a bounding box in a spatial index
virtual void remove (PxSpatialIndexItemId id)=0
 remove an item from a spatial index
virtual void overlap (const PxBounds3 &aabb, PxSpatialOverlapCallback &callback) const =0
 make an overlap query against a spatial index
virtual void raycast (const PxVec3 &origin, const PxVec3 &unitDir, PxReal maxDist, PxSpatialLocationCallback &callback) const =0
 make a raycast query against a spatial index
virtual void sweep (const PxBounds3 &aabb, const PxVec3 &unitDir, PxReal maxDist, PxSpatialLocationCallback &callback) const =0
 make a sweep query against a spatial index
virtual void flush ()=0
 force an immediate update of the internal structures of the index
virtual void rebuildFull ()=0
 force a full optimized rebuild of the index.
virtual void setIncrementalRebuildRate (PxU32 rate)=0
 set the incremental rebuild rate for the index.
virtual void rebuildStep ()=0
 take one step in rebuilding the tree. See setIncrementalRebuildRate()
virtual void release ()=0
 release this object

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.

Deprecated:
Spatial index feature has been deprecated in PhysX version 3.4
See also:
PxCreateSpatialIndex

Constructor & Destructor Documentation

virtual PxSpatialIndex::~PxSpatialIndex (  )  [inline, protected, virtual]


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] item the item to be inserted
[in] bounds the 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] aabb the axis aligned bounding box for the query
[in] callback the 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] 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

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] id the 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] rate the 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] 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

virtual void PxSpatialIndex::update ( PxSpatialIndexItemId  id,
const PxBounds3 bounds 
) [pure virtual]

update a bounding box in a spatial index

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


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


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