Interface ConstHeightFieldShapeSettings

All Superinterfaces:
AutoCloseable, Comparable<JoltPhysicsObject>, ConstJoltPhysicsObject, ConstSerializableObject, ConstShapeSettings
All Known Implementing Classes:
HeightFieldShapeSettings

public interface ConstHeightFieldShapeSettings extends ConstShapeSettings
Read-only access to a HeightFieldShapeSettings object. (native type: const HeightFieldShapeSettings)
  • Method Details

    • calculateBitsPerSampleForError

      int calculateBitsPerSampleForError(float maxError)
      Calculate the minimum bits per sample that will provide the specified error tolerance. The settings are unaffected.
      Parameters:
      maxError - the allowable tolerance
      Returns:
      the (hypothetical) bits per sample
    • countHeights

      int countHeights()
      Count the height samples, including cNoCollisionValue. The settings are unaffected.
      Returns:
      the actual number of samples in the array (≥0)
    • countMaterials

      int countMaterials()
      Count the references in the material list, including null refs. The settings are unaffected.
      Returns:
      the actual number of references in the list (≥0)
    • countSquares

      int countSquares()
      Count the squares. The settings are unaffected.
      Returns:
      the actual number of material indices in the array (≥0)
    • determineMinAndMaxSample

      void determineMinAndMaxSample(float[] storeMin, float[] storeMax, float[] storeQuantScale)
      Calculate 3 quantization parameters of the current settings. The settings are unaffected.
      Parameters:
      storeMin - storage for the minimum height (ignoring cNoCollisionValue) or MIN_VALUE if no samples have collision
      storeMax - storage for the maximum height (ignoring cNoCollisionValue) or MAX_VALUE if no samples have collision
      storeQuantScale - storage for the quantization scale factor
    • getActiveEdgeCosThresholdAngle

      float getActiveEdgeCosThresholdAngle()
      Return the cosine of the active-edge threshold angle. The settings are unaffected.
      Returns:
      the cosine
    • getBitsPerSample

      int getBitsPerSample()
      Return the number of bits per sample to use during compression. The settings are unaffected.
      Returns:
      the number of bits (≥1, ≤16)
    • getBlockSize

      int getBlockSize()
      Return the block size. The settings are unaffected.

      For culling purposes, the height field is organized in blocks of 2 * mBlockSize * mBlockSize triangles.

      Sensible values range from 2 to 8.

      Returns:
      the block size (in rows)
    • getHeightSample

      float getHeightSample(int sampleIndex)
      Return the height of the specified sample. The settings are unaffected.
      Parameters:
      sampleIndex - the array index (≥0, <sampleCount^2)
      Returns:
      the sample height or cNoCollisionValue
    • getHeightSample

      float getHeightSample(int x, int y)
      Return the height of the specified sample. The settings are unaffected.
      Parameters:
      x - the X index of the sample (≥0, <sampleCount)
      y - the Y index of the sample (≥0, <sampleCount)
      Returns:
      the sample height or cNoCollisionValue
    • getMaterialIndex

      int getMaterialIndex(int squareIndex)
      Return the material index for the specified square. The settings are unaffected.
      Parameters:
      squareIndex - the index of the square (≥0, <(sampleCount-1)^2)
      Returns:
      an index into the material list (≥0)
    • getMaterialIndex

      int getMaterialIndex(int x, int y)
      Return the material index for the specified square. The settings are unaffected.
      Parameters:
      x - the X index of the square (≥0, <sampleCount-1)
      y - the Y index of the square (≥0, <sampleCount-1)
      Returns:
      an index into the material list (≥0)
    • getMaterialRef

      PhysicsMaterialRefC getMaterialRef(int materialIndex)
      Return a reference to the material for the specified material index.
      Parameters:
      materialIndex - the index in the local table (≥0)
      Returns:
      a new counted reference to the existing material
    • getMaterialRef

      PhysicsMaterialRefC getMaterialRef(int x, int y)
      Return a reference to the material for the specified square.
      Parameters:
      x - the X index of the square (≥0, <sampleCount-1)
      y - the Y index of the square (≥0, <sampleCount-1)
      Returns:
      a new counted reference to the existing material
    • getMaterialRefForSquare

      PhysicsMaterialRefC getMaterialRefForSquare(int squareIndex)
      Return a reference to the material for the specified square.
      Parameters:
      squareIndex - the index of the square (≥0, <(sampleCount-1)^2)
      Returns:
      a new counted reference to the existing material
    • getMaterialsCapacity

      int getMaterialsCapacity()
      Return the artificial minimum capacity for the created shape's material list. The settings are unaffected.
      Returns:
      the capacity (in refs)
    • getMaxHeightValue

      float getMaxHeightValue()
      Return the artificial maximum height. The settings are unaffected.
      Returns:
      the height value
    • getMinHeightValue

      float getMinHeightValue()
      Return the artificial minimum height. The settings are unaffected.
      Returns:
      the height value
    • getOffset

      Vec3 getOffset()
      Copy the offset of the first sample. The settings are unaffected.
      Returns:
      a new offset vector
    • getSampleCount

      int getSampleCount()
      Count the samples along each edge. The settings are unaffected.
      Returns:
      the number of samples (≥0)
    • getScale

      Vec3 getScale()
      Copy the scale factors. The settings are unaffected.
      Returns:
      a new scaling vector