magic-pixels
    Preparing search index...

    Class DirectionalLight

    Light from a source so far away that its rays are parallel, like the sun. It shines along the node's -Z axis in world space, the same axis a camera looks along, so light.lookAt(target) aims it (the +Z convention of Object3D.lookAt is overridden here) and a glTF KHR_lights_punctual directional light maps onto it without conversion. The position is irrelevant; only the orientation counts.

    Hierarchy (View Summary)

    Index
    children: Object3D[] = []
    color: Color

    the light's colour, used as linear RGB; the alpha channel is ignored

    intensity: number = 1

    multiplies the colour, 1 by default

    localMatrix: Mat4 = ...

    transform relative to the parent

    matrixAutoUpdate: boolean = true

    When true (the default), updateWorldMatrix() recomposes localMatrix from position, rotation and scale. Set to false to write localMatrix yourself; flag changes with worldMatrixNeedsUpdate.

    parent: Object3D | null = null
    position: Vector = ...

    translation relative to the parent

    quaternion: Quaternion = ...

    rotation relative to the parent, as a unit quaternion

    rotation: Vector = ...

    rotation relative to the parent, as Euler angles in radians applied in XYZ order; kept in sync with quaternion

    scale: Vector = ...

    scale factors per axis

    visible: boolean = true

    invisible objects and their children are not rendered

    worldMatrix: Mat4 = ...

    transform relative to the scene root

    worldMatrixNeedsUpdate: boolean = false

    set to true after changing localMatrix manually

    • Aim the light at target, a point in the parent's coordinate system: the -Z axis (the direction the light shines) points at it.

      Parameters

      Returns this

    • Recompose localMatrix from position, quaternion and scale, after bringing quaternion and rotation in sync (see the class description).

      Returns this

    • Update the world matrices of this object and its descendants.

      Parameters

      • force: boolean = false

        recompute even if nothing was flagged as changed

      Returns void