tar_config, custom gradients
[tar-legacy.git] / MCDV / interpolation.h
index 304bf96ff4cd22bf0035542920056aa59b33cac7..f2540771a472f13bf9e4144e06c86615debe264f 100644 (file)
@@ -8,6 +8,11 @@ static float lerpf(float a, float b, float f) {
        return (a * (1.0f - f)) + (b * f);
 }
 
+template<typename T>
+static T lerpT(T a, T b, float f) {
+       return (T)((float)a * (1.0f - f)) + ((float)b * f);
+}
+
 static glm::vec3 lerp(glm::vec3 a, glm::vec3 b, float f) {
        return glm::vec3(lerpf(a.x, b.x, f),
                lerpf(a.y, b.y, f),