cl_beams_quakepositionhack 1 makes your lightning gun appear to fire from your waist (as in Quake and QuakeWorld)
cl_bob 0.02 view bobbing amount
cl_bobcycle 0.6 view bobbing speed
+cl_bobroll 0.001 view rolling amount
+cl_bobrollcycle 0.75 view rolling speed
+cl_bobrollairtime 0.05 how fast the view rolls back when you stop touching the ground
cl_bobmodel 1 enables gun bobbing
cl_bobmodel_side 0.05 gun bobbing sideways sway amount
cl_bobmodel_speed 7 gun bobbing speed
cvar_t cl_bob = {CVAR_SAVE, "cl_bob","0.02", "view bobbing amount"};
cvar_t cl_bobcycle = {CVAR_SAVE, "cl_bobcycle","0.6", "view bobbing speed"};
cvar_t cl_bobup = {CVAR_SAVE, "cl_bobup","0.5", "view bobbing adjustment that makes the up or down swing of the bob last longer"};
-cvar_t cl_bobroll = {CVAR_SAVE, "cl_bobroll","0.01", "view rolling amount"};
-cvar_t cl_bobrollcycle = {CVAR_SAVE, "cl_bobrollcycle","0.5", "view rolling speed"};
+cvar_t cl_bobroll = {CVAR_SAVE, "cl_bobroll","0.001", "view rolling amount"};
+cvar_t cl_bobrollcycle = {CVAR_SAVE, "cl_bobrollcycle","0.75", "view rolling speed"};
cvar_t cl_bobrollairtime = {CVAR_SAVE, "cl_bobrollairtime","0.05", "how fast the view rolls back when you stop touching the ground"};
cvar_t cl_bobmodel = {CVAR_SAVE, "cl_bobmodel", "1", "enables gun bobbing"};
cvar_t cl_bobmodel_side = {CVAR_SAVE, "cl_bobmodel_side", "0.15", "gun bobbing sideways sway amount"};
}
// view rolling code
- // TODO 1 (DONE): Make it work around the center rather than the left side
- // TODO 2 (DONE): Make the roll smoothly return to 0 when you stop touching the ground, rather than instantly
- // TODO 3: Write cvars to darkplaces.txt, set better defaults and possibly disable by default once the first TODOs are ready
if (cl_bobroll.value && cl_bobrollcycle.value)
{
cycle2 = cl.time / cl_bobrollcycle.value;
else
cycle2 = sin(M_PI + M_PI * (cycle2-0.5)/0.5);
+ // this value slowly decreases from 1 to 0 when we stop touching the ground.
+ // The cycle is later multiplied with it so the view smooths back to normal
if (cl.onground)
cl.bobroll_airtime = 1;
else