about summary refs log tree commit diff
path: root/src/game/g_game.h
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-16 22:32:17 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-16 22:32:17 +0000
commit4a3c2e2c8c3a8dee5828258f920f1c175e952cb0 (patch)
treee0fda9dfad5e605c0810c8f27d719078cd48fd63 /src/game/g_game.h
parent727c9a3a3249deec1c5a96025e99c0c654e7ff80 (diff)
downloadzcatch-4a3c2e2c8c3a8dee5828258f920f1c175e952cb0.tar.gz
zcatch-4a3c2e2c8c3a8dee5828258f920f1c175e952cb0.zip
loads of fixes, skidding, velocity ramping and other stuff
Diffstat (limited to 'src/game/g_game.h')
-rw-r--r--src/game/g_game.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/g_game.h b/src/game/g_game.h
index 3cb6639b..6b13fb7b 100644
--- a/src/game/g_game.h
+++ b/src/game/g_game.h
@@ -53,11 +53,12 @@ inline float get_angle(vec2 dir)
 }
 
 
-inline vec2 calc_pos(vec2 p, vec2 v, float gravity, float t)
+inline vec2 calc_pos(vec2 p, vec2 v, float curvature, float speed, float t)
 {
 	vec2 n;
+	t *= speed;
 	n.x = p.x + v.x*t;
-	n.y = p.y + v.y*t - gravity*(t*t);
+	n.y = p.y + v.y*t + curvature/10000*(t*t);
 	return n;
 }
 
@@ -88,7 +89,7 @@ inline T saturated_add(T min, T max, T current, T modifier)
 void move_point(vec2 *inout_pos, vec2 *inout_vel, float elasticity, int *bounces);
 void move_box(vec2 *inout_pos, vec2 *inout_vel, vec2 size, float elasticity);
 bool test_box(vec2 pos, vec2 size);
-
+float velocity_ramp(float value, float start, float range, float curvature);
 
 // hooking stuff
 enum