diff options
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r-- | src/render/draw.cc | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index 4305b4d..e9976b6 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -276,7 +276,10 @@ void draw_pass_default() if (!entity->model()) { gl::push(); gl::translate(entity->location()); - gl::rotate(entity->direction(), 0.0f, 0.0f, 1.0f ); + + // FIXME + //gl::rotate(entity->direction(), 0.0f, 0.0f, 1.0f ); + gl::multmatrix(entity->axis()); if ((entity->flags() & core::Entity::Bright) == core::Entity::Bright) gl::disable(GL_LIGHTING); @@ -326,7 +329,9 @@ void draw_pass_model_vertex() if (test_draw_distance(entity)) { gl::push(); gl::translate(entity->location()); - gl::rotate(entity->direction(), 0.0f, 0.0f, 1.0f ); + // FIXME + //gl::rotate(entity->direction(), 0.0f, 0.0f, 1.0f ); + gl::multmatrix(entity->axis()); draw_model_vertex(entity); @@ -346,7 +351,9 @@ void draw_pass_model_evertex() if (test_draw_distance(entity)) { gl::push(); gl::translate(entity->location()); - gl::rotate(entity->direction(), 0.0f, 0.0f, 1.0f ); + // FIXME + //gl::rotate(entity->direction(), 0.0f, 0.0f, 1.0f ); + gl::multmatrix(entity->axis()); draw_model_evertex(entity); @@ -366,7 +373,9 @@ void draw_pass_model_fx() { gl::push(); gl::translate(entity->location()); - gl::rotate(entity->direction(), 0.0f, 0.0f, 1.0f ); + // FIXME + //gl::rotate(entity->direction(), 0.0f, 0.0f, 1.0f ); + gl::multmatrix(entity->axis()); draw_model_lights(entity); @@ -436,6 +445,42 @@ void draw_pass_spacegrid() gl::pop(); } +void draw_local_axis() +{ + if (!core::localcontrol()) + return; + + gl::push(); + gl::translate(core::localcontrol()->location()); + + gl::begin(gl::Lines); + gl::color(0.5f, 0.0f,0.0f); + gl::vertex(core::localcontrol()->axis()[0] * -1.0f); + gl::color(1.0f, 0.0f, 0.0f); + gl::vertex(core::localcontrol()->axis()[0]); + + gl::color(0.5f, 0.5f,0.0f); + gl::vertex(core::localcontrol()->axis()[1] * -1.0f); + gl::color(1.0f, 1.0f, 0.0f); + gl::vertex(0.0f, 0.0f, 0.0f); + + gl::color(0.5f, 0.5f,0.0f); + gl::vertex(core::localcontrol()->axis()[1]); + gl::color(1.0f, 1.0f, 0.0f); + gl::vertex(0.0f, 0.0f, 0.0f); + + gl::color(0.0f, 0.5f,0.0f); + gl::vertex(core::localcontrol()->axis()[2] * -1.0f); + gl::color(0.0f, 1.0f, 0.0f); + gl::vertex(0.0f, 0.0f, 0.0f); + + gl::color(0.0f, 0.5f,0.0f); + gl::vertex(core::localcontrol()->axis()[2]); + gl::color(0.0f, 1.0f, 0.0f); + gl::vertex(0.0f, 0.0f, 0.0f); + + gl::pop(); +} /* ----- Main draw routine ----------------------------------------- */ void draw(math::Vector3f const &eye, math::Vector3f const &target, float seconds) @@ -500,6 +545,8 @@ void draw(math::Vector3f const &eye, 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_pass_spacegrid(); // draw the blue spacegrid gl::disable(GL_DEPTH_TEST); // disable depth buffer writing |