mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-04 11:04:28 +00:00
Implement cl_viewbob cvar for viewmodel bobbing. Same as in http://am.half-lifecreations.com/forums/index.php?topic=288.0
This commit is contained in:
parent
7a5c29cbc9
commit
ea8f2bed77
@ -35,6 +35,7 @@ extern client_sprite_t *GetSpriteList( client_sprite_t *pList, const char *psz,
|
|||||||
|
|
||||||
extern cvar_t *sensitivity;
|
extern cvar_t *sensitivity;
|
||||||
cvar_t *cl_lw = NULL;
|
cvar_t *cl_lw = NULL;
|
||||||
|
cvar_t *cl_viewbob = NULL;
|
||||||
|
|
||||||
void ShutdownInput( void );
|
void ShutdownInput( void );
|
||||||
|
|
||||||
@ -194,6 +195,7 @@ void CHud::Init( void )
|
|||||||
m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE );
|
m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE );
|
||||||
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
|
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
|
||||||
cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" );
|
cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" );
|
||||||
|
cl_viewbob = CVAR_CREATE( "cl_viewbob", "0", FCVAR_ARCHIVE );
|
||||||
|
|
||||||
m_pSpriteList = NULL;
|
m_pSpriteList = NULL;
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@ extern cvar_t *cl_forwardspeed;
|
|||||||
extern cvar_t *chase_active;
|
extern cvar_t *chase_active;
|
||||||
extern cvar_t *scr_ofsx, *scr_ofsy, *scr_ofsz;
|
extern cvar_t *scr_ofsx, *scr_ofsy, *scr_ofsz;
|
||||||
extern cvar_t *cl_vsmoothing;
|
extern cvar_t *cl_vsmoothing;
|
||||||
|
extern cvar_t *cl_viewbob;
|
||||||
extern Vector dead_viewangles;
|
extern Vector dead_viewangles;
|
||||||
|
|
||||||
#define CAM_MODE_RELAX 1
|
#define CAM_MODE_RELAX 1
|
||||||
@ -527,7 +528,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams )
|
|||||||
V_AddIdle( pparams );
|
V_AddIdle( pparams );
|
||||||
|
|
||||||
// offsets
|
// offsets
|
||||||
if ( pparams->health <= 0 )
|
if( pparams->health <= 0 )
|
||||||
{
|
{
|
||||||
VectorCopy( dead_viewangles, angles );
|
VectorCopy( dead_viewangles, angles );
|
||||||
}
|
}
|
||||||
@ -598,6 +599,9 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams )
|
|||||||
view->angles[ROLL] -= bob * 1;
|
view->angles[ROLL] -= bob * 1;
|
||||||
view->angles[PITCH] -= bob * 0.3;
|
view->angles[PITCH] -= bob * 0.3;
|
||||||
|
|
||||||
|
if( cl_viewbob && cl_viewbob->value )
|
||||||
|
VectorCopy( view->angles, view->curstate.angles );
|
||||||
|
|
||||||
// pushing the view origin down off of the same X/Z plane as the ent's origin will give the
|
// pushing the view origin down off of the same X/Z plane as the ent's origin will give the
|
||||||
// gun a very nice 'shifting' effect when the player looks up/down. If there is a problem
|
// gun a very nice 'shifting' effect when the player looks up/down. If there is a problem
|
||||||
// with view model distortion, this may be a cause. (SJB).
|
// with view model distortion, this may be a cause. (SJB).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user