X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FCamera.hh;h=fae25079ec700d88d7e1a5edb1baff0e3324874e;hp=8b3b1dabe12e2760612b25554cf3c5007cb22dcf;hb=57b78ebe21b1b48acd337daa5a1cb8c383959cfa;hpb=29e3d45f7bbbf31eadf793c41ff2b3d9c47b7539 diff --git a/src/Moof/Camera.hh b/src/Moof/Camera.hh index 8b3b1da..fae2507 100644 --- a/src/Moof/Camera.hh +++ b/src/Moof/Camera.hh @@ -30,6 +30,7 @@ #define _MOOF_CAMERA_HH_ #include +#include #include #include @@ -45,37 +46,42 @@ public: Camera() : position_(0.0, 0.0, 0.0) { - quaternion_rotation_world_y(rotation_, 0.0); - srcRotation_ = rotation_; - dstRotation_ = rotation_; + cml::quaternion_rotation_world_y(rotation_, 0.0f); 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& getTransformation() const + const Matrix4& getModelviewMatrix() const { - return transformation_; + return modelview_; } - void adjustFromInput(const Event& event); + 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 transformation_; + Matrix4 modelview_; + Frustum frustum_; Lerpv3 pInterp_; - - Quaternion srcRotation_; - Quaternion dstRotation_; - Scalar tInterp_; };