X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FCamera.hh;h=8b3b1dabe12e2760612b25554cf3c5007cb22dcf;hp=8800e3baf1fbf0b9f925d893459805df547988e0;hb=29e3d45f7bbbf31eadf793c41ff2b3d9c47b7539;hpb=16d1a05b0777e97a45c48e2874aa4e5cc791282e diff --git a/src/Moof/Camera.hh b/src/Moof/Camera.hh index 8800e3b..8b3b1da 100644 --- a/src/Moof/Camera.hh +++ b/src/Moof/Camera.hh @@ -29,14 +29,53 @@ #ifndef _MOOF_CAMERA_HH_ #define _MOOF_CAMERA_HH_ +#include +#include +#include + namespace Mf { class Camera { + void calculateSecondary(); + public: + Camera() : + position_(0.0, 0.0, 0.0) + { + quaternion_rotation_world_y(rotation_, 0.0); + srcRotation_ = rotation_; + dstRotation_ = rotation_; + calculateSecondary(); + } + + void setPosition(const Vector3& point); + void setRotation(const Quaternion& rotation); + + void lookAt(const Vector3& point); + + const Matrix4& getTransformation() const + { + return transformation_; + } + + void adjustFromInput(const Event& event); + + void update(Scalar t, Scalar dt); + private: + Vector3 position_; + Quaternion rotation_; + + Matrix4 transformation_; + + Lerpv3 pInterp_; + + Quaternion srcRotation_; + Quaternion dstRotation_; + Scalar tInterp_; };