Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Private Attributes | List of all members
Player Class Reference

Creates a Player object that inherits Entity. More...

#include <Player.h>

Inheritance diagram for Player:
Inheritance graph
Collaboration diagram for Player:
Collaboration graph

Public Member Functions

 Player (Model *model, float scaleValue)
 
 ~Player ()
 
void update (float dt)
 
void input (SDL_Event &incomingEvent)
 
void updateMovement (float dt)
 
void updateRotation (float dt)
 
void updateRotationCheck (float dt, float direction)
 
float getWorldSpeed ()
 
void resetCommands ()
 
- Public Member Functions inherited from Entity
 Entity (Model *model, float scaleValue)
 
virtual ~Entity ()
 
void draw (glm::mat4 &viewMatrix, glm::mat4 &projMatrix)
 
void setPosition (glm::vec3 position)
 
void setPosition (float x, float y, float z)
 
void rotateX (float angle)
 
void rotateY (float angle)
 
void rotateZ (float angle)
 
void setScale (float scaleValue)
 
void move (glm::vec3 movement)
 
void moveX (float movement)
 
void moveY (float movement)
 
void moveZ (float movement)
 
void setMoveSpeed (float moveSpeed)
 
glm::vec3 getPosition ()
 
glm::vec3 getOrientation ()
 
float getScale ()
 

Private Attributes

bool up
 
bool down
 
bool left
 
bool right
 
bool rotateUp
 
bool rotateDown
 
float minAngle
 
float worldSpeed
 

Additional Inherited Members

- Protected Attributes inherited from Entity
Modelmodel
 
glm::vec3 rotation
 
glm::vec3 position
 
float scaleValue
 
float moveSpeed
 
float rotateSpeed
 

Detailed Description

Creates a Player object that inherits Entity.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

Player::Player ( Model model,
float  scaleValue 
)

Constructs a Player Object. Creates a Player Object with a Model using the shader file locations, the obj file location and OpenGL.

Parameters
modelA pointer to the model.
scaleValueThe scale of the Model.

Here is the call graph for this function:

Player::~Player ( )

Destructs a Player Object. Destructs the Player Object deleting the Player Object from memory.

Member Function Documentation

float Player::getWorldSpeed ( )

Getter # Gets the world speed of the Entity.

Returns
The world speed of the Entity.

Here is the caller graph for this function:

void Player::input ( SDL_Event &  incomingEvent)

Handles inputs for the Player.

Parameters
incomingEventA reference to the input event.

Here is the caller graph for this function:

void Player::resetCommands ( )

Sets all of the user commands to false

Here is the caller graph for this function:

void Player::update ( float  dt)
virtual

A function that updates the Player

Parameters
dtThe delta time.

Implements Entity.

Here is the call graph for this function:

Here is the caller graph for this function:

void Player::updateMovement ( float  dt)

Updates the player movement.

Parameters
dtThe delta time.

Here is the call graph for this function:

Here is the caller graph for this function:

void Player::updateRotation ( float  dt)

Updates the player rotation.

Parameters
dtThe delta time.

Here is the call graph for this function:

Here is the caller graph for this function:

void Player::updateRotationCheck ( float  dt,
float  direction 
)

Updates the player rotation.

Parameters
dtThe delta time.
directionThe direction to rotate the player (1 for up, -1 for down).

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool Player::down
private
bool Player::left
private
float Player::minAngle
private

The min angle the Player can be

bool Player::right
private
bool Player::rotateDown
private
bool Player::rotateUp
private
bool Player::up
private

Movement commands

float Player::worldSpeed
private

The speed the world moves


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