[client] Get the chase camera working with input

It turns out cam_controls is for pointing the player model in the
direction of movement rather than controlling the camera (I should add
proper camera controls).
This commit is contained in:
Bill Currie 2022-03-01 16:07:04 +09:00
parent ee3c9fa59f
commit 54c3b4cc53
2 changed files with 6 additions and 2 deletions

View file

@ -121,6 +121,9 @@ set_camera (chasestate_t *cs, viewstate_t *vs)
static void
cam_controls (chasestate_t *cs, viewstate_t *vs)
{
// FIXME this doesn't actually control the camera, but rather makes the
// player face the direction of motion. It probably should not access
// movement input buttons and axes directly.
// get basic movement from keyboard
vec4f_t move = { };
vec4f_t forward = { };
@ -162,7 +165,8 @@ cam_controls (chasestate_t *cs, viewstate_t *vs)
vs->player_angles[YAW] = (atan2 (dir[1], dir[0]) * 180 / M_PI);
}
vs->player_angles[PITCH] = 0;
//vs->player_angles[PITCH] = 0;
VectorCopy (vs->player_angles, cs->player_angles);
}
static void

View file

@ -409,7 +409,7 @@ CL_Input_BuildMove (float frametime, movestate_t *state, viewstate_t *vs)
VectorScale (forward, move[FORWARD], f);
VectorScale (right, move[SIDE], r);
move[FORWARD] = f[0] + r[0];
move[SIDE] = f[1] + r[1];
move[SIDE] = -f[1] - r[1];
}
state->move = move;
}