You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

57 lines
1.3 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. //
  11. // The Camera class
  12. // ----------------
  13. //
  14. #if !defined __CAMERA_H__
  15. #define __CAMERA_H__
  16. #include "worldentity.h"
  17. namespace lol
  18. {
  19. class Camera : public WorldEntity
  20. {
  21. public:
  22. Camera(vec3 const &position, vec3 const &target, vec3 const &up);
  23. ~Camera();
  24. char const *GetName() { return "<camera>"; }
  25. void SetPosition(vec3 const &pos);
  26. void SetRotation(quat const &rot);
  27. void SetOrtho(float width, float height, float near, float far);
  28. void SetPerspective(float fov, float width, float height,
  29. float near, float far);
  30. void SetTarget(vec3 const &pos);
  31. vec3 GetTarget();
  32. vec3 GetPosition();
  33. mat4 const &GetViewMatrix();
  34. mat4 const &GetProjMatrix();
  35. protected:
  36. virtual void TickGame(float seconds);
  37. virtual void TickDraw(float seconds);
  38. private:
  39. mat4 m_view_matrix, m_proj_matrix;
  40. vec3 m_target, m_up;
  41. };
  42. } /* namespace lol */
  43. #endif /* __CAMERA_H__ */