-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointLight.cpp
More file actions
39 lines (32 loc) · 841 Bytes
/
PointLight.cpp
File metadata and controls
39 lines (32 loc) · 841 Bytes
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
export module graphics:PointLight;
import :CubeMap;
import math;
import color;
import <cmath>;
export namespace graphics
{
class PointLight
{
math::Vec3 position;
public:
float strength;
float specularStrength;
math::Vec3 specularColor;
CubeMap shadowMap;
PointLight() = default;
explicit PointLight(const unsigned int resolution, const math::Vec3& position,
const float strength, const float specularStrength,
const math::Vec3& specularColor = color::white.subvector<3>()) : position(position),
strength(strength), specularStrength(specularStrength), specularColor(specularColor),
shadowMap(resolution, position) {}
math::Vec3 getPosition() const
{
return position;
}
void setPosition(const math::Vec3& position)
{
this->position = position;
shadowMap.setPosition(position);
}
};
}