Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ILightSceneApi

The api for a light scene. A light scene is a collection of lights. Therefore multiple light scene can be used to switch between different lighting environments. It can be created by calling the createLightScene method.

Hierarchy

  • ILightSceneApi

Index

Properties

id: string

The id of the light scene.

lights: {}

The collection of lights in the light scene.

Type declaration

node: ITreeNode

The node in which the lights are stored in the scene tree.

name?: string

The name of the light scene.

Methods

  • addAmbientLight(properties: { color?: Color; id?: string; intensity?: number; name?: string }): ILightApi
  • Create an ambient light and add it to the light scene.

    Parameters

    • properties: { color?: Color; id?: string; intensity?: number; name?: string }
      • Optional color?: Color

        The color of the light.

      • Optional id?: string

        The id of the light.

      • Optional intensity?: number

        The intensity of the light. (0-Infinity, default: 0.5)

      • Optional name?: string

        The name of the light.

    Returns ILightApi

  • addDirectionalLight(properties: { castShadow?: boolean; color?: Color; direction?: vec3; id?: string; intensity?: number; name?: string; shadowMapBias?: number; shadowMapResolution?: number }): IDirectionalLightApi
  • Create a directional light and add it to the light scene.

    Parameters

    • properties: { castShadow?: boolean; color?: Color; direction?: vec3; id?: string; intensity?: number; name?: string; shadowMapBias?: number; shadowMapResolution?: number }
      • Optional castShadow?: boolean

        Option for the light to cast shadows.

      • Optional color?: Color

        The color of the light.

      • Optional direction?: vec3

        The direction of the light.

      • Optional id?: string

        The id of the light.

      • Optional intensity?: number

        The intensity of the light. (0-Infinity, default: 0.5)

      • Optional name?: string

        The name of the light.

      • Optional shadowMapBias?: number

        The bias of the shadow map. For more info on the shadow bias, see here.

      • Optional shadowMapResolution?: number

        The resolution of the shadow map. (default: 1024, has to be power of two)

    Returns IDirectionalLightApi

  • addHemisphereLight(properties: { color?: Color; groundColor?: Color; id?: string; intensity?: number; name?: string }): IHemisphereLightApi
  • Create an hemisphere light and add it to the light scene.

    Parameters

    • properties: { color?: Color; groundColor?: Color; id?: string; intensity?: number; name?: string }
      • Optional color?: Color

        The color of the light.

      • Optional groundColor?: Color

        The ground color of the light.

      • Optional id?: string

        The id of the light.

      • Optional intensity?: number

        The intensity of the light. (0-Infinity, default: 0.5)

      • Optional name?: string

        The name of the light.

    Returns IHemisphereLightApi

  • addPointLight(properties: { color?: Color; decay?: number; distance?: number; id?: string; intensity?: number; name?: string; position?: vec3 }): IPointLightApi
  • Create a point light and add it to the light scene.

    Parameters

    • properties: { color?: Color; decay?: number; distance?: number; id?: string; intensity?: number; name?: string; position?: vec3 }
      • Optional color?: Color

        The color of the light.

      • Optional decay?: number

        The decay of the light.

      • Optional distance?: number

        The distance of the light.

      • Optional id?: string

        The id of the light.

      • Optional intensity?: number

        The intensity of the light. (0-Infinity, default: 0.5)

      • Optional name?: string

        The name of the light.

      • Optional position?: vec3

        The position of the light.

    Returns IPointLightApi

  • addSpotLight(properties: { angle?: number; color?: Color; decay?: number; distance?: number; id?: string; intensity?: number; name?: string; penumbra?: number; position?: vec3; target?: vec3 }): ISpotLightApi
  • Create a point light and add it to the light scene.

    Parameters

    • properties: { angle?: number; color?: Color; decay?: number; distance?: number; id?: string; intensity?: number; name?: string; penumbra?: number; position?: vec3; target?: vec3 }
      • Optional angle?: number

        The angle of the light.

      • Optional color?: Color

        The color of the light.

      • Optional decay?: number

        The decay of the light.

      • Optional distance?: number

        The distance of the light.

      • Optional id?: string

        The id of the light.

      • Optional intensity?: number

        The intensity of the light. (0-Infinity, default: 0.5)

      • Optional name?: string

        The name of the light.

      • Optional penumbra?: number

        The penumbra of the light.

      • Optional position?: vec3

        The position of the light.

      • Optional target?: vec3

        The target of the light.

    Returns ISpotLightApi

  • removeLight(id: string): boolean
  • Remove a light from the light scene with the specified id.

    Parameters

    • id: string

      The id of the light to remove.

    Returns boolean