diff options
author | Stijn Buys <ingar@osirion.org> | 2011-07-22 19:32:09 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-07-22 19:32:09 +0000 |
commit | 7cbc39deea27f95257a7b797d79f74a756ec4fb1 (patch) | |
tree | 7066ed9ad05ebd2e8d8387f376fff3d751773fee /src/render | |
parent | f6f4da07f8ed086d8f5fffdce7bb3e963e9128a1 (diff) |
Corrects docks location for entities with scaled models
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/draw.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index b4fe5bd..84015e3 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -1455,6 +1455,7 @@ void draw_target(const core::Entity *entity) float d = math::distance(core::localcontrol()->location(), entity->location()) - entity->radius() - core::localcontrol()->radius(); if (d > core::range::fxdistance) return; + const float modelscale = entity->radius() / entity->model()->radius(); gl::enable(GL_DEPTH_TEST); gl::push(); @@ -1465,8 +1466,8 @@ void draw_target(const core::Entity *entity) for (model::Model::Docks::iterator dit = model->docks().begin(); dit != model->docks().end(); dit++) { model::Dock *dock = (*dit); - math::Vector3f maxbox(dock->location()); - math::Vector3f minbox(dock->location()); + math::Vector3f maxbox(dock->location() * modelscale); + math::Vector3f minbox(dock->location() * modelscale); for (size_t i = 0; i < 3; i++) { maxbox[i] += 0.025; |