-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrimitive.h
More file actions
53 lines (41 loc) · 1.26 KB
/
Primitive.h
File metadata and controls
53 lines (41 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef PRIMITIVE
#define PRIMITIVE
#include <glm/glm.hpp>
#include <GL/glew.h>
#include <vector>
#include "GameObject.h"
#include "Vertex.h"
#include "Material.h"
#include "Physics.h"
class Primitive : public GameObject{
public:
Primitive();
virtual ~Primitive();
glm::vec3 getPosition() {return position;}
glm::vec3 getRotation() {return rotation;}
glm::vec3 getScale() {return scale;}
glm::mat4 getModelMatrix() {return modelMatrix;}
Material getMaterial() {return material;}
BoundingBox getBoundingBox() {return boundingBox;}
void setPosition(glm::vec3 pos) {position = pos;}
void setScale(glm::vec3 newScale) {scale = newScale;}
void setMaterial(Material& mat) {material = mat;}
void setModelMatrix(glm::mat4 model) {modelMatrix = model;}
virtual void render() = 0;
//TODO: Figure out what properties are and if should use here
bool isInSelectRange = false;
bool isSelected = false;
glm::vec3 selectedLocation;
protected:
glm::vec3 position, rotation, scale;
glm::mat4 modelMatrix;
Material material;
BoundingBox boundingBox;
std::vector<Vertex> vertices;
void createIDs();
void bindVertexArray();
void unbindVertexArray();
private:
GLuint vaoID, vboID;
};
#endif