Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r--src/render/draw.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 5b64497..4b42596 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -35,6 +35,8 @@ const float drawdistance = 128.0f;
const float drawfxdistance = 32.0f;
math::Vector3f camera_target;
+math::Vector3f camera_eye;
+
float angle = 0;
@@ -43,13 +45,13 @@ float angle = 0;
inline bool test_draw_distance(core::Entity *entity)
{
return (entity->model() &&
- (math::distancesquared(camera_target, entity->location()) <= (drawdistance*drawdistance*entity->model()->radius())));
+ (math::distancesquared(camera_eye, entity->location()) <= (drawdistance*drawdistance*entity->model()->radius())));
}
inline bool test_drawfx_distance(core::Entity *entity)
{
return (entity->model() &&
- (math::distancesquared(camera_target, entity->location()) <= (drawfxdistance*drawfxdistance*entity->model()->radius())));
+ (math::distancesquared(camera_eye, entity->location()) <= (drawfxdistance*drawfxdistance*entity->model()->radius())));
}
@@ -483,7 +485,7 @@ void draw_local_axis()
}
/* ----- Main draw routine ----------------------------------------- */
-void draw(math::Vector3f const &target, float seconds)
+void draw(math::Vector3f const &eye, math::Vector3f const &target, float seconds)
{
Stats::clear();
@@ -493,7 +495,8 @@ void draw(math::Vector3f const &target, float seconds)
angle -= 360.0f;
}
- camera_target = target;
+ camera_target.assign(target);
+ camera_eye.assign(eye);
gl::enable(GL_DEPTH_TEST); // enable depth buffer writing
gl::enable(GL_CULL_FACE); // enable culling
@@ -545,11 +548,11 @@ void draw(math::Vector3f const &target, float seconds)
gl::disable(GL_COLOR_MATERIAL); // disable color tracking
gl::disable(GL_CULL_FACE); // disable culling
- draw_local_axis();
+ // draw_local_axis();
draw_pass_spacegrid(); // draw the blue spacegrid
- gl::disable(GL_DEPTH_TEST); // disable depth buffer writing
+ gl::disable(GL_DEPTH_TEST); // disable depth buffer
// GL_BLEND must be enabled for the GUI
}