#include <src/orxonox/objects/weaponsystem/projectiles/Projectile.h>
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_ |
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] |
bool orxonox::Projectile::collidesAgainst | ( | WorldEntity * | otherObject, | |
btManifoldPoint & | contactPoint | |||
) | [virtual] |
Virtual function that gets called when this object collides with another.
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] |
void orxonox::Projectile::destroyObject | ( | ) |
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] |
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.
dt | The time since the last frame in seconds |
Reimplemented from orxonox::MobileEntity.
References bDestroy_, orxonox::BaseObject::isActive(), and SUPER.
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().