Orxonox: orxonox::HUDNavigation Class Reference

# orxonox::HUDNavigation Class Reference

`#include <src/orxonox/overlays/hud/HUDNavigation.h>`

Inheritance diagram for orxonox::HUDNavigation:

List of all members.

## 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.

## Constructor & Destructor Documentation

orxonox::HUDNavigation::HUDNavigation | ( | BaseObject * | creator | ) |

References aimMarker_, orxonox::OrxonoxOverlay::background_, orxonox::getUniqueNumberString(), navMarker_, navText_, RegisterObject, setAimMarkerSize(), setFont(), setNavMarkerSize(), setTextSize(), orxonox::BaseObject::setVisible(), and wasOutOfView_.

orxonox::HUDNavigation::~HUDNavigation | ( |  | ) | `[virtual]`

References aimMarker_, orxonox::BaseObject::isInitialized(), navMarker_, and navText_.

## Member Function Documentation

void orxonox::HUDNavigation::angleChanged | ( |  | ) | `[inline, private, virtual]`

Called whenever the rotation angle has changed.

Reimplemented from orxonox::OrxonoxOverlay.

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]`

References orxonox::BLANKSTRING, and navText_.

Referenced by XMLPort().

float orxonox::HUDNavigation::getNavMarkerSize | ( |  | ) | const`[inline, private]`

Referenced by XMLPort().

float orxonox::HUDNavigation::getTextSize | ( |  | ) | const`[private]`

References navText_.

Referenced by XMLPort().

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]`

References navText_.

Referenced by HUDNavigation(), and XMLPort().

void orxonox::HUDNavigation::setNavMarkerSize | ( | float | size | ) | `[inline, private]`

Referenced by HUDNavigation(), and XMLPort().

void orxonox::HUDNavigation::setTextSize | ( | float | size | ) | `[private]`

References navText_.

Referenced by HUDNavigation(), and XMLPort().

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.

Parameters:

  | 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.

Parameters:

  | xmlelement | The XML-element
  | loading | Loading (true) or saving (false)

Returns:
  The XML-element

Reimplemented from orxonox::OrxonoxOverlay.

References getAimMarkerSize(), getFont(), getNavMarkerSize(), getTextSize(), setAimMarkerSize(), setFont(), setNavMarkerSize(), setTextSize(), SUPER, and XMLPortParam.

## Member Data Documentation

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]`

One paramter size of the aim marker.

Referenced by sizeChanged().

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]`

One paramter size of the navigation marker.

Referenced by sizeChanged().

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]`

Performance booster variable: setMaterial is not cheap.

Referenced by HUDNavigation(), and tick().

The documentation for this class was generated from the following files:

- src/orxonox/overlays/hud/HUDNavigation.h
- src/orxonox/overlays/hud/HUDNavigation.cc