#ifndef _CHASECAM_H
#define _CHASECAM_H

//////////////////////////////////////////////////////////////////////
//	globals
//////////////////////////////////////////////////////////////////////

extern	userEntity_t	*cam_debug_target;

//////////////////////////////////////////////////////////////////////
//	typedefs
//////////////////////////////////////////////////////////////////////

typedef	struct	cameraHook_s
{
	think_t			pre_think;	// routine called each frame for an
								// active camera
	think_t			post_think;	// routine called each frame for an
								// active camera
	int				mode;
	int				demonic;

	float			follow_dist;
	float			target_dist;
	float			next_change;
	float			min_change_time;
	float			speed;
	float			max_speed;

	Vector			view_angle;	// the current angle we are viewing from
	Vector			ideal_angle;// the final angle we want to view from

	Vector			target_angles;	//	last angles of target
	
	Vector			best_org;
	Vector			best_dir;

	// for taking over the target entity
	think_t			target_think;
	think_t			target_prethink;
	think_t			target_postthink;
	unsigned long	target_ai_flags;
	char			target_th_state;
	int				target_movetype;
} cameraHook_t;


void	camera_set_viewangle (userEntity_t *client, Vector &ang);

void	camera_start				(userEntity_t *self);
void	camera_stop					(userEntity_t *self);
void	camera_toggle				(userEntity_t *self);
void	camera_set_target			(userEntity_t *camera, userEntity_t *target);
void	camera_next_monster			(userEntity_t *self);
void	camera_prev_monster			(userEntity_t *self);
void	camera_mode					(userEntity_t *self, int cmode);
void	camera_debug				(userEntity_t *self);
void	camera_toggle_possession	(userEntity_t *self);
void	camera_toggle_gravity		(userEntity_t *self);
void	camera_set_debug_target		(userEntity_t *self);
void	camera_toggle_debug_target	(userEntity_t *self);
void	camera_kill_target			(userEntity_t *self);
void	camera_lock					(userEntity_t *self);
void	camera_force_enemy			(userEntity_t *self);
#endif