Class HeightFieldShape

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstShape, RefTarget, AutoCloseable, Comparable<ConstJoltPhysicsObject>

public class HeightFieldShape extends Shape
A Shape to represent a surface defined by a matrix of heights.
  • Method Details

    • getBlockSize

      public int getBlockSize()
      Return the block size. The shape is unaffected.
      Returns:
      the number of height values in a block
    • getPosition

      public Vec3 getPosition(int x, int y)
      Copy the location of specified sample. The shape is unaffected.
      Parameters:
      x - the X coordinate of the sample (≥0, <sampleCount)
      y - the Y coordinate of the sample (≥0, <sampleCount)
      Returns:
      a new location vector
    • isNoCollision

      public boolean isNoCollision(int x, int y)
      Test whether the shape has a hole at the specified sample. The shape is unaffected.
      Parameters:
      x - the X coordinate of the sample (≥0, <sampleCount)
      y - the Y coordinate of the sample (≥0, <sampleCount)
      Returns:
      true if there's a hole, otherwise false