-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphicsObject.h
98 lines (79 loc) · 1.98 KB
/
GraphicsObject.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef GRAPHICSOBJECT_H
#define GRAPHICSOBJECT_H
#include <GL/glew.h>
#include <GL/freeglut.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include "glm/glm.hpp"
#include <math.h>
#include "camera.h"
#include "LightSource.h"
class GraphicsObject
{
public:
//vars
std::string name;
std::string texname;
std::string normtexname;
//vertex
GLuint VBO;
//color
GLuint CBO;
//indicies
GLuint IBO;
//normals
GLuint NBO;
//uvs
GLuint UBO;
//tangents
GLuint TBO;
//bitangents
GLuint BBO;
GLint textureID;
GLint normalMapID;
glm::vec3 position;
glm::mat4 TranslateOrigin;
glm::mat4 InitialTransform;
glm::mat4 ModelMatrix;
std::vector<GLfloat> vertex_buffer_data;
std::vector<GLuint> index_buffer_data;
std::vector<GLfloat> vertex_normal_data;
std::vector<GLfloat> texture_vertex_data;
std::vector<GLfloat> vertex_tangent_data;
std::vector<GLfloat> vertex_bintangent_data;
glm::vec3 diffuse;
glm::vec3 specular;
GLfloat shininess;
//Shader Flags
static float speed;
static bool disableSpec;
static bool disableAmbient;
static bool disableDiff;
static bool disableNormalMapping;
//func
GraphicsObject(const std::vector<GLfloat> & vertex_buffer_temp,
const std::vector<GLuint> & index_buffer_temp,
const glm::vec3 & diff_tmp,
const glm::vec3 & spec_tmp,
const std::vector<GLfloat> & tex_tmp,
GLfloat shiny,
const std::string & name,
const std::string & texname,
const std::string & normtexname);
void Draw(GLuint ShaderProgram, std::vector<LightSource> lightSources);
void initobj(float x, float y, float z);
void IdleWork(bool updown);
GLint LoadTexture(const std::string & filename);
enum DataID {vPosition = 0, vNormals = 1, vUV = 2, vTangents = 3, vBiTangents = 4};
private:
//vars
float oldtime;
float newtime;
//func
void rotAroundCenter();
void UpDown();
void SetupDataBuffers();
};
#endif /*GRAPHICSOBJECT_H */