PointLight
Represents a light that gets emitted from a single point in all directions.
A common use case for this is to replicate the light emitted from a bare lightbulb.
cpp
auto point_light = vglx::PointLight::Create({
.color = 0xFFFFFF,
.intensity = 1.0f,
.attenuation = {
.base = 1.0f,
.linear = 0.0f,
.quadratic = 0.0f
}
});
INFO
Derives from Light and inherits all public properties and methods.
Construction
Constructors
PointLight()
cpp
vglx::PointLight::PointLight(const Parameters ¶ms)
Parameter | Description |
---|---|
params | PointLight::Parameters |
Constructs a PointLight object.
Factories preferred
PointLight::Create() auto
cpp
static auto vglx::PointLight::Create(const Parameters ¶ms)
Parameter | Description |
---|---|
params | PointLight::Parameters |
Creates a shared pointer to an PointLight object.
Types
PointLight::Parameters struct
Parameters for constructing a PointLight object.
Name | Type | Description |
---|---|---|
attenuation | Attenuation | Light attenuation properties. |
color | Color | Light color. |
intensity | float | Light intensity. |
Properties
attenuation Attenuation
cpp
Attenuation attenuation
Light attenuation properties.
Functions
GetType() LightType virtual
cpp
LightType vglx::PointLight::GetType() const override
Returns light type.
OnUpdate() void virtual
cpp
void vglx::PointLight::OnUpdate(float delta) override
Parameter | Description |
---|---|
delta | Time in seconds since the last update. |
Updates the light each frame.
SetDebugMode() void virtual
cpp
void vglx::PointLight::SetDebugMode(bool is_debug_mode) override
Parameter | Description |
---|---|
is_debug_mode | True to enable debug mode, false to disable. |
Sets debug mode.