예제 #1
0
        public static float GetNoise(float[] noiseSet, int sideSize, int x, int z, int max, float power)
        {
            // FastSIMD keeps things in x,z fashion but we have them ordered as z,x
            int   index = Helpers.GetIndex1DFrom2D(z, x, sideSize);
            float n     = noiseSet[index] + 1f;

            n *= (max >> 1);

            if (Math.Abs(power - 1f) > float.Epsilon)
            {
                n = Mathf.Pow(n, power);
            }

            return(n);
        }