Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Player.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SDL.h>
4 #include <iostream>
5 #include <glm.hpp>
6 #include <gtc/type_ptr.hpp>
7 #include <gtc/matrix_transform.hpp>
8 #include <memory>
9 #include "glew.h"
10 #include "Utilities.h"
11 #include "Entity.h"
12 
14 #define MAX_ROTATE_ANGLE 300
15 
16 #define ROTATE_AMOUNT (360 - MAX_ROTATE_ANGLE) * 0.1f
17 
22 class Player : public Entity
23 {
24 private:
28  float minAngle;
30  float worldSpeed;
31 
32 public:
39  Player(Model* model, float scaleValue);
40 
45  ~Player();
46 
51  void update(float dt);
52 
57  void input(SDL_Event &incomingEvent);
58 
63  void updateMovement(float dt);
64 
69  void updateRotation(float dt);
70 
76  void updateRotationCheck(float dt, float direction);
77 
82  float getWorldSpeed();
83 
87  void resetCommands();
88 };
void updateRotation(float dt)
Definition: Player.cpp:167
bool left
Definition: Player.h:26
bool rotateDown
Definition: Player.h:26
Model * model
Definition: Entity.h:20
void input(SDL_Event &incomingEvent)
Definition: Player.cpp:53
Creates a Model from an object and a shader.
Definition: Model.h:14
float worldSpeed
Definition: Player.h:30
bool rotateUp
Definition: Player.h:26
void resetCommands()
Definition: Player.cpp:228
float minAngle
Definition: Player.h:28
Player(Model *model, float scaleValue)
Definition: Player.cpp:6
bool up
Definition: Player.h:26
void updateRotationCheck(float dt, float direction)
Definition: Player.cpp:187
Creates an Entity containing a Model.
Definition: Entity.h:16
void updateMovement(float dt)
Definition: Player.cpp:117
float getWorldSpeed()
Definition: Player.cpp:219
float scaleValue
Definition: Entity.h:26
bool right
Definition: Player.h:26
~Player()
Definition: Player.cpp:23
bool down
Definition: Player.h:26
Creates a Player object that inherits Entity.
Definition: Player.h:22
void update(float dt)
Definition: Player.cpp:32