/// <summary> /// Returns the Z co-ordinate of the requested <paramref name="corner"/> of this cuboid. /// </summary> /// <param name="corner">The corner whose position it is you wish to obtain.</param> /// <returns>The position on the Z-axis of the requested <paramref name="corner"/> of this cuboid.</returns> public float GetCornerZ(CuboidCorner corner) { Assure.True(Enum.IsDefined(typeof(CuboidCorner), corner), "Invalid corner constant: " + corner + " is not a valid CuboidCorner value."); switch (corner) { case CuboidCorner.BackTopLeft: case CuboidCorner.BackTopRight: case CuboidCorner.BackBottomLeft: case CuboidCorner.BackBottomRight: return(FrontBottomLeft.Z + Depth); default: return(FrontBottomLeft.Z); } }
/// <summary> /// Returns the X, Y and Z co-ordinate of the requested <paramref name="corner"/> of this rectangle. /// </summary> /// <param name="corner">The corner whose position it is you wish to obtain.</param> /// <returns>A <see cref="Vector3"/> whose <see cref="Vector3.X"/>, <see cref="Vector3.Y"/> and <see cref="Vector3.Z"/> components /// are set to the X, Y and Z position of the requested <paramref name="corner"/> on this cuboid.</returns> public Vector3 GetCorner(CuboidCorner corner) { return(new Vector3(GetCornerX(corner), GetCornerY(corner), GetCornerZ(corner))); }