UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cl_camera.h File Reference

Go to the source code of this file.

Data Structures

struct  camera_s
 

Macros

#define FOV   75.0
 
#define CAMERA_START_DIST   600
 
#define CAMERA_START_HEIGHT   UNIT_HEIGHT * 1.5
 
#define CAMERA_LEVEL_HEIGHT   UNIT_HEIGHT
 

Typedefs

typedef struct camera_s camera_t
 

Functions

void CL_CameraInit (void)
 
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. More...
 
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. More...
 
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. More...
 
void CL_CameraZoomIn (void)
 Zooms the scene of the battlefield in. More...
 
void CL_CameraZoomOut (void)
 Zooms the scene of the battlefield out. More...
 

Variables

cvar_tcl_centerview
 
cvar_tcl_camzoommax
 
cvar_tcl_camzoommin
 
cvar_tcl_camzoomquant
 
const float MIN_ZOOM
 
const float MAX_ZOOM
 

Macro Definition Documentation

#define CAMERA_LEVEL_HEIGHT   UNIT_HEIGHT

Definition at line 45 of file cl_camera.h.

Referenced by CL_CameraMove().

#define CAMERA_START_DIST   600

Definition at line 43 of file cl_camera.h.

Referenced by CL_CameraMove().

#define CAMERA_START_HEIGHT   UNIT_HEIGHT * 1.5

Definition at line 44 of file cl_camera.h.

Referenced by CL_CameraMove().

#define FOV   75.0

Definition at line 42 of file cl_camera.h.

Referenced by CL_ViewCalcFieldOfViewX().

Typedef Documentation

typedef struct camera_s camera_t

Function Documentation

void CL_CameraInit ( void  )
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.

See also
CL_CameraMove
CL_ViewCenterAtGridPosition
Parameters
[in]fromThe grid position to start the camera movement from
[in]targetThe grid position to move the camera to

Definition at line 250 of file cl_camera.cpp.

References clientBattleScape_s::cam, cameraRoute, cl, CL_BlockBattlescapeEvents(), Cvar_SetValue(), cvar_s::integer, camera_s::origin, PosToVec, routeDelta, routeDist, routeFrom, camera_s::speed, UNIT_SIZE, VectorClear, VectorCompareEps(), VectorCopy, VectorLength(), VectorNormalize(), and VectorSubtract.

Referenced by CL_CheckCameraRoute().

void CL_CameraZoomIn ( void  )

Zooms the scene of the battlefield in.

Definition at line 302 of file cl_camera.cpp.

References clientBattleScape_s::cam, cl, CL_ViewCalcFieldOfViewX(), MAX_CAMZOOM_QUANT, MAX_ZOOM, MIN_CAMZOOM_QUANT, cvar_s::value, and camera_s::zoom.

Referenced by CL_ZoomInQuant_f(), and uiBattleScapeNode::onScroll().

void CL_CameraZoomOut ( void  )

Zooms the scene of the battlefield out.

Definition at line 325 of file cl_camera.cpp.

References clientBattleScape_s::cam, cl, CL_ViewCalcFieldOfViewX(), MAX_CAMZOOM_QUANT, MIN_CAMZOOM_QUANT, MIN_ZOOM, cvar_s::value, and camera_s::zoom.

Referenced by CL_ZoomOutQuant_f(), and uiBattleScapeNode::onScroll().

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 at line 285 of file cl_camera.cpp.

References clientBattleScape_s::cam, cl, CL_CameraRoute(), Cvar_SetValue(), camera_s::origin, VecToPos, and Vector2Dist.

Referenced by CL_ActorAppear(), CL_ActorStartShoot(), CL_MoveView(), and LE_CenterView().

Variable Documentation

cvar_t* cl_camzoommax

Definition at line 66 of file cl_camera.cpp.

cvar_t* cl_camzoommin

Definition at line 68 of file cl_camera.cpp.

Referenced by CL_ViewCalcFieldOfViewX().

cvar_t* cl_camzoomquant

Definition at line 67 of file cl_camera.cpp.

cvar_t* cl_centerview

Definition at line 69 of file cl_camera.cpp.

Referenced by LE_CenterView().

const float MAX_ZOOM

Definition at line 44 of file cl_camera.cpp.

Referenced by CL_CameraMove(), CL_CameraZoomIn(), and CL_CamSetZoom_f().

const float MIN_ZOOM

Definition at line 40 of file cl_camera.cpp.

Referenced by CL_CameraMove(), CL_CameraZoomOut(), CL_CamSetZoom_f(), and SEQ_SetCamera().