SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
PointLight.cpp
Go to the documentation of this file.
3
4namespace Sleak {
5
6PointLight::PointLight(const std::string& name) : Light(name) {}
7
10
11 entry.PositionX = m_position.GetX();
12 entry.PositionY = m_position.GetY();
13 entry.PositionZ = m_position.GetZ();
14 entry.Type = 1; // Point
15
16 entry.DirectionX = 0.0f;
17 entry.DirectionY = 0.0f;
18 entry.DirectionZ = 0.0f;
19 entry.Intensity = m_intensity;
20
21 entry.ColorR = m_color.GetX();
22 entry.ColorG = m_color.GetY();
23 entry.ColorB = m_color.GetZ();
24 entry.Range = m_range;
25
26 entry.SpotInnerCos = 0.0f;
27 entry.SpotOuterCos = 0.0f;
28 entry.AreaWidth = 0.0f;
29 entry.AreaHeight = 0.0f;
30
31 return entry;
32}
33
34} // namespace Sleak
Math::Vector3D m_color
Definition Light.hpp:57
Light(const std::string &name="Light")
Definition Light.cpp:5
float m_intensity
Definition Light.hpp:58
RenderEngine::LightGPUEntry BuildGPUData() const override
Packs this light's parameters into the GPU-side entry used by the lighting constant buffer.
Definition PointLight.cpp:8
PointLight(const std::string &name="PointLight")
Definition PointLight.cpp:6
Root namespace for everything the engine exposes.
Definition Camera.hpp:10
One light's packed GPU representation, laid out for std140/cbuffer alignment.