PxAABBManager

Defined in include/PxBroadPhase.h

class PxAABBManager

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

Public Functions

virtual void release() = 0
virtual PxBroadPhase &getBroadPhase() = 0

Retrieves the underlying broadphase.

See also

PxBroadPhase

Returns

The managed broadphase.

virtual const PxBounds3 *getBounds() const = 0

Retrieves the managed bounds.

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

See also

PxBounds3

Returns

The managed object bounds.

virtual const float *getDistances() const = 0

Retrieves the managed distances.

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

Returns

The managed object distances.

virtual const PxBpFilterGroup *getGroups() const = 0

Retrieves the managed filter groups.

Returns

The managed object groups.

virtual PxU32 getCapacity() const = 0

Retrieves the managed buffers’ capacity.

Bounds, distances and groups buffers have the same capacity.

Returns

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.

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.

See also

PxBpIndex PxBounds3 PxBpFilterGroup

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)

virtual void removeObject(PxBpIndex index) = 0

Removes an object from the manager.

See also

PxBpIndex

Parameters

index – [in] The object’s index

virtual void updateObject(PxBpIndex index, const PxBounds3 *bounds = NULL, const float *distance = NULL) = 0

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.

See also

PxBpIndex PxBounds3

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

virtual void update(PxBaseTask *continuation = NULL) = 0

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.

See also

PxBaseTask

Parameters

continuation – [in] Continuation task to enable multi-threaded implementations, or NULL.

virtual void fetchResults(PxBroadPhaseResults &results) = 0

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

inline void updateAndFetchResults(PxBroadPhaseResults &results)

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

inline void update(PxBroadPhaseResults &results)

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

Protected Functions

inline PxAABBManager()
inline virtual ~PxAABBManager()