getAabbAtIndex method

void getAabbAtIndex(
  1. int xi,
  2. int yi,
  3. AABB aabb
)

Get an AABB of a square in the heightfield @param xi @param yi @param result

Implementation

void getAabbAtIndex(int xi, int yi, AABB aabb){//{ lowerBound, upperBound }: AABB) {
  final data = this.data;
  final elementSize = this.elementSize.toDouble();

  aabb.lowerBound.set(
    xi * elementSize,
    yi * elementSize,
    data[xi][yi]
  );
  aabb.upperBound.set(
    (xi + 1) * elementSize,
    (yi + 1) * elementSize,
    data[xi + 1][yi + 1]
  );
}