X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=vg%2Fvg_m.h;h=a567092e79b130fa83dfe2234ead19aa95ad4d78;hb=c87000a5e48d2cf3afdf308189767951eb819c09;hp=6276edb814bdb23bb0b83e036698ebf4b9d9513a;hpb=0c6380402b4225e2d5e27063e2e49c911b4aa3fb;p=fishladder.git diff --git a/vg/vg_m.h b/vg/vg_m.h index 6276edb..a567092 100644 --- a/vg/vg_m.h +++ b/vg/vg_m.h @@ -145,6 +145,12 @@ static inline float v2_dist( v2f a, v2f b ) return sqrtf( v2_dist2( a, b ) ); } +static inline void v2_lerp( v2f a, v2f b, float t, v2f d ) +{ + d[0] = a[0] + t*(b[0]-a[0]); + d[1] = a[1] + t*(b[1]-a[1]); +} + // Vector 3 // ==================================================================================================================