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-14 22:42:10 +0000
committerStijn Buys <ingar@osirion.org>2008-07-14 22:42:10 +0000
commitd10188594d789796fbc9f5c147aa999a2dc58725 (patch)
tree0ad90f7d2a303bdb8a3517a89bc8f3c195653cc6 /src/render
parentc297e7f00dc8dae522afe816365a282fae40d254 (diff)
fix camera position in track mode, fix z-buffer issues, added draw_location
Diffstat (limited to 'src/render')
-rw-r--r--src/render/camera.cc4
-rw-r--r--src/render/draw.cc18
2 files changed, 7 insertions, 15 deletions
diff --git a/src/render/camera.cc b/src/render/camera.cc
index a55038d..287e4ad 100644
--- a/src/render/camera.cc
+++ b/src/render/camera.cc
@@ -265,8 +265,8 @@ void Camera::draw(float seconds)
}
if (core::localcontrol()->model()) {
- camera_target -= (core::localcontrol()->model()->maxbbox().x + 0.1f) * camera_axis.forward();
- camera_target += (core::localcontrol()->model()->maxbbox().z + 0.1f ) * camera_axis.up();
+ camera_target -= (core::localcontrol()->model()->maxbbox().x + core::localcontrol()->model()->radius() + 0.1f) * 0.5f * camera_axis.forward();
+ camera_target += (core::localcontrol()->model()->maxbbox().z + core::localcontrol()->model()->radius() + 0.1f) * 0.5f * camera_axis.up();
}
} else if (mode() == Free) {
diff --git a/src/render/draw.cc b/src/render/draw.cc
index d1b06ea..c650169 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -716,14 +716,14 @@ void draw_pass_sky()
if (!(r_sky && r_sky->value()))
return;
- size_t flare_texture = Textures::load("textures/env/sky");
- Textures::bind(flare_texture);
+ size_t sky_texture = Textures::load("textures/env/sky");
+ Textures::bind(sky_texture);
gl::enable(GL_TEXTURE_2D);
gl::push();
gl::translate(Camera::eye());
- draw_sphere_inside(math::Color(), 16000);
+ draw_sphere_inside(math::Color(), 8192);
gl::pop();
gl::disable(GL_TEXTURE_2D);
@@ -784,7 +784,7 @@ void draw(float seconds)
gl::matrixmode(GL_PROJECTION);
gl::loadidentity();
gl::frustum(-frustum_size*Camera::aspect(), frustum_size*Camera::aspect(),
- -frustum_size, frustum_size, frustum_front, 16384.0f);
+ -frustum_size, frustum_size, frustum_front, 8192.0f);
gl::matrixmode(GL_MODELVIEW);
gl::loadidentity();
@@ -826,16 +826,8 @@ void draw(float seconds)
draw_pass_default(); // draw entities without model
- gl::disable(GL_RESCALE_NORMAL);
-
- // adjust the projection matrix for local world view
- gl::matrixmode(GL_PROJECTION);
- gl::loadidentity();
- gl::frustum(-frustum_size*Camera::aspect(), frustum_size*Camera::aspect(),
- -frustum_size, frustum_size, frustum_front, 1024.0f);
- gl::matrixmode(GL_MODELVIEW);
-
glEnableClientState(GL_COLOR_ARRAY);
+ gl::disable(GL_RESCALE_NORMAL);
draw_pass_model_vertex(); // draw entities with model