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

ColorThread::Vec3Linear RGB tint. Default {1, 1, 1}.
IntensityfloatMultiplier on the contribution. Default 1.0.
EnabledboolDisable 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

ColorThread::Vec3Liniowy odcień RGB. Domyślnie {1, 1, 1}.
IntensityfloatMnożnik wkładu. Domyślnie 1.0.
EnabledboolWyłą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;