Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Entity.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 #include <glm.hpp>
5 #include <gtc/type_ptr.hpp>
6 #include <gtc/matrix_transform.hpp>
7 #include <memory>
8 #include "glew.h"
9 #include "Utilities.h"
10 #include "Model.h"
11 
16 class Entity
17 {
18 protected:
22  glm::vec3 rotation;
24  glm::vec3 position;
26  float scaleValue;
28  float moveSpeed;
30  float rotateSpeed;
31 
32 public:
39  Entity(Model* model, float scaleValue);
40 
45  virtual ~Entity();
46 
51  virtual void update(float dt) = 0;
52 
58  void draw(glm::mat4 &viewMatrix, glm::mat4 &projMatrix);
59 
64  void setPosition(glm::vec3 position);
65 
72  void setPosition(float x, float y, float z);
73 
78  void rotateX(float angle);
79 
84  void rotateY(float angle);
85 
90  void rotateZ(float angle);
91 
96  void setScale(float scaleValue);
97 
102  void move(glm::vec3 movement);
103 
108  void moveX(float movement);
109 
114  void moveY(float movement);
115 
120  void moveZ(float movement);
121 
126  void setMoveSpeed(float moveSpeed);
127 
132  glm::vec3 getPosition();
133 
138  glm::vec3 getOrientation();
139 
144  float getScale();
145 };
GLdouble GLdouble z
Definition: glew.h:1558
Model * model
Definition: Entity.h:20
Creates a Model from an object and a shader.
Definition: Model.h:14
Entity(Model *model, float scaleValue)
Definition: Entity.cpp:6
void rotateX(float angle)
Definition: Entity.cpp:63
void rotateZ(float angle)
Definition: Entity.cpp:103
GLint GLint GLint GLint GLint GLint y
Definition: glew.h:1251
void rotateY(float angle)
Definition: Entity.cpp:83
void move(glm::vec3 movement)
Definition: Entity.cpp:134
void setPosition(glm::vec3 position)
Definition: Entity.cpp:37
virtual void update(float dt)=0
void moveY(float movement)
Definition: Entity.cpp:156
Creates an Entity containing a Model.
Definition: Entity.h:16
float getScale()
Definition: Entity.cpp:205
void draw(glm::mat4 &viewMatrix, glm::mat4 &projMatrix)
Definition: Entity.cpp:28
void moveZ(float movement)
Definition: Entity.cpp:167
void setScale(float scaleValue)
Definition: Entity.cpp:123
glm::vec3 getOrientation()
Definition: Entity.cpp:196
void moveX(float movement)
Definition: Entity.cpp:145
float scaleValue
Definition: Entity.h:26
GLint GLint GLint GLint GLint x
Definition: glew.h:1251
virtual ~Entity()
Definition: Entity.cpp:21
float rotateSpeed
Definition: Entity.h:30
glm::vec3 rotation
Definition: Entity.h:22
glm::vec3 getPosition()
Definition: Entity.cpp:187
GLdouble angle
Definition: glew.h:8878
glm::vec3 position
Definition: Entity.h:24
void setMoveSpeed(float moveSpeed)
Definition: Entity.cpp:178
float moveSpeed
Definition: Entity.h:28