Package physx.physics

Class PxBroadPhaseRegion

java.lang.Object
physx.NativeObject
physx.physics.PxBroadPhaseRegion

public class PxBroadPhaseRegion extends NativeObject
"Region of interest" for the broad-phase.

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.

  • 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

      public static PxBroadPhaseRegion wrapPointer(long address)
    • arrayGet

      public static PxBroadPhaseRegion arrayGet(long baseAddress, int index)
    • destroy

      public void destroy()
    • getMBounds

      public PxBounds3 getMBounds()
      Region's bounds
    • setMBounds

      public void setMBounds(PxBounds3 value)
      Region's bounds
    • getMUserData

      public NativeObject getMUserData()
      Region's user-provided data
    • setMUserData

      public void setMUserData(NativeObject value)
      Region's user-provided data