SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
PointLight.hpp
Go to the documentation of this file.
1#ifndef _POINT_LIGHT_HPP_
2#define _POINT_LIGHT_HPP_
3
4#include <Lighting/Light.hpp>
5
6namespace Sleak {
7
8 /// Omnidirectional light that falls off with distance out to Range.
9 /// @ingroup lighting
10 class ENGINE_API PointLight : public Light {
11 public:
12 explicit PointLight(const std::string& name = "PointLight");
13 ~PointLight() override = default;
14
16
17 void SetRange(float range) { m_range = range; }
18 float GetRange() const { return m_range; }
19
20 void SetPosition(const Math::Vector3D& pos) {
21 m_position = pos;
22 }
23 Math::Vector3D GetPosition() const { return m_position; }
24
25 private:
26 Math::Vector3D m_position{0.0f, 0.0f, 0.0f};
27 float m_range = 10.0f;
28 };
29
30} // namespace Sleak
31
32#endif // _POINT_LIGHT_HPP_
Light(const std::string &name="Light")
Definition Light.cpp:5
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
void SetPosition(const Math::Vector3D &pos)
float GetRange() const
Math::Vector3D GetPosition() const
~PointLight() override=default
void SetRange(float range)
Root namespace for everything the engine exposes.
Definition Camera.hpp:10
One light's packed GPU representation, laid out for std140/cbuffer alignment.