List of utility methods to do Lerp
float | lerp(float a, float b, float interpolation) lerp return a + interpolation * (b - a);
|
float | lerp(float a, float b, float t) lerp return a + (b - a) * t;
|
float | lerp(float fromValue, float toValue, float progress) Linearly interpolates between fromValue to toValue on progress position. return fromValue + (toValue - fromValue) * progress;
|
float | lerp(float origin, float target, int steps, int maxSteps) lerp return origin + (target - origin) * steps / maxSteps;
|
float | lerp(float start, float stop, float amt) Calculates a number between two numbers at a specific increment. return start + (stop - start) * amt;
|
float | lerp(float target, float current, float factor) linear interpolate between target & current, factor is between 0 and 1.0 return target * factor + current * (1.0f - factor);
|
float | lerp(float to, float from, float f) lerp float ret = (to > from ? to - f : to + f); if (withinThreshold(from, ret, 1)) return from; return ret; |
float | lerp(float va, float vb, float t) Linearly interpolates between va and vb by the parameter t. return va + t * (vb - va);
|
float | lerp(float value1, float value2, float amount) Interpolates between value1 and value2 by amount. return value1 + (value2 - value1) * amount;
|
int | lerp(int a, int b, float value) lerp return (int) (a + (b - a) * value); |