ThreePipe
    Preparing search index...

    Class DirectionalLight2

    Extension of three.js DirectionalLight with additional properties for serialization and UI A directional light is a light source that has a position but no dimensions - a single point in space that emits light in a specific direction.

    Note - gltf serialization is handled by GLTFLightExtrasExtension

    Hierarchy

    Implements

    Index

    Constructors

    Properties

    assetType: "light" = ...
    castShadow: boolean

    Whether the object gets rendered into shadow map.

    If set to true light will cast dynamic shadows. Warning: This is expensive and requires tweaking to get shadows looking right.

    THREE.DirectionalLightShadow | DirectionalLightShadow for details.

    false

    Array with object's children.

    THREE.Object3DGroup | Group for info on manually grouping objects.

    []

    color: Color

    Color of the light. \

    new THREE.Color(0xffffff) (white).

    getObjectById: (
        id: number,
    ) =>
        | undefined
        | IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >

    Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

    Type declaration

    Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.

    id

    getObjectByName: (
        name: string,
    ) =>
        | undefined
        | IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >

    Searches through an object and its children, starting with the object itself, and returns the first with a matching name.

    Type declaration

    Note that for most objects the name is an empty string by default You will have to set it manually to make use of this method.

    getObjectByProperty: (
        name: string,
        value: string,
    ) =>
        | undefined
        | IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >

    Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.

    Type declaration

    intensity: number

    The light's intensity, or strength. The units of intensity depend on the type of light.

    1

    isDirectionalLight2: true
    parent:
        | null
        | IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >

    Object's parent in the scene graph.

    An object can have at most one parent.

    null

    position: Vector3

    This is set equal to THREE.Object3D.DEFAULT_UP, so that the light shines from the top down.

    Object3D.DEFAULT_UP (0, 1, 0)

    refreshUi: (this: IObject3D) => void = iLightCommons.refreshUi
    rotation: Euler

    Object's local rotation (Euler angles), in radians.

    new THREE.Euler() - that is (0, 0, 0, Euler.DEFAULT_ORDER).

    setDirty: (
        this: ILight,
        options?: IObjectSetDirtyOptions,
        ...args: any[],
    ) => void = iLightCommons.setDirty

    Dispatches 'objectUpdate' event on object.

    shadowBias: number
    shadowFar: number
    shadowFrustum: number
    shadowMapSize: Vector2
    shadowNear: number
    shadowNormalBias: number
    shadowRadius: number
    traverse: (callback: (object: IObject3D) => void) => void

    Executes the callback on this object and all descendants.

    Type declaration

      • (callback: (object: IObject3D) => void): void
      • Parameters

        • callback: (object: IObject3D) => void

          A function with as first argument an Object3D object.

        Returns void

    Note: Modifying the scene graph inside the callback is discouraged.

    traverseAncestors: (callback: (object: IObject3D) => void) => void

    Executes the callback on all ancestors.

    Type declaration

      • (callback: (object: IObject3D) => void): void
      • Parameters

        • callback: (object: IObject3D) => void

          A function with as first argument an Object3D object.

        Returns void

    Note: Modifying the scene graph inside the callback is discouraged.

    traverseVisible: (callback: (object: IObject3D) => void) => void

    Like traverse, but the callback will only be executed for visible objects

    Type declaration

      • (callback: (object: IObject3D) => void): void
      • Parameters

        • callback: (object: IObject3D) => void

          A function with as first argument an Object3D object.

        Returns void

    Descendants of invisible objects are not traversed. Note: Modifying the scene graph inside the callback is discouraged.

    uiConfig: UiObjectConfig = ...
    visible: boolean

    Object gets rendered if true.

    true

    Accessors

    Methods