Orxonox: orxonox::Engine Class Reference

# orxonox::Engine Class Reference

`#include <src/orxonox/objects/items/Engine.h>`

Inheritance diagram for orxonox::Engine:

List of all members.

## Public Member Functions

virtual void | addToSpaceShip (SpaceShip *ship)
virtual void | changedActivity ()
| This function gets called if the activity of the object changes.
| Engine (BaseObject *creator)
float | getAccelerationBack () const
float | getAccelerationBrake () const
float | getAccelerationFront () const
float | getAccelerationLeftRight () const
float | getAccelerationUpDown () const
float | getBoostFactor () const
virtual const Vector3 & | getDirection () const
float | getMaxSpeedBack () const
float | getMaxSpeedFront () const
float | getMaxSpeedLeftRight () const
float | getMaxSpeedUpDown () const
SpaceShip * | getShip () const
float | getSpeedFactor () const
void | loadSound (const std::string filename)
void | registerVariables ()
void | setAccelerationBack (float acceleration)
void | setAccelerationBrake (float acceleration)
void | setAccelerationFront (float acceleration)
void | setAccelerationLeftRight (float acceleration)
void | setAccelerationUpDown (float acceleration)
void | setBoostFactor (float factor)
void | setConfigValues ()
| Function to collect the SetConfigValue-macro calls.
void | setMaxSpeedBack (float speed)
void | setMaxSpeedFront (float speed)
void | setMaxSpeedLeftRight (float speed)
void | setMaxSpeedUpDown (float speed)
void | setSpeedFactor (float factor)
virtual void | tick (float dt)
| Gets called every frame.
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| XML loading and saving.
virtual | ~Engine ()

## Private Member Functions

void | networkcallback_shipID ()

## Private Attributes

float | accelerationBack_
float | accelerationBrake_
float | accelerationFront_
float | accelerationLeftRight_
float | accelerationUpDown_
float | blurStrength_
Shader * | boostBlur_
float | boostFactor_
float | maxSpeedBack_
float | maxSpeedFront_
float | maxSpeedLeftRight_
float | maxSpeedUpDown_
SpaceShip * | ship_
unsigned int | shipID_
SoundBase * | sound_
float | speedFactor_

## Constructor & Destructor Documentation

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

References accelerationBack_, accelerationBrake_, accelerationFront_, accelerationLeftRight_, accelerationUpDown_, boostBlur_, boostFactor_, maxSpeedBack_, maxSpeedFront_, maxSpeedLeftRight_, maxSpeedUpDown_, orxonox::OBJECTID_UNKNOWN, RegisterObject, registerVariables(), setConfigValues(), ship_, shipID_, sound_, and speedFactor_.

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

References boostBlur_, orxonox::BaseObject::isInitialized(), orxonox::SpaceShip::setEngine(), ship_, and sound_.

## Member Function Documentation

void orxonox::Engine::addToSpaceShip | ( | SpaceShip * | ship | ) | `[virtual]`

Reimplemented in orxonox::MultiStateEngine.

References orxonox::SoundBase::attachToEntity(), boostBlur_, orxonox::SpaceShip::getEngine(), orxonox::Synchronisable::getObjectID(), orxonox::SpaceShip::setEngine(), ship_, shipID_, and sound_.

Referenced by orxonox::MultiStateEngine::addToSpaceShip(), orxonox::SpaceShip::loadEngineTemplate(), networkcallback_shipID(), and orxonox::SpaceShip::setEngine().

void orxonox::Engine::changedActivity | ( |  | ) | `[virtual]`

This function gets called if the activity of the object changes.

Reimplemented from orxonox::BaseObject.

References boostBlur_, orxonox::BaseObject::isVisible(), orxonox::Shader::setVisible(), and SUPER.

float orxonox::Engine::getAccelerationBack | ( |  | ) | const`[inline]`

float orxonox::Engine::getAccelerationBrake | ( |  | ) | const`[inline]`

float orxonox::Engine::getAccelerationFront | ( |  | ) | const`[inline]`

float orxonox::Engine::getAccelerationLeftRight | ( |  | ) | const`[inline]`

float orxonox::Engine::getAccelerationUpDown | ( |  | ) | const`[inline]`

float orxonox::Engine::getBoostFactor | ( |  | ) | const`[inline]`

Referenced by orxonox::HUDSpeedBar::tick(), and XMLPort().

const Vector3 & orxonox::Engine::getDirection | ( |  | ) | const`[virtual]`

References orxonox::SpaceShip::getSteeringDirection(), and ship_.

Referenced by orxonox::MultiStateEngine::tick(), and tick().

float orxonox::Engine::getMaxSpeedBack | ( |  | ) | const`[inline]`

float orxonox::Engine::getMaxSpeedFront | ( |  | ) | const`[inline]`

Referenced by orxonox::HUDSpeedBar::tick().

float orxonox::Engine::getMaxSpeedLeftRight | ( |  | ) | const`[inline]`

float orxonox::Engine::getMaxSpeedUpDown | ( |  | ) | const`[inline]`

SpaceShip* orxonox::Engine::getShip | ( |  | ) | const`[inline]`

Referenced by orxonox::MultiStateEngine::addActiveEffect(), orxonox::MultiStateEngine::addBoostEffect(), orxonox::MultiStateEngine::addBrakeEffect(), orxonox::MultiStateEngine::addForwardEffect(), orxonox::SpaceShip::setEngine(), orxonox::MultiStateEngine::tick(), and orxonox::MultiStateEngine::~MultiStateEngine().

float orxonox::Engine::getSpeedFactor | ( |  | ) | const`[inline]`

Referenced by orxonox::HUDSpeedBar::tick().

void orxonox::Engine::loadSound | ( | const std::string | filename | ) |

References orxonox::SoundBase::loadFile(), orxonox::SoundBase::play(), ship_, and sound_.

Referenced by XMLPort().

void orxonox::Engine::networkcallback_shipID | ( |  | ) | `[private]`

References addToSpaceShip(), orxonox::Synchronisable::getSynchronisable(), orxonox::OBJECTID_UNKNOWN, ship_, and shipID_.

Referenced by registerVariables(), and tick().

void orxonox::Engine::registerVariables | ( |  | ) |

Reimplemented in orxonox::MultiStateEngine.

References accelerationBack_, accelerationBrake_, accelerationFront_, accelerationLeftRight_, accelerationUpDown_, boostFactor_, maxSpeedBack_, maxSpeedFront_, maxSpeedLeftRight_, maxSpeedUpDown_, networkcallback_shipID(), orxonox::Synchronisable::registerVariable(), shipID_, speedFactor_, and orxonox::VariableDirection::ToClient.

Referenced by Engine().

void orxonox::Engine::setAccelerationBack | ( | float | acceleration | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setAccelerationBrake | ( | float | acceleration | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setAccelerationFront | ( | float | acceleration | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setAccelerationLeftRight | ( | float | acceleration | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setAccelerationUpDown | ( | float | acceleration | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setBoostFactor | ( | float | factor | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setConfigValues | ( |  | ) |

Function to collect the SetConfigValue-macro calls.

Reimplemented from orxonox::OrxonoxClass.

References blurStrength_, and SetConfigValue.

Referenced by Engine().

void orxonox::Engine::setMaxSpeedBack | ( | float | speed | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setMaxSpeedFront | ( | float | speed | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setMaxSpeedLeftRight | ( | float | speed | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setMaxSpeedUpDown | ( | float | speed | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Engine::setSpeedFactor | ( | float | factor | ) | `[inline]`

void orxonox::Engine::tick | ( | float | dt | ) | `[virtual]`

Gets called every frame.

Parameters:

  | dt | The time since the last frame in seconds

Implements orxonox::Tickable.

Reimplemented in orxonox::MultiStateEngine.

References orxonox::ModifierType::Acceleration, accelerationBack_, accelerationBrake_, accelerationFront_, accelerationLeftRight_, accelerationUpDown_, blurStrength_, boostBlur_, boostFactor_, orxonox::clamp(), orxonox::SpaceShip::getBoost(), getDirection(), orxonox::MobileEntity::getLocalVelocity(), orxonox::WorldEntity::getOrientation(), orxonox::SpaceShip::getPermanentBoost(), orxonox::Pawn::getPickups(), orxonox::BaseObject::getScene(), orxonox::Scene::getSceneManager(), orxonox::ControllableEntity::hasHumanController(), orxonox::ControllableEntity::hasLocalController(), orxonox::BaseObject::isActive(), maxSpeedBack_, maxSpeedFront_, maxSpeedLeftRight_, maxSpeedUpDown_, networkcallback_shipID(), orxonox::PickupCollection::processModifiers(), orxonox::MobileEntity::setAcceleration(), orxonox::SpaceShip::setBoost(), orxonox::Shader::setCompositor(), orxonox::Shader::setParameter(), orxonox::SpaceShip::setSteeringDirection(), ship_, shipID_, speedFactor_, SUPER, and orxonox::MT_Type::Vector3.

void orxonox::Engine::XMLPort | ( | Element & | xmlelement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

XML loading and saving.

Parameters:

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

Returns:
  The XML-element

Reimplemented from orxonox::BaseObject.

Reimplemented in orxonox::MultiStateEngine.

References getBoostFactor(), loadSound(), setAccelerationBack(), setAccelerationBrake(), setAccelerationFront(), setAccelerationLeftRight(), setAccelerationUpDown(), setBoostFactor(), setMaxSpeedBack(), setMaxSpeedFront(), setMaxSpeedLeftRight(), setMaxSpeedUpDown(), SUPER, XMLPortParam, and XMLPortParamLoadOnly.

## Member Data Documentation

float orxonox::Engine::accelerationBack_`[private]`

Referenced by Engine(), registerVariables(), and tick().

float orxonox::Engine::accelerationBrake_`[private]`

Referenced by Engine(), registerVariables(), and tick().

float orxonox::Engine::accelerationFront_`[private]`

Referenced by Engine(), registerVariables(), and tick().

float orxonox::Engine::accelerationLeftRight_`[private]`

Referenced by Engine(), registerVariables(), and tick().

float orxonox::Engine::accelerationUpDown_`[private]`

Referenced by Engine(), registerVariables(), and tick().

float orxonox::Engine::blurStrength_`[private]`

Referenced by setConfigValues(), and tick().

Shader* orxonox::Engine::boostBlur_`[private]`

Referenced by addToSpaceShip(), changedActivity(), Engine(), tick(), and ~Engine().

float orxonox::Engine::boostFactor_`[private]`

Referenced by Engine(), registerVariables(), and tick().

float orxonox::Engine::maxSpeedBack_`[private]`

Referenced by Engine(), registerVariables(), and tick().

float orxonox::Engine::maxSpeedFront_`[private]`

Referenced by Engine(), registerVariables(), and tick().

float orxonox::Engine::maxSpeedLeftRight_`[private]`

Referenced by Engine(), registerVariables(), and tick().

float orxonox::Engine::maxSpeedUpDown_`[private]`

Referenced by Engine(), registerVariables(), and tick().

SpaceShip* orxonox::Engine::ship_`[private]`

Referenced by addToSpaceShip(), Engine(), getDirection(), loadSound(), networkcallback_shipID(), tick(), and ~Engine().

unsigned int orxonox::Engine::shipID_`[private]`

Referenced by addToSpaceShip(), Engine(), networkcallback_shipID(), registerVariables(), and tick().

SoundBase* orxonox::Engine::sound_`[private]`

Referenced by addToSpaceShip(), Engine(), loadSound(), and ~Engine().

float orxonox::Engine::speedFactor_`[private]`

Referenced by Engine(), registerVariables(), and tick().

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

- src/orxonox/objects/items/Engine.h
- src/orxonox/objects/items/Engine.cc