]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Camera.cc
fixed layer bugs; generalized octree
[chaz/yoink] / src / Moof / Camera.cc
index b38dd143cf04a51bc4dc30068a322ea77e073a42..6b6cfa1ac8572a26f6d8a558177813d9a342e434 100644 (file)
@@ -26,9 +26,8 @@
 
 *******************************************************************************/
 
-#include <iostream>
-#include <Moof/Camera.hh>
-#include <Moof/OpenGL.hh>
+#include "Camera.hh"
+#include "OpenGL.hh"
 
 
 namespace Mf {
@@ -52,21 +51,22 @@ void Camera::setProjection(const Matrix4& projection)
        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)
@@ -80,11 +80,12 @@ 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();
 }
 
-void Camera::adjustFromInput(const Event& event)
+void Camera::handleEvent(const Event& event)
 {
        switch (event.type)
        {
This page took 0.021068 seconds and 4 git commands to generate.