try again: velocity test (less jumpy this time)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5294 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-07-06 20:40:20 +00:00
parent 1344b25410
commit c27a4e699c
+5 -3
View File
@@ -171,9 +171,11 @@ void parsepositions(ucharbuf &p)
{
loopi(3)
{
d->vel.v[i] = (( o.v[i] + ( i == 2 ? d->eyeheight : 0.0) ) - d->o.v[i]) * 0.4 + d->vel.v[i] * 0.6;
int t = 6 * d->vel.v[i];
d->vel.v[i] = 0.25f * t;
float dr = o.v[i] - d->o.v[i];
if ( fabs(d->vel.v[i]) > 0.1 )
d->vel.v[i] = (i == 2 ? ( dr + d->eyeheight > 0 ? ( dr + d->eyeheight ) * 5 : 0 ) : dr ) * 0.1 + d->vel.v[i] * 0.9;
else
d->vel.v[i] = (i == 2 ? ( dr + d->eyeheight > 0 ? ( dr + d->eyeheight ) * 5 : 0 ) : dr ) * 0.6 + d->vel.v[i] * 0.4;
}
}
else loopi(3) d->vel.v[i] = 0.0f;