RavEngine
Loading...
Searching...
No Matches
physx::Bp::BroadPhase Class Referenceabstract
Inheritance diagram for physx::Bp::BroadPhase:
[legend]
Collaboration diagram for physx::Bp::BroadPhase:
[legend]

Public Member Functions

virtual PxBroadPhaseType::Enum getType () const =0
 
virtual void release ()=0
 Shutdown of the broadphase.
 
virtual void update (PxcScratchAllocator *scratchAllocator, const BroadPhaseUpdateData &updateData, physx::PxBaseTask *continuation)=0
 Updates the broadphase and computes the lists of created/deleted pairs.
 
virtual void preBroadPhase (const Bp::BroadPhaseUpdateData &updateData)=0
 prepare broad phase data.
 
virtual void fetchBroadPhaseResults ()=0
 Fetch the results of any asynchronous broad phase work.
 
virtual const BroadPhasePair * getCreatedPairs (PxU32 &nbCreatedPairs) const =0
 
virtual const BroadPhasePair * getDeletedPairs (PxU32 &nbDeletedPairs) const =0
 Get deleted pairs.
 
virtual void freeBuffers ()=0
 After the broadphase has completed its update() function and the created/deleted pairs have been queried with getCreatedPairs/getDeletedPairs it is desirable to free any memory that was temporarily acquired for the update but is is no longer required post-update. This can be achieved with the function freeBuffers().
 
virtual void shiftOrigin (const PxVec3 &shift, const PxBounds3 *boundsArray, const PxReal *contactDistances)=0
 Adjust internal structures after all bounds have been adjusted due to a scene origin shift.
 
- Public Member Functions inherited from physx::Bp::BroadPhaseBase
virtual void getCaps (PxBroadPhaseCaps &caps) const
 Gets broad-phase caps.
 
virtual PxU32 getNbRegions () const PX_OVERRIDE
 Returns number of regions currently registered in the broad-phase.
 
virtual PxU32 getRegions (PxBroadPhaseRegionInfo *, PxU32, PxU32) const PX_OVERRIDE
 Gets broad-phase regions.
 
virtual PxU32 addRegion (const PxBroadPhaseRegion &, bool, const PxBounds3 *, const PxReal *) PX_OVERRIDE
 Adds a new broad-phase region.
 
virtual bool removeRegion (PxU32) PX_OVERRIDE
 Removes a broad-phase region.
 
virtual PxU32 getNbOutOfBoundsObjects () const PX_OVERRIDE
 
virtual const PxU32 * getOutOfBoundsObjects () const PX_OVERRIDE
 
- Public Member Functions inherited from physx::PxUserAllocated
PX_INLINE void * operator new (size_t, void *address)
 
PX_INLINE void operator delete (void *, void *)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete (void *ptr, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete[] (void *ptr, Alloc alloc, const char *fileName, int line)
 
PX_INLINE void operator delete (void *ptr)
 
PX_INLINE void operator delete[] (void *ptr)
 

Static Public Member Functions

static BroadPhase * create (const PxBroadPhaseType::Enum bpType, const PxU32 maxNbRegions, const PxU32 maxNbBroadPhaseOverlaps, const PxU32 maxNbStaticShapes, const PxU32 maxNbDynamicShapes, PxU64 contextID)
 Instantiate a BroadPhase instance.
 

Member Function Documentation

◆ create()

BroadPhase * BroadPhase::create ( const PxBroadPhaseType::Enum  bpType,
const PxU32  maxNbRegions,
const PxU32  maxNbBroadPhaseOverlaps,
const PxU32  maxNbStaticShapes,
const PxU32  maxNbDynamicShapes,
PxU64  contextID 
)
static

Instantiate a BroadPhase instance.

Parameters
[in]bpType- the bp type (either mbp or sap). This is typically specified in PxSceneDesc.
[in]maxNbRegionsis the expected maximum number of broad-phase regions.
[in]maxNbBroadPhaseOverlapsis the expected maximum number of broad-phase overlaps.
[in]maxNbStaticShapesis the expected maximum number of static shapes.
[in]maxNbDynamicShapesis the expected maximum number of dynamic shapes.
[in]contextIDis the context ID parameter sent to the profiler
Returns
The instantiated BroadPhase.
Note
maxNbRegions is only used if mbp is the chosen broadphase (PxBroadPhaseType::eMBP)
maxNbRegions, maxNbBroadPhaseOverlaps, maxNbStaticShapes and maxNbDynamicShapes are typically specified in PxSceneLimits

◆ fetchBroadPhaseResults()

virtual void physx::Bp::BroadPhase::fetchBroadPhaseResults ( )
pure virtual

Fetch the results of any asynchronous broad phase work.

Implemented in physx::Bp::BroadPhaseABP, physx::Bp::BroadPhaseMBP, and physx::Bp::BroadPhaseSap.

◆ freeBuffers()

virtual void physx::Bp::BroadPhase::freeBuffers ( )
pure virtual

After the broadphase has completed its update() function and the created/deleted pairs have been queried with getCreatedPairs/getDeletedPairs it is desirable to free any memory that was temporarily acquired for the update but is is no longer required post-update. This can be achieved with the function freeBuffers().

Implemented in physx::Bp::BroadPhaseABP, physx::Bp::BroadPhaseMBP, and physx::Bp::BroadPhaseSap.

◆ getDeletedPairs()

virtual const BroadPhasePair * physx::Bp::BroadPhase::getDeletedPairs ( PxU32 &  nbDeletedPairs) const
pure virtual

Get deleted pairs.

Note that a deleted pair can only be reported if that pair has already appeared in the list of created pairs in an earlier update. A lost overlap occurs when a pair of bounds previously overlapped on all three axes but have now separated on at least one axis. A lost overlap must involve at least one of the bounds of the lost overlap pair appearing in the updated list. Lost overlaps arising from removal of bounds from the broadphase do not appear in the list of deleted pairs. It is impossible for the same pair to appear simultaneously in the list of created and deleted pairs.

Parameters
nbDeletedPairs[out] The number of deleted overlap pairs computed in the execution of update() that has just completed.
Returns
The array of deleted overlap pairs computed in the execution of update() that has just completed.

Implemented in physx::Bp::BroadPhaseABP, physx::Bp::BroadPhaseMBP, and physx::Bp::BroadPhaseSap.

◆ preBroadPhase()

virtual void physx::Bp::BroadPhase::preBroadPhase ( const Bp::BroadPhaseUpdateData &  updateData)
pure virtual

prepare broad phase data.

Implemented in physx::Bp::BroadPhaseABP, physx::Bp::BroadPhaseMBP, and physx::Bp::BroadPhaseSap.

◆ release()

virtual void physx::Bp::BroadPhase::release ( )
pure virtual

Shutdown of the broadphase.

Implemented in physx::Bp::BroadPhaseABP, physx::Bp::BroadPhaseMBP, and physx::Bp::BroadPhaseSap.

◆ shiftOrigin()

virtual void physx::Bp::BroadPhase::shiftOrigin ( const PxVec3 &  shift,
const PxBounds3 *  boundsArray,
const PxReal *  contactDistances 
)
pure virtual

Adjust internal structures after all bounds have been adjusted due to a scene origin shift.

Implemented in physx::Bp::BroadPhaseABP, physx::Bp::BroadPhaseMBP, and physx::Bp::BroadPhaseSap.

◆ update()

virtual void physx::Bp::BroadPhase::update ( PxcScratchAllocator *  scratchAllocator,
const BroadPhaseUpdateData &  updateData,
physx::PxBaseTask *  continuation 
)
pure virtual

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

Parameters
[in]scratchAllocator- a PxcScratchAllocator instance used for temporary memory allocations. This must be non-null.
[in]updateDataa description of changes to the collection of aabbs since the last broadphase update. The changes detail the indices of the bounds that have been added/updated/removed as well as an array of all bound coordinates and an array of group ids used to filter pairs with the same id.
See also
BroadPhaseUpdateData
Parameters
[in]continuationthe task that is in the queue to be executed immediately after the broadphase has completed its update. NULL is not supported.
Note
In PX_CHECKED and PX_DEBUG build configurations illegal input data (that does not conform to the BroadPhaseUpdateData specifications) triggers a special code-path that entirely bypasses the broadphase and issues a warning message to the error stream. No guarantees can be made about the correctness/consistency of broadphase behavior with illegal input data in PX_RELEASE and PX_PROFILE configs because validity checks are not active in these builds.

Implemented in physx::Bp::BroadPhaseABP, physx::Bp::BroadPhaseMBP, and physx::Bp::BroadPhaseSap.


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