Player Class Reference

#include <Player.h>

Inheritance diagram for Player:
IShootable

List of all members.

Public Member Functions

 Player (Game *game, Physics *physics, H3DNode camera, const int id)
 ~Player ()
void hit ()
void update (float timeStep)
Vec3 getPosition () const
const char * getCurrentWeaponName () const
void setKeyboardInput (const int key, bool pushed)
void setMouseInput (float dX, float dY)
void setMouseButtonInput (int button, bool action)
void addReflectionCamera (H3DNode cam2)

Detailed Description

Definition at line 26 of file Player.h.


Constructor & Destructor Documentation

Player::Player ( Game game,
Physics physics,
H3DNode  camera,
const int  id 
)

constructs the Player. The player has currently no viewable body.

Parameters:
game the game is needed to give and take important calls
camera the camera frustrum represents the player's view and is changed by the user's input
physics the physics are needed to conduct physics simulation
id an identifier
See also:
IShootable

Definition at line 29 of file Player.cpp.

Player::~Player (  ) 

Definition at line 102 of file Player.cpp.


Member Function Documentation

void Player::addReflectionCamera ( H3DNode  cam2  ) 

Definition at line 110 of file Player.cpp.

const char * Player::getCurrentWeaponName (  )  const

returns the name of the selected weapon

Definition at line 327 of file Player.cpp.

Vec3 Player::getPosition (  )  const

returns the current player position in world space

Returns:
a Vec3 represention the current position

Definition at line 318 of file Player.cpp.

void Player::hit (  )  [virtual]

this method should be called from the enemy when he hits the player. The health should be decreased in turn. this method is not implemented, yet.

Implements IShootable.

Definition at line 299 of file Player.cpp.

void Player::setKeyboardInput ( const int  key,
bool  pushed 
)

does actions according to a pressed key

Parameters:
key 
pushed true when pressed, false when released

Definition at line 472 of file Player.cpp.

void Player::setMouseButtonInput ( int  button,
bool  action 
)

fires a gun when the left mouse button is clicked

Definition at line 552 of file Player.cpp.

void Player::setMouseInput ( float  dX,
float  dY 
)

adjusts the viewing angle which is used for the camera according to the mouse movement

Definition at line 539 of file Player.cpp.

void Player::update ( float  timeStep  ) 

applies the changes made to the player's view. Changes ocurr from both player input and physics, that is: gravitation and so on.

Parameters:
timeStep 

Definition at line 119 of file Player.cpp.


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

Generated by  doxygen 1.6.2