#include <play_field.h>
Public Member Functions | |
PlayField (const SceneConfiguration &sceneConfig) | |
Constructor. | |
~PlayField () | |
Destructor. | |
virtual void | timeUpdate (float dt) |
Timer value change event occured. | |
virtual void | callableBackNotify (BubbleField *subject) |
Subject performed action on which the callback was defined. | |
virtual void | callableBackNotify (Avatar *subject) |
Subject performed action on which the callback was defined. | |
void | fire () |
Shoot a bubble. | |
void | launchBubble () |
This method is called when the bubble should be really fired. | |
Static Public Member Functions | |
static float | getSizeHalfSize () |
Returns half size of a single side of the play box. | |
static float | getDepth () |
Returns the depth of the play box. | |
static float | getNearWallBound () |
Returns the near bound of the back wall. | |
Private Member Functions | |
PlayField (const PlayField &) | |
PlayField & | operator= (const PlayField &) |
void | createNewBubble () |
Adds non moving bubble which can be fired. | |
SbVec3f | coordsInBubbleField (const SbVec3f &pfCoords) |
Translates coordinates from play field system to bubble field system. | |
Private Attributes | |
PlayBoxGraphics * | _graphics |
Strategy object that encapsulates an algorithm rendering the play field. | |
PlayBoxPhysics * | _physics |
Strategy object that encapsulates an algorithm in charge of physics. | |
Avatar * | _avatar |
Graphical representation of the player (the avatar). | |
Camera * | _camera |
Camera. | |
BubbleField * | _bubbleField |
"Glued-on" bubbles on the rear wall | |
Bubble * | _flyingBubble |
Bubble flying in the field. | |
bool | _bubbleIsReady |
Interface is waiting for a command to fire the bubble. | |
BubbleGenerator * | _bubbleGenerator |
Bubble generator. | |
float | _wallOffset |
Offset of the rear wall. | |
SoTranslation * | _wallTranslation |
Translation of the rear wall. | |
float | _wallSpeed |
Rear wall speed. | |
void(* | _failedGameEndFunc )() |
Function that should be called on failed game end. | |
Static Private Attributes | |
static const float | PLAY_BOX_SIDE_HALF_SIZE |
Half size of a single side of the play box. | |
static const float | PLAY_BOX_DEPTH |
Depth of the play box. | |
static const float | PLAY_BOX_NEAR_WALL_BOUND |
The near bound of the back wall. | |
static const float | DEFAULT_WALL_OFFSET |
Default rear wall offset. |
Reference object (cannot be copied).
PlayField::PlayField | ( | const PlayField & | ) | [private] |
PlayField::PlayField | ( | const SceneConfiguration & | sceneConfig | ) |
PlayField::~PlayField | ( | ) |
Destructor.
void PlayField::createNewBubble | ( | ) | [private] |
Adds non moving bubble which can be fired.
SbVec3f PlayField::coordsInBubbleField | ( | const SbVec3f & | pfCoords | ) | [private] |
Translates coordinates from play field system to bubble field system.
[in] | pfCoords | Coordinates in play field |
virtual void PlayField::timeUpdate | ( | float | dt | ) | [virtual] |
Timer value change event occured.
This method is called on each timer value change.
[in] | dt | Time difference between the last call (delta). |
Implements TimeUpdateable.
virtual void PlayField::callableBackNotify | ( | BubbleField * | subject | ) | [virtual] |
Subject performed action on which the callback was defined.
[in] | subject | Object that perfmored the action. |
Implements Templates::CallableBack< BubbleField >.
virtual void PlayField::callableBackNotify | ( | Avatar * | subject | ) | [virtual] |
Subject performed action on which the callback was defined.
[in] | subject | Object that perfmored the action. |
Implements Templates::CallableBack< Avatar >.
void PlayField::fire | ( | ) |
Shoot a bubble.
void PlayField::launchBubble | ( | ) |
This method is called when the bubble should be really fired.
This method is used to delay launch of the bubble after fire() method was called in order to allow some graphical magic.
static float PlayField::getSizeHalfSize | ( | ) | [inline, static] |
Returns half size of a single side of the play box.
References PLAY_BOX_SIDE_HALF_SIZE.
Referenced by Bubble::getRadius().
static float PlayField::getDepth | ( | ) | [inline, static] |
static float PlayField::getNearWallBound | ( | ) | [inline, static] |
const float PlayField::PLAY_BOX_SIDE_HALF_SIZE [static, private] |
const float PlayField::PLAY_BOX_DEPTH [static, private] |
const float PlayField::PLAY_BOX_NEAR_WALL_BOUND [static, private] |
const float PlayField::DEFAULT_WALL_OFFSET [static, private] |
Default rear wall offset.
PlayBoxGraphics* PlayField::_graphics [private] |
Strategy object that encapsulates an algorithm rendering the play field.
PlayBoxPhysics* PlayField::_physics [private] |
Strategy object that encapsulates an algorithm in charge of physics.
Avatar* PlayField::_avatar [private] |
Graphical representation of the player (the avatar).
Camera* PlayField::_camera [private] |
BubbleField* PlayField::_bubbleField [private] |
"Glued-on" bubbles on the rear wall
Bubble* PlayField::_flyingBubble [private] |
Bubble flying in the field.
bool PlayField::_bubbleIsReady [private] |
Interface is waiting for a command to fire the bubble.
BubbleGenerator* PlayField::_bubbleGenerator [private] |
Bubble generator.
float PlayField::_wallOffset [private] |
Offset of the rear wall.
SoTranslation* PlayField::_wallTranslation [private] |
Translation of the rear wall.
float PlayField::_wallSpeed [private] |
Rear wall speed.
void(* PlayField::_failedGameEndFunc)() [private] |
Function that should be called on failed game end.