getAABB method

void getAABB(
  1. AABB aabb
)

Get the world AABB of the ray.

Implementation

void getAABB(AABB aabb) {
  final lowerBound = aabb.lowerBound;
  final upperBound = aabb.upperBound;
  final to = this.to;
  final from = this.from;
  lowerBound.x = math.min(to.x, from.x);
  lowerBound.y = math.min(to.y, from.y);
  lowerBound.z = math.min(to.z, from.z);
  upperBound.x = math.max(to.x, from.x);
  upperBound.y = math.max(to.y, from.y);
  upperBound.z = math.max(to.z, from.z);
}