UFO: Alien Invasion
cl_camera.h
Go to the documentation of this file.
1
5/*
6All original material Copyright (C) 2002-2022 UFO: Alien Invasion.
7
8Original file from Quake 2 v3.21: quake2-2.31/client/cl_input.c
9Copyright (C) 1997-2001 Id Software, Inc.
10
11This program is free software; you can redistribute it and/or
12modify it under the terms of the GNU General Public License
13as published by the Free Software Foundation; either version 2
14of the License, or (at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
20See the GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with this program; if not, write to the Free Software
24Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26*/
27
28#pragma once
29
30typedef struct camera_s {
36 vec3_t axis[3];
38 float lerplevel;
39 float zoom;
40} camera_t;
41
42#define FOV 75.0
43#define CAMERA_START_DIST 600
44#define CAMERA_START_HEIGHT UNIT_HEIGHT * 1.5
45#define CAMERA_LEVEL_HEIGHT UNIT_HEIGHT
46
47extern cvar_t* cl_centerview;
48extern cvar_t* cl_camzoommax;
49extern cvar_t* cl_camzoommin;
51
52extern const float MIN_ZOOM, MAX_ZOOM;
53
54void CL_CameraInit(void);
55void CL_CameraMove(void);
56void CL_CameraRoute(const pos3_t from, const pos3_t target);
57void CL_CheckCameraRoute(const pos3_t from, const pos3_t target);
58void CL_CameraZoomIn(void);
59void CL_CameraZoomOut(void);
void CL_CheckCameraRoute(const pos3_t from, const pos3_t target)
Only moves the camera to the given target location if its not yet close enough.
Definition: cl_camera.cpp:285
cvar_t * cl_centerview
Definition: cl_camera.cpp:69
void CL_CameraMove(void)
Update the camera position. This can be done in two different reasons. The first is the user input,...
Definition: cl_camera.cpp:93
cvar_t * cl_camzoommax
Definition: cl_camera.cpp:66
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.
Definition: cl_camera.cpp:250
void CL_CameraZoomIn(void)
Zooms the scene of the battlefield in.
Definition: cl_camera.cpp:302
cvar_t * cl_camzoommin
Definition: cl_camera.cpp:68
cvar_t * cl_camzoomquant
Definition: cl_camera.cpp:67
void CL_CameraZoomOut(void)
Zooms the scene of the battlefield out.
Definition: cl_camera.cpp:325
void CL_CameraInit(void)
Definition: cl_camera.cpp:391
const float MAX_ZOOM
Definition: cl_camera.h:52
const float MIN_ZOOM
Definition: cl_camera.cpp:40
vec3_t camorg
Definition: cl_camera.h:32
float lerplevel
Definition: cl_camera.h:38
vec3_t origin
Definition: cl_camera.h:31
float zoom
Definition: cl_camera.h:39
vec3_t angles
Definition: cl_camera.h:34
vec3_t speed
Definition: cl_camera.h:33
vec3_t omega
Definition: cl_camera.h:35
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
Definition: cvar.h:71
pos_t pos3_t[3]
Definition: ufotypes.h:58
vec_t vec3_t[3]
Definition: ufotypes.h:39