add cl_bobview

This commit is contained in:
pierow 2024-01-14 16:57:25 -05:00
parent 48da9f7260
commit ae447029c0
5 changed files with 27 additions and 5 deletions

View file

@ -179,7 +179,9 @@ lightgamma "2"
ex_interp "0.05"
cl_cross "1"
rate "30000"
cl_bob "0"
cl_bob "0.01"
cl_bobcycle "0.8"
cl_bob "0.5"
cl_weaponswap "2"
+mlook

View file

@ -124,6 +124,7 @@ cvar_t *cl_yawspeed;
cvar_t *cl_pitchspeed;
cvar_t *cl_anglespeedkey;
cvar_t *cl_vsmoothing;
cvar_t *cl_bobview;
cvar_t *cl_autohelp;
cvar_t *cl_centerentityid;
cvar_t *cl_musicenabled;
@ -1619,6 +1620,7 @@ void InitInput (void)
cl_pitchdown = gEngfuncs.pfnRegisterVariable ( "cl_pitchdown", "89", 0 );
cl_vsmoothing = gEngfuncs.pfnRegisterVariable ( "cl_vsmoothing", "0.05", FCVAR_ARCHIVE );
cl_bobview = gEngfuncs.pfnRegisterVariable ( "cl_bobview", "0", FCVAR_ARCHIVE );
m_pitch = gEngfuncs.pfnRegisterVariable ( "m_pitch","0.022", FCVAR_ARCHIVE );
m_yaw = gEngfuncs.pfnRegisterVariable ( "m_yaw","0.022", FCVAR_ARCHIVE );

View file

@ -77,6 +77,7 @@ when crossing a water boudnary.
extern cvar_t *chase_active;
extern cvar_t *scr_ofsx, *scr_ofsy, *scr_ofsz;
extern cvar_t *cl_vsmoothing;
extern cvar_t *cl_bobview;
#define CAM_MODE_RELAX 1
#define CAM_MODE_FOCUS 2
@ -621,8 +622,11 @@ void V_CalcNormalRefdef ( struct ref_params_s *pparams )
// refresh position
VectorCopy ( pparams->simorg, pparams->vieworg );
if (cl_bobview && cl_bobview->value != 0)
{
pparams->vieworg[2] += ( bob );
VectorAdd( pparams->vieworg, pparams->viewheight, pparams->vieworg );
}
VectorCopy ( pparams->cl_viewangles, pparams->viewangles );
@ -754,7 +758,10 @@ void V_CalcNormalRefdef ( struct ref_params_s *pparams )
{
view->origin[ i ] += bob * 0.4 * pparams->forward[ i ];
}
if (cl_bobview && cl_bobview->value != 0)
{
view->origin[2] += bob;
}
// throw in a little tilt.
view->angles[YAW] -= bob * 0.5;

View file

@ -94,6 +94,20 @@ DESCRIPTION INFO_OPTIONS
}
{ "3.000000" }
}
"cl_bob"
{
"Weapon bobbing (0.01 default)"
{ NUMBER 0.000000 0.010000 }
{ "0.01" }
}
"cl_bobview"
{
"View bobbing (requires weapon bobbing)"
{ BOOL }
{ "0" }
}
"cl_weaponswap"
{

View file

@ -12,9 +12,6 @@ lightgamma "2"
fps_override "1"
gl_vsync "0"
//View and weapon bob off
cl_bob "0"
//Network rates for the 21st century
rate "30000"
cl_updaterate "100"