#include <Player.h>
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) |
Definition at line 26 of file Player.h.
constructs the Player. The player has currently no viewable body.
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 |
Definition at line 29 of file Player.cpp.
Player::~Player | ( | ) |
Definition at line 102 of file Player.cpp.
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
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
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.
timeStep |
Definition at line 119 of file Player.cpp.