SpotLightComponent class Scene graph
An engine Component that places a SpotLight in the scene.
While the owning node is part of a live scene, the component registers its light with the scene's render layer so the renderer can find it, and unregisters it when the node leaves the scene.
The light's world position is the owning node's world-space translation, and its aim is the node's world-space rotation applied to the light's local SpotLight.direction, so re-orienting the node aims the cone.
Constructors
- SpotLightComponent(SpotLight light)
-
Creates a component that lights the scene with
light.
Properties
- 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
- light ↔ SpotLight
-
The light this component contributes. Its SpotLight.direction is read
in the owning node's local space; worldDirection is the world result.
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
- worldDirection → Vector3
-
The cone's world-space aim: the owning node's world-space rotation
applied to the light's local SpotLight.direction. Need not be unit
length (the shader normalizes it).
no setter
- worldPosition → Vector3
-
The light's world-space position: the owning node's world-space
translation.
no setter
Methods
-
cloneFor(
Node cloneOwner) → Component? -
Clones carry the light, sharing the light object like other clone
payloads (geometry, materials).
override
-
fixedUpdate(
double fixedDt) → void -
Called once per fixed physics step while the component is mounted,
enabled, and loaded.
fixedDtis 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.
override
-
onUnmount(
) → void -
Called when the owning node leaves a live scene graph.
override
-
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.
deltaSecondsis the elapsed time since the previous tick.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited