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