GCubeSDK
©2026 FenixFox®Studios

DirectionalLight

DirectionalLight ⟵ LightObject3D

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 = true) override

Copies properties from another Object3D

object Source object to copy from
recursive Whether to copy all child objects as well

virtual Object3D* clone(bool recursive = true) const override

Creates a copy of this object

recursive Whether to clone all child objects as well

Properties

castShadow bool Whether this light casts shadows
direction Vector3 Light direction vector (normalized)
gxLightObj GXLightObj GX light object for this directional light
target Object3D* Target object the light points toward
useTarget bool Whether to use target-based direction calculation