示例#1
0
        /// <summary>
        /// Returns a rectangle describing the requested <paramref name="side"/> of this cuboid (transposed in to the 2D XY plane).
        /// </summary>
        /// <param name="side">The side that you wish to get a description of.</param>
        /// <returns>A <see cref="Rectangle"/> whose dimensions represent the requested <paramref name="side"/>
        /// of this cuboid.</returns>
        public Rectangle GetSide(CuboidSide side)
        {
            Assure.True(Enum.IsDefined(typeof(CuboidSide), side), "Invalid side constant: " + side + " is not a valid CuboidSide value.");
            switch (side)
            {
            case CuboidSide.Top:
            case CuboidSide.Bottom:
                return(new Rectangle((Vector2)FrontBottomLeft[0, 2], Width, Depth));

            case CuboidSide.Left:
            case CuboidSide.Right:
                return(new Rectangle((Vector2)FrontBottomLeft[2, 1], Depth, Height));

            default:
                return(new Rectangle((Vector2)FrontBottomLeft[0, 1], Width, Height));
            }
        }
 public void AddSide(CuboidSide side, IGeometryTextureDefintion textureDefinition)
 {
     _definitions.Add(side, textureDefinition);
 }