void IN_MLookUp (void) { if (concussioned) return; KeyUp(&in_mlook); if (!mlook_active && lookspring.value) V_StartPitchDrift(); }
/* =============== V_DriftPitch Moves the client pitch angle towards cl.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. Drifting is enabled when the center view key is hit, mlook is released and lookspring is non 0, or when =============== */ void V_DriftPitch (void) { float delta, move; if (noclip_anglehack || !cl.onground || cls.demoplayback ) //FIXME: noclip_anglehack is set on the server, so in a nonlocal game this won't work. { cl.driftmove = 0; cl.pitchvel = 0; return; } // don't count small mouse motion if (cl.nodrift) { if ( fabs(cl.cmd.forwardmove) < cl_forwardspeed.value) cl.driftmove = 0; else cl.driftmove += host_frametime; if ( cl.driftmove > v_centermove.value) { if (lookspring.value) V_StartPitchDrift (); } return; } delta = cl.idealpitch - cl.viewangles[PITCH]; if (!delta) { cl.pitchvel = 0; return; } move = host_frametime * cl.pitchvel; cl.pitchvel += host_frametime * v_centerspeed.value; //Con_Printf ("move: %f (%f)\n", move, host_frametime); if (delta > 0) { if (move > delta) { cl.pitchvel = 0; move = delta; } cl.viewangles[PITCH] += move; } else if (delta < 0) { if (move > -delta) { cl.pitchvel = 0; move = -delta; } cl.viewangles[PITCH] -= move; } }
/* if ( gViewPort ) { gViewPort->HideScoreBoard(); } */ } void IN_MLookUp (void) { KeyUp( &in_mlook ); if ( !( in_mlook.state & 1 ) && lookspring->value ) { V_StartPitchDrift();
/* =============== 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(gEngfuncs.IsNoClipping() || !pparams->onground || pparams->demoplayback || pparams->spectator) { pd.driftmove = 0; pd.pitchvel = 0; return; } // don't count small mouse motion if(pd.nodrift) { if(fabs(pparams->cmd->forwardmove) < cl_forwardspeed->value) pd.driftmove = 0; else pd.driftmove += pparams->frametime; if(pd.driftmove > v_centermove->value) { V_StartPitchDrift(); } return; } delta = pparams->idealpitch - pparams->cl_viewangles[PITCH]; if(!delta) { pd.pitchvel = 0; return; } move = pparams->frametime * pd.pitchvel; pd.pitchvel += pparams->frametime * v_centerspeed->value; //Con_Printf ("move: %f (%f)\n", move, pparams->frametime); 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. 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 ) { if( gEngfuncs.IsNoClipping() || !pparams->onground || pparams->demoplayback ) { pd.driftmove = 0; pd.pitchvel = 0; return; } if( pd.nodrift ) { if( fabs( pparams->cmd->forwardmove ) < cl_forwardspeed->value ) { pd.driftmove = 0; } else { pd.driftmove += pparams->frametime; } if( pd.driftmove > v_centermove->value ) V_StartPitchDrift (); return; } float delta = pparams->idealpitch - pparams->cl_viewangles[PITCH]; if( !delta ) { pd.pitchvel = 0; return; } float move = pparams->frametime * pd.pitchvel; pd.pitchvel += pparams->frametime * v_centerspeed->value; 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 cl.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. Drifting is enabled when the center view key is hit, mlook is released and lookspring is non 0, or when =============== */ void V_DriftPitch (void) { float delta, move; if (noclip_anglehack || !cl.onground || cls.demoplayback ) { cl.driftmove = 0; cl.pitchvel = 0; return; } // don't count small mouse motion if (cl.nodrift) { if ( fabs(cl.cmd.forwardmove) < cl_forwardspeed.value) cl.driftmove = 0; else cl.driftmove += cl.realframetime; if ( cl.driftmove > v_centermove.value) { V_StartPitchDrift (); } return; } delta = cl.idealpitch - cl.viewangles[PITCH]; if (!delta) { cl.pitchvel = 0; return; } move = cl.realframetime * cl.pitchvel; cl.pitchvel += cl.realframetime * v_centerspeed.value; if (delta > 0) { if (move > delta) { cl.pitchvel = 0; move = delta; } cl.viewangles[PITCH] += move; } else if (delta < 0) { if (move > -delta) { cl.pitchvel = 0; move = -delta; } cl.viewangles[PITCH] -= move; } }
/* V_DriftPitch Moves the client pitch angle towards cl.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. Drifting is enabled when the center view key is hit, mlook is released and lookspring is non 0, or when */ static void V_DriftPitch (void) { float delta, move; int frameno = (cls.netchan.outgoing_sequence - 1) & UPDATE_MASK; usercmd_t *cmd = &cl.frames[frameno].cmd; if (view_message->onground == -1 || cls.demoplayback) { cl.driftmove = 0; cl.pitchvel = 0; return; } // don't count small mouse motion if (cl.nodrift) { if (fabs (cmd->forwardmove) < cl_forwardspeed->value) cl.driftmove = 0; else cl.driftmove += host_frametime; if (cl.driftmove > v_centermove->value) { V_StartPitchDrift (); } return; } delta = cl.idealpitch - cl.viewangles[PITCH]; if (!delta) { cl.pitchvel = 0; return; } move = host_frametime * cl.pitchvel; cl.pitchvel += host_frametime * v_centerspeed->value; if (delta > 0) { if (move > delta) { cl.pitchvel = 0; move = delta; } cl.viewangles[PITCH] += move; } else if (delta < 0) { if (move > -delta) { cl.pitchvel = 0; move = -delta; } cl.viewangles[PITCH] -= move; } }
/* Moves the client pitch angle towards cl.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. Drifting is enabled when the center view key is hit, mlook is released and lookspring is non 0, or when */ void V_DriftPitch (void) { float delta, move; if (!cl.onground || cls.demoplayback ) { cl.driftmove = cl.pitchvel = 0; return; } // don't count small mouse motion if (cl.nodrift) { if ( fabs(cl.frames[(cls.netchan.outgoing_sequence-1)&UPDATE_MASK].cmd.forwardmove) < 200) cl.driftmove = 0; else cl.driftmove += cls.frametime; if ( cl.driftmove > v_centermove.value) V_StartPitchDrift (); return; } delta = 0 - cl.viewangles[PITCH]; if (!delta) { cl.pitchvel = 0; return; } move = cls.frametime * cl.pitchvel; cl.pitchvel += cls.frametime * v_centerspeed.value; if (delta > 0) { if (move > delta) { cl.pitchvel = 0; move = delta; } cl.viewangles[PITCH] += move; } else if (delta < 0) { if (move > -delta) { cl.pitchvel = 0; move = -delta; } cl.viewangles[PITCH] -= move; } }
/* =============== 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 ( gEngfuncs.IsNoClipping() || !pparams->onground || pparams->demoplayback || pparams->spectator ) { pd.driftmove = 0; pd.pitchvel = 0; return; } // don't count small mouse motion if ( pd.nodrift) { if ( v_centermove->value > 0 && !(in_mlook.state & 1) ) { // 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. 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; // player didn't move enough } } return; // don't drift view } delta = pparams->idealpitch - pparams->cl_viewangles[PITCH]; if (!delta) { pd.pitchvel = 0; return; } move = pparams->frametime * pd.pitchvel; pd.pitchvel *= (1.0f+(pparams->frametime*0.25f)); // get faster by time 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; } }
static void IN_MLookUp (void) { KeyUp(&in_mlook); if (!(in_mlook.state & 1) && lookspring.integer) V_StartPitchDrift(); }