API

Interface RectAreaLight

A single-sided rectangular emitter, shining along its SceneNode's local -Z axis.

interface RectAreaLight {
    children: SceneNode[];
    diffuse: [number, number, number];
    emissionTexture: Texture2D | null;
    excludedMeshes?: ReadonlySet<Mesh>;
    excludedMeshIds?: ReadonlySet<string>;
    height: number;
    includedOnlyMeshes?: ReadonlySet<Mesh>;
    includedOnlyMeshIds?: ReadonlySet<string>;
    intensity: number;
    lightType: "rectArea";
    metadata?: LiteMetadata;
    name: string;
    parent: IWorldMatrixProvider | null;
    position: ObservableVec3;
    rotation: EulerProxy;
    rotationQuaternion: ObservableQuat;
    scaling: ObservableVec3;
    shadowGenerator?: ShadowGenerator;
    specular: [number, number, number];
    visible?: boolean;
    width: number;
    worldMatrix: Mat4;
    worldMatrixVersion: number;
}

Hierarchy (View Summary)

Index
children: SceneNode[]
diffuse: [number, number, number]
emissionTexture: Texture2D | null

Preprocessed emitter image, or null for solid emission. Changes require a scene lighting rebuild.

excludedMeshes?: ReadonlySet<Mesh>

Meshes excluded from this light by object identity. Applied before the ID sets.

excludedMeshIds?: ReadonlySet<string>

Mesh IDs excluded from this light. If set, these meshes are NOT lit by this light.

height: number

Local height. World scaling is applied independently.

includedOnlyMeshes?: ReadonlySet<Mesh>

If non-empty, ONLY these meshes are lit by this light, minus any in excludedMeshes. Applied before the ID sets.

includedOnlyMeshIds?: ReadonlySet<string>

If non-empty, ONLY these mesh IDs are lit by this light. Takes priority over excludedMeshIds.

intensity: number

Direct intensity multiplier, without photometric conversion.

lightType: "rectArea"
metadata?: LiteMetadata

User metadata. glTF loads populate metadata.gltf.extras when source extras exist.

name: string
parent: IWorldMatrixProvider | null
position: ObservableVec3
rotation: EulerProxy

Euler XYZ bidirectional proxy — reads decompose current quat; writes update quat atomically.

rotationQuaternion: ObservableQuat

Quaternion rotation — source of truth for the local matrix.

shadowGenerator?: ShadowGenerator

Shadow generator attached to this light. Set this to make the light cast shadows.

specular: [number, number, number]
visible?: boolean

Self-visibility. Undefined/true = visible; false skips render + camera AABB.

Read-only: change it with setMeshVisible(node, visible), which cascades the value to descendants and invalidates cached opaque render bundles. A plain field write would do neither, leaving a hidden mesh drawing or a revealed mesh missing.

width: number

Local width. World scaling is applied independently.

worldMatrix: Mat4
worldMatrixVersion: number