/*
 *  ZCam v1.0.4
 *  Spectator Camera for Quake III Arena
 *  Copyright (C), 2001 by Avi "Zung!" Rozen
 *	
 *  http://www.telefragged.com/zungbang/zcam
 *
 *  Credits:
 *  FLIC  camera mode is based on code  taken from q2cam by Paul Jordan
 *  SWING camera mode is based on ideas taken from CreepCam for Quake I 
 *
 */

#ifndef __ZCAM_H__
#define __ZCAM_H__

#define MAX_VISIBLE_RANGE		1000

/* camera mode */
typedef enum camera_mode_e {
    CAMERA_MODE_OFF,
    CAMERA_MODE_FLIC,
    CAMERA_MODE_SWING
} camera_mode_t;

/* camera data */
typedef struct camera_s {
    camera_mode_t mode;      // camera mode

    // swing mode
    float		swing_distance;   // distance behind player
    float		swing_height;     // height of camera
    float 	swing_angle;      // angle of camera
    float 	swing_yaw;	  // yaw of camera
    float		swing_pitch;      // pitch of camera
    gentity_t	*swing_target;
    gentity_t	*swing_secondry_target;
    vec3_t 	swing_last_viewangles;
    float         swing_msg_time;

    // flic mode
    gentity_t     *flic_target;
    qboolean      flic_watching_the_dead;
    qboolean	flic_watching_the_wall;
    vec3_t        flic_dead_origin;
    float         flic_xy_lag;
    float         flic_z_lag;
    float         flic_angle_lag;
    float		flic_last_move_time;
    float		flic_last_switch_time;
    qboolean	flic_override;	  // signal that player must be followed
}
camera_t;

void camera_init (void);
void camera_shutdown (void);
void camera_state_save (gclient_t *client);
void camera_state_load (gclient_t *client);
void camera_begin (gentity_t *ent);
void camera_disconnect (gentity_t *ent);
void camera_think (gentity_t *ent);
void camera_cmd (gentity_t *ent);

#endif /* __ZCAM_H__ */

