Orxonox: orxonox::DroppedItem Class Reference

# orxonox::DroppedItem Class Reference

`#include <src/orxonox/objects/pickup/DroppedItem.h>`

Inheritance diagram for orxonox::DroppedItem:

List of all members.

## Public Member Functions

void | createTimer ()
| DroppedItem (BaseObject *creator)
BaseItem * | getItem () const
float | getTimeToLive () const
float | getTriggerDistance () const
void | setItem (BaseItem *item)
void | setTimeToLive (float time)
void | setTriggerDistance (float distance)
void | tick (float dt)
| Gets called every frame.
void | timerCallback ()
void | trigger (Pawn *pawn)
virtual | ~DroppedItem ()

## Static Public Member Functions

static DroppedItem * | createDefaultDrop (BaseItem *item, Pawn *pawn, const ColourValue &flareColour=ColourValue(0.5f, 1.0f, 0.3f), float timeToLive=0)
static DroppedItem * | createDefaultDrop (BaseItem *item, const Vector3 &position, const ColourValue &flareColour=ColourValue(0.5f, 1.0f, 0.3f), float timeToLive=0)

## Private Attributes

BaseItem * | item_
Timer< DroppedItem > | timer_
float | timeToLive_
float | triggerDistance_

## Constructor & Destructor Documentation

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

References item_, RegisterObject, timeToLive_, and triggerDistance_.

Referenced by createDefaultDrop().

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

## Member Function Documentation

DroppedItem * orxonox::DroppedItem::createDefaultDrop | ( | BaseItem * | item,
|  | Pawn * | pawn,
|  | const ColourValue & | flareColour = `ColourValue(0.5f, 1.0f, 0.3f)`,
|  | float | timeToLive = `0` |
| ) |  |  | `[static]`

References createDefaultDrop(), orxonox::WorldEntity::getOrientation(), orxonox::WorldEntity::getPosition(), and orxonox::MT_Type::Vector3.

DroppedItem * orxonox::DroppedItem::createDefaultDrop | ( | BaseItem * | item,
|  | const Vector3 & | position,
|  | const ColourValue & | flareColour = `ColourValue(0.5f, 1.0f, 0.3f)`,
|  | float | timeToLive = `0` |
| ) |  |  | `[static]`

References orxonox::WorldEntity::attach(), COUT, createTimer(), DroppedItem(), orxonox::BaseItem::getPickupIdentifier(), orxonox::Billboard::setColour(), setItem(), orxonox::Billboard::setMaterial(), orxonox::Model::setMeshSource(), orxonox::StaticEntity::setPosition(), orxonox::WorldEntity::setScale(), and setTimeToLive().

Referenced by createDefaultDrop(), orxonox::Jump::dropped(), and orxonox::HealthUsable::dropped().

void orxonox::DroppedItem::createTimer | ( |  | ) |

References orxonox::createExecutor(), timer_, timerCallback(), and timeToLive_.

Referenced by createDefaultDrop().

BaseItem* orxonox::DroppedItem::getItem | ( |  | ) | const`[inline]`

float orxonox::DroppedItem::getTimeToLive | ( |  | ) | const`[inline]`

float orxonox::DroppedItem::getTriggerDistance | ( |  | ) | const`[inline]`

void orxonox::DroppedItem::setItem | ( | BaseItem * | item | ) | `[inline]`

Referenced by createDefaultDrop().

void orxonox::DroppedItem::setTimeToLive | ( | float | time | ) | `[inline]`

Referenced by createDefaultDrop().

void orxonox::DroppedItem::setTriggerDistance | ( | float | distance | ) | `[inline]`

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

Gets called every frame.

Parameters:

  | dt | The time since the last frame in seconds

Implements orxonox::Tickable.

References orxonox::WorldEntity::getWorldPosition(), item_, trigger(), triggerDistance_, and orxonox::MT_Type::Vector3.

void orxonox::DroppedItem::timerCallback | ( |  | ) |

References COUT, orxonox::BaseItem::getPickupIdentifier(), and item_.

Referenced by createTimer().

void orxonox::DroppedItem::trigger | ( | Pawn * | pawn | ) |

References COUT, orxonox::BaseItem::getPickupIdentifier(), item_, and orxonox::BaseItem::pickedUp().

Referenced by tick().

## Member Data Documentation

BaseItem* orxonox::DroppedItem::item_`[private]`

Referenced by DroppedItem(), tick(), timerCallback(), and trigger().

Timer<DroppedItem> orxonox::DroppedItem::timer_`[private]`

Referenced by createTimer().

float orxonox::DroppedItem::timeToLive_`[private]`

Referenced by createTimer(), and DroppedItem().

float orxonox::DroppedItem::triggerDistance_`[private]`

Referenced by DroppedItem(), and tick().

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

- src/orxonox/objects/pickup/DroppedItem.h
- src/orxonox/objects/pickup/DroppedItem.cc