Light
This class is not intended to be used directly. Use one of the concrete light types such as DirectionalLight, PointLight, or SpotLight unless defining a custom light implementation.
INFO
Derives from Node and inherits all public properties and methods.
Construction
Constructors
Light()
Constructs a new light.
Light::Light(Color color, float intensity);| Parameter | Description |
|---|---|
| color | Light color. |
| intensity | Light intensity multiplier. |
Types
Light::Type enum
Enumerates all supported light types.
| Value | Description |
|---|---|
| Ambient | Non-directional constant light. |
| Directional | Infinitely distant light with parallel rays. |
| Point | Omnidirectional light emitting from a single point. |
| Spot | Light emitting in a cone from a single point. |
Light::Attenuation struct
Defines how light intensity diminishes over distance.
Used by point and spot lights to simulate physical light falloff. The attenuation model follows the classic convention:
where , , and correspond to base, linear, and quadratic components respectively, and is the distance from the light source.
| Parameter | Description |
|---|---|
| base float | Constant term unaffected by distance. |
| linear float | Linear fade with distance. |
| quadratic float | Quadratic fade (inverse-square falloff). |
Properties
Light color represented as RGB components.
Color color {0xffffff};Functions
GetNodeType() Node::Type virtual
Identifies this node as Node::Type::Light.
Type vglx::Light::GetNodeType() const override;GetType() Light::Type pure virtual
Returns the specific Type of this light.
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.
virtual void Light::SetDebugMode(bool is_debug_mode);| Parameter | Description |
|---|---|
| is_debug_mode | true to enable debug mode; false to disable. |