
#ifndef CAMERA_H_
#define CAMERA_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <math.h>
#include "vertex.h"
#include "coord.h"

#define CAMERA_COEF_POS_1	0.0025f
#define CAMERA_COEF_POS_2	0.00025f
#define CAMERA_COEF_ROT_1	0.005f
#define CAMERA_COEF_ROT_2	0.0005f

enum	e_camera_mode
{
	CAMERA_MODE_INSTANT,
	CAMERA_MODE_RELATIVE,
	CAMERA_MODE_SPEED
};

struct					s_camera_part
{
	enum e_camera_mode	mode_pos;
	enum e_camera_mode	mode_rot;
	struct s_coord		coord_actual;
	struct s_coord		coord_speed;
	struct s_coord		coord_target;
	float				coef_pos_1;
	float				coef_pos_2;
	float				coef_rot_1;
	float				coef_rot_2;
};

struct						s_camera
{
	struct s_camera_part	part_focus;
	struct s_camera_part	part_shift;
	struct s_coord*			focus;
	struct s_coord*			shift;
	char					modulo;
	char					reset;
};

void	camera_begin (struct s_camera *);
void	camera_coef_pos (struct s_camera *, float, float, float, float);
void	camera_coef_rot (struct s_camera *, float, float, float, float);
void	camera_define (struct s_camera *);
void	camera_mode (struct s_camera *, enum e_camera_mode, enum e_camera_mode, enum e_camera_mode, enum e_camera_mode, char);
void	camera_stop (void);

#ifdef __cplusplus
}
#endif

#endif
