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];
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
45 float centerz
; // center axis x, y, z
52 float old_zoom
; // save zoom
54 int id
; // id number for camera
55 int type
; // camera TYPE
60 void Vector_Normalize(Vector a
, Vector res
);
62 void HandleCameraKeys(bool *keys
);
68 void LoadCameras(void);
69 void ToggleCamera(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
);
84 Vector trgPos
, // Target Position
85 Vector prevTrgPos
, // Previous Target Position
88 float springConst
, // Hooke's Constant
89 float dampConst
, // Damp Constant
92 extern DriverCamera
*driver_camera
[MAX_CAMERAS
];
93 extern int current_camera
;
95 void ToggleViewMode(void);