From 7cbc39deea27f95257a7b797d79f74a756ec4fb1 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 22 Jul 2011 19:32:09 +0000 Subject: Corrects docks location for entities with scaled models --- src/render/draw.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/render') 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; -- cgit v1.2.3