Orxonox: orxonox::ArtificialController Class Reference

# orxonox::ArtificialController Class Reference

`#include <src/orxonox/objects/controllers/ArtificialController.h>`

Inheritance diagram for orxonox::ArtificialController:

List of all members.

## Public Member Functions

| ArtificialController (BaseObject *creator)
virtual void | destroyedPawn (Pawn *pawn)
virtual | ~ArtificialController ()

## Protected Member Functions

void | aimAtTarget ()
void | forgetTarget ()
bool | isCloseAtTarget (float distance) const
bool | isLookingAtTarget (float angle) const
void | moveToPosition (const Vector3 &target)
void | moveToTargetPosition ()
void | searchNewTarget ()
void | searchRandomTargetPosition ()
void | setTarget (Pawn *target)
void | setTargetPosition (const Vector3 &target)

## Static Protected Member Functions

static bool | sameTeam (ControllableEntity *entity1, ControllableEntity *entity2, Gametype *gametype)

## Protected Attributes

bool | bHasTargetPosition_
bool | bShooting_
Pawn * | target_
Vector3 | targetPosition_

## Constructor & Destructor Documentation

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

References bHasTargetPosition_, bShooting_, RegisterObject, target_, and targetPosition_.

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

## Member Function Documentation

void orxonox::ArtificialController::aimAtTarget | ( |  | ) | `[protected]`

References bHasTargetPosition_, orxonox::Controller::getControllableEntity(), orxonox::WorldEntity::getPosition(), orxonox::getPredictedPosition(), orxonox::MobileEntity::getVelocity(), target_, and targetPosition_.

Referenced by orxonox::WaypointPatrolController::tick(), and orxonox::AIController::tick().

void orxonox::ArtificialController::destroyedPawn | ( | Pawn * | pawn | ) | `[virtual]`

Implements orxonox::PawnListener.

References forgetTarget(), searchRandomTargetPosition(), and target_.

void orxonox::ArtificialController::forgetTarget | ( |  | ) | `[protected]`

References bShooting_, and target_.

Referenced by orxonox::AIController::action(), destroyedPawn(), and searchNewTarget().

bool orxonox::ArtificialController::isCloseAtTarget | ( | float | distance | ) | const`[protected]`

References orxonox::Controller::getControllableEntity(), orxonox::WorldEntity::getPosition(), target_, and targetPosition_.

Referenced by orxonox::WaypointPatrolController::tick(), and orxonox::AIController::tick().

bool orxonox::ArtificialController::isLookingAtTarget | ( | float | angle | ) | const`[protected]`

References orxonox::WorldEntity::FRONT, orxonox::getAngle(), orxonox::Controller::getControllableEntity(), and targetPosition_.

Referenced by orxonox::WaypointPatrolController::tick(), and orxonox::AIController::tick().

void orxonox::ArtificialController::moveToPosition | ( | const Vector3 & | target | ) | `[protected]`

References orxonox::WorldEntity::FRONT, orxonox::get2DViewdirection(), orxonox::Controller::getControllableEntity(), orxonox::WorldEntity::getPosition(), orxonox::MobileEntity::getVelocity(), orxonox::ControllableEntity::moveFrontBack(), orxonox::ControllableEntity::rotatePitch(), orxonox::ControllableEntity::rotateYaw(), orxonox::sgn(), target_, orxonox::WorldEntity::UP, and orxonox::MT_Type::Vector2.

Referenced by moveToTargetPosition(), and orxonox::WaypointController::tick().

void orxonox::ArtificialController::moveToTargetPosition | ( |  | ) | `[protected]`

References moveToPosition(), and targetPosition_.

Referenced by orxonox::WaypointPatrolController::tick(), and orxonox::AIController::tick().

bool orxonox::ArtificialController::sameTeam | ( | ControllableEntity * | entity1,
|  | ControllableEntity * | entity2,
|  | Gametype * | gametype |
| ) |  |  | `[static, protected]`

References orxonox::BaseState::ControlTeam1, orxonox::BaseState::ControlTeam2, orxonox::ControllableEntity::getPlayer(), orxonox::TeamBaseMatchBase::getState(), orxonox::TeamDeathmatch::getTeam(), orxonox::WaypointPatrolController::getTeam(), orxonox::ControllableEntity::getXMLController(), and orxonox::BaseState::Uncontrolled.

Referenced by orxonox::WaypointPatrolController::searchEnemy(), and searchNewTarget().

void orxonox::ArtificialController::searchNewTarget | ( |  | ) | `[protected]`

References forgetTarget(), orxonox::WorldEntity::FRONT, orxonox::Controller::getControllableEntity(), orxonox::BaseObject::getGametype(), orxonox::WorldEntity::getPosition(), orxonox::MobileEntity::getVelocity(), orxonox::rnd(), sameTeam(), target_, targetPosition_, and orxonox::MT_Type::Vector3.

Referenced by orxonox::AIController::action().

void orxonox::ArtificialController::searchRandomTargetPosition | ( |  | ) | `[protected]`

References bHasTargetPosition_, orxonox::rnd(), targetPosition_, and orxonox::MT_Type::Vector3.

Referenced by orxonox::AIController::action(), and destroyedPawn().

void orxonox::ArtificialController::setTarget | ( | Pawn * | target | ) | `[protected]`

References orxonox::WorldEntity::getPosition(), target_, and targetPosition_.

void orxonox::ArtificialController::setTargetPosition | ( | const Vector3 & | target | ) | `[protected]`

References bHasTargetPosition_, and targetPosition_.

## Member Data Documentation

bool orxonox::ArtificialController::bHasTargetPosition_`[protected]`

Referenced by orxonox::AIController::action(), aimAtTarget(), ArtificialController(), searchRandomTargetPosition(), setTargetPosition(), orxonox::WaypointPatrolController::tick(), and orxonox::AIController::tick().

bool orxonox::ArtificialController::bShooting_`[protected]`

Referenced by orxonox::AIController::action(), ArtificialController(), forgetTarget(), and orxonox::AIController::tick().

Pawn* orxonox::ArtificialController::target_`[protected]`

Referenced by orxonox::AIController::action(), aimAtTarget(), ArtificialController(), destroyedPawn(), forgetTarget(), isCloseAtTarget(), moveToPosition(), orxonox::WaypointPatrolController::searchEnemy(), searchNewTarget(), setTarget(), orxonox::WaypointPatrolController::tick(), and orxonox::AIController::tick().

Vector3 orxonox::ArtificialController::targetPosition_`[protected]`

Referenced by aimAtTarget(), ArtificialController(), isCloseAtTarget(), isLookingAtTarget(), moveToTargetPosition(), searchNewTarget(), searchRandomTargetPosition(), setTarget(), and setTargetPosition().

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

- src/orxonox/objects/controllers/ArtificialController.h
- src/orxonox/objects/controllers/ArtificialController.cc