From 41c3bee2b91c18a51d1b1f720d45d52bf0fbf89a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 13 Nov 2010 23:51:05 +0000 Subject: show target location and radius in client::DevInfoWidget --- src/client/infowidget.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/client/infowidget.cc') diff --git a/src/client/infowidget.cc b/src/client/infowidget.cc index 9340627..6dcb608 100644 --- a/src/client/infowidget.cc +++ b/src/client/infowidget.cc @@ -46,7 +46,6 @@ void DevInfoWidget::draw() { std::ostringstream textstream; const core::Entity *target = targets::current(); - float d = 0; textstream << "^Ncore ^B"; time_to_stream(textstream, core::application()->time()); @@ -58,19 +57,24 @@ void DevInfoWidget::draw() textstream << '\n'; if (core::localcontrol()) { + textstream << "^B" << core::localcontrol()->name() << '\n'; + textstream << "^Nthurst ^B" << std::fixed << std::setprecision(2) + << core::localcontrol()->thrust() << '\n'; + textstream << "^Nspeed ^B" << std::fixed << std::setprecision(2) + << core::localcontrol()->speed() << '\n'; textstream << "^Nx,y,z ^B" << std::fixed << std::setprecision(2) << core::localcontrol()->location().x() << ", " << core::localcontrol()->location().y() << ", " << core::localcontrol()->location().z() << '\n'; - textstream << "^Nradius ^B" << core::localcontrol()->radius() << '\n'; - textstream << "^Nthurst ^B" << core::localcontrol()->thrust() << " " - << "^Nspeed ^B" << core::localcontrol()->speed() << '\n'; - if (target) { - d = math::distance(core::localcontrol()->location(), target->location()) - target->radius() - core::localcontrol()->radius(); - textstream << "^Ndist ^B" << d << '\n'; + textstream << "^B" << target->name() << '\n'; + textstream << "^Nx,y,z ^B" << std::fixed << std::setprecision(2) + << target->location().x() << ", " + << target->location().y() << ", " + << target->location().z() << '\n'; + textstream << "^Nradius ^B" << target->radius() << '\n'; } } -- cgit v1.2.3