Sky Class

Extends Object3D
Module: Lights

Sky class if composed of a HemisphereLight, DirectionalLight and a dynamic generated Sky sphere geometry.

This object is composed by 3 internal objects - Hemisphere light - Directional Light - Mesh

Constructor

Sky

(
  • autoUpdate
  • dayTime
  • sunDistance
  • time
)

Parameters:

  • autoUpdate Boolean

    If true sky auto updated its state

  • dayTime Number

    Day duration in seconds

  • sunDistance Number

    Distance of the sun

  • time Number

    Starting time

Methods

initialize

()

Initialize sky object.

Called automatically by the runtime.

isEmpty

() Boolean

Check if object is empty (has no childrens).

Returns:

Boolean:

True is object is empty

toJSON

(
  • meta
)
Object

Create JSON for object.

Parameters:

  • meta Object

Returns:

Object:

json

update

()

Update sky state.

Called automatically by the runtime.

updateSky

()

Update sky color and sun position.

If autoUpdate set to true is automatically called by the update method.

Properties

autoUpdate

Boolean

If set to true the sky auto updates its time

Default: true

clock

Clock

Clock used to control day time

colorBottom

Array

Array with bottom sky colors

colorTop

Array

Array with top sky colors

dayTime

Number

Day time in seconds

hemisphere

HemisphereLight

Hemisphere light used to match ambient ligth with sky color

moonColor

Number

Moon color in hex RGB

Default: 0x5555BB

sky

Mesh

Sky mesh with material shader to calculate dinamically sky color

sun

DirectionalLight

Directional light to simulate sun light and cast shadows

sunColor

Number

Sun color in hex RGB

Default: 0xFFFFAA

sunDistance

Number

Sun distance

time

Number

Current day time in seconds