smooth recoil, crouching

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1424 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-11-11 16:11:51 +00:00
parent 6e3f739b96
commit edf220fc63
4 changed files with 18 additions and 11 deletions
+3
View File
@@ -67,6 +67,7 @@ struct weaponmove
if(percent_done > 100.0f) percent_done = 100.0f;
// f(x) = -sin(x-1.5)^3
kick = -sinf(pow((1.5f/100.0f*percent_done)-1.5f,3));
if(player1->crouching) kick *= 0.35f;
}
if(player1->lastaction && player1->lastattackgun==player1->gunselect)
@@ -102,6 +103,8 @@ struct weaponmove
sway.x *= swayspeed;
sway.y *= swayspeed;
sway.z *= swayupspeed;
if(player1->crouching) sway.mul(0.35f);
}
pos.x -= base.x*k_back+sway.x;