public FrustrumIntersectionType Intersect(BoundingBox box) {
var totalIn = 0;
foreach (var intersection in Planes.Select(plane => Plane.Intersects(plane, box))) {
switch (intersection) {
case PlaneIntersectionType.Back:
return FrustrumIntersectionType.None;
case PlaneIntersectionType.Front:
totalIn++;
break;
}
}
return totalIn == 6 ? FrustrumIntersectionType.Inside : FrustrumIntersectionType.Intersection;
}
}