#ifndef DEF_SCENE_MAP #define DEF_SCENE_MAP #include #include #include "windmill.hpp" #include "game.hpp" #define EXIT 0 #define SCENE_TITLE 1 #define SCENE_MAP 2 #define SCENE_MAP_DEBUG 3 #define PI 3.1415 #define DEG 180.0 #define MAP_EXTERIOR_LIMIT 1000 #define COLLISION_NONE 0 #define COLLISION_GROUND 1 #define COLLISION_WALL 2 #define COLLISION_ON 3 #define COLLISION_CARA 4 #define COLLISION_BOUND 5 struct Collision_flag { int type; Object* object; }; struct Bbox3D { short x1, y1, z1; short x2, y2, z2; short radius; }; struct Location { float x, y, z; float yaw, pitch; }; class Scene_Map { public: Scene_Map(); void launch(); void update(); void draw(); void animation(); void player_action(); void load_map(); //Object* object(int id); void terminate(); ~Scene_Map(); void player_move(); void player_turn(); Collision_flag collision(float* new_x, float* new_y, float* new_z); void look(Object* object, float x, float y, float z, float yaw, float pitch); void lerp_camera(Camera camera_start, Camera camera_end, float t); // renvoie un pointeur vers l objet dont l id est connu Object* object(int id); // renvoie l id d un objet connu int id(Object* object); // retourne true si le joueur bool action_object(Object* object, int poly_id = -1); // retourne true si le joueur est proche du point (x,y,z) dans le repere de l'objet bool action_object(Object* object, float x, float y, float z); // retourne true le joueur regarde l objet [et le poly indique] bool look_object(Object* object, int poly_id = -1); Camera camera; float time_scene; // collision Bbox3D* bbox; Collision_flag flag; // histoire bool show_repere; bool show_coordinates; Camera camera_look; // camera ou regarder Camera camera_temp; // camera temporaire pour les transitions bool vue_horloge; bool vue_panneau_moulin; bool parle_avec_forgeron; Location position_pancarte_entrepot; }; #endif