#include <src/orxonox/objects/worldentities/PongBall.h>
Public Member Functions | |
void | applyBats () |
float | getBatLength () const |
Vector2 | getFieldDimension () const |
float | getSpeed () const |
PongBall (BaseObject *creator) | |
void | registerVariables () |
void | setBatLength (float batlength) |
void | setBats (PongBat **bats) |
void | setFieldDimension (const Vector2 &dimension) |
void | setFieldDimension (float width, float height) |
void | setSpeed (float speed) |
virtual void | tick (float dt) |
Gets called every frame. | |
virtual | ~PongBall () |
Static Public Attributes | |
static const float | MAX_REL_Z_VELOCITY = 1.5 |
Private Attributes | |
PongBat ** | bat_ |
unsigned int * | batID_ |
float | batlength_ |
SoundBase * | batsound_ |
float | fieldHeight_ |
float | fieldWidth_ |
float | relMercyOffset_ |
SoundBase * | scoresound_ |
SoundBase * | sidesound_ |
float | speed_ |
orxonox::PongBall::PongBall | ( | BaseObject * | creator | ) |
virtual orxonox::PongBall::~PongBall | ( | ) | [inline, virtual] |
void orxonox::PongBall::applyBats | ( | ) |
References bat_, batID_, orxonox::Synchronisable::getSynchronisable(), and orxonox::OBJECTID_UNKNOWN.
Referenced by registerVariables().
float orxonox::PongBall::getBatLength | ( | ) | const [inline] |
Referenced by orxonox::PongAI::calculateRandomOffset().
Vector2 orxonox::PongBall::getFieldDimension | ( | ) | const [inline] |
References orxonox::MT_Type::Vector2.
Referenced by orxonox::PongAI::calculateBallEndPosition(), orxonox::PongAI::calculateRandomOffset(), and orxonox::PongAI::tick().
float orxonox::PongBall::getSpeed | ( | ) | const [inline] |
void orxonox::PongBall::registerVariables | ( | ) |
Reimplemented from orxonox::MovableEntity.
References applyBats(), batID_, batlength_, fieldHeight_, fieldWidth_, orxonox::Synchronisable::registerVariable(), relMercyOffset_, speed_, and orxonox::VariableDirection::ToClient.
Referenced by PongBall().
void orxonox::PongBall::setBatLength | ( | float | batlength | ) | [inline] |
Referenced by orxonox::Pong::start().
void orxonox::PongBall::setBats | ( | PongBat ** | bats | ) |
References bat_, batID_, and orxonox::Synchronisable::getObjectID().
Referenced by orxonox::Pong::start().
void orxonox::PongBall::setFieldDimension | ( | const Vector2 & | dimension | ) | [inline] |
void orxonox::PongBall::setFieldDimension | ( | float | width, | |
float | height | |||
) | [inline] |
Referenced by orxonox::Pong::start().
void orxonox::PongBall::setSpeed | ( | float | speed | ) |
void orxonox::PongBall::tick | ( | float | dt | ) | [virtual] |
Gets called every frame.
dt | The time since the last frame in seconds |
Reimplemented from orxonox::MobileEntity.
References bat_, batlength_, batsound_, fieldHeight_, fieldWidth_, orxonox::BaseObject::getGametype(), orxonox::WorldEntity::getPosition(), orxonox::MobileEntity::getVelocity(), orxonox::GameMode::isMaster(), MAX_REL_Z_VELOCITY, orxonox::SoundBase::play(), orxonox::Gametype::playerScored(), scoresound_, orxonox::MovableEntity::setPosition(), orxonox::MobileEntity::setVelocity(), orxonox::sgn(), sidesound_, speed_, SUPER, and orxonox::MT_Type::Vector3.
PongBat** orxonox::PongBall::bat_ [private] |
Referenced by applyBats(), PongBall(), setBats(), and tick().
unsigned int* orxonox::PongBall::batID_ [private] |
Referenced by applyBats(), PongBall(), registerVariables(), and setBats().
float orxonox::PongBall::batlength_ [private] |
Referenced by registerVariables(), and tick().
SoundBase* orxonox::PongBall::batsound_ [private] |
Referenced by PongBall(), and tick().
float orxonox::PongBall::fieldHeight_ [private] |
Referenced by registerVariables(), and tick().
float orxonox::PongBall::fieldWidth_ [private] |
Referenced by registerVariables(), and tick().
const float orxonox::PongBall::MAX_REL_Z_VELOCITY = 1.5 [static] |
Referenced by orxonox::PongAI::calculateBallEndPosition(), and tick().
float orxonox::PongBall::relMercyOffset_ [private] |
Referenced by PongBall(), and registerVariables().
SoundBase* orxonox::PongBall::scoresound_ [private] |
Referenced by PongBall(), and tick().
SoundBase* orxonox::PongBall::sidesound_ [private] |
Referenced by PongBall(), and tick().
float orxonox::PongBall::speed_ [private] |
Referenced by PongBall(), registerVariables(), setSpeed(), and tick().