X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FCamera.hh;h=72df5db6703fcc3d90e3c25fb615ccc3c250f7d5;hp=8800e3baf1fbf0b9f925d893459805df547988e0;hb=8ad81a8282ce6e9e488a453e6bcd05fbc09715dc;hpb=c2321281bf12a7efaedde930422c7ddbc92080d4 diff --git a/src/Moof/Camera.hh b/src/Moof/Camera.hh index 8800e3b..72df5db 100644 --- a/src/Moof/Camera.hh +++ b/src/Moof/Camera.hh @@ -29,14 +29,59 @@ #ifndef _MOOF_CAMERA_HH_ #define _MOOF_CAMERA_HH_ +#include +#include +#include +#include + namespace Mf { class Camera { + void calculateSecondary(); + public: + Camera() : + position_(0.0, 0.0, 0.0) + { + cml::quaternion_rotation_world_y(rotation_, 0.0); + calculateSecondary(); + } + + void setPosition(const Vector3& point); + void setRotation(const Quaternion& rotation); + + void setProjection(const Matrix4& projection); + void setProjection(Scalar fovy, Scalar aspect, Scalar near, Scalar far); + + void uploadProjectionToGL() const; + + void lookAt(const Vector3& point); + + const Matrix4& getModelviewMatrix() const + { + return modelview_; + } + + const Frustum& getFrustum() const + { + return frustum_; + } + + void handleEvent(const Event& event); + void update(Scalar t, Scalar dt); + private: + Vector3 position_; + Quaternion rotation_; + Matrix4 projection_; + + Matrix4 modelview_; + Frustum frustum_; + + Lerpv3 pInterp_; };