Add lerp function.

This commit is contained in:
Ulysse Cura 2026-08-04 19:48:11 +02:00
parent 344664f537
commit b63a67eb84
2 changed files with 7 additions and 0 deletions

View File

@ -131,4 +131,6 @@ void frect_to_rect(const frect_t *frect, rect_t *rect);
*/
#define intersect_frect(A, B, result) SDL_IntersectFRect(A, B, result)
float lerp(float a, float b, float t);
#endif // VECTOR2D_H

View File

@ -15,3 +15,8 @@ void frect_to_rect(const frect_t *frect, rect_t *rect)
rect->w = (int)frect->w;
rect->h = (int)frect->h;
}
float lerp(float a, float b, float t)
{
return a * (1 - t) + b * t;
}