LibNoise.Unity.Generator.Billow.GetValue C# (CSharp) Méthode

GetValue() public méthode

Returns the output value for the given input coordinates.
public GetValue ( double x, double y, double z ) : double
x double The input coordinate on the x-axis.
y double The input coordinate on the y-axis.
z double The input coordinate on the z-axis.
Résultat double
        public override double GetValue(double x, double y, double z)
        {
            double value = 0.0;
            double signal = 0.0;
            double curp = 1.0;
            double nx, ny, nz;
            long seed;
            x *= this.m_frequency;
            y *= this.m_frequency;
            z *= this.m_frequency;
            for (int i = 0; i < this.m_octaveCount; i++)
            {
                nx = Utils.MakeInt32Range(x);
                ny = Utils.MakeInt32Range(y);
                nz = Utils.MakeInt32Range(z);
                seed = (this.m_seed + i) & 0xffffffff;
                signal = Utils.GradientCoherentNoise3D(nx, ny, nz, seed, this.m_quality);
                signal = 2.0 * Math.Abs(signal) - 1.0;
                value += signal * curp;
                x *= this.m_lacunarity;
                y *= this.m_lacunarity;
                z *= this.m_lacunarity;
                curp *= this.m_persistence;
            }
            return value + 0.5;
        }