- forward[0] *= bob;
- forward[1] *= bob;
- right[0] *= bob;
- right[1] *= bob;
- // we use cl.cmd.sidemove with forward and cl.cmd.forwardmove with right so the side bobbing
- // goes to the side when we walk forward and to the front when we strafe
- VectorMAMAM(cl.cmd.sidemove, forward, cl.cmd.forwardmove, right, cl.cmd.upmove, up, bobvel);
- vieworg[0] += bobvel[0];
- vieworg[1] += bobvel[1];
+ // now get the speed based on those angles. The bounds should match the same value as xyspeed's
+ side = bound(-400, DotProduct (cl.velocity, right) * cl.bob2_smooth, 400);
+ front = bound(-400, DotProduct (cl.velocity, forward) * cl.bob2_smooth, 400);
+ VectorScale(forward, bob, forward);
+ VectorScale(right, bob, right);
+ // we use side with forward and front with right, so the bobbing goes
+ // to the side when we walk forward and to the front when we strafe
+ VectorMAMAM(side, forward, front, right, 0, up, bob2vel);
+ vieworg[0] += bob2vel[0];
+ vieworg[1] += bob2vel[1];