home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Amiga / Jeux / demos / crystalPPC.lha / sector.h < prev    next >
C/C++ Source or Header  |  1998-01-15  |  2KB  |  78 lines

  1. #ifndef SECTOR_H
  2. #define SECTOR_H
  3.  
  4. #ifndef DEF_H
  5. #include "def.h"
  6. #endif
  7.  
  8. #ifndef MATH3D_H
  9. #include "math3d.h"
  10. #endif
  11.  
  12. #ifndef POLYSET_H
  13. #include "polyset.h"
  14. #endif
  15.  
  16. class Thing;
  17. class Light;
  18. class Polygon3D;
  19. class ViewPolygon;
  20. class Camera;
  21. class World;
  22. class DynLight;
  23. #if USE_OCCLUSION
  24. class Occlusion;
  25. #endif
  26.  
  27. class Sector : public PolygonSet
  28. {
  29. private:
  30.   Thing* first_thing;
  31. #if USE_OCCLUSION
  32.   Occlusion* first_occlusion;
  33. #endif
  34.   Light* lights[16];
  35.   int num_lights;
  36.   int draw_done;
  37.   int beam_done;
  38.   int level1, level2, level3;
  39.  
  40. public:
  41.   Sector (char* name, int max_v, int max_p);
  42.   ~Sector ();
  43.  
  44.   void add_thing (Thing* thing);
  45. #if USE_OCCLUSION
  46.   void add_occlusion (Occlusion* occlusion);
  47. #endif
  48.   void add_light (Light* light);
  49.  
  50.   Thing* get_thing (char* name);
  51.  
  52.   int get_level1 () { return level1; }
  53.   int get_level2 () { return level2; }
  54.   int get_level3 () { return level3; }
  55.  
  56.   Polygon3D* hit_beam (Vector3& start, Vector3& end);
  57.   int hit_beam (Vector3& start, Vector3& end, Polygon3D* poly);
  58.   void mipmap_settings (int setting);
  59.   void shine (Light* light);
  60.   void shine_lights ();
  61.   void clear_shine_done ();
  62.   void draw (ViewPolygon* view, Matrix3& m_w2c, Matrix3& m_c2w, Vector3& v_w2c);
  63.   void setup_dyn_light (DynLight* light);
  64.   DynLight* add_dyn_light (float x, float y, float z, float dist, float strenght,
  65.                float red_strength, float blue_strength);
  66.  
  67.   void save (FILE* fp, int indent, Textures* textures);
  68.   void load (World* w, char** buf, Textures* textures);
  69.   void load_room (World* w, char** buf, Textures* textures);
  70.  
  71.   Light** get_lights () { return lights; }
  72.   int get_num_lights () { return num_lights; }
  73.  
  74.   Polygon3D* select_polygon (Camera* c, ViewPolygon* view, int xx, int yy);
  75. };
  76.  
  77. #endif /*SECTOR_H*/
  78.