setTriangle method
Set the AABB to enclose a triangle
.
Implementation
void setTriangle(Triangle triangle) {
_min.setValues(
math.min(triangle._point0.x,
math.min(triangle._point1.x, triangle._point2.x)),
math.min(triangle._point0.y,
math.min(triangle._point1.y, triangle._point2.y)),
math.min(triangle._point0.z,
math.min(triangle._point1.z, triangle._point2.z)));
_max.setValues(
math.max(triangle._point0.x,
math.max(triangle._point1.x, triangle._point2.x)),
math.max(triangle._point0.y,
math.max(triangle._point1.y, triangle._point2.y)),
math.max(triangle._point0.z,
math.max(triangle._point1.z, triangle._point2.z)));
}