orxonox::PickupSpawner Class Reference

PickupSpawner. More...

#include <src/orxonox/objects/pickup/PickupSpawner.h>

Inheritance diagram for orxonox::PickupSpawner:

orxonox::StaticEntity orxonox::Tickable orxonox::WorldEntity orxonox::OrxonoxClass orxonox::BaseObject orxonox::Synchronisable orxonox::OrxonoxClass orxonox::OrxonoxClass

List of all members.

Public Member Functions

virtual void changedActivity ()
 Invoked when activity has changed (set visibilty).
TemplategetItemTemplate () const
 Get the template for the item to spawn.
const std::stringgetItemTemplateName () const
 Get the template name for the item to spawn.
float getRespawnTime () const
 Get the time to respawn.
float getTriggerDistance () const
 Get the distance in which to trigger.
 PickupSpawner (BaseObject *creator)
 Constructor. Registers the PickupSpawner.
void respawnTimerCallback ()
 Method called when the timer runs out.
void setItemTemplateName (const std::string &name)
 Set the template name of the item to spawn.
void setRespawnTime (float time)
 Set the time to respawn.
void setTriggerDistance (float value)
 Set the distance in which to trigger.
virtual void tick (float dt)
 Tick, checks if any Pawn is close enough to trigger.
void trigger (Pawn *pawn)
 Method called when a Pawn is close enough.
virtual void XMLPort (Element &xmlelement, XMLPort::Mode mode)
 Method for creating a PickupSpawner through XML.
virtual ~PickupSpawner ()
 Deconstructor.

Private Attributes

TemplateitemTemplate_
 Template of the item to spawn.
std::string itemTemplateName_
 Template name of the item to spawn.
float respawnTime_
 Time after which this gets re-actived.
Timer< PickupSpawnerrespawnTimer_
 Timer used for re-activating.
float tickSum_
 Adds up tick to use in sine movement.
float triggerDistance_
 Distance in which this gets triggered.

Static Private Attributes

static const float bounceDistance_s = 4.0f
 Distance the pickup bounces up and down.
static const float bounceSpeed_s = 6.0f
 Speed of pickup to bounce up and down.
static const float rotationSpeed_s = 1.0f
 Rotation speed of pickup.


Detailed Description

PickupSpawner.

Author:
Daniel 'Huty' Haggenmueller

Constructor & Destructor Documentation

orxonox::PickupSpawner::PickupSpawner ( BaseObject creator  ) 

Constructor. Registers the PickupSpawner.

Parameters:
creator Pointer to the object which created this item.

References itemTemplate_, RegisterObject, respawnTime_, tickSum_, and triggerDistance_.

orxonox::PickupSpawner::~PickupSpawner (  )  [virtual]

Deconstructor.


Member Function Documentation

void orxonox::PickupSpawner::changedActivity (  )  [virtual]

Invoked when activity has changed (set visibilty).

Invoked when the activity has changed. Sets visibility of attached objects.

Reimplemented from orxonox::BaseObject.

References orxonox::WorldEntity::getAttachedObjects(), and SUPER.

Template* orxonox::PickupSpawner::getItemTemplate (  )  const [inline]

Get the template for the item to spawn.

Returns:
Returns the template of the item to spawn.

const std::string& orxonox::PickupSpawner::getItemTemplateName (  )  const [inline]

Get the template name for the item to spawn.

Returns:
Returns the name of the template of the item to spawn.

Referenced by XMLPort().

float orxonox::PickupSpawner::getRespawnTime (  )  const [inline]

Get the time to respawn.

Returns:
Returns the time after which this gets re-actived.

Referenced by XMLPort().

float orxonox::PickupSpawner::getTriggerDistance (  )  const [inline]

Get the distance in which to trigger.

Returns:
Returns the distance in which this gets triggered.

Referenced by XMLPort().

void orxonox::PickupSpawner::respawnTimerCallback (  ) 

Method called when the timer runs out.

Invoked by the timer, re-activates the PickupSpawner.

References COUT, and orxonox::BaseObject::setActive().

Referenced by trigger().

void orxonox::PickupSpawner::setItemTemplateName ( const std::string name  ) 

Set the template name of the item to spawn.

Set the template name of the item to spawn, also loads the template.

Parameters:
name Name of the new template.

References orxonox::Template::getTemplate(), itemTemplate_, and itemTemplateName_.

Referenced by XMLPort().

void orxonox::PickupSpawner::setRespawnTime ( float  time  )  [inline]

Set the time to respawn.

Parameters:
time New time after which this gets re-actived.

Referenced by XMLPort().

void orxonox::PickupSpawner::setTriggerDistance ( float  value  )  [inline]

Set the distance in which to trigger.

Parameters:
value The new distance in which to trigger.

Referenced by XMLPort().

void orxonox::PickupSpawner::tick ( float  dt  )  [virtual]

void orxonox::PickupSpawner::trigger ( Pawn pawn  ) 

void orxonox::PickupSpawner::XMLPort ( Element &  xmlelement,
XMLPort::Mode  mode 
) [virtual]


Member Data Documentation

const float orxonox::PickupSpawner::bounceDistance_s = 4.0f [static, private]

Distance the pickup bounces up and down.

Referenced by tick().

const float orxonox::PickupSpawner::bounceSpeed_s = 6.0f [static, private]

Speed of pickup to bounce up and down.

Referenced by tick().

Template of the item to spawn.

Referenced by PickupSpawner(), setItemTemplateName(), trigger(), and XMLPort().

Template name of the item to spawn.

Referenced by setItemTemplateName(), and trigger().

Time after which this gets re-actived.

Referenced by PickupSpawner(), and trigger().

Timer used for re-activating.

Referenced by trigger().

const float orxonox::PickupSpawner::rotationSpeed_s = 1.0f [static, private]

Rotation speed of pickup.

Referenced by tick().

Adds up tick to use in sine movement.

Referenced by PickupSpawner(), and tick().

Distance in which this gets triggered.

Referenced by PickupSpawner(), and tick().


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

Generated on Tue Jul 28 16:22:54 2009 for Orxonox by  doxygen 1.5.6