OpenMetaverse.Utils.SmoothStep C# (CSharp) Method

SmoothStep() public static method

public static SmoothStep ( double value1, double value2, double amount ) : double
value1 double
value2 double
amount double
return double
        public static double SmoothStep(double value1, double value2, double amount)
        {
            // It is expected that 0 < amount < 1
            // If amount < 0, return value1
            // If amount > 1, return value2
            double result = Utils.Clamp(amount, 0f, 1f);
            return Utils.Hermite(value1, 0f, value2, 0f, result);
        }

Same methods

Utils::SmoothStep ( float value1, float value2, float amount ) : float

Usage Example

示例#1
0
 public static Vector4 SmoothStep(Vector4 value1, Vector4 value2, float amount)
 {
     return(new Vector4(
                Utils.SmoothStep(value1.X, value2.X, amount),
                Utils.SmoothStep(value1.Y, value2.Y, amount),
                Utils.SmoothStep(value1.Z, value2.Z, amount),
                Utils.SmoothStep(value1.W, value2.W, amount)));
 }
All Usage Examples Of OpenMetaverse.Utils::SmoothStep