Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-07-16 22:55:07 +0000
committerStijn Buys <ingar@osirion.org>2008-07-16 22:55:07 +0000
commiteb075660e7cb61b138c2da337115c59857f89e17 (patch)
tree0fe031a8f3562b22f61d0f95b740fe5f2326fd7b /src/render/camera.cc
parentfecc54ad8c5a108831c2bc268f9dd7e16b511b7e (diff)
network protocol cleanup, radar test (doesn't work)
Diffstat (limited to 'src/render/camera.cc')
-rw-r--r--src/render/camera.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/render/camera.cc b/src/render/camera.cc
index 287e4ad..8fe84a7 100644
--- a/src/render/camera.cc
+++ b/src/render/camera.cc
@@ -150,9 +150,8 @@ void Camera::next_mode()
}
}
-void Camera::draw(float seconds)
+void Camera::frame(float seconds)
{
- math::Matrix4f matrix;
math::Axis target_axis;
float d = 0;
@@ -304,14 +303,28 @@ void Camera::draw(float seconds)
distance += frustum_front;
+ // calculate eye position
+ camera_eye = camera_target - (distance * camera_axis.forward());
+}
+
+void Camera::draw()
+{
+ // Change to the projection matrix and set our viewing volume large enough for the skysphere
+ gl::matrixmode(GL_PROJECTION);
+ gl::loadidentity();
+ gl::frustum(-frustum_size*Camera::aspect(), frustum_size*Camera::aspect(),
+ -frustum_size, frustum_size, frustum_front, 2048.0f);
+
+ gl::matrixmode(GL_MODELVIEW);
+ gl::loadidentity();
+
// map world coordinates to opengl coordinates
gl::rotate(90.0f, 0, 1.0, 0);
gl::rotate(-90.0f, 1.0f , 0, 0);
- // assign transformation matrix
- matrix.assign(camera_axis);
-
// apply the transpose of the axis transformation (the axis is orhtonormal)
+ math::Matrix4f matrix;
+ matrix.assign(camera_axis);
gl::multmatrix(matrix.transpose());
// match the camera with the current target
@@ -319,9 +332,6 @@ void Camera::draw(float seconds)
// apply camera offset
gl::translate(distance * camera_axis.forward());
-
- // calculate eye position
- camera_eye = camera_target - (distance * camera_axis.forward());
}
void Camera::set_direction(float direction)