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

Low-level broadphase API. More...

#include <PxBroadPhase.h>

Public Member Functions

virtual void release ()=0
 
virtual PxBroadPhaseType::Enum getType () const =0
 Gets the broadphase type.
 
virtual void getCaps (PxBroadPhaseCaps &caps) const =0
 Gets broad-phase caps.
 
virtual PxBroadPhaseRegions * getRegions ()=0
 Retrieves the regions API if applicable.
 
virtual PxAllocatorCallback * getAllocator ()=0
 Retrieves the broadphase allocator.
 
virtual PxU64 getContextID () const =0
 Retrieves the profiler's context ID.
 
virtual void setScratchBlock (void *scratchBlock, PxU32 size)=0
 Sets a scratch buffer.
 
virtual void update (const PxBroadPhaseUpdateData &updateData, 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, const PxBroadPhaseUpdateData &updateData)
 Helper for single-threaded updates.
 

Detailed Description

Low-level broadphase API.

This low-level API only supports batched updates and leaves most of the data management to its clients.

This is useful if you want to use the broadphase with your own memory buffers. Note however that the GPU broadphase works best with buffers allocated in CUDA memory. The getAllocator() function returns an allocator that is compatible with the selected broadphase. It is recommended to allocate and deallocate the broadphase data (bounds, groups, distances) using this allocator.

Important note: it must be safe to load 4 bytes past the end of the provided bounds array.

The high-level broadphase API (PxAABBManager) is an easier-to-use interface that automatically deals with these requirements.

See also
PxCreateBroadPhase

Member Function Documentation

◆ fetchResults()

virtual void physx::PxBroadPhase::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

◆ getAllocator()

virtual PxAllocatorCallback * physx::PxBroadPhase::getAllocator ( )
pure virtual

Retrieves the broadphase allocator.

User-provided buffers should ideally be allocated with this allocator, for best performance. This is especially true for the GPU broadphases, whose buffers need to be allocated in CUDA host memory.

Returns
The broadphase allocator.
See also
PxAllocatorCallback

◆ getCaps()

virtual void physx::PxBroadPhase::getCaps ( PxBroadPhaseCaps &  caps) const
pure virtual

Gets broad-phase caps.

Parameters
caps[out] Broad-phase caps
See also
PxBroadPhaseCaps

◆ getContextID()

virtual PxU64 physx::PxBroadPhase::getContextID ( ) const
pure virtual

Retrieves the profiler's context ID.

Returns
The context ID.
See also
PxBroadPhaseDesc

◆ getRegions()

virtual PxBroadPhaseRegions * physx::PxBroadPhase::getRegions ( )
pure virtual

Retrieves the regions API if applicable.

For broadphases that do not use explicit user-defined regions, this call returns NULL.

Returns
Region API, or NULL.
See also
PxBroadPhaseRegions

◆ getType()

virtual PxBroadPhaseType::Enum physx::PxBroadPhase::getType ( ) const
pure virtual

Gets the broadphase type.

Returns
Broadphase type.
See also
PxBroadPhaseType::Enum

◆ setScratchBlock()

virtual void physx::PxBroadPhase::setScratchBlock ( void *  scratchBlock,
PxU32  size 
)
pure virtual

Sets a scratch buffer.

Some broadphases might take advantage of a scratch buffer to limit runtime allocations.

All broadphases still work without providing a scratch buffer, this is an optional function that can potentially reduce runtime allocations.

Parameters
scratchBlock[in] The scratch buffer
size[in] Size of the scratch buffer in bytes

◆ update() [1/2]

virtual void physx::PxBroadPhase::update ( const PxBroadPhaseUpdateData &  updateData,
PxBaseTask *  continuation = NULL 
)
pure virtual

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

The provided update data describes changes to objects since the last broadphase update.

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
updateData[in] The update data
continuation[in] Continuation task to enable multi-threaded implementations, or NULL.
See also
PxBroadPhaseUpdateData PxBaseTask

◆ update() [2/2]

PX_FORCE_INLINE void physx::PxBroadPhase::update ( PxBroadPhaseResults &  results,
const PxBroadPhaseUpdateData &  updateData 
)
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
updateData[in] The update data
See also
PxBroadPhaseUpdateData PxBroadPhaseResults

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