#include <src/orxonox/objects/controllers/WaypointPatrolController.h>
Public Member Functions | |
float | getAlertnessRadius () const |
int | getTeam () const |
void | setAlertnessRadius (float radius) |
void | setTeam (int team) |
virtual void | tick (float dt) |
Gets called every frame. | |
WaypointPatrolController (BaseObject *creator) | |
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode) |
XML loading and saving. | |
virtual | ~WaypointPatrolController () |
Protected Member Functions | |
void | searchEnemy () |
Protected Attributes | |
float | alertnessradius_ |
Timer< WaypointPatrolController > | patrolTimer_ |
int | team_ |
orxonox::WaypointPatrolController::WaypointPatrolController | ( | BaseObject * | creator | ) |
References alertnessradius_, orxonox::createExecutor(), patrolTimer_, RegisterObject, orxonox::rnd(), searchEnemy(), and team_.
virtual orxonox::WaypointPatrolController::~WaypointPatrolController | ( | ) | [inline, virtual] |
float orxonox::WaypointPatrolController::getAlertnessRadius | ( | ) | const [inline] |
Referenced by XMLPort().
int orxonox::WaypointPatrolController::getTeam | ( | ) | const [inline] |
Referenced by orxonox::ArtificialController::sameTeam(), and XMLPort().
void orxonox::WaypointPatrolController::searchEnemy | ( | ) | [protected] |
References alertnessradius_, orxonox::Controller::getControllableEntity(), orxonox::BaseObject::getGametype(), orxonox::WorldEntity::getPosition(), patrolTimer_, orxonox::rnd(), orxonox::ArtificialController::sameTeam(), orxonox::ArtificialController::target_, and orxonox::MT_Type::Vector3.
Referenced by WaypointPatrolController().
void orxonox::WaypointPatrolController::setAlertnessRadius | ( | float | radius | ) | [inline] |
Referenced by XMLPort().
void orxonox::WaypointPatrolController::setTeam | ( | int | team | ) | [inline] |
Referenced by XMLPort().
void orxonox::WaypointPatrolController::tick | ( | float | dt | ) | [virtual] |
Gets called every frame.
dt | The time since the last frame in seconds |
Reimplemented from orxonox::WaypointController.
References orxonox::ArtificialController::aimAtTarget(), orxonox::ArtificialController::bHasTargetPosition_, orxonox::ControllableEntity::fire(), orxonox::Controller::getControllableEntity(), orxonox::BaseObject::isActive(), orxonox::ArtificialController::isCloseAtTarget(), orxonox::ArtificialController::isLookingAtTarget(), orxonox::ArtificialController::moveToTargetPosition(), SUPER, and orxonox::ArtificialController::target_.
void orxonox::WaypointPatrolController::XMLPort | ( | Element & | xmlelement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
XML loading and saving.
xmlelement | The XML-element | |
loading | Loading (true) or saving (false) |
Reimplemented from orxonox::WaypointController.
References getAlertnessRadius(), getTeam(), setAlertnessRadius(), setTeam(), SUPER, and XMLPortParam.
float orxonox::WaypointPatrolController::alertnessradius_ [protected] |
Referenced by searchEnemy(), and WaypointPatrolController().
Referenced by searchEnemy(), and WaypointPatrolController().
int orxonox::WaypointPatrolController::team_ [protected] |
Referenced by WaypointPatrolController().