Skip to content

Documentation / @ripl/3d / LightList

Class: LightList ​

Defined in: 3d/src/core/lights.ts:467

An ordered, mutable collection of the lights illuminating a scene.

Every mutation — adding, removing, or changing a property on a light already in the list — notifies the owning context, so lighting changes repaint without an explicit render call.

Implements ​

Constructors ​

Constructor ​

new LightList(notify): LightList

Defined in: 3d/src/core/lights.ts:486

Parameters ​

ParameterTypeDescription
notify() => voidCalled after every mutation, and by any light in the list when it changes.

Returns ​

LightList

Accessors ​

length ​

Get Signature ​

get length(): number

Defined in: 3d/src/core/lights.ts:474

The number of lights in the list, enabled or not.

Returns ​

number


version ​

Get Signature ​

get version(): number

Defined in: 3d/src/core/lights.ts:479

Increments on every mutation, so a consumer can cache resolved lighting between frames.

Returns ​

number

Methods ​

[iterator]() ​

[iterator](): Iterator<Light>

Defined in: 3d/src/core/lights.ts:491

Iterates the lights in insertion order, enabled or not.

Returns ​

Iterator<Light>

Implementation of ​

Iterable.[iterator]


add() ​

add(...lights): void

Defined in: 3d/src/core/lights.ts:496

Adds one or more lights, ignoring any already present.

Parameters ​

ParameterType
...lightsLight[]

Returns ​

void


clear() ​

clear(): void

Defined in: 3d/src/core/lights.ts:526

Removes every light.

Returns ​

void


find() ​

find(type): Light | undefined

Defined in: 3d/src/core/lights.ts:541

Returns the first light of the given type, or undefined when there is none.

Parameters ​

ParameterType
typeLightType

Returns ​

Light | undefined


remove() ​

remove(...lights): void

Defined in: 3d/src/core/lights.ts:510

Removes one or more lights, ignoring any not present.

Parameters ​

ParameterType
...lightsLight[]

Returns ​

void


toArray() ​

toArray(): Light[]

Defined in: 3d/src/core/lights.ts:536

Returns the lights as a new array, in insertion order.

Returns ​

Light[]