/* Relay -- a tool to record and play Quake2 demos Copyright (C) 2000 Conor Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Conor Davis cedavis@planetquake.com */ #include "sv_local.h" static void Pmove_Spectator(pmove_t *pm) { vec3_t angles, velocity, wishvel, forward, right; float fmove, smove; int i; for (i = 0; i < 3; i++) { velocity[i] = pm->s.velocity[i] * 0.125; angles[i] = SHORT2ANGLE(pm->cmd.angles[i]); } AngleVectors(angles, forward, right, NULL); fmove = pm->cmd.forwardmove; smove = pm->cmd.sidemove; VectorNormalize(forward); VectorNormalize(right); for (i = 0; i < 3; i++) wishvel[i] = forward[i]*fmove + right[i]*smove; wishvel[2] += pm->cmd.upmove; VectorCopy(wishvel, velocity); for (i = 0; i < 3; i++) { pm->s.velocity[i] = velocity[i] * 8; pm->s.origin[i] += pm->s.velocity[i]*pm->cmd.msec*0.001; } VectorCopy(angles, pm->viewangles); } void Pmove(pmove_t *pm) { switch(pm->s.pm_type) { case PM_SPECTATOR: Pmove_Spectator(pm); break; default: break; } }