*******************************************************************************/
-#include <iostream>
-#include <Moof/Camera.hh>
-#include <Moof/OpenGL.hh>
+#include "Camera.hh"
+#include "OpenGL.hh"
namespace Mf {
projection_ = projection;
}
-void Camera::setProjection(Scalar fovy, Scalar aspect, Scalar near, Scalar far)
+void Camera::setProjection(Scalar fovy, Scalar aspect, Scalar abutting,
+ Scalar distant)
{
- cml::matrix_perspective_yfov_RH(projection_, fovy, aspect, near, far,
- cml::z_clip_neg_one);
-
+ cml::matrix_perspective_yfov_RH(projection_, fovy, aspect, abutting,
+ distant, cml::z_clip_neg_one);
calculateSecondary();
}
-void Camera::uploadProjectionToGL() const
+void Camera::uploadToGL() const
{
glMatrixMode(GL_PROJECTION);
- glLoadMatrix(projection_.data());
+ glMultMatrix(projection_.data());
glMatrixMode(GL_MODELVIEW);
+ glMultMatrix(modelview_.data());
}
void Camera::update(Scalar t, Scalar dt)
void Camera::lookAt(const Vector3& point)
{
- cml::quaternion_rotation_aim_at(rotation_, position_, point, Vector3(0.0, -1.0, 0.0));
+ cml::quaternion_rotation_aim_at(rotation_, position_, point,
+ Vector3(0.0, -1.0, 0.0));
calculateSecondary();
}