ruk·si

🔷 C++
Lerp

Updated at 2015-01-01 03:50
float lerp(float ratio, float zeroValue, float fullValue) {
    if (ratio > 1.0f) { ratio = 1.0f; }
    if (ratio < 0.0f) { ratio = 0.0f; }
    return (1.0f - ratio) * zeroValue + ratio * fullValue;
}