Game Class Reference

#include <Game.h>

List of all members.

Public Member Functions

 Game ()
 ~Game ()
void update (const float timeStep, const float fps)
bool init ()
void resize (int width, int height)
void release ()
void recycleEnemy (Enemy *oldEnemy)
std::vector< Enemy * > getEnemies () const
AirplanegetAirplane () const
H3DRes getReflectionTexture () const
bool hasPlayerAtLevelBounds (const Vec3 playerPosition) const
void keyStateChange (int key, bool state)
void mouseMoveEvent (float dX, float dY)
void mouseButtonEvent (int button, bool action)

Static Public Member Functions

static void advanceEmitter (H3DNode emitter, const float timeStep)
static H3DNode addLight (H3DNode parent, const char *name, const float px, const float py, const float pz, const float rx, const float ry, const float rz, const int length, const int fov, const int shadowCount, const float r, const float g, const float b)

Detailed Description

This class provides the start point of all graphics and physics simulation. Although there is very little actual content added, this class is responsible for general asset and object creation (Enemy, Player, World etc), and rendering as well utilizing

update(timeStep)

.

Please note that the given keyboard and mouse input is directed to Player.

Definition at line 31 of file Game.h.


Constructor & Destructor Documentation

Game::Game (  ) 

does currently nothing

Definition at line 37 of file Game.cpp.

Game::~Game (  ) 

keeps the memory clean

Definition at line 45 of file Game.cpp.


Member Function Documentation

H3DNode Game::addLight ( H3DNode  parent,
const char *  name,
const float  px,
const float  py,
const float  pz,
const float  rx,
const float  ry,
const float  rz,
const int  length,
const int  fov,
const int  shadowCount,
const float  r,
const float  g,
const float  b 
) [static]

Adds light to the world in a compact manner.

Parameters:
px the position on the x axis relative to the world
py the position on the y axis relative to the world
pz the position on the z axis relative to the world
rx the rotation on the x axis relative to the world
ry the rotation on the y axis relative to the world
rz the rotation on the z axis relative to the world
length the length of the light cone from the light source away
fov the field of view, an angle that defines the reflection
shadowCount the number of shadows for the shadow context
r red color part of the light; from 0.0 to 1.0
g green color part of the light; from 0.0 to 1.0
b blue color part of the light; from 0.0 to 1.0
Returns:
the created light

Definition at line 296 of file Game.cpp.

void Game::advanceEmitter ( H3DNode  emitter,
const float  timeStep 
) [static]

animates particles of the given emitter

Parameters:
emitter the emitter to be animated
timeStep the time delta that shall be rendered

Definition at line 271 of file Game.cpp.

Airplane * Game::getAirplane (  )  const
Returns:
the only airplane that this game has got

Definition at line 246 of file Game.cpp.

std::vector< Enemy * > Game::getEnemies (  )  const

returns a vector of enemies

Definition at line 238 of file Game.cpp.

H3DRes Game::getReflectionTexture (  )  const
Returns:
the material ressource of the water reflection

Definition at line 254 of file Game.cpp.

bool Game::hasPlayerAtLevelBounds ( const Vec3  playerPosition  )  const

Definition at line 258 of file Game.cpp.

bool Game::init (  ) 

inits the graphics engine and creates physics, player, and enemies

Definition at line 58 of file Game.cpp.

void Game::keyStateChange ( int  key,
bool  state 
)

sends keyboard events to the player

Definition at line 358 of file Game.cpp.

void Game::mouseButtonEvent ( int  button,
bool  action 
)

sends mouse click events to the player

Parameters:
button which button is clicked
action true when clicked, false when released

Definition at line 351 of file Game.cpp.

void Game::mouseMoveEvent ( float  dX,
float  dY 
)

sends mouse motion to the player

Definition at line 365 of file Game.cpp.

void Game::recycleEnemy ( Enemy oldEnemy  ) 

resets a recently killed enemy until all enemies are killed

Definition at line 223 of file Game.cpp.

void Game::release (  ) 

Definition at line 341 of file Game.cpp.

void Game::resize ( int  width,
int  height 
)

Definition at line 326 of file Game.cpp.

void Game::update ( const float  timeStep,
const float  fps 
)

Actually the loop is in Start.main()

Parameters:
timeStep the time since the last rendering in millisecs

Definition at line 128 of file Game.cpp.


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

Generated by  doxygen 1.6.2