Пример #1
0
        /// <summary>
        /// Checks if we need to draw a ground surface.
        /// </summary>
        private bool shouldDrawGround(int h, int v, int z)
        {
            IHoleVoxel hva;

            if (z == world.Size.z - 1)
            {
                hva = null;
            }
            else
            {
                hva = world.voxelHVD(h, v, z) as IHoleVoxel;
            }

            IHoleVoxel hvb;

            if (z == 0)
            {
                hvb = null;
            }
            else
            {
                hvb = world.voxelHVD(h, v, z - 1) as IHoleVoxel;
            }

            if (hva != null && !hva.DrawGround(false))
            {
                return(false);
            }
            if (hvb != null && !hvb.DrawGround(true))
            {
                return(false);
            }

            return(true);
        }