Orxonox: orxonox::DistanceTrigger Class Reference

# orxonox::DistanceTrigger Class Reference

`#include <src/orxonox/objects/worldentities/triggers/DistanceTrigger.h>`

Inheritance diagram for orxonox::DistanceTrigger:

List of all members.

## Public Member Functions

void | addTarget (Ogre::Node *targetNode)
void | addTargets (const std::string &targets)
bool | checkDistance ()
| DistanceTrigger (BaseObject *creator)
float | getDistance () const
void | removeTarget (Ogre::Node *targetNode)
void | removeTargets (const std::string &targets)
void | setDistance (float distance)
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| Method for creating a PlayerTrigger object through XML.
virtual | ~DistanceTrigger ()

## Protected Member Functions

virtual bool | isTriggered (TriggerMode::Value mode)
virtual void | notifyMaskUpdate ()

## Protected Attributes

ClassTreeMask | targetMask_

## Private Attributes

float | distance_
std::set< Ogre::Node * > | targetSet_

## Constructor & Destructor Documentation

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

< Normally hasn't just ControllableEntities as targets.

References Class, distance_, orxonox::ClassTreeMask::exclude(), RegisterObject, orxonox::PlayerTrigger::setForPlayer(), and targetMask_.

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

## Member Function Documentation

void orxonox::DistanceTrigger::addTarget | ( | Ogre::Node * | targetNode | ) |

References targetSet_.

void orxonox::DistanceTrigger::addTargets | ( | const std::string & | targets | ) |

Checks whether the target is (or is derived from) a ControllableEntity.

References Class, ClassByString, COUT, orxonox::ClassTreeMask::exclude(), orxonox::OrxonoxClass::getIdentifier(), orxonox::Identifier::getName(), orxonox::BaseObject::getName(), orxonox::ClassTreeMask::include(), orxonox::Identifier::isA(), notifyMaskUpdate(), orxonox::PlayerTrigger::setForPlayer(), and targetMask_.

Referenced by XMLPort().

bool orxonox::DistanceTrigger::checkDistance | ( |  | ) |

References orxonox::ClassTreeMask::begin(), distance_, orxonox::ClassTreeMask::end(), orxonox::WorldEntity::getWorldPosition(), orxonox::PlayerTrigger::isForPlayer(), orxonox::PlayerTrigger::setTriggeringPlayer(), targetMask_, and orxonox::MT_Type::Vector3.

Referenced by isTriggered().

float orxonox::DistanceTrigger::getDistance | ( |  | ) | const`[inline]`

Referenced by XMLPort().

bool orxonox::DistanceTrigger::isTriggered | ( | TriggerMode::Value | mode | ) | `[protected, virtual]`

Implements orxonox::PlayerTrigger.

References checkDistance(), and orxonox::Trigger::isTriggered().

virtual void orxonox::DistanceTrigger::notifyMaskUpdate | ( |  | ) | `[inline, protected, virtual]`

Reimplemented in orxonox::CheckPoint.

Referenced by addTargets().

void orxonox::DistanceTrigger::removeTarget | ( | Ogre::Node * | targetNode | ) |

References COUT, and targetSet_.

void orxonox::DistanceTrigger::removeTargets | ( | const std::string & | targets | ) |

References ClassByString, orxonox::ClassTreeMask::exclude(), and targetMask_.

void orxonox::DistanceTrigger::setDistance | ( | float | distance | ) | `[inline]`

Referenced by orxonox::CheckPoint::CheckPoint(), and XMLPort().

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

Method for creating a PlayerTrigger object through XML.

Method for creating a QuestEffectBeacon object through XML.

Reimplemented from orxonox::PlayerTrigger.

Reimplemented in orxonox::CheckPoint.

References addTargets(), getDistance(), setDistance(), SUPER, XMLPortParam, and XMLPortParamLoadOnly.

## Member Data Documentation

float orxonox::DistanceTrigger::distance_`[private]`

Referenced by checkDistance(), and DistanceTrigger().

ClassTreeMask orxonox::DistanceTrigger::targetMask_`[protected]`

Referenced by addTargets(), checkDistance(), DistanceTrigger(), orxonox::CheckPoint::notifyMaskUpdate(), and removeTargets().

std::set<Ogre::Node*> orxonox::DistanceTrigger::targetSet_`[private]`

Referenced by addTarget(), and removeTarget().

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

- src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
- src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc