Atlas Engine
API Referenceatlasatlas/graphics

AreaLight

Oriented area light with dimensions, emission range, and optional two-sided emission.

Module: atlas/graphics

Oriented area light with dimensions, emission range, and optional two-sided emission.

Declaration

export class AreaLight { ... }

Constructors

Creates a new area light.

constructor(
            position?: Position3d,
            right?: Magnitude3d,
            up?: Magnitude3d,
            size?: Size2d,
            color?: Color,
            shineColor?: Color,
            intensity?: number,
            range?: number,
            angle?: number,
            castsBothSides?: boolean,
            rotation?: Rotation3d,
        );

Properties

position

The position in world space.

position: Position3d;

The right.

right: Magnitude3d;

up

The up.

up: Magnitude3d;

size

The dimensions.

size: Size2d;

color

The RGBA color.

color: Color;

shineColor

The shine color.

shineColor: Color;

intensity

The effect intensity.

intensity: number;

range

The range.

range: number;

angle

The angle.

angle: number;

castsBothSides

Whether the area light emits from both faces.

castsBothSides: boolean;

rotation

The Euler rotation in degrees.

rotation: Rotation3d;

Methods

getNormal

Returns normal.

getNormal(): Magnitude3d;

setColor

Updates the color used by this object.

setColor(color: Color): void;

setRotation

Replaces the rotation.

setRotation(rotation: Rotation3d): void;

rotate

Applies an incremental rotation.

rotate(delta: Rotation3d): void;

createDebugObject

Creates a visual representation of the light for debugging.

createDebugObject(): void;

castShadows

Enables shadow casting with the requested shadow-map resolution.

castShadows(resolution: number): void;

On this page