Interface ILight<TShadowSupport, E, ET>

interface ILight<
    TShadowSupport extends LightShadow
    | undefined = LightShadow | undefined,
    E extends ILightEvent = ILightEvent,
    ET extends ILightEventTypes = ILightEventTypes,
> {
    _currentGeometry?: null | IGeometry;
    _currentMaterial?: null | IMaterial | IMaterial[];
    _onGeometryUpdate?: (e: IGeometryEvent<"geometryUpdate">) => void;
    assetType: "light";
    children: IObject3D[];
    geometry?: IGeometry;
    isCamera?: boolean;
    isLight: true;
    isLine?: boolean;
    isLineSegments?: boolean;
    isMesh?: boolean;
    isScene?: boolean;
    isWidget?: boolean;
    lightObject: ILight<TShadowSupport, E, ET>;
    material?: IMaterial | IMaterial[];
    materials?: IMaterial[];
    modelObject: ILight<TShadowSupport, E, ET>;
    morphTargetDictionary?: Record<string, number>;
    morphTargetInfluences?: number[];
    objectProcessor?: IObjectProcessor;
    parent: null | IObject3D;
    parentRoot?: null | IObject3D;
    target?: Object3D;
    uiConfig?: UiObjectConfig;
    userData: IObject3DUserData;
    add(...object: IObject3D[]): this;
    autoCenter(setDirty?: boolean, undo?: boolean): this;
    autoScale(
        autoScaleRadius?: number,
        isCentered?: boolean,
        setDirty?: boolean,
        undo?: boolean,
    ): this;
    clone(recursive?: boolean): this;
    copy(
        source: this,
        recursive?: boolean,
        distanceFromTarget?: number,
        worldSpace?: boolean,
        ...args: any[],
    ): this;
    dispose(removeFromParent?: boolean): void;
    getObjectById<T extends IObject3D = IObject3D>(id: number): undefined | T;
    getObjectByName<T extends IObject3D = IObject3D>(
        name: string,
    ): undefined | T;
    getObjectByProperty<T extends IObject3D = IObject3D>(
        name: string,
        value: string,
    ): undefined | T;
    pivotToBoundsCenter(setDirty?: boolean): () => void;
    pivotToPoint(point: Vector3, setDirty?: boolean): this;
    refreshUi(): void;
    remove(...object: IObject3D[]): this;
    setDirty(e?: IObjectSetDirtyOptions): void;
    traverse(callback: (object: IObject3D) => void): void;
    traverseAncestors(callback: (object: IObject3D) => void): void;
    traverseVisible(callback: (object: IObject3D) => void): void;
    updateMorphTargets(): void;
}

Type Parameters

Hierarchy (View Summary)

Implemented by

Properties

_currentGeometry?: null | IGeometry
_currentMaterial?: null | IMaterial | IMaterial[]
_onGeometryUpdate?: (e: IGeometryEvent<"geometryUpdate">) => void
assetType: "light"
children: IObject3D[]

Array with object's children.

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

[]

geometry?: IGeometry
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
isLineSegments?: boolean
isMesh?: boolean
isScene?: boolean
isWidget?: boolean
lightObject: ILight<TShadowSupport, E, ET>

use this instead

material?: IMaterial | IMaterial[]
materials?: IMaterial[]

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

modelObject: ILight<TShadowSupport, E, ET>

use object directly

morphTargetDictionary?: Record<string, number>
morphTargetInfluences?: number[]
objectProcessor?: IObjectProcessor
parent: null | IObject3D

Object's parent in the scene graph.

An object can have at most one parent.

null

parentRoot?: null | IObject3D

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

target?: Object3D
uiConfig?: UiObjectConfig

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

  • 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

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

    Type Parameters

    Parameters

    • id: number

      Unique number of the object instance. Expects a Integer

    Returns undefined | T

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

    id

  • 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 Parameters

    Parameters

    • name: string

      the property name to search for.

    • value: string

      value of the given property.

    Returns undefined | T

  • 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.