|
|
| BroadPhaseMBP (PxU32 maxNbRegions, PxU32 maxNbBroadPhaseOverlaps, PxU32 maxNbStaticShapes, PxU32 maxNbDynamicShapes, PxU64 contextID) |
| |
| virtual void | getCaps (PxBroadPhaseCaps &caps) const |
| | Gets broad-phase caps.
|
| |
| virtual PxU32 | getNbRegions () const |
| | Returns number of regions currently registered in the broad-phase.
|
| |
| virtual PxU32 | getRegions (PxBroadPhaseRegionInfo *userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const |
| | Gets broad-phase regions.
|
| |
| virtual PxU32 | addRegion (const PxBroadPhaseRegion ®ion, bool populateRegion, const PxBounds3 *boundsArray, const PxReal *contactDistance) |
| | Adds a new broad-phase region.
|
| |
| virtual bool | removeRegion (PxU32 handle) |
| | Removes a broad-phase region.
|
| |
| virtual PxU32 | getNbOutOfBoundsObjects () const |
| |
| virtual const PxU32 * | getOutOfBoundsObjects () const |
| |
| virtual PxBroadPhaseType::Enum | getType () const PX_OVERRIDE |
| |
| virtual void | release () PX_OVERRIDE |
| | Shutdown of the broadphase.
|
| |
| virtual void | update (PxcScratchAllocator *scratchAllocator, const BroadPhaseUpdateData &updateData, physx::PxBaseTask *continuation) PX_OVERRIDE |
| | Updates the broadphase and computes the lists of created/deleted pairs.
|
| |
| virtual void | preBroadPhase (const Bp::BroadPhaseUpdateData &) PX_OVERRIDE |
| | prepare broad phase data.
|
| |
| virtual void | fetchBroadPhaseResults () PX_OVERRIDE |
| | Fetch the results of any asynchronous broad phase work.
|
| |
| virtual const BroadPhasePair * | getCreatedPairs (PxU32 &) const PX_OVERRIDE |
| |
| virtual const BroadPhasePair * | getDeletedPairs (PxU32 &) const PX_OVERRIDE |
| | Get deleted pairs.
|
| |
| virtual void | freeBuffers () PX_OVERRIDE |
| | 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) PX_OVERRIDE |
| | Adjust internal structures after all bounds have been adjusted due to a scene origin shift.
|
| |
|
void | setUpdateData (const BroadPhaseUpdateData &updateData) |
| |
|
void | addObjects (const BroadPhaseUpdateData &updateData) |
| |
|
void | removeObjects (const BroadPhaseUpdateData &updateData) |
| |
|
void | updateObjects (const BroadPhaseUpdateData &updateData) |
| |
|
void | update () |
| |
|
void | postUpdate () |
| |
|
void | allocateMappingArray (PxU32 newCapacity) |
| |
|
PxU32 | getCurrentNbPairs () const |
| |
|
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) |
| |
Adds a new broad-phase region.
The total number of regions is limited to PxBroadPhaseCaps::mMaxNbRegions. If that number is exceeded, the call is ignored.
The newly added region will be automatically populated with already existing objects that touch it, if the 'populateRegion' parameter is set to true. Otherwise the newly added region will be empty, and it will only be populated with objects when those objects are added to the simulation, or updated if they already exist.
Using 'populateRegion=true' has a cost, so it is best to avoid it if possible. In particular it is more efficient to create the empty regions first (with populateRegion=false) and then add the objects afterwards (rather than the opposite).
Objects automatically move from one region to another during their lifetime. The system keeps tracks of what regions a given object is in. It is legal for an object to be in an arbitrary number of regions. However if an object leaves all regions, or is created outside of all regions, several things happen:
- collisions get disabled for this object
- the object appears in the getOutOfBoundsObjects() array
If an out-of-bounds object, whose collisions are disabled, re-enters a valid broadphase region, then collisions are re-enabled for that object.
- Parameters
-
| region | [in] User-provided region data |
| populateRegion | [in] True to automatically populate the newly added region with existing objects touching it |
| bounds | [in] User-managed array of bounds |
| distances | [in] User-managed array of distances |
- Returns
- Handle for newly created region, or 0xffffffff in case of failure.
- See also
- PxBroadPhaseRegion getOutOfBoundsObjects()
Reimplemented from physx::Bp::BroadPhaseBase.