Camera3D.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef CAMERA3D_H
  2. #define CAMERA3D_H
  3. #include "client/math/Vector3D.h"
  4. #include "client/math/Matrix3D.h"
  5. #include "client/math/Plane3D.h"
  6. class Camera3D
  7. {
  8. public:
  9. Camera3D();
  10. virtual ~Camera3D();
  11. bool isInFrustum(float x, float y, float z, float x2, float y2, float z2) const;
  12. void addToOldLengthAngle(float f);
  13. void storePosition();
  14. void setPosition(float x, float y, float z, float length, float width);
  15. const Vector3D& getFlatFront() const;
  16. const Vector3D& getFlatBack() const;
  17. const Vector3D& getFlatRight() const;
  18. const Vector3D& getFlatLeft() const;
  19. const Vector3D& getFlatUp() const;
  20. const Vector3D& getFlatDown() const;
  21. void update(float lag);
  22. const float* getViewMatrix();
  23. private:
  24. Vector3D oldCamera;
  25. Vector3D camera;
  26. float oldLengthAngle;
  27. float lengthAngle;
  28. float oldWidthAngle;
  29. float widthAngle;
  30. Vector3D front;
  31. Vector3D back;
  32. Vector3D right;
  33. Vector3D left;
  34. Vector3D up;
  35. Vector3D down;
  36. Vector3D flatFront;
  37. Vector3D flatBack;
  38. Vector3D flatRight;
  39. Vector3D flatLeft;
  40. Vector3D flatUp;
  41. Vector3D flatDown;
  42. Matrix3D view;
  43. Plane3D frustumPlanes[6];
  44. };
  45. #endif