Class PxHeightFieldGeometry

java.lang.Object
physx.NativeObject
physx.geometry.PxGeometry
physx.geometry.PxHeightFieldGeometry

public class PxHeightFieldGeometry extends PxGeometry
Height field geometry class.

This class allows to create a scaled height field geometry instance.

There is a minimum allowed value for Y and XZ scaling - PX_MIN_HEIGHTFIELD_XZ_SCALE, heightfield creation will fail if XZ value is below this value.

  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxHeightFieldGeometry

      protected PxHeightFieldGeometry(long address)
    • PxHeightFieldGeometry

      public PxHeightFieldGeometry()
      Constructor.
    • PxHeightFieldGeometry

      public PxHeightFieldGeometry(PxHeightField hf, PxMeshGeometryFlags flags, float heightScale, float rowScale, float columnScale)
      Constructor.
  • Method Details

    • wrapPointer

      public static PxHeightFieldGeometry wrapPointer(long address)
    • arrayGet

      public static PxHeightFieldGeometry arrayGet(long baseAddress, int index)
    • createAt

      public static PxHeightFieldGeometry createAt(long address)
      Parameters:
      address - Pre-allocated memory, where the object is created.
      Returns:
      Stack allocated object of PxHeightFieldGeometry
    • createAt

      public static <T> PxHeightFieldGeometry createAt(T allocator, NativeObject.Allocator<T> allocate)
      Type Parameters:
      T - Allocator class, e.g. LWJGL's MemoryStack.
      Parameters:
      allocator - Object to use for allocation, e.g. an instance of LWJGL's MemoryStack.
      allocate - Method to call on allocator to obtain the target address, e.g. MemoryStack::nmalloc.
      Returns:
      Stack allocated object of PxHeightFieldGeometry
    • createAt

      public static PxHeightFieldGeometry createAt(long address, PxHeightField hf, PxMeshGeometryFlags flags, float heightScale, float rowScale, float columnScale)
      Parameters:
      address - Pre-allocated memory, where the object is created.
      hf - WebIDL type: PxHeightField
      flags - WebIDL type: PxMeshGeometryFlags [Ref]
      heightScale - WebIDL type: float
      rowScale - WebIDL type: float
      columnScale - WebIDL type: float
      Returns:
      Stack allocated object of PxHeightFieldGeometry
    • createAt

      public static <T> PxHeightFieldGeometry createAt(T allocator, NativeObject.Allocator<T> allocate, PxHeightField hf, PxMeshGeometryFlags flags, float heightScale, float rowScale, float columnScale)
      Type Parameters:
      T - Allocator class, e.g. LWJGL's MemoryStack.
      Parameters:
      allocator - Object to use for allocation, e.g. an instance of LWJGL's MemoryStack.
      allocate - Method to call on allocator to obtain the target address, e.g. MemoryStack::nmalloc.
      hf - WebIDL type: PxHeightField
      flags - WebIDL type: PxMeshGeometryFlags [Ref]
      heightScale - WebIDL type: float
      rowScale - WebIDL type: float
      columnScale - WebIDL type: float
      Returns:
      Stack allocated object of PxHeightFieldGeometry
    • destroy

      public void destroy()
      Overrides:
      destroy in class PxGeometry
    • getHeightField

      public PxHeightField getHeightField()
      The height field data.
    • setHeightField

      public void setHeightField(PxHeightField value)
      The height field data.
    • getHeightScale

      public float getHeightScale()
      The scaling factor for the height field in vertical direction (y direction in local space).
    • setHeightScale

      public void setHeightScale(float value)
      The scaling factor for the height field in vertical direction (y direction in local space).
    • getRowScale

      public float getRowScale()
      The scaling factor for the height field in the row direction (x direction in local space).
    • setRowScale

      public void setRowScale(float value)
      The scaling factor for the height field in the row direction (x direction in local space).
    • getColumnScale

      public float getColumnScale()
      The scaling factor for the height field in the column direction (z direction in local space).
    • setColumnScale

      public void setColumnScale(float value)
      The scaling factor for the height field in the column direction (z direction in local space).
    • getHeightFieldFlags

      public PxMeshGeometryFlags getHeightFieldFlags()
      Flags to specify some collision properties for the height field.
    • setHeightFieldFlags

      public void setHeightFieldFlags(PxMeshGeometryFlags value)
      Flags to specify some collision properties for the height field.
    • isValid

      public boolean isValid()
      Returns true if the geometry is valid.
      Returns:
      True if the current settings are valid

      Note: A valid height field has a positive scale value in each direction (heightScale > 0, rowScale > 0, columnScale > 0). It is illegal to call PxPhysics::createShape with a height field that has zero extents in any direction.