#ifndef _MOOF_CAMERA_HH_
#define _MOOF_CAMERA_HH_
+#include <Moof/Event.hh>
+#include <Moof/Frustum.hh>
+#include <Moof/Interpolator.hh>
+#include <Moof/Math.hh>
+
namespace Mf {
class Camera
{
+ void calculateSecondary();
+
public:
+ Camera() :
+ position_(0.0, 0.0, 0.0)
+ {
+ cml::quaternion_rotation_world_y(rotation_, SCALAR(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 uploadToGL() 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_;
+
+ Lerp3 pInterp_;
};