#include <src/orxonox/overlays/hud/HUDNavigation.h>
Public Member Functions | |
HUDNavigation (BaseObject *creator) | |
virtual void | tick (float dt) |
Gets called every frame. | |
virtual void | XMLPort (Element &xmlElement, XMLPort::Mode mode) |
Loads the OrxonoxOverlay. | |
virtual | ~HUDNavigation () |
Private Member Functions | |
void | angleChanged () |
Called whenever the rotation angle has changed. | |
float | getAimMarkerSize () const |
float | getDist2Focus () const |
const std::string & | getFont () const |
float | getNavMarkerSize () const |
float | getTextSize () const |
void | positionChanged () |
Determines the position of the overlay. This works also well when a rotation angle is applied. The overlay always gets aligned correctly as well as possible. | |
void | setAimMarkerSize (float size) |
void | setFont (const std::string &font) |
void | setNavMarkerSize (float size) |
void | setTextSize (float size) |
void | sizeChanged () |
Overridden method of OrxonoxOverlay. Usually the entire overlay scales with scale(). Here we obviously have to adjust this. | |
void | updateFocus () |
void | updateMarker () |
Private Attributes | |
Ogre::PanelOverlayElement * | aimMarker_ |
Panel used to show the aim Marker. | |
float | aimMarkerSize_ |
One paramter size of the aim marker. | |
Ogre::PanelOverlayElement * | navMarker_ |
the panel used to show the arrow and the target marker | |
float | navMarkerSize_ |
One paramter size of the navigation marker. | |
Ogre::TextAreaOverlayElement * | navText_ |
Text overlay to display the target distance. | |
bool | wasOutOfView_ |
Performance booster variable: setMaterial is not cheap. |
orxonox::HUDNavigation::HUDNavigation | ( | BaseObject * | creator | ) |
orxonox::HUDNavigation::~HUDNavigation | ( | ) | [virtual] |
References aimMarker_, orxonox::BaseObject::isInitialized(), navMarker_, and navText_.
void orxonox::HUDNavigation::angleChanged | ( | ) | [inline, private, virtual] |
float orxonox::HUDNavigation::getAimMarkerSize | ( | ) | const [inline, private] |
Referenced by XMLPort().
float orxonox::HUDNavigation::getDist2Focus | ( | ) | const [private] |
Referenced by tick().
const std::string & orxonox::HUDNavigation::getFont | ( | ) | const [private] |
float orxonox::HUDNavigation::getNavMarkerSize | ( | ) | const [inline, private] |
Referenced by XMLPort().
float orxonox::HUDNavigation::getTextSize | ( | ) | const [private] |
void orxonox::HUDNavigation::positionChanged | ( | ) | [inline, private, virtual] |
Determines the position of the overlay. This works also well when a rotation angle is applied. The overlay always gets aligned correctly as well as possible.
Reimplemented from orxonox::OrxonoxOverlay.
void orxonox::HUDNavigation::setAimMarkerSize | ( | float | size | ) | [inline, private] |
Referenced by HUDNavigation(), and XMLPort().
void orxonox::HUDNavigation::setFont | ( | const std::string & | font | ) | [private] |
void orxonox::HUDNavigation::setNavMarkerSize | ( | float | size | ) | [inline, private] |
Referenced by HUDNavigation(), and XMLPort().
void orxonox::HUDNavigation::setTextSize | ( | float | size | ) | [private] |
void orxonox::HUDNavigation::sizeChanged | ( | ) | [private, virtual] |
Overridden method of OrxonoxOverlay. Usually the entire overlay scales with scale(). Here we obviously have to adjust this.
Reimplemented from orxonox::OrxonoxOverlay.
References aimMarker_, aimMarkerSize_, orxonox::OrxonoxOverlay::getActualSize(), navMarker_, navMarkerSize_, and navText_.
void orxonox::HUDNavigation::tick | ( | float | dt | ) | [virtual] |
Gets called every frame.
dt | The time since the last frame in seconds |
Implements orxonox::Tickable.
References aimMarker_, getDist2Focus(), orxonox::Radar::getFocus(), orxonox::Radar::getInstance(), orxonox::RadarViewable::getRVWorldPosition(), orxonox::multi_cast(), navMarker_, navText_, orxonox::OrxonoxOverlay::overlay_, SUPER, orxonox::MT_Type::Vector3, and wasOutOfView_.
void orxonox::HUDNavigation::updateFocus | ( | ) | [private] |
void orxonox::HUDNavigation::updateMarker | ( | ) | [private] |
void orxonox::HUDNavigation::XMLPort | ( | Element & | xmlElement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
Loads the OrxonoxOverlay.
This has to be called before usage, otherwise strange behaviour is guaranteed! (there should be no segfaults however). XML loading and saving.
xmlelement | The XML-element | |
loading | Loading (true) or saving (false) |
Reimplemented from orxonox::OrxonoxOverlay.
References getAimMarkerSize(), getFont(), getNavMarkerSize(), getTextSize(), setAimMarkerSize(), setFont(), setNavMarkerSize(), setTextSize(), SUPER, and XMLPortParam.
Ogre::PanelOverlayElement* orxonox::HUDNavigation::aimMarker_ [private] |
Panel used to show the aim Marker.
Referenced by HUDNavigation(), sizeChanged(), tick(), and ~HUDNavigation().
float orxonox::HUDNavigation::aimMarkerSize_ [private] |
Ogre::PanelOverlayElement* orxonox::HUDNavigation::navMarker_ [private] |
the panel used to show the arrow and the target marker
Referenced by HUDNavigation(), sizeChanged(), tick(), and ~HUDNavigation().
float orxonox::HUDNavigation::navMarkerSize_ [private] |
Ogre::TextAreaOverlayElement* orxonox::HUDNavigation::navText_ [private] |
Text overlay to display the target distance.
Referenced by getFont(), getTextSize(), HUDNavigation(), setFont(), setTextSize(), sizeChanged(), tick(), and ~HUDNavigation().
bool orxonox::HUDNavigation::wasOutOfView_ [private] |