29#ifndef PX_BROAD_PHASE_H
30#define PX_BROAD_PHASE_H
35#include "PxPhysXConfig.h"
36#include "foundation/PxBounds3.h"
44 class PxCudaContextManager;
171 if(PxU32(
mType)>=PxBroadPhaseType::eLAST)
183 #define PX_INVALID_BP_FILTER_GROUP 0xffffffff
248 const PxBpIndex* updated, PxU32 nbUpdated,
249 const PxBpIndex* removed, PxU32 nbRemoved,
399 virtual PxU32 getNbOutOfBoundsObjects()
const = 0;
404 virtual const PxU32* getOutOfBoundsObjects()
const = 0;
433 virtual void release() = 0;
545 PX_C_EXPORT PX_PHYSX_CORE_API PxBroadPhase*
PxCreateBroadPhase(
const PxBroadPhaseDesc& desc);
568 virtual void release() = 0;
698 PX_C_EXPORT PX_PHYSX_CORE_API PxAABBManager*
PxCreateAABBManager(PxBroadPhase& broadphase);
High-level broadphase API.
Definition PxBroadPhase.h:559
virtual void updateObject(PxBpIndex index, const PxBounds3 *bounds=NULL, const float *distance=NULL)=0
Updates an object in the manager.
virtual const PxBounds3 * getBounds() const =0
Retrieves the managed bounds.
virtual void fetchResults(PxBroadPhaseResults &results)=0
Retrieves the broadphase results after an update.
virtual PxU32 getCapacity() const =0
Retrieves the managed buffers' capacity.
virtual PxBroadPhase & getBroadPhase()=0
Retrieves the underlying broadphase.
virtual void addObject(PxBpIndex index, const PxBounds3 &bounds, PxBpFilterGroup group, float distance=0.0f)=0
Adds an object to the manager.
virtual const PxBpFilterGroup * getGroups() const =0
Retrieves the managed filter groups.
PX_FORCE_INLINE void update(PxBroadPhaseResults &results)
Helper for single-threaded updates.
Definition PxBroadPhase.h:682
virtual void removeObject(PxBpIndex index)=0
Removes an object from the manager.
virtual const float * getDistances() const =0
Retrieves the managed distances.
virtual void update(PxBaseTask *continuation=NULL)=0
Updates the broadphase and computes the lists of created/deleted pairs.
Abstract base class for an application defined memory allocator that can be used by the Nv library.
Definition PxAllocatorCallback.h:53
Base class of all task types.
Definition PxTask.h:45
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
Broadphase descriptor.
Definition PxBroadPhase.h:149
PxU32 mFoundLostPairsCapacity
(GPU) Capacity of found and lost buffers allocated in GPU global memory. This is used for the found/l...
Definition PxBroadPhase.h:164
bool mDiscardStaticVsKinematic
Static-vs-kinematic filtering flag. Not supported by PxBroadPhaseType::eGPU.
Definition PxBroadPhase.h:166
PxBroadPhaseType::Enum mType
Desired broadphase implementation.
Definition PxBroadPhase.h:160
PxU64 mContextID
Context ID for profiler. See PxProfilerCallback.
Definition PxBroadPhase.h:161
bool mDiscardKinematicVsKinematic
kinematic-vs-kinematic filtering flag. Not supported by PxBroadPhaseType::eGPU.
Definition PxBroadPhase.h:167
PxCudaContextManager * mContextManager
(GPU) CUDA context manager, must be provided for PxBroadPhaseType::eGPU.
Definition PxBroadPhase.h:163
Broadphase regions.
Definition PxBroadPhase.h:325
virtual PxU32 getNbRegions() const =0
Returns number of regions currently registered in the broad-phase.
virtual PxU32 addRegion(const PxBroadPhaseRegion ®ion, bool populateRegion, const PxBounds3 *bounds, const float *distances)=0
Adds a new broad-phase region.
virtual bool removeRegion(PxU32 handle)=0
Removes a broad-phase region.
virtual PxU32 getRegions(PxBroadPhaseRegionInfo *userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Gets broad-phase regions.
Broadphase data update structure.
Definition PxBroadPhase.h:244
const PxBpFilterGroup * mGroups
(Persistent) array of groups.
Definition PxBroadPhase.h:281
const PxU32 mCapacity
Capacity of bounds / groups / distance buffers.
Definition PxBroadPhase.h:283
const PxBounds3 * mBounds
(Persistent) array of bounds.
Definition PxBroadPhase.h:280
const PxU32 mNbCreated
Number of created objects.
Definition PxBroadPhase.h:272
const PxBpIndex * mCreated
Indices of created objects.
Definition PxBroadPhase.h:271
const PxBpIndex * mRemoved
Indices of removed objects.
Definition PxBroadPhase.h:277
const PxU32 mNbUpdated
Number of updated objects.
Definition PxBroadPhase.h:275
const float * mDistances
(Persistent) array of distances.
Definition PxBroadPhase.h:282
const PxBpIndex * mUpdated
Indices of updated objects.
Definition PxBroadPhase.h:274
const PxU32 mNbRemoved
Number of removed objects.
Definition PxBroadPhase.h:278
Low-level broadphase API.
Definition PxBroadPhase.h:424
virtual void setScratchBlock(void *scratchBlock, PxU32 size)=0
Sets a scratch buffer.
virtual PxAllocatorCallback * getAllocator()=0
Retrieves the broadphase allocator.
PX_FORCE_INLINE void update(PxBroadPhaseResults &results, const PxBroadPhaseUpdateData &updateData)
Helper for single-threaded updates.
Definition PxBroadPhase.h:529
virtual PxBroadPhaseType::Enum getType() const =0
Gets the broadphase type.
virtual void fetchResults(PxBroadPhaseResults &results)=0
Retrieves the broadphase results after an update.
virtual PxBroadPhaseRegions * getRegions()=0
Retrieves the regions API if applicable.
virtual PxU64 getContextID() const =0
Retrieves the profiler's context ID.
virtual void getCaps(PxBroadPhaseCaps &caps) const =0
Gets broad-phase caps.
virtual void update(const PxBroadPhaseUpdateData &updateData, PxBaseTask *continuation=NULL)=0
Updates the broadphase and computes the lists of created/deleted pairs.
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxU32 PxBpFilterGroup
Broadphase filter group.
Definition PxBroadPhase.h:182
PX_C_EXPORT PX_PHYSX_CORE_API PxAABBManager * PxCreateAABBManager(PxBroadPhase &broadphase)
AABB manager factory function.
Definition NpImmediateMode.cpp:2898
PxU32 PxBpIndex
Broadphase index. Indexes bounds, groups and distance arrays.
Definition PxBroadPhase.h:181
PX_C_EXPORT PX_PHYSX_CORE_API PxBpFilterGroup PxGetBroadPhaseStaticFilterGroup()
Retrieves the filter group for static objects.
Definition NpImmediateMode.cpp:2171
PX_C_EXPORT PX_PHYSX_CORE_API PxBroadPhase * PxCreateBroadPhase(const PxBroadPhaseDesc &desc)
Broadphase factory function.
Definition NpImmediateMode.cpp:2559
PX_C_EXPORT PX_PHYSX_CORE_API PxBpFilterGroup PxGetBroadPhaseDynamicFilterGroup(PxU32 id)
Retrieves a filter group for dynamic objects.
Definition NpImmediateMode.cpp:2176
PX_C_EXPORT PX_PHYSX_CORE_API PxBpFilterGroup PxGetBroadPhaseKinematicFilterGroup(PxU32 id)
Retrieves a filter group for kinematic objects.
Definition NpImmediateMode.cpp:2181
Caps class for broad phase.
Definition PxBroadPhase.h:131
PxU32 mMaxNbRegions
Max number of regions supported by the broad-phase (0 = explicit regions not needed)
Definition PxBroadPhase.h:132
Broadphase pair.
Definition PxBroadPhase.h:294
PxBpIndex mID0
Index of first object.
Definition PxBroadPhase.h:295
PxBpIndex mID1
Index of second object.
Definition PxBroadPhase.h:296
Information & stats structure for a region.
Definition PxBroadPhase.h:119
PxU32 mNbStaticObjects
Number of static objects in the region.
Definition PxBroadPhase.h:121
bool mActive
True if region is currently used, i.e. it has not been removed.
Definition PxBroadPhase.h:123
PxBroadPhaseRegion mRegion
User-provided region data.
Definition PxBroadPhase.h:120
PxU32 mNbDynamicObjects
Number of dynamic objects in the region.
Definition PxBroadPhase.h:122
bool mOverlap
True if region overlaps other regions (regions that are just touching are not considering overlapping...
Definition PxBroadPhase.h:124
"Region of interest" for the broad-phase.
Definition PxBroadPhase.h:110
void * mUserData
Region's user-provided data.
Definition PxBroadPhase.h:112
PxBounds3 mBounds
Region's bounds.
Definition PxBroadPhase.h:111
Broadphase results.
Definition PxBroadPhase.h:307
const PxBroadPhasePair * mCreatedPairs
Array of new/found/created pairs.
Definition PxBroadPhase.h:311
PxU32 mNbDeletedPairs
Number of lost/deleted pairs.
Definition PxBroadPhase.h:313
PxU32 mNbCreatedPairs
Number of new/found/created pairs.
Definition PxBroadPhase.h:310
const PxBroadPhasePair * mDeletedPairs
Array of lost/deleted pairs.
Definition PxBroadPhase.h:314
Broad phase algorithm used in the simulation.
Definition PxBroadPhase.h:77
Enum
Definition PxBroadPhase.h:79
@ eABP
Automatic box pruning.
Definition PxBroadPhase.h:82
@ ePABP
Parallel automatic box pruning.
Definition PxBroadPhase.h:83
@ eMBP
Multi box pruning.
Definition PxBroadPhase.h:81
@ eGPU
GPU broad phase.
Definition PxBroadPhase.h:84
@ eSAP
3-axes sweep-and-prune
Definition PxBroadPhase.h:80