DirectionalLightComponent struct in Thread
Infinite-distance light shining in the direction implied by the entity's
TransformComponent.Rotation. Identity rotation
points straight down -Y.
Properties
| Color | Thread::Vec3 | Linear RGB tint. Default {1, 1, 1}. |
| Intensity | float | Multiplier on the contribution. Default 1.0. |
| Enabled | bool | Disable to keep the entity around without contributing light. |
Example
Entity sun = scene->CreateEntity("Sun");
sun.GetComponent<Thread::TransformComponent>().Rotation =
{ Thread::Math::Radians(-50.0f), Thread::Math::Radians(35.0f), 0.0f };
auto& dl = sun.AddComponent<Thread::DirectionalLightComponent>();
dl.Color = { 1.0f, 0.95f, 0.85f };
dl.Intensity = 2.0f;
DirectionalLightComponent struct w Thread
Światło z nieskończonej odległości, świecące w kierunku wynikającym z
TransformComponent.Rotation encji. Rotacja zerowa świeci
prosto w dół, w -Y.
Właściwości
| Color | Thread::Vec3 | Liniowy odcień RGB. Domyślnie {1, 1, 1}. |
| Intensity | float | Mnożnik wkładu. Domyślnie 1.0. |
| Enabled | bool | Wyłącz, żeby zostawić encję bez świecenia. |
Przykład
Entity sun = scene->CreateEntity("Sun");
sun.GetComponent<Thread::TransformComponent>().Rotation =
{ Thread::Math::Radians(-50.0f), Thread::Math::Radians(35.0f), 0.0f };
auto& dl = sun.AddComponent<Thread::DirectionalLightComponent>();
dl.Color = { 1.0f, 0.95f, 0.85f };
dl.Intensity = 2.0f;