/*
hjm_camera.h
*/


enum
	{
	CM_SEA_CENTERTOP=1,
	CM_LEFTSIDE,
	CM_START,
	CM_FOLLOW,
	CM_DEMOBEGIN,
	CM_DEMO,
	CM_FINISHDEMO,
	CM_ENDING,
	CM_MAX  /* the number of camera mode */
	};


struct Camera
	{
	/* criterional information */
	int camera_mode;  /* mode of the camera */
	float model_px;  /* position of the machine */
	float model_py;
	float model_pz;
	float model_vx;  /* velocity of the machine */
	float model_vy;
	float model_vz;
	float model_fx;  /* normalized vector of the front of the machine */
	float model_fy;
	float model_fz;
	float model_ux;  /* normalized vector of the up of the machine */
	float model_uy;
	float model_uz;
	float model_lx;  /* normalized vector of the left of the machine */
	float model_ly;
	float model_lz;
	float model_hpx;  /* position of the head of the rider */
	float model_hpy;
	float model_hpz;

	/* camera-functions set following */
	float camera_px;  /* position of the camera */
	float camera_py;
	float camera_pz;
	float camera_vx;  /* velocity of the camera */
	float camera_vy;
	float camera_vz;
	float camera_fx;  /* normalized vector of the forward of the camera */
	float camera_fy;
	float camera_fz;
	float camera_ux;  /* normalized vector of the up of the camera */
	float camera_uy;
	float camera_uz;
	float look_px;  /* position of the point at which camera look */
	float look_py;
	float look_pz;
	float camera_fov;  /* field of view angle in the y direction */
	float camera_cos;  /* cos(camera_ang) */
	float camera_sin;  /* sin(camera_ang) */
	float slide_x;  /* screen offset from viewing */
	float slide_y;
	float clip_near;  /* clip surface */
	float clip_far;

	/* matrix */
	Mtxf look_m;  /* view-matrix */
	ushort perspNorm;  /* for computing a perspective projection matrix */

	/* attribute */
	int number;  /* the order number of a camera */
	int game_camera_mode;  /* the mode of a camera in game */

	float camera_fx_2d;
	float camera_fz_2d;

	int game_camera_bank_flag;
	float model_py_offset;

	/* reserved */
	char reserved[12];
	};
typedef struct Camera Camera;


extern const int my_camera,your_camera;
extern Camera camera[];
extern int fCourseTitle;
extern int fFinishDemo;

void init_camera_boot(void);  /* at booting game */
void init_camera(void);  /* at changing the mode of a camera */
void move_camera(void);  /* move camera in each frames */
void camera_change_game(void);  /* change the mode of a camera in game */
Gfx *drawPolygonForCamera(Gfx *pGfx);  /* draw polygons for cameras */
