RavEngine
Loading...
Searching...
No Matches
physx::PxAABBManager Class Referenceabstract

High-level broadphase API. More...

#include <PxBroadPhase.h>

Public Member Functions

virtual void release ()=0
 
virtual PxBroadPhase & getBroadPhase ()=0
 Retrieves the underlying broadphase.
 
virtual const PxBounds3 * getBounds () const =0
 Retrieves the managed bounds.
 
virtual const float * getDistances () const =0
 Retrieves the managed distances.
 
virtual const PxBpFilterGroup * getGroups () const =0
 Retrieves the managed filter groups.
 
virtual PxU32 getCapacity () const =0
 Retrieves the managed buffers' capacity.
 
virtual void addObject (PxBpIndex index, const PxBounds3 &bounds, PxBpFilterGroup group, float distance=0.0f)=0
 Adds an object to the manager.
 
virtual void removeObject (PxBpIndex index)=0
 Removes an object from the manager.
 
virtual void updateObject (PxBpIndex index, const PxBounds3 *bounds=NULL, const float *distance=NULL)=0
 Updates an object in the manager.
 
virtual void update (PxBaseTask *continuation=NULL)=0
 Updates the broadphase and computes the lists of created/deleted pairs.
 
virtual void fetchResults (PxBroadPhaseResults &results)=0
 Retrieves the broadphase results after an update.
 
PX_FORCE_INLINE void update (PxBroadPhaseResults &results)
 Helper for single-threaded updates.
 

Detailed Description

High-level broadphase API.

The low-level broadphase API (PxBroadPhase) only supports batched updates and has a few non-trivial requirements for managing the bounds data.

The high-level broadphase API (PxAABBManager) is an easier-to-use one-object-at-a-time API that automatically deals with the quirks of the PxBroadPhase data management.

See also
PxCreateAABBManager

Member Function Documentation

◆ addObject()

virtual void physx::PxAABBManager::addObject ( PxBpIndex  index,
const PxBounds3 &  bounds,
PxBpFilterGroup  group,
float  distance = 0.0f 
)
pure virtual

Adds an object to the manager.

Objects' indices are externally managed, i.e. they must be provided by users (as opposed to handles that could be returned by this manager). The design allows users to identify an object by a single ID, and use the same ID in multiple sub-systems.

Parameters
index[in] The object's index
bounds[in] The object's bounds
group[in] The object's filter group
distance[in] The object's distance (optional)
See also
PxBpIndex PxBounds3 PxBpFilterGroup

◆ fetchResults()

virtual void physx::PxAABBManager::fetchResults ( PxBroadPhaseResults &  results)
pure virtual

Retrieves the broadphase results after an update.

This should be called once after each update call to retrieve the results of the broadphase. The results are incremental, i.e. the system only returns new and lost pairs, not all current pairs.

Parameters
results[out] The broadphase results
See also
PxBroadPhaseResults

◆ getBounds()

virtual const PxBounds3 * physx::PxAABBManager::getBounds ( ) const
pure virtual

Retrieves the managed bounds.

This is needed as input parameters to functions like PxBroadPhaseRegions::addRegion.

Returns
The managed object bounds.
See also
PxBounds3

◆ getBroadPhase()

virtual PxBroadPhase & physx::PxAABBManager::getBroadPhase ( )
pure virtual

Retrieves the underlying broadphase.

Returns
The managed broadphase.
See also
PxBroadPhase

◆ getCapacity()

virtual PxU32 physx::PxAABBManager::getCapacity ( ) const
pure virtual

Retrieves the managed buffers' capacity.

Bounds, distances and groups buffers have the same capacity.

Returns
The managed buffers' capacity.

◆ getDistances()

virtual const float * physx::PxAABBManager::getDistances ( ) const
pure virtual

Retrieves the managed distances.

This is needed as input parameters to functions like PxBroadPhaseRegions::addRegion.

Returns
The managed object distances.

◆ getGroups()

virtual const PxBpFilterGroup * physx::PxAABBManager::getGroups ( ) const
pure virtual

Retrieves the managed filter groups.

Returns
The managed object groups.

◆ removeObject()

virtual void physx::PxAABBManager::removeObject ( PxBpIndex  index)
pure virtual

Removes an object from the manager.

Parameters
index[in] The object's index
See also
PxBpIndex

◆ update() [1/2]

virtual void physx::PxAABBManager::update ( PxBaseTask *  continuation = NULL)
pure virtual

Updates the broadphase and computes the lists of created/deleted pairs.

The data necessary for updating the broadphase is internally computed by the AABB manager.

To benefit from potentially multithreaded implementations, it is necessary to provide a continuation task to the function. It is legal to pass NULL there, but the underlying (CPU) implementations will then run single-threaded.

Parameters
continuation[in] Continuation task to enable multi-threaded implementations, or NULL.
See also
PxBaseTask

◆ update() [2/2]

PX_FORCE_INLINE void physx::PxAABBManager::update ( PxBroadPhaseResults &  results)
inline

Helper for single-threaded updates.

This short helper function performs a single-theaded update and reports the results in a single call.

Parameters
results[out] The broadphase results
See also
PxBroadPhaseResults

◆ updateObject()

virtual void physx::PxAABBManager::updateObject ( PxBpIndex  index,
const PxBounds3 *  bounds = NULL,
const float *  distance = NULL 
)
pure virtual

Updates an object in the manager.

This call can update an object's bounds, distance, or both. It is not possible to update an object's filter group.

Parameters
index[in] The object's index
bounds[in] The object's updated bounds, or NULL
distance[in] The object's updated distance, or NULL
See also
PxBpIndex PxBounds3

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