camera.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. ===========================================================================
  3. Copyright (C) 1997-2006 Id Software, Inc.
  4. This file is part of Quake 2 Tools source code.
  5. Quake 2 Tools source code is free software; you can redistribute it
  6. and/or modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the License,
  8. or (at your option) any later version.
  9. Quake 2 Tools source code is distributed in the hope that it will be
  10. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Quake 2 Tools source code; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. ===========================================================================
  17. */
  18. // window system independent camera view code
  19. typedef enum
  20. {
  21. cd_wire,
  22. cd_solid,
  23. cd_texture,
  24. cd_blend
  25. } camera_draw_mode;
  26. typedef struct
  27. {
  28. int width, height;
  29. qboolean timing;
  30. vec3_t origin;
  31. vec3_t angles;
  32. camera_draw_mode draw_mode;
  33. vec3_t color; // background
  34. vec3_t forward, right, up; // move matrix
  35. vec3_t vup, vpn, vright; // view matrix
  36. } camera_t;
  37. extern camera_t camera;
  38. void Cam_Init ();
  39. void Cam_KeyDown (int key);
  40. void Cam_MouseDown (int x, int y, int buttons);
  41. void Cam_MouseUp (int x, int y, int buttons);
  42. void Cam_MouseMoved (int x, int y, int buttons);
  43. void Cam_MouseControl (float dtime);
  44. void Cam_Draw ();
  45. void Cam_HomeView ();
  46. void Cam_ChangeFloor (qboolean up);