cl_dll/view.cpp
/*
===============
V_DriftPitch

Moves the client pitch angle towards idealpitch sent by the server.

If the user is adjusting pitch manually, either with lookup/lookdown,
mlook and mouse, or klook and keyboard, pitch drifting is constantly stopped.
===============
*/
V_DriftPitch
Moves the client pitch angle towards idealpitch sent by the server.

If the user is adjusting pitch manually, either with lookup/lookdown,
mlook and mouse, or klook and keyboard, pitch drifting is constantly stopped.
V_DriftPitch Moves the client pitch angle towards idealpitch sent by the server . If the user is adjusting pitch manually either with lookup / lookdown mlook and mouse or klook and keyboard pitch drifting is constantly stopped .
void V_DriftPitch(struct ref_params_s* pparams)
{
	float delta, move;
	if (0 != gEngfuncs.IsNoClipping() || 0 == pparams->onground || 0 != pparams->demoplayback || 0 != pparams->spectator)
	{
		pd.driftmove = 0;
		pd.pitchvel = 0;
		return;
	}
	if (0 != pd.nodrift)
	{
		if (v_centermove->value > 0 && (in_mlook.state & 1) == 0)
		{
			if (fabs(pparams->cmd->forwardmove) < cl_forwardspeed->value)
				pd.driftmove = 0;
			else
				pd.driftmove += pparams->frametime;
			if (pd.driftmove > v_centermove->value)
			{
				V_StartPitchDrift();
			}
			else
			{
				return; 
			}
		}
		return; 
	}
	delta = pparams->idealpitch - pparams->cl_viewangles[PITCH];
	if (0 == delta)
	{
		pd.pitchvel = 0;
		return;
	}
	move = pparams->frametime * pd.pitchvel;
	pd.pitchvel *= (1.0f + (pparams->frametime * 0.25f)); 
	if (delta > 0)
	{
		if (move > delta)
		{
			pd.pitchvel = 0;
			move = delta;
		}
		pparams->cl_viewangles[PITCH] += move;
	}
	else if (delta < 0)
	{
		if (move > -delta)
		{
			pd.pitchvel = 0;
			move = -delta;
		}
		pparams->cl_viewangles[PITCH] -= move;
	}
}
void V_DriftPitch ( struct ref_params_s * pparams ) { float delta , move ; if ( 0 != gEngfuncs . IsNoClipping ( ) || 0 == pparams -> onground || 0 != pparams -> demoplayback || 0 != pparams -> spectator ) { pd . driftmove = 0 ; pd . pitchvel = 0 ; return ; } if ( 0 != pd . nodrift ) { if ( v_centermove -> value > 0 && ( in_mlook . state & 1 ) == 0 ) { if ( fabs ( pparams -> cmd -> forwardmove ) < cl_forwardspeed -> value ) pd . driftmove = 0 ; else pd . driftmove += pparams -> frametime ; if ( pd . driftmove > v_centermove -> value ) { V_StartPitchDrift ( ) ; } else { return ; } } return ; } delta = pparams -> idealpitch - pparams -> cl_viewangles [ PITCH ] ; if ( 0 == delta ) { pd . pitchvel = 0 ; return ; } move = pparams -> frametime * pd . pitchvel ; pd . pitchvel *= ( 1.0f + ( pparams -> frametime * 0.25f ) ) ; if ( delta > 0 ) { if ( move > delta ) { pd . pitchvel = 0 ; move = delta ; } pparams -> cl_viewangles [ PITCH ] += move ; } else if ( delta < 0 ) { if ( move > - delta ) { pd . pitchvel = 0 ; move = - delta ; } pparams -> cl_viewangles [ PITCH ] -= move ; } }
V_DriftPitch
Moves the client pitch angle towards idealpitch sent by the server.
V_DriftPitch Moves the client pitch angle towards idealpitch sent by the server .
// don't count small mouse motion // this is for lazy players. if they stopped, looked around and then continued // to move the view will be centered automatically if they move more than // v_centermove units. // player didn't move enough // don't drift view // get faster by time