Moves common math functions to own file

This commit is contained in:
Rune Harlyk
2024-07-12 13:34:31 +02:00
committed by Rune Harlyk
parent c432792300
commit cfa3e58d09
3 changed files with 14 additions and 4 deletions
+12
View File
@@ -0,0 +1,12 @@
#ifndef MATHUTILS_H
#define MATHUTILS_H
#include <cmath>
inline float lerp(float start, float end, float t) { return (1 - t) * start + t * end; }
inline bool isEqual(float a, float b, float epsilon) { return std::fabs(a - b) < epsilon; }
inline float round2(float value) { return (int)(value * 100 + 0.5) / 100.0; }
#endif