summaryrefslogtreecommitdiff
path: root/src/gui/Camera.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/Camera.h')
-rw-r--r--src/gui/Camera.h33
1 files changed, 8 insertions, 25 deletions
diff --git a/src/gui/Camera.h b/src/gui/Camera.h
index f5ce954..8ea35d0 100644
--- a/src/gui/Camera.h
+++ b/src/gui/Camera.h
@@ -9,7 +9,6 @@
#define CAMERA_H_
#include <cmath>
#include <QtOpenGL>
-#include "exceptions.h"
#include "Vector3D.h"
namespace vhc {
@@ -26,37 +25,21 @@ private:
public:
- Camera(): position(1, 1, 1), direction(-1, 0, 0), up(0,0,1), heading(M_PI_4), pitch(-M_PI_4) {};
+ Camera();
virtual ~Camera() {};
- void setView() {
- Vector3D td = direction.rotate(Vector3D::j, pitch).rotate(Vector3D::k, heading);; //tranformed direction
- Vector3D at = position + td;
+ void setView();
- gluLookAt(position.getX(), position.getY(), position.getZ(),
- at.getX(), at.getY(), at.getZ(),
- up.getX(), up.getY(), up.getZ());
- }
+ void addHeading(double h);
- void addHeading(double h) {
- heading += h;
- }
+ void addPitch(double h);
- void addPitch(double h) {
- pitch += h;
- if (pitch <= -M_PI_2) pitch = -M_PI_2 + 0.001;
- if (pitch >= M_PI_2) pitch = M_PI_2 - 0.001;
- }
+ void move(const Vector3D& moveVector);
- void move(const Vector3D& moveVector) {
- Vector3D mv = moveVector.rotate(Vector3D::j, pitch).rotate(Vector3D::k, heading);
- position = position + mv;
- }
-
- Vector3D getPosition() {return position;}
- double getHeading() {return heading;}
- double getPitch() {return pitch;}
+ Vector3D getPosition() const;
+ double getHeading() const;
+ double getPitch() const;
};