Orxonox: orxonox::Projectile Class Reference

# orxonox::Projectile Class Reference

`#include <src/orxonox/objects/weaponsystem/projectiles/Projectile.h>`

Inheritance diagram for orxonox::Projectile:

List of all members.

## Public Member Functions

virtual bool | collidesAgainst (WorldEntity *otherObject, btManifoldPoint &contactPoint)
| Virtual function that gets called when this object collides with another.
virtual void | destroyedPawn (Pawn *pawn)
void | destroyObject ()
float | getDamage () const
Pawn * | getOwner () const
| Projectile (BaseObject *creator)
void | setConfigValues ()
| Function to collect the SetConfigValue-macro calls.
void | setDamage (float damage)
void | setOwner (Pawn *owner)
virtual void | tick (float dt)
| Gets called every frame.
virtual | ~Projectile ()

## Private Attributes

bool | bDestroy_
float | damage_
Timer< Projectile > | destroyTimer_
float | lifetime_
Pawn * | owner_

## Constructor & Destructor Documentation

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

References orxonox::WorldEntity::attachCollisionShape(), bDestroy_, orxonox::createExecutor(), destroyObject(), destroyTimer_, orxonox::WorldEntity::enableCollisionCallback(), orxonox::GameMode::isMaster(), orxonox::WorldEntity::Kinematic, lifetime_, owner_, RegisterObject, orxonox::WorldEntity::setCollisionResponse(), orxonox::WorldEntity::setCollisionType(), setConfigValues(), and orxonox::SphereCollisionShape::setRadius().

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

## Member Function Documentation

bool orxonox::Projectile::collidesAgainst | ( | WorldEntity * | otherObject,
|  | btManifoldPoint & | contactPoint |
| ) |  |  | `[virtual]`

Virtual function that gets called when this object collides with another.

Parameters:

  | otherObject | The object this one has collided into. contactPoint Contact point provided by Bullet. Holds more information and can me modified. See return value. Returning false means that no modification to the contactPoint has been made. Return true otherwise! Condition is that enableCollisionCallback() was called.

Reimplemented from orxonox::MovableEntity.

References bDestroy_, orxonox::Pawn::damage(), orxonox::ModifierType::Damage, damage_, orxonox::BaseObject::getCreator(), orxonox::WorldEntity::getOrientation(), orxonox::Pawn::getPickups(), orxonox::WorldEntity::getPosition(), orxonox::GameMode::isMaster(), owner_, orxonox::PickupCollection::processModifiers(), orxonox::ParticleSpawner::setDestroyAfterLife(), orxonox::ParticleSpawner::setLifetime(), orxonox::StaticEntity::setOrientation(), orxonox::StaticEntity::setPosition(), and orxonox::ParticleEmitter::setSource().

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

Implements orxonox::PawnListener.

References owner_.

void orxonox::Projectile::destroyObject | ( |  | ) |

References orxonox::GameMode::isMaster().

Referenced by Projectile().

float orxonox::Projectile::getDamage | ( |  | ) | const`[inline]`

Pawn* orxonox::Projectile::getOwner | ( |  | ) | const`[inline]`

Reimplemented from orxonox::MovableEntity.

void orxonox::Projectile::setConfigValues | ( |  | ) |

Function to collect the SetConfigValue-macro calls.

Reimplemented from orxonox::OrxonoxClass.

References damage_, lifetime_, and SetConfigValue.

Referenced by Projectile().

void orxonox::Projectile::setDamage | ( | float | damage | ) | `[inline]`

Referenced by orxonox::LightningGun::fire(), orxonox::LaserFire::fire(), orxonox::FusionFire::fire(), orxonox::HsW01::shot(), and orxonox::EnergyDrink::shot().

void orxonox::Projectile::setOwner | ( | Pawn * | owner | ) | `[inline]`

Reimplemented from orxonox::MovableEntity.

Referenced by orxonox::LightningGun::fire(), orxonox::LaserFire::fire(), orxonox::FusionFire::fire(), orxonox::HsW01::shot(), and orxonox::EnergyDrink::shot().

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

Gets called every frame.

Parameters:

  | dt | The time since the last frame in seconds

Reimplemented from orxonox::MobileEntity.

References bDestroy_, orxonox::BaseObject::isActive(), and SUPER.

## Member Data Documentation

bool orxonox::Projectile::bDestroy_`[private]`

Referenced by collidesAgainst(), Projectile(), and tick().

float orxonox::Projectile::damage_`[private]`

Referenced by collidesAgainst(), and setConfigValues().

Timer<Projectile> orxonox::Projectile::destroyTimer_`[private]`

Referenced by Projectile().

float orxonox::Projectile::lifetime_`[private]`

Referenced by Projectile(), and setConfigValues().

Pawn* orxonox::Projectile::owner_`[private]`

Reimplemented from orxonox::MovableEntity.

Referenced by collidesAgainst(), destroyedPawn(), and Projectile().

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

- src/orxonox/objects/weaponsystem/projectiles/Projectile.h
- src/orxonox/objects/weaponsystem/projectiles/Projectile.cc