|
RavEngine
|
Base broad phase class. Functions only relevant to MBP. More...
#include <BpBroadPhase.h>
Public Member Functions | |
| 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) |
Base broad phase class. Functions only relevant to MBP.
|
inlinevirtual |
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:
If an out-of-bounds object, whose collisions are disabled, re-enters a valid broadphase region, then collisions are re-enabled for that object.
| 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 |
Implements physx::PxBroadPhaseRegions.
Reimplemented in physx::Bp::BroadPhaseMBP.
|
inlinevirtual |
Gets broad-phase caps.
| caps | [out] Broad-phase caps |
Reimplemented in physx::Bp::BroadPhaseMBP.
|
inlinevirtual |
Implements physx::PxBroadPhaseRegions.
|
inlinevirtual |
Returns number of regions currently registered in the broad-phase.
Implements physx::PxBroadPhaseRegions.
Reimplemented in physx::Bp::BroadPhaseMBP.
|
inlinevirtual |
Implements physx::PxBroadPhaseRegions.
|
inlinevirtual |
Gets broad-phase regions.
| userBuffer | [out] Returned broad-phase regions |
| bufferSize | [in] Size of provided userBuffer. |
| startIndex | [in] Index of first desired region, in [0 ; getNbRegions()[ |
Implements physx::PxBroadPhaseRegions.
Reimplemented in physx::Bp::BroadPhaseMBP.
|
inlinevirtual |
Removes a broad-phase region.
If the region still contains objects, and if those objects do not overlap any region any more, they are not automatically removed from the simulation. Instead, the PxBroadPhaseCallback::onObjectOutOfBounds notification is used for each object. Users are responsible for removing the objects from the simulation if this is the desired behavior.
If the handle is invalid, or if a valid handle is removed twice, an error message is sent to the error stream.
| handle | [in] Region's handle, as returned by addRegion |
Implements physx::PxBroadPhaseRegions.
Reimplemented in physx::Bp::BroadPhaseMBP.