home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / shareware / crystalppc / camera.h < prev    next >
C/C++ Source or Header  |  1998-06-08  |  1KB  |  66 lines

  1. #ifndef CAMERA_H
  2. #define CAMERA_H
  3.  
  4. #ifndef MATH3D_H
  5. #include "math3d.h"
  6. #endif
  7.  
  8. class Sector;
  9. class Polygon3D;
  10. class Vertex;
  11. class World;
  12.  
  13. #define MODE_NONE 0
  14. #define MODE_EDIT 1
  15. #define MODE_VERTEX 2
  16. #define MODE_POLYGON 3
  17. #define MODE_MOVE_VERTEX 4
  18.  
  19. #define MAX_SEL_VERTEX 20
  20.  
  21. #define SHIFT_VIEWPOINT -.3
  22.  
  23. class Camera
  24. {
  25. public:
  26.   Matrix3 m_world2cam;
  27.   Vector3 v_world2cam;
  28.   Vector3 v_viewpos;
  29.   Sector* sector;
  30.   Matrix3 m_cam2world;
  31.   int edit_mode;
  32.   Polygon3D* sel_polygon;
  33.   int num_sel_verts;
  34.   Vertex* sel_vertex[MAX_SEL_VERTEX];
  35.   int light_lev;
  36.  
  37. private:
  38.   void really_move (Vector3& new_position);
  39.  
  40. public:
  41.   Camera ();
  42.   ~Camera ();
  43.  
  44.   void save_file (char* filename);
  45.   void load_file (World* world, char* filename);
  46.  
  47.   void get_forward_position (float dist, Vector3& where);
  48.   Polygon3D* get_hit (Vector3& where);
  49.  
  50.   void turn_around ();
  51.   void forward (float dist);
  52.   void backward (float dist) { forward (-dist); }
  53.   void up (float dist);
  54.   void down (float dist) { up (-dist); }
  55.   void right (float dist);
  56.   void left (float dist) { right (-dist); }
  57.   void rot_right (float angle);
  58.   void rot_left (float angle) { rot_right (-angle); }
  59.   void rot_up (float angle);
  60.   void rot_down (float angle) { rot_up (-angle); }
  61.   void rot_z_right (float angle);
  62.   void rot_z_left (float angle) { rot_z_right (-angle); }
  63. };
  64.  
  65. #endif /*CAMERA_H*/
  66.