Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
spotlight.hpp
Go to the documentation of this file.
1
8
9
#pragma once
10
#include "
light.hpp
"
11
12
#include <
toast/export.hpp
>
13
14
namespace
toast {
15
class
[[ToastNode, Icon(
"SpotLight"
)]] TOAST_API Spotlight :
public
Light {
16
public
:
17
Spotlight() {
setLightType
(LightType::spot); }
18
19
~Spotlight()
override
=
default
;
20
21
[[nodiscard]]
22
auto
innerRadius()
const
->
float
{
23
return
m_inner_radius;
24
}
25
26
[[nodiscard]]
27
auto
outerRadius()
const
->
float
{
28
return
m_outer_radius;
29
}
30
31
[[nodiscard]]
32
auto
attenuation()
const
->
float
{
33
return
m_attenuation;
34
}
35
36
private
:
37
[[
Reflect
, Unit(
"°"
), Range(0.0, 90.0)]]
38
float
m_inner_radius = 15.0f;
39
40
[[
Reflect
, Unit(
"°"
), Range(0.0, 90.0)]]
41
float
m_outer_radius = 25.0f;
42
43
[[
Reflect
, Unit(
"m"
)]]
44
float
m_attenuation = 10.0f;
45
};
46
}
toast::Light::setLightType
void setLightType(LightType type)
Tags the concrete light kind; called once from each subclass's own constructor body.
Definition
light.hpp:70
toast::Reflect
Definition
reflect.hpp:244
export.hpp
light.hpp
Base light node; registers with the renderer so it can be collected into the per-frame light list.
engine
src
toast
world
spotlight.hpp
Generated by
1.17.0