-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrimitiveObject.h
42 lines (37 loc) · 944 Bytes
/
PrimitiveObject.h
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
#pragma once
#define M_PI 3.14159265358979323846
class PrimitiveObject
{
GLuint VAO;
GLuint VBO;
protected:
glm::vec3 position;
glm::vec4 rotation;
std::vector<GLfloat> coord;
GLuint textureDiffuse;
GLuint textureSpecular;
public:
PrimitiveObject(GLuint texD, GLuint texS, glm::vec3 pos, glm::vec4 rot)
: textureDiffuse(texD), textureSpecular(texS), position(pos), rotation(rot) {}
~PrimitiveObject();
void bindVertices();
void Draw(const glm::mat4&, GLuint modelLoc, GLuint shader) const;
void pushVertex(GLfloat x, GLfloat y, GLfloat z, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat tx, GLfloat ty);
void rotateVerticesAroundAxis();
glm::vec3 getPosition()
{
return position;
}
void setPosition(glm::vec3 position)
{
this->position = position;
}
glm::vec4 getRotation()
{
return rotation;
}
void setRotation(glm::vec4 rotation)
{
this->rotation = rotation;
}
};