System.Windows.Forms.MathHelper.SmoothStep C# (CSharp) Méthode

SmoothStep() public static méthode

Interpolates between two values using a cubic equation.
public static SmoothStep ( float value1, float value2, float amount ) : float
value1 float Source value.
value2 float Source value.
amount float Weighting value.
Résultat float
        public static float SmoothStep(float value1, float value2, float amount)
        {
            // originaly from https://github.com/mono/MonoGame/
            // It is expected that 0 < amount < 1
            // If amount < 0, return value1
            // If amount > 1, return value2
            float result = MathHelper.Clamp(amount * UnityEngine.Time.deltaTime, 0f, 1f);
            result = MathHelper.Hermite(value1, 0f, value2, 0f, result);

            return result;
        }