diff --git a/src/vec.c b/src/vec.c index b77c17a..aa927ad 100644 --- a/src/vec.c +++ b/src/vec.c @@ -47,17 +47,9 @@ void vec_divf(Vec *vector, float scale) { void vec_lerp(Vec *from, Vec to, float scale) { /* A linear interpolation function, can be used for camera and * animations. 'scale' is the transformation speed, 1 being - * instant. - */ - /* from * (1 - scale) + temp * scale */ - Vec temp; - vec_cpy(&temp, to); - /* from * (1 - scale) */ - vec_mulf(from, 1 - scale); - /* temp * scale */ - vec_mulf(&temp, scale); - /* add */ - vec_add(from, temp); + * instant. */ + from->x = from->x * (1 - scale) + to.x * scale; + from->y = from->y * (1 - scale) + to.y * scale; } void vec_clamp(Vec *to_limit, Vec min, Vec max) {