Orxonox: orxonox::PongBall Class Reference

# orxonox::PongBall Class Reference

`#include <src/orxonox/objects/worldentities/PongBall.h>`

Inheritance diagram for orxonox::PongBall:

List of all members.

## 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_

## Constructor & Destructor Documentation

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

References bat_, batID_, batsound_, orxonox::SoundBase::loadFile(), orxonox::OBJECTID_UNKNOWN, RegisterObject, registerVariables(), relMercyOffset_, scoresound_, sidesound_, and speed_.

virtual orxonox::PongBall::~PongBall | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

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 | ) |

References orxonox::MobileEntity::getVelocity(), orxonox::rnd(), orxonox::MobileEntity::setVelocity(), orxonox::sgn(), speed_, and orxonox::MT_Type::Vector3.

Referenced by orxonox::Pong::playerScored(), orxonox::Pong::start(), and orxonox::Pong::startBall().

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

Gets called every frame.

Parameters:

  | 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.

## Member Data Documentation

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().

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

- src/orxonox/objects/worldentities/PongBall.h
- src/orxonox/objects/worldentities/PongBall.cc