-
Notifications
You must be signed in to change notification settings - Fork 0
/
Light.cpp
46 lines (46 loc) · 1.05 KB
/
Light.cpp
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
#include "Light.h"
Light*Light::mMainLight = nullptr;
std::unordered_set<Light*> Light::mLights;
Light::Light(){
mType = kLightTypeDirectional;
mPosition[0] = 0.0f;
mPosition[1] = 1.0f;
mPosition[2] = 0.0f;
mPosition[3] = 0.0f;
}
void Light::SetAmbientColor(float r, float g, float b, float a) {
mAmbient[0] = r;
mAmbient[1] = g;
mAmbient[2] = b;
mAmbient[3] = a;
}
void Light::SetDiffuseColor(float r, float g, float b, float a) {
mDiffuse[0] = r;
mDiffuse[1] = g;
mDiffuse[2] = b;
mDiffuse[3] = a;
}
void Light::SetSpecularColor(float r, float g, float b, float a) {
mSpecular[0] = r;
mSpecular[1] = g;
mSpecular[2] = b;
mSpecular[3] = a;
}
void Light::SetSetting0(float x, float y, float z, float w) {
mSetting0[0] = x;
mSetting0[1] = y;
mSetting0[2] = z;
mSetting0[3] = w;
}
void Light::SetSetting1(float x, float y, float z, float w) {
mSetting1[0] = x;
mSetting1[1] = y;
mSetting1[2] = z;
mSetting1[3] = w;
}
void Light::SetPosition(float x, float y, float z, float w) {
mPosition[0] = x;
mPosition[1] = y;
mPosition[2] = z;
mPosition[3] = w;
}