#include <src/orxonox/objects/controllers/WaypointController.h>
Public Member Functions | |
void | addWaypoint (WorldEntity *waypoint) |
float | getAccuracy () const |
WorldEntity * | getWaypoint (unsigned int index) const |
void | setAccuracy (float accuracy) |
virtual void | tick (float dt) |
Gets called every frame. | |
WaypointController (BaseObject *creator) | |
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode) |
XML loading and saving. | |
virtual | ~WaypointController () |
Protected Attributes | |
size_t | currentWaypoint_ |
float | squaredaccuracy_ |
std::vector< WorldEntity * > | waypoints_ |
orxonox::WaypointController::WaypointController | ( | BaseObject * | creator | ) |
References currentWaypoint_, RegisterObject, and setAccuracy().
orxonox::WaypointController::~WaypointController | ( | ) | [virtual] |
References orxonox::BaseObject::isInitialized(), and waypoints_.
void orxonox::WaypointController::addWaypoint | ( | WorldEntity * | waypoint | ) |
float orxonox::WaypointController::getAccuracy | ( | ) | const [inline] |
Referenced by XMLPort().
WorldEntity * orxonox::WaypointController::getWaypoint | ( | unsigned int | index | ) | const |
void orxonox::WaypointController::setAccuracy | ( | float | accuracy | ) | [inline] |
Referenced by WaypointController(), and XMLPort().
void orxonox::WaypointController::tick | ( | float | dt | ) | [virtual] |
Gets called every frame.
dt | The time since the last frame in seconds |
Implements orxonox::Tickable.
Reimplemented in orxonox::WaypointPatrolController.
References currentWaypoint_, orxonox::Controller::getControllableEntity(), orxonox::BaseObject::isActive(), orxonox::ArtificialController::moveToPosition(), squaredaccuracy_, and waypoints_.
void orxonox::WaypointController::XMLPort | ( | Element & | xmlelement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
XML loading and saving.
xmlelement | The XML-element | |
loading | Loading (true) or saving (false) |
Reimplemented from orxonox::BaseObject.
Reimplemented in orxonox::WaypointPatrolController.
References addWaypoint(), getAccuracy(), getWaypoint(), setAccuracy(), SUPER, XMLPortObject, and XMLPortParam.
size_t orxonox::WaypointController::currentWaypoint_ [protected] |
Referenced by tick(), and WaypointController().
float orxonox::WaypointController::squaredaccuracy_ [protected] |
Referenced by tick().
std::vector<WorldEntity*> orxonox::WaypointController::waypoints_ [protected] |
Referenced by addWaypoint(), getWaypoint(), tick(), and ~WaypointController().