Skip to content

Light

Abstract base class for light types.

Not intended for direct use.

INFO

Derives from Node and inherits all public properties and methods.

Construction

Constructors


Light()

cpp
vglx::Light::Light(Color color, float intensity)
ParameterDescription
colorLight color.
intensityLight intensity.

Constructs a Light object.

Types

Light::Attenuation struct

Defines how light intensity diminishes over distance.

NameTypeDescription
basefloatMinimum light intensity, unaffected by distance.
linearfloatGradual, proportional fade as distance increases.
quadraticfloatReal-world light falloff using an inverse-square law.

Properties

color Color

cpp
Color color { 0xffffff }

Light color, represented as RGB values.

intensity float

cpp
float intensity { 1.0f }

Light intensity.

Functions

GetNodeType() Node::Type virtual

cpp
Node::Type vglx::Light::GetNodeType() const override

Returns node type.

GetType() LightType pure virtual

cpp
virtual LightType vglx::Light::GetType() const=0

Returns light type.

SetDebugMode() void virtual

cpp
virtual void vglx::Light::SetDebugMode(bool is_debug_mode)
ParameterDescription
is_debug_modeTrue to enable debug mode, false to disable.

Sets debug mode.

Released under the MIT License.