SgSky

Reference

class SgSky
module:
create(options, parent)

Create a new sky object in the scenegraph.

Parameters:
  • options (table) – A table of options to fill the parameters

  • parent (SceneObject) – The parent scene object to add this to

Returns:

a promise which will resolve to the created object

Return type:

Promise

Usage:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
-- Options can be omitted. This example shows the defaults,
-- only specify the ones you want different.
SgSky:create({
    active = true,
    name = "",
    transform = Transform.new(),
    layers = {0},
    tags = {},
    receiveShadow = false,
    castShadow = false,
    size = 1000,
    turbidity = 10,
    rayleigh = 2,
    mieCoefficient = 0.005,
    mieDirectionalG = 0.8,
    inclination = 0.49
    azimuth = 0.25
})
fromObject(obj)

Create a sky object from another scene object

Parameters:

obj (SceneObject) – The scene object to convert

fromHandle(handle, nodeId)

create a sky object from a handle. Used internally.

Parameters:
  • handle (number)

  • nodeId (str)

Returns:

result object

Return type:

SgSky

Examples