mirror of
https://github.com/nzp-team/quakespasm.git
synced 2024-11-10 06:32:03 +00:00
NX/VITA: Idle View Model Bobbing Integration from CSQC
This commit is contained in:
parent
b5150a81e6
commit
d93ecf2b1d
1 changed files with 27 additions and 10 deletions
|
@ -230,15 +230,32 @@ float V_CalcBob (float speed,float which)//0 = regular, 1 = side bobbing
|
|||
float bob = 0;
|
||||
float sprint = 1;
|
||||
|
||||
if (cl.stats[STAT_ZOOM] == 2)
|
||||
return;
|
||||
|
||||
// Bob idle-y, instead of presenting as if in-motion.
|
||||
if (speed < 0.1) {
|
||||
if(cl.stats[STAT_ZOOM] == 1)
|
||||
speed = 0.05;
|
||||
else
|
||||
speed = 0.25;
|
||||
|
||||
if (which == 0)
|
||||
bob = cl_bobup.value * 10 * speed * (sprint * sprint) * sin(cl.time * 3.25 * sprint);
|
||||
else
|
||||
bob = cl_bobside.value * 50 * speed * (sprint * sprint * sprint) * sin((cl.time * sprint) - (M_PI * 0.25));
|
||||
}
|
||||
// Normal walk/sprint bob.
|
||||
else {
|
||||
if(cl.stats[STAT_ZOOM] == 3)
|
||||
sprint = 1.8; //this gets sprinting speed in comparison to walk speed per weapon
|
||||
if(cl.stats[STAT_ZOOM] == 2)
|
||||
return 0;
|
||||
|
||||
//12.048 -> 4.3 = 100 -> 36ish, so replace 100 with 36
|
||||
if(which == 0)
|
||||
bob = cl_bobup.value * 24 * speed * (sprint * sprint) * sin((cl.time * 12.5 * sprint));//Pitch Bobbing 10
|
||||
else if(which == 1)
|
||||
bob = cl_bobside.value * 24 * speed * (sprint * sprint * sprint) * sin((cl.time * 6.25 * sprint) - (M_PI * 0.25));//Yaw Bobbing 5
|
||||
}
|
||||
|
||||
return bob;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue