DayNightCycleComponent class Gameplay kit

Controller driving time-of-day solar movement and dynamic lighting transitions.

Inheritance

Constructors

DayNightCycleComponent({double timeOfDay = 12.0, double timeSpeed = 0.0, double latitude = 34.0, Node? sunLightNode, PhysicalSkySource? skySource, Scene? targetScene, bool applyLightingToTarget = true, bool shadowOnly = false})

Properties

applyLightingToTarget bool
Whether to automatically apply evaluated sun colors and intensities to the light.
getter/setter pair
enabled bool
Whether this component's update hook runs each frame.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isAttached bool
Whether this component is currently attached to a node.
no setterinherited
isLoaded bool
Whether onLoad has completed.
no setterinherited
isMounted bool
Whether the owning node is part of a live scene graph.
no setterinherited
latitude double
Latitude of the world in degrees (-90 to +90).
getter/setter pair
node Node
The node this component is attached to.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowOnly bool
When true, the directional sun light contributes pure shadow casting with 0 direct illuminance.
getter/setter pair
skySource PhysicalSkySource?
Optional procedural physical sky whose sun direction is synchronized.
getter/setter pair
sunDirection → Vector3
Evaluates the normalized sun direction vector looking towards the sun in the sky.
no setter
sunLightNode Node?
Target node hosting the scene's primary directional sun light.
getter/setter pair
targetScene Scene?
Optional target scene whose environment intensity is synchronized.
getter/setter pair
timeOfDay double
Current time of day in 24-hour decimal format (0.0 to 24.0).
getter/setter pair
timeSpeed double
Speed multiplier for time progression (e.g. 1.0 = 1 game hour per second, 0 = paused).
getter/setter pair

Methods

cloneFor(Node cloneOwner) Component?
Returns a copy of this component for cloneOwner, the Node.clone counterpart of the owning node, or null to not carry the component to clones (the default).
override
evaluateLighting() AtmosphericLighting
Evaluates lighting parameters based on current sun elevation.
fixedUpdate(double fixedDt) → void
Called once per fixed physics step while the component is mounted, enabled, and loaded. fixedDt is the fixed timestep of the surrounding PhysicsWorld, not the frame interval.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAttach() → void
Called when this component is added to a node.
inherited
onDetach() → void
Called when this component is removed from a node.
inherited
onLoad() Future<void>
Optional asynchronous setup, such as loading an asset.
inherited
onMount() → void
Called when the owning node enters a live scene graph.
inherited
onUnmount() → void
Called when the owning node leaves a live scene graph.
inherited
toString() String
A string representation of this object.
inherited
update(double deltaSeconds) → void
Called once per frame while the component is mounted, enabled, and loaded. deltaSeconds is the elapsed time since the previous tick. A traversal visits each component at most once. Removing this component or an earlier sibling is safe. A component inserted before the current traversal position starts on the next frame. Reordering component or child lists during traversal is unsupported.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited