#include "../client.h"
#include "cl_view.h"
#include "cl_hud.h"
#include "../input/cl_input.h"
#include "events/e_parse.h"
Go to the source code of this file.
Defines | |
#define | MIN_CAMROT_SPEED 50 |
#define | MIN_CAMROT_ACCEL 50 |
#define | MAX_CAMROT_SPEED 1000 |
#define | MAX_CAMROT_ACCEL 1000 |
#define | MIN_CAMMOVE_SPEED 150 |
#define | MIN_CAMMOVE_ACCEL 150 |
#define | MAX_CAMMOVE_SPEED 3000 |
#define | MAX_CAMMOVE_ACCEL 3000 |
#define | LEVEL_MIN 0.05 |
#define | LEVEL_SPEED 3.0 |
#define | ZOOM_SPEED 2.0 |
#define | MIN_CAMZOOM_QUANT 0.05 |
#define | MAX_CAMZOOM_QUANT 1.0 |
Functions | |
static void | CL_ClampCamToMap (const float border) |
forces the camera to stay within the horizontal bounds of the map plus some border | |
void | CL_CameraMove (void) |
Update the camera position. This can be done in two different reasons. The first is the user input, the second is an active camera route. The camera route overrides the user input and is lerping the movement until the final position is reached. | |
void | CL_CameraRoute (const pos3_t from, const pos3_t target) |
Interpolates the camera movement from the given start point to the given end point. | |
void | CL_CameraZoomIn (void) |
Zooms the scene of the battlefield in. | |
void | CL_CameraZoomOut (void) |
Zooms the scene of the battlefield out. | |
static void | CL_CamSetAngles_f (void) |
static void | CL_CamSetZoom_f (void) |
static void | CL_CenterCameraIntoMap_f (void) |
void | CL_CameraInit (void) |
Variables | |
static qboolean | cameraRoute = qfalse |
static vec3_t | routeFrom |
static vec3_t | routeDelta |
static float | routeDist |
const float | MIN_ZOOM = 0.5 |
const float | MAX_ZOOM = 32.0 |
static cvar_t * | cl_camrotspeed |
static cvar_t * | cl_cammovespeed |
static cvar_t * | cl_cammoveaccel |
static cvar_t * | cl_campitchmin |
static cvar_t * | cl_campitchmax |
cvar_t * | cl_camzoommax |
cvar_t * | cl_camzoomquant |
cvar_t * | cl_camzoommin |
cvar_t * | cl_centerview |
Definition in file cl_camera.c.
#define LEVEL_MIN 0.05 |
Definition at line 49 of file cl_camera.c.
Referenced by CL_CameraMove().
#define LEVEL_SPEED 3.0 |
Definition at line 50 of file cl_camera.c.
Referenced by CL_CameraMove().
#define MAX_CAMMOVE_ACCEL 3000 |
Definition at line 48 of file cl_camera.c.
Referenced by CL_CameraMove().
#define MAX_CAMMOVE_SPEED 3000 |
Definition at line 47 of file cl_camera.c.
Referenced by CL_CameraMove().
#define MAX_CAMROT_ACCEL 1000 |
Definition at line 44 of file cl_camera.c.
#define MAX_CAMROT_SPEED 1000 |
Definition at line 43 of file cl_camera.c.
Referenced by CL_CameraMove().
#define MAX_CAMZOOM_QUANT 1.0 |
Definition at line 53 of file cl_camera.c.
Referenced by CL_CameraZoomIn(), and CL_CameraZoomOut().
#define MIN_CAMMOVE_ACCEL 150 |
Definition at line 46 of file cl_camera.c.
Referenced by CL_CameraMove().
#define MIN_CAMMOVE_SPEED 150 |
Definition at line 45 of file cl_camera.c.
Referenced by CL_CameraMove().
#define MIN_CAMROT_ACCEL 50 |
Definition at line 42 of file cl_camera.c.
#define MIN_CAMROT_SPEED 50 |
Definition at line 41 of file cl_camera.c.
Referenced by CL_CameraMove().
#define MIN_CAMZOOM_QUANT 0.05 |
Definition at line 52 of file cl_camera.c.
Referenced by CL_CameraZoomIn(), and CL_CameraZoomOut().
#define ZOOM_SPEED 2.0 |
Definition at line 51 of file cl_camera.c.
Referenced by CL_CameraMove().
void CL_CameraInit | ( | void | ) |
Definition at line 357 of file cl_camera.c.
References CL_CamSetAngles_f(), CL_CamSetZoom_f(), CL_CenterCameraIntoMap_f(), Cmd_AddCommand(), CVAR_ARCHIVE, and Cvar_Get().
Referenced by CL_InitLocal().
void CL_CameraMove | ( | void | ) |
Update the camera position. This can be done in two different reasons. The first is the user input, the second is an active camera route. The camera route overrides the user input and is lerping the movement until the final position is reached.
Definition at line 87 of file cl_camera.c.
References AngleVectors(), ca_active, CAMERA_LEVEL_HEIGHT, CAMERA_START_DIST, CAMERA_START_HEIGHT, cameraRoute, cl, CL_BlockBattlescapeEvents(), CL_ClampCamToMap(), CL_GetKeyMouseState(), cl_isometric, CL_ViewCalcFieldOfViewX(), cl_worldlevel, cls, DotProduct, client_static_s::frametime, i, cvar_s::integer, LEVEL_MIN, LEVEL_SPEED, MAX_CAMMOVE_ACCEL, MAX_CAMMOVE_SPEED, MAX_CAMROT_SPEED, MAX_ZOOM, MIN_CAMMOVE_ACCEL, MIN_CAMMOVE_SPEED, MIN_CAMROT_SPEED, MIN_ZOOM, PITCH, qfalse, ROLL, routeDelta, routeDist, routeFrom, client_static_s::state, STATE_FORWARD, STATE_RIGHT, STATE_ROT, STATE_TILT, STATE_ZOOM, torad, cvar_s::value, VectorClear, VectorDist, VectorLength(), VectorMA(), VectorNormalize(), VectorNormalize2(), VectorScale, VectorSet, viddef, viddef_t::viewHeight, viddef_t::viewWidth, YAW, and ZOOM_SPEED.
Referenced by CL_Frame().
Interpolates the camera movement from the given start point to the given end point.
[in] | from | The grid position to start the camera movement from |
[in] | target | The grid position to move the camera to |
Definition at line 239 of file cl_camera.c.
References cameraRoute, cl, CL_BlockBattlescapeEvents(), Cvar_SetValue(), cvar_s::integer, PosToVec, qtrue, routeDelta, routeDist, routeFrom, VectorClear, VectorCopy, VectorLength(), VectorNormalize(), and VectorSubtract.
Referenced by CL_ActorStartShoot().
void CL_CameraZoomIn | ( | void | ) |
Zooms the scene of the battlefield in.
Definition at line 268 of file cl_camera.c.
References cl, CL_ViewCalcFieldOfViewX(), MAX_CAMZOOM_QUANT, MAX_ZOOM, MIN_CAMZOOM_QUANT, and cvar_s::value.
Referenced by CL_ZoomInQuant_f().
void CL_CameraZoomOut | ( | void | ) |
Zooms the scene of the battlefield out.
Definition at line 291 of file cl_camera.c.
References cl, CL_ViewCalcFieldOfViewX(), MAX_CAMZOOM_QUANT, MIN_CAMZOOM_QUANT, MIN_ZOOM, and cvar_s::value.
Referenced by CL_ZoomOutQuant_f().
static void CL_CamSetAngles_f | ( | void | ) | [static] |
Definition at line 323 of file cl_camera.c.
References cl, Cmd_Argc(), Cmd_Argv(), Com_Printf(), PITCH, ROLL, and YAW.
Referenced by CL_CameraInit().
static void CL_CamSetZoom_f | ( | void | ) | [static] |
Definition at line 337 of file cl_camera.c.
References cl, Cmd_Argc(), Cmd_Argv(), Com_Printf(), MAX_ZOOM, MIN_ZOOM, and cvar_s::value.
Referenced by CL_CameraInit().
static void CL_CenterCameraIntoMap_f | ( | void | ) | [static] |
Definition at line 352 of file cl_camera.c.
References cl, and VectorCenterFromMinsMaxs().
Referenced by CL_CameraInit().
static void CL_ClampCamToMap | ( | const float | border | ) | [inline, static] |
forces the camera to stay within the horizontal bounds of the map plus some border
Definition at line 69 of file cl_camera.c.
References cl.
Referenced by CL_CameraMove().
qboolean cameraRoute = qfalse [static] |
Definition at line 34 of file cl_camera.c.
Referenced by CL_CameraMove(), and CL_CameraRoute().
cvar_t* cl_cammoveaccel [static] |
Definition at line 57 of file cl_camera.c.
cvar_t* cl_cammovespeed [static] |
Definition at line 56 of file cl_camera.c.
cvar_t* cl_campitchmax [static] |
Definition at line 59 of file cl_camera.c.
cvar_t* cl_campitchmin [static] |
Definition at line 58 of file cl_camera.c.
cvar_t* cl_camrotspeed [static] |
Definition at line 55 of file cl_camera.c.
Definition at line 60 of file cl_camera.c.
Definition at line 62 of file cl_camera.c.
Referenced by CL_ViewCalcFieldOfViewX().
Definition at line 61 of file cl_camera.c.
Definition at line 63 of file cl_camera.c.
Referenced by LE_CenterView().
const float MAX_ZOOM = 32.0 |
Definition at line 39 of file cl_camera.c.
Referenced by CL_CameraMove(), CL_CameraZoomIn(), and CL_CamSetZoom_f().
const float MIN_ZOOM = 0.5 |
Definition at line 38 of file cl_camera.c.
Referenced by CL_CameraMove(), CL_CameraZoomOut(), CL_CamSetZoom_f(), and SEQ_SetCamera().
vec3_t routeDelta [static] |
Definition at line 35 of file cl_camera.c.
Referenced by CL_CameraMove(), and CL_CameraRoute().
float routeDist [static] |
Definition at line 36 of file cl_camera.c.
Referenced by CL_CameraMove(), and CL_CameraRoute().
Definition at line 35 of file cl_camera.c.
Referenced by CL_CameraMove(), and CL_CameraRoute().