ThreePipe
    Preparing search index...

    Interface ILight<TShadowSupport, TE>

    interface ILight<
        TShadowSupport extends LightShadow
        | undefined = LightShadow | undefined,
        TE extends IObject3DEventMap = IObject3DEventMap,
    > {
        __objExtUiConfigs?: Record<
            string,
            | undefined
            | (
                | UiObjectConfig<any, string, any>
                | Fof<ValOrArrOp<UiObjectConfig<any, string, any>>>
            )[],
        >;
        _currentGeometry?:
            | null
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
        _currentMaterial?:
            | null
            | IMaterial<IMaterialEventMap>
            | IMaterial<IMaterialEventMap>[];
        _customDepthMaterial?: Material<MaterialEventMap>;
        _customGBufferMaterial?: Material<MaterialEventMap>;
        _customNormalMaterial?: Material<MaterialEventMap>;
        _loadingPromise?: Promise<void>;
        _onGeometryUpdate?: EventListener2<
            "geometryUpdate",
            BufferGeometryEventMap,
            IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
        >;
        _rootPathRefreshed?: boolean;
        _rootPathRefreshing?: boolean;
        _sChildren?: Object3D<Object3DEventMap>[];
        acceptChildEvents?: boolean;
        assetType: "light";
        autoUpgradeChildren?: boolean;
        boundingBox?: null | Box3;
        boundingSphere?: null | Sphere;
        children: IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >[];
        currentMaterial?:
            | null
            | IMaterial<IMaterialEventMap>
            | IMaterial<IMaterialEventMap>[];
        customGBufferMaterial?: Material<MaterialEventMap>;
        customNormalMaterial?: Material<MaterialEventMap>;
        forcedOverrideMaterial?: Material<MaterialEventMap>;
        geometry?: undefined;
        isCamera?: boolean;
        isLight: true;
        isLine?: boolean;
        isLine2?: boolean;
        isLineSegments?: boolean;
        isLineSegments2?: boolean;
        isMesh?: boolean;
        isMeshLine?: boolean;
        isPoints?: boolean;
        isScene?: boolean;
        isWidget?: boolean;
        lightObject: ILight<TShadowSupport, TE>;
        material?: undefined;
        materials?: IMaterial<IMaterialEventMap>[];
        modelObject: ILight<TShadowSupport, TE>;
        morphTargetDictionary?: Record<string, number>;
        morphTargetInfluences?: number[];
        objectExtensions?: IObjectExtension[];
        objectProcessor?: IObjectProcessor;
        parent:
            | null
            | IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >;
        parentRoot?:
            | null
            | IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >;
        target?: Object3D<Object3DEventMap>;
        uiConfig?: UiObjectConfig<any, string, any>;
        userData: IObject3DUserData;
        add(
            ...object: IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >[],
        ): this;
        autoCenter(setDirty?: boolean, undo?: boolean): this;
        autoScale(
            autoScaleRadius?: number,
            isCentered?: boolean,
            setDirty?: boolean,
            undo?: boolean,
        ): this;
        clone(recursive?: boolean): this;
        computeBoundingBox(): void;
        computeBoundingSphere(): void;
        computeLineDistances(): void;
        copy(
            source: this,
            recursive?: boolean,
            distanceFromTarget?: number,
            worldSpace?: boolean,
            ...args: any[],
        ): this;
        dispose(removeFromParent?: boolean): void;
        getObjectById<
            T extends
                IObject3D<
                    IObject3DEventMap,
                    undefined
                    | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,

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

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

                        | undefined
                        | IMaterial<IMaterialEventMap>
                        | IMaterial<IMaterialEventMap>[],
                > = IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >,
        >(
            name: string,
            value: string,
        ): undefined | T;
        pivotToBoundsCenter(setDirty?: boolean): () => void;
        pivotToPoint(point: Vector3, setDirty?: boolean): this;
        refreshUi(): void;
        remove(
            ...object: IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >[],
        ): this;
        setDirty(e?: IObjectSetDirtyOptions): void;
        traverse(callback: (object: IObject3D) => void): void;
        traverseAncestors(callback: (object: IObject3D) => void): void;
        traverseModels(
            callback: (object: IObject3D) => boolean | void,
            options: { visible: boolean; widgets: boolean; [key: string]: any },
        ): void;
        traverseVisible(callback: (object: IObject3D) => void): void;
        updateMorphTargets(): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    __objExtUiConfigs?: Record<
        string,
        | undefined
        | (
            | UiObjectConfig<any, string, any>
            | Fof<ValOrArrOp<UiObjectConfig<any, string, any>>>
        )[],
    >
    _currentGeometry?:
        | null
        | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>
    _currentMaterial?:
        | null
        | IMaterial<IMaterialEventMap>
        | IMaterial<IMaterialEventMap>[]
    _customDepthMaterial?: Material<MaterialEventMap>
    • store for the actual customDepthMaterial
    _customGBufferMaterial?: Material<MaterialEventMap>
    • store for the actual customGBufferMaterial
    _customNormalMaterial?: Material<MaterialEventMap>
    • store for the actual customNormalMaterial
    _loadingPromise?: Promise<void>

    A promise can be set by the object to indicate that the object is loading. This can be used by the scene, viewer, plugins to defer actions until the object is loaded.

    _onGeometryUpdate?: EventListener2<
        "geometryUpdate",
        BufferGeometryEventMap,
        IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
    >
    • for embedded objects
    _rootPathRefreshed?: boolean
    • for embedded objects
    _rootPathRefreshing?: boolean
    • when embedded objects are loading
    _sChildren?: Object3D<Object3DEventMap>[]
    • for embedded objects
    acceptChildEvents?: boolean

    Set to false to disable propagation of any events from its children.

    assetType: "light"
    autoUpgradeChildren?: boolean

    Set to false to disable automatic call of upgradeObject3D when a child is added.

    boundingBox?: null | Box3

    For InstancedMesh, SkinnedMesh etc

    boundingSphere?: null | Sphere

    For InstancedMesh, SkinnedMesh etc

    Array with object's children.

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

    []

    currentMaterial?:
        | null
        | IMaterial<IMaterialEventMap>
        | IMaterial<IMaterialEventMap>[]
    customGBufferMaterial?: Material<MaterialEventMap>

    Required for plugins like GBufferPlugin

    customNormalMaterial?: Material<MaterialEventMap>

    Required for plugins like NormalBufferPlugin

    forcedOverrideMaterial?: Material<MaterialEventMap>

    If this is set, it will be returned when accessing material property. see GBufferRenderPass for sample usage

    geometry?: undefined
    isCamera?: boolean
    isLight: true

    Read-only flag to check if a given object is of type HemisphereLight.

    This is a constant value

    true

    isLine?: boolean
    isLine2?: boolean
    isLineSegments?: boolean
    isLineSegments2?: boolean
    isMesh?: boolean
    isMeshLine?: boolean
    isPoints?: boolean
    isScene?: boolean
    isWidget?: boolean
    lightObject: ILight<TShadowSupport, TE>

    use this instead

    material?: undefined

    Same as material but always returns an array. To set, just set material property

    modelObject: ILight<TShadowSupport, TE>

    use object directly

    morphTargetDictionary?: Record<string, number>
    morphTargetInfluences?: number[]
    objectExtensions?: IObjectExtension[]
    objectProcessor?: IObjectProcessor
    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

    parentRoot?:
        | null
        | IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >

    Parent/Ancestor of this object to bubble events to. This is set internally by setupObject3D.

    uiConfig?: UiObjectConfig<any, string, any>

    An object that can be used to store custom data about the Object3D.

    It should not hold references to functions as these will not be cloned.

    {}

    Methods

    • Moves the bounding box center of the object to the center of the world

      Parameters

      • OptionalsetDirty: boolean

        calls setDirty

      • Optionalundo: boolean

        undo any previous autoCenter operation

      Returns this

      true
      
    • Scales the object to fit the given radius.

      Parameters

      • OptionalautoScaleRadius: number

        optional (taken from userData.autoScaleRadius by default)

      • OptionalisCentered: boolean

        optional (taken from userData.isCentered by default)

      • OptionalsetDirty: boolean

        true by default

      • Optionalundo: boolean

        undo any previous autoScale operation

      Returns this

    • Returns a clone of this object and optionally all descendants.

      Parameters

      • Optionalrecursive: boolean

        If true, descendants of the object are also cloned. Default true

      Returns this

    • For InstancedMesh, SkinnedMesh etc Computes bounding box, updating .boundingBox attribute.

      Returns void

      Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.

    • Copies value of all the properties from the source to this instance.

      Parameters

      • source: this
      • Optionalrecursive: boolean
      • OptionaldistanceFromTarget: number
      • OptionalworldSpace: boolean
      • ...args: any[]

      Returns this

    • Moves the object pivot to the center of the bounding box.

      The object will rotate around the new pivot.

      Parameters

      • OptionalsetDirty: boolean

        calls setDirty

      Returns () => void

      undo function

      true
      
    • Moves the object pivot to the given point

      The object will rotate around the new pivot.

      Parameters

      • point: Vector3

        point to move the pivot to

      • OptionalsetDirty: boolean

        calls setDirty

      Returns this

      undo function

      true
      
    • Executes the callback on this object and all descendants.

      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.

    • Traverse only upgraded objects with extra options

      Parameters

      • callback: (object: IObject3D) => boolean | void
      • options: { visible: boolean; widgets: boolean; [key: string]: any }

      Returns void