-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodelMaterial.hpp
49 lines (40 loc) · 1.1 KB
/
modelMaterial.hpp
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
/**
* @file modelMaterial.hpp
* @brief Internal material representation for *.mtl files
* @author Dr. Jeffrey Paone
*
* @copyright MIT License Copyright (c) 2021 Dr. Jeffrey Paone
*
* These functions, classes, and constants help minimize common
* code that needs to be written.
*/
#ifndef CSCI441_MODEL_MATERIAL_H
#define CSCI441_MODEL_MATERIAL_H
#ifdef CSCI441_USE_GLEW
#include <GL/glew.h>
#else
#include <glad/gl.h>
#endif
#include <glm/ext/vector_float4.hpp>
namespace CSCI441_INTERNAL {
struct ModelMaterial {
glm::vec4 ambient;
glm::vec4 diffuse;
glm::vec4 specular;
GLfloat shininess;
[[maybe_unused]] glm::vec4 emissive;
GLuint map_Kd;
[[maybe_unused]] GLuint map_d;
ModelMaterial() :
shininess(0.0f),
map_Kd(0),
map_d(0) {
for(size_t i = 0; i < 3; i++) {
ambient[i] = diffuse[i] = specular[i] = emissive[i] = 0.0f;
}
ambient[3] = diffuse[3] = specular[3] = emissive[3] = 1.0f;
}
};
enum class MODEL_TYPE {OBJ, OFF, PLY, STL};
}
#endif // CSCI441_MODEL_MATERIAL_H