Toast Engine
Loading...
Searching...
No Matches
point_light.hpp
Go to the documentation of this file.
1
8
9#pragma once
10#include "light.hpp"
11
12#include <toast/export.hpp>
13
14namespace toast {
15class [[ToastNode, Icon("PointLight")]] TOAST_API PointLight : public Light {
16public:
17 PointLight() { setLightType(LightType::point); }
18
19 ~PointLight() override = default;
20
21 [[nodiscard]]
22 auto attenuation() const -> float {
23 return m_attenuation;
24 }
25
26private:
27 [[Reflect, Unit("m"), Range(0, 1000)]]
28 float m_attenuation = 10.0f;
29};
30}
void setLightType(LightType type)
Tags the concrete light kind; called once from each subclass's own constructor body.
Definition light.hpp:70
Definition reflect.hpp:244
Base light node; registers with the renderer so it can be collected into the per-frame light list.