Sun
The Sun is a light source that comes default in every World. It can be accessed by running this.scene().findFirst(‘Light Sun’);.
Function | Description |
---|---|
color() |
Returns the color of the Sun in RGB (Red, Green, Blue) format. The minimum value is 0 and the maximum is 1 (think of it as the 0-255 scale divided by 255). For example, {r:0, g:0, b:0} is black and {r:1, g:1, b:1} is white. |
intensity() |
Returns the intensity of the Sun. |
rotation() |
Returns the rotation of the Sun in degrees. |
rotationQuat() |
Returns the rotation of the Sun in Quaternion. |
setColor(value) |
Sets the color of the Sun. Expected range of {r, g, b} is 0-1. |
setIntensity(value) |
Sets the intensity of the Sun. |
setRotation(value) |
Sets the rotation value of the Sun, in degrees. |
setRotationQuat(value) |
Sets the rotation value of the Sun, in Quaternion. |
color()
Returns the color of the Sun in RGB (Red, Green, Blue) format. The minimum value is 0 and the maximum is 1 (think of it as the 0-255 scale divided by 255). For example, {r:0, g:0, b:0} is black and {r:1, g:1, b:1} is white.
Returns
Vec3 the color of the Sun
intensity()
Returns the intensity of the Sun.
Returns
number the intensity of the Sun. Range is 0-1000.
rotation()
Returns the rotation of the Sun in degrees.
Returns
Vec3 the {x, y, z} rotation value of the Sun
rotationQuat()
Returns the rotation of the Sun in Quaternion.
Returns
Quaternion the Quaternion rotation value
setColor(value)
Sets the color of the Sun. Expected range of {r, g, b} is 0-1.
Parameters
Vec3 value – the {r, g, b} color
setIntensity(value)
Sets the intensity of the Sun.
Parameters
number value – the intensity of the Light, ranging from 0-1000
setRotation(value)
Sets the rotation value of the Sun, in degrees.
Parameters
Vec3 – the {x, y, z} rotation value
setRotationQuat(value)
Sets the rotation value of the Sun, in Quaternion.
Parameters
Quaternion – the Quaternion rotation value