DirectionalLight
DirectionalLight ⟵ Light ⟵ Object3D
A light that gets emitted in a specific direction.
DirectionalLight simulates light from an infinitely distant source, such as the sun. All light rays produced are parallel, making it perfect for simulating daylight or distant light sources.
Methods
DirectionalLight(const Color& color, f32 lightIntensity)
Universal constructor - covers all cases with smart defaults
| color | color (RGBA) | Color() |
| lightIntensity | Intensity value (0.0 - 1.0) | 1.0f |
virtual void apply() override
Applies this directional light's settings to the GX pipeline
virtual void update() override
Updates directional light state (called each frame)
virtual DirectionalLight* clone() const override
Creates a copy of this directional light
virtual void copy(const Light& source) override
Copies properties from another light
| source | Source light to copy from |
virtual void copy(const Object3D& object, bool recursive) override
Copies properties from another Object3D
| object | Source object to copy from | |
| recursive | Whether to copy all child objects as well | true |
virtual Object3D* clone(bool recursive) const override
Creates a copy of this object
| recursive | Whether to clone all child objects as well | true |
virtual void dispose() override
Frees GPU-related resources
virtual void setupGXLight() override
Sets up the GX directional light object
Properties
| castShadow | bool | Whether this light casts shadows |
| target | Object3D * | Target object the light points toward |
| direction | Vector3 | Light direction vector (normalized) |
| gxLightObj | GXLightObj | GX light object for diffuse lighting |
| gxSpecularLightObj | GXLightObj | GX light object for specular lighting |
| useTarget | bool | Whether to use target |