-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMaterial.h
82 lines (69 loc) · 1.64 KB
/
Material.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
#ifndef MATERIAL_H
#define MATERIAL_H
#include <iostream>
#include <fstream>
#include "Entity.h"
#include "TextureManager.h"
#include "Matrix.h"
#include "ShaderManager.h"
using namespace std;
struct SaveMat
{
float nColor[3];
float nEmission[3];
float nSpecular;
int nShininess;
float nTexOffset[2];
float nTexScale[2];
float nTexRotate;
char sName[100];
char sTextureName[100];
char sNormalName[100];
bool bNormalEnabled;
};
class Material : public Entity
{
private:
float m_nColor[3];
float m_nEmission[3];
float m_nSpecular;
int m_nShininess;
float m_nTexOffset[2];
float m_nTexScale[2];
float m_nTexRotate;
string *m_sTextureName;
string *m_sNormalName;
bool m_bNormalEnabled;
public:
Material();
Material(Material *copyMaterial);
void use();
void sendToShader(string sShader);
bool loadMaterial(const char* sFileName);
void saveMaterial(const char* sFileName);
void setColor(float nRed, float nGreen, float nBlue);
void setEmission(float nRed, float nGreen, float nBlue);
void setSpecular(float nIntensity);
void setShine(int nShine);
void setTexOffset(float nX, float nY);
void setUTexOffset(float nValue);
void setVTexOffset(float nValue);
void setTexScale(float nX, float nY);
void setUTexScale(float nValue);
void setVTexScale(float nValue);
void setTexRotate(float nRotate);
float *getColor();
float *getEmission();
float getSpecular();
int getShine();
float *getTexOffset();
float *getTexScale();
float getTexRotate();
void setTexture(string *sTextureName);
string *getTexture();
void setNormal(string *sNormalName);
string *getNormal();
void enableNormal(bool bEnabled);
bool normalsEnabled();
};
#endif