setRay method

void setRay (Ray ray, double limitMin, double limitMax)

Set the AABB to enclose a limited ray (or line segment) that is limited by limitMin and limitMax.

Implementation

void setRay(Ray ray, double limitMin, double limitMax) {
  ray..copyAt(_min, limitMin)..copyAt(_max, limitMax);

  if (_max.x < _min.x) {
    final double temp = _max.x;
    _max.x = _min.x;
    _min.x = temp;
  }

  if (_max.y < _min.y) {
    final double temp = _max.y;
    _max.y = _min.y;
    _min.y = temp;
  }

  if (_max.z < _min.z) {
    final double temp = _max.z;
    _max.z = _min.z;
    _min.z = temp;
  }
}