Atlas Engine
API Referenceatlasatlas/graphics

SpotLight

Positioned cone light with inner and outer cutoffs, direction, and range.

Module: atlas/graphics

Positioned cone light with inner and outer cutoffs, direction, and range.

Declaration

export class SpotLight { ... }

Constructors

Creates a new spot light.

constructor(
            position?: Position3d,
            direction?: Magnitude3d,
            color?: Color,
            cutOff?: number,
            outerCutOff?: number,
            shineColor?: Color,
            intensity?: number,
            range?: number,
        );

Properties

position

The position in world space.

position: Position3d;

direction

The normalized direction vector.

direction: Magnitude3d;

color

The RGBA color.

color: Color;

shineColor

The shine color.

shineColor: Color;

range

The range.

range: number;

cutOff

The cut off.

cutOff: number;

outerCutOff

The outer cut off.

outerCutOff: number;

intensity

The effect intensity.

intensity: number;

Methods

setColor

Updates the color used by this object.

setColor(color: Color): void;

createDebugObject

Creates a visual representation of the light for debugging.

createDebugObject(): void;

lookAt

Orients toward the target position.

lookAt(target: Position3d): void;

castShadows

Enables shadow casting with the requested shadow-map resolution.

castShadows(resolution: number): void;

On this page