-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPointLight.cpp
28 lines (24 loc) · 1009 Bytes
/
PointLight.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
#include "PointLight.h"
Mimema::PointLight::PointLightState::PointLightState(const glm::vec3& position, const glm::vec3& color,
float intensity, const glm::vec3& attenuation) {
this->position = position;
this->color = color;
this->intensity = intensity;
this->attenuation = attenuation;
}
Mimema::PointLight::PointLightState Mimema::PointLight::PointLightState::operator*(float alpha) const {
return {position * alpha,
color * alpha,
intensity * alpha,
attenuation * attenuation};
}
Mimema::PointLight::PointLightState
Mimema::PointLight::PointLightState::operator+(const Mimema::PointLight::PointLightState& rhs) const {
return {position + rhs.position,
color + rhs.color,
intensity + rhs.intensity,
attenuation + rhs.attenuation};
}
Mimema::PointLight::PointLight(const PointLightState& pointLightState) : pointLightState(pointLightState) {
// None
}