mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-23 02:41:30 +00:00
[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:
parent
ee3c9fa59f
commit
54c3b4cc53
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue