diff options
author | Stijn Buys <ingar@osirion.org> | 2009-08-16 16:32:38 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-08-16 16:32:38 +0000 |
commit | 95cc140404c6524ea16e193e1421e826b239114f (patch) | |
tree | 3b4b2bf3ab9f4ee948192c1b37f265fe9127c21b /src/render/draw.cc | |
parent | 6f00effd8f95ad8698d077e6c21426b00d1d02b1 (diff) |
more constness, initial patchDef2 support in MapFile, reverse engine disables impulse drive, r_axis support
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r-- | src/render/draw.cc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index 1884125..e9123cd 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -837,6 +837,7 @@ void draw_model_bbox(model::Model *model) gl::vertex(model->model_maxbbox.x, model->model_minbbox.y, model->model_minbbox.z); gl::end(); + // body gl::begin(gl::Lines); gl::vertex(model->model_maxbbox.x, model->model_maxbbox.y, model->model_maxbbox.z); gl::vertex(model->model_maxbbox.x, model->model_maxbbox.y, model->model_minbbox.z); @@ -846,6 +847,43 @@ void draw_model_bbox(model::Model *model) gl::vertex(model->model_minbbox.x, model->model_minbbox.y, model->model_minbbox.z); gl::vertex(model->model_maxbbox.x, model->model_minbbox.y, model->model_maxbbox.z); gl::vertex(model->model_maxbbox.x, model->model_minbbox.y, model->model_minbbox.z); + + gl::end(); +} + + +// draw entity axis +void draw_model_axis(const core::Entity *entity) +{ + // axis + const float r = entity->radius() * 1.5f; + + gl::begin(gl::Lines); + + gl::color(entity->color()); + + gl::vertex(-r, 0.0f, 0.0f); + gl::vertex(r, 0.0f, 0.0f); + + gl::vertex(0.0f, -r, 0.0f); + gl::vertex(0.0f, r, 0.0f); + + gl::vertex(0.0f, 0.0f, -r); + gl::vertex(0.0f, 0.0f, r); + + const math::Axis worldaxis(entity->axis().transpose()); + + gl::color(1.0f, 0.0f, 0.0f); + + gl::vertex(worldaxis.forward() * -1 * r); + gl::vertex(worldaxis.forward() * r); + + gl::vertex(worldaxis.left() * -1 * r); + gl::vertex(worldaxis.left() * r); + + gl::vertex(worldaxis.up() * -1 * r); + gl::vertex(worldaxis.up() * r); + gl::end(); } @@ -866,6 +904,9 @@ void draw_pass_model_fragments() draw_model_bbox(entity->model()); } + if (r_axis->value()) { + draw_model_axis(entity); + } gl::pop(); } } |