Beispiel #1
0
 /// <summary>
 /// Returns the bounding box containing this box and the given box.
 /// </summary>
 public void Enlarge(Box3i box)
 {
     Min.x = Math.Min(Min.x, box.Min.x);
     Min.y = Math.Min(Min.y, box.Min.y);
     Min.z = Math.Min(Min.z, box.Min.z);
     Max.x = Math.Max(Max.x, box.Max.x);
     Max.y = Math.Max(Max.y, box.Max.y);
     Max.z = Math.Max(Max.z, box.Max.z);
 }
Beispiel #2
0
 /// <summary>
 /// Returns true if this bounding box contains the given bounding box.
 /// </summary>
 public bool IntersectsBox(Box3i a)
 {
     if (Max.x < a.Min.x || Min.x > a.Max.x)
     {
         return(false);
     }
     if (Max.y < a.Min.y || Min.y > a.Max.y)
     {
         return(false);
     }
     if (Max.z < a.Min.z || Min.z > a.Max.z)
     {
         return(false);
     }
     return(true);
 }