From f3f3177a7eb9caaaf777f08af6f358dd8ea921cb Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sat, 24 May 2008 08:00:11 +0000 Subject: [PATCH] grenade gravity tweaks git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2094 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/physics.cpp | 3 ++- source/src/weapon.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/src/physics.cpp b/source/src/physics.cpp index a8716c2f..c264c224 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -273,7 +273,8 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) else // apply gravity { const float CUBES_PER_METER = 4; // assumes 4 cubes make up 1 meter - const float GRAVITY = 9.81f/CUBES_PER_METER/1000.0f; + const float BOUNCE_MASS = 0.5f; // sane default mass of 0.5 kg + const float GRAVITY = BOUNCE_MASS*9.81f/CUBES_PER_METER/1000.0f; bounce->vel.z -= GRAVITY*curtime; } diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 5ee6447b..d574bfc6 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -244,7 +244,7 @@ void movebounceents() loopv(bounceents) if(bounceents[i]) { bounceent *p = bounceents[i]; - if((p->bouncetype==BT_NADE || p->bouncetype==BT_GIB) && p->applyphysics()) movebounceent(p, 2, false); + if((p->bouncetype==BT_NADE || p->bouncetype==BT_GIB) && p->applyphysics()) movebounceent(p, 1, false); if(!p->isalive(lastmillis)) { p->destroy(); @@ -546,7 +546,7 @@ grenadeent::grenadeent (playerent *owner, int millis) bounceent::millis = lastmillis; timetolive = 2000-millis; bouncetype = BT_NADE; - maxspeed = 27.0f; + maxspeed = 30.0f; rotspeed = 6.0f; }