public static void ExpandBoundingBox(ref BoundingBox boundingBox, ref Vector3 sweep) { if (sweep.X > 0) boundingBox.Max.X += sweep.X; else boundingBox.Min.X += sweep.X; if (sweep.Y > 0) boundingBox.Max.Y += sweep.Y; else boundingBox.Min.Y += sweep.Y; if (sweep.Z > 0) boundingBox.Max.Z += sweep.Z; else boundingBox.Min.Z += sweep.Z; }