Skip to content

Light ​

Abstract base class for all light types.

This class is not intended to be used directly. Use one of the concrete light types such as AmbientLight, DirectionalLight, PointLight, or SpotLight.

INFO

Derives from Node and inherits all public properties and methods.

Construction ​

Constructors ​


Light() ​

Constructs a new light.

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

Types ​

Light::Type enum ​

Enumerates all supported light types.

ValueDescription
AmbientNon-directional constant light.
DirectionalInfinitely distant light with parallel rays.
PointOmnidirectional light emitting from a single point.
SpotLight emitting in a cone from a single point.

Properties ​

color Color ​

Light color represented as RGB components.

cpp
Color color {0xffffffu};

intensity float ​

Intensity multiplier applied to color.

cpp
float intensity {1.0f};

Functions ​

GetNodeType() Node::Type virtual ​

Identifies this node as Node::Type::Light.

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

GetType() Light::Type pure virtual ​

Returns the specific Type of this light.

cpp
virtual Type vglx::Light::GetType() const=0;

SetDebugMode() void virtual ​

Enables or disables debug visualization mode.

This mode can be used by renderers to draw light representations such as frustums, spheres, or cones for debugging purposes.

cpp
virtual void Light::SetDebugMode(bool is_debug_mode);
ParameterDescription
is_debug_modetrue to enable debug mode; false to disable.

Released under the MIT License.