Ejemplo n.º 1
0
        /// <summary>
        /// Returns a rgba byte array to be used for default shading on a standard cube, can supply the shading levels
        /// </summary>
        /// <param name="baseColor"></param>
        /// <param name="blockSideShadings"></param>
        /// <param name="smoothShadedSides"></param>
        /// <returns></returns>
        public static byte[] GetShadedCubeRGBA(int baseColor, float[] blockSideShadings, bool smoothShadedSides)
        {
            int topSideColor   = ColorUtil.ColorMultiply3(baseColor, blockSideShadings[0]);
            int frontSideColor = ColorUtil.ColorMultiply3(baseColor, blockSideShadings[1]);
            int backSideColor  = ColorUtil.ColorMultiply3(baseColor, blockSideShadings[2]);
            int bottomColor    = ColorUtil.ColorMultiply3(baseColor, blockSideShadings[3]);

            return(GetShadedCubeRGBA(new int[] {
                frontSideColor,
                backSideColor,
                backSideColor,
                frontSideColor,
                topSideColor,
                bottomColor
            }, smoothShadedSides));
        }