This is currently only used for the PxBroadPhaseType::eMBP broad-phase, which requires zones or regions to be defined when the simulation starts in order to work. Regions can overlap and be added or removed at runtime, but at least one region needs to be defined when the scene is created.
If objects that do no overlap any region are inserted into the scene, they will not be added to the broad-phase and thus collisions will be disabled for them. A PxBroadPhaseCallback out-of-bounds notification will be sent for each one of those objects.
The total number of regions is limited by PxBroadPhaseCaps::mMaxNbRegions.
The number of regions has a direct impact on performance and memory usage, so it is recommended to experiment with various settings to find the best combination for your game. A good default setup is to start with global bounds around the whole world, and subdivide these bounds into 4*4 regions. The PxBroadPhaseExt::createRegionsFromWorldBounds function can do that for you.
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxBroadPhaseRegionarrayGet(long baseAddress, int index) voiddestroy()Region's boundsRegion's user-provided datavoidsetMBounds(PxBounds3 value) Region's boundsvoidsetMUserData(NativeObject value) Region's user-provided datastatic PxBroadPhaseRegionwrapPointer(long address) Methods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxBroadPhaseRegion
protected PxBroadPhaseRegion(long address) -
PxBroadPhaseRegion
public PxBroadPhaseRegion()
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
getMBounds
Region's bounds -
setMBounds
Region's bounds -
getMUserData
Region's user-provided data -
setMUserData
Region's user-provided data
-