public void TestBoxICenter() { // ARRANGE. var box = new BoxI(new Vector3I(2, 3, 4), new Vector3I(6, 8, 10)); var center = new Vector3I(5, 7, 9); // ASSERT. Assert.AreEqual(center, box.Center); }
/// <summary> /// Checks whether the two specified boxes at least partially intersect each other. /// </summary> /// <param name="first"> /// First box to check. /// </param> /// <param name="second"> /// Second box to check. /// </param> /// <returns> /// <c>true</c>, if the two boxes intersect each other, and <c>false</c> otherwise. /// </returns> public static bool Intersects(this BoxI first, BoxI second) { return (first.MaxX > second.X && first.X < second.MaxX) && (first.MaxY > second.Y && first.Y < second.MaxY) && (first.MaxZ > second.Z && first.Z < second.MaxZ); }