Beispiel #1
0
 /// <summary>
 ///      Generates an output value given the coordinates of the specified input value.
 /// </summary>
 /// <exception cref="NullReferenceException">Thrown if NoiseModule1 or NoiseModule2 are null.</exception>
 /// <param name="x">The x coordinate of the input value.</param>
 /// <param name="y">The y coordinate of the input value.</param>
 /// <param name="z">The z coordinate of the input value.</param>
 /// <returns>The output value.</returns>
 public override double GetValue(double x, double y, double z)
 {
     if (NoiseModule1 == null || NoiseModule2 == null)
     {
         throw new NullReferenceException("NoiseModule1 or NoiseModule2 are null.");
     }
     return(NoiseModule1.GetValue(x, y, z) + NoiseModule2.GetValue(x, y, z));
 }
Beispiel #2
0
        /// <summary>
        ///      Generates an output value given the coordinates of the specified input value.
        /// </summary>
        /// <param name="x">The x coordinate of the input value.</param>
        /// <param name="y">The y coordinate of the input value.</param>
        /// <param name="z">The z coordinate of the input value.</param>
        /// <returns>The output value.</returns>
        public override double GetValue(double x, double y, double z)
        {
            double v0    = NoiseModule1.GetValue(x, y, z);
            double v1    = NoiseModule2.GetValue(x, y, z);
            double alpha = (ControlModule.GetValue(x, y, z) + 1.0) / 2.0;

            return(Interp.LinearInterp(v0, v1, alpha));
        }