Camera.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef CAMERA_H_
  2. #define CAMERA_H_
  3. #include "Object.h"
  4. namespace gameplay
  5. {
  6. class Camera : public Object
  7. {
  8. public:
  9. /**
  10. * Constructor.
  11. */
  12. Camera(void);
  13. /**
  14. * Destructor.
  15. */
  16. virtual ~Camera(void);
  17. virtual unsigned int getTypeId(void) const;
  18. virtual const char* getElementName(void) const;
  19. virtual void writeBinary(FILE* file);
  20. virtual void writeText(FILE* file);
  21. void setPerspective();
  22. void setOrthographic();
  23. void setAspectRatio(float value);
  24. void setNearPlane(float value);
  25. void setFarPlane(float value);
  26. void setViewportWidth(float width);
  27. void setViewportHeight(float height);
  28. void setFieldOfView(float value);
  29. float getViewPortWidth();
  30. float getViewPortHeight();
  31. enum CameraType
  32. {
  33. CameraPerspective = 1,
  34. CameraOrthographic = 2
  35. };
  36. private:
  37. unsigned char _cameraType;
  38. float _fieldOfView;
  39. float _aspectRatio;
  40. float _nearPlane;
  41. float _farPlane;
  42. float _viewportWidth;
  43. float _viewportHeight;
  44. };
  45. }
  46. #endif