Initial Import
[glAntsMech.git] / glants_mech / linux / src / camera.h
blob5723d1874891df58e33835e92fc98e76e56cb254
1 //
2 // Berlin Brown
3 // bigbinc@hotmail.com
4 //
5 #ifndef _CAMERA_H_
6 #define _CAMERA_H_
8 #include "bot.h"
10 #define MAX_ZOOM 45.2f
12 #define OFFSET_ROTATION 8.0f
14 #define PI_1 3.141592654f
16 #define PI (3.14159265358f)
17 #define PI_180 (PI_1 / 180.0f)
19 #define CAMERA driver_camera[current_camera]
21 typedef float Vector[3];
23 #define MAX_CAMERAS 4
26 #define BEGIN_CAMERA glPushMatrix(); SetCamera();
27 #define END_CAMERA glPopMatrix();
29 #define SELECT_CAMERA(cam_id) current_camera = cam_id
31 #define CAMERA_STATIC 0
32 #define CAMERA_WALKING 1
34 //----------------------------------
35 // define a camera struct
36 //..................................
37 typedef struct tagCamera
40 float position[3]; // current location
41 float angle[3]; // angle camera is pointing
42 float rotation[3]; // rotation around the world
43 float centerx; // center axis
44 float centery;
45 float centerz; // center axis x, y, z
47 float Yaw;
48 float Pitch;
49 float Roll;
51 float zoom_factor;
52 float old_zoom; // save zoom
54 int id; // id number for camera
55 int type; // camera TYPE
57 } DriverCamera;
60 void Vector_Normalize(Vector a, Vector res);
62 void HandleCameraKeys(bool *keys);
65 float GetBotX(void);
66 float GetBotY(void);
68 void LoadCameras(void);
69 void ToggleCamera(void);
70 void SetCamera(void);
72 void TranslateCamera(float x, float y, float z);
73 void AngleCamera(float x, float y, float z);
74 void TurnCamera(float x, float y, float z);
76 void PosCamera(float x, float y, float z);
78 void SyncCamera(void);
80 void GetCameraBot(DriverBotPtr bot);
82 void SpringDamp(
83 Vector currPos,
84 Vector trgPos, // Target Position
85 Vector prevTrgPos, // Previous Target Position
86 Vector result,
88 float springConst, // Hooke's Constant
89 float dampConst, // Damp Constant
90 float springLen);
92 extern DriverCamera *driver_camera[MAX_CAMERAS];
93 extern int current_camera;
95 void ToggleViewMode(void);
98 #endif