diff options
Diffstat (limited to 'src/game/game.h')
| -rw-r--r-- | src/game/game.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game/game.h b/src/game/game.h index 62d67cb7..53036d3d 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -26,6 +26,15 @@ inline float get_angle(vec2 dir) } +inline vec2 calc_pos(vec2 p, vec2 v, float gravity, float t) +{ + vec2 n; + n.x = p.x + v.x*t; + n.y = p.y + v.y*t - gravity*(t*t); + return n; +} + + template<typename T> inline T saturated_add(T min, T max, T current, T modifier) { |