Processors.Decay

Static Method in Processors

Declaration

public static float Decay(float input, float rate, float target = 0F)

Description

Decays the input back to zero over time at a given rate. The rate is multiplied by Time.deltaTime.

Parameters

inputThe input value to decay.
rateHow quickly the input decays.
targetThe optional value to decay to, otherwise zero.

Returns

floatThe decayed input value.

Overload

Declaration

public static double Decay(double input, double rate, double target = 0)

Description

Decays the input back to zero over time at a given rate. The rate is multiplied by Time.deltaTime.

Parameters

inputThe input value to decay.
rateHow quickly the input decays.
targetThe optional value to decay to, otherwise zero.

Returns

doubleThe decayed input value.