Module: lights

Lights API.

Summary

Methods

Type Definitions

Detailed Description

Methods

get_lamps(lamps_typeopt) → {Array.<Object3D>}

Get lamp objects. If lamps_type is defined, creates a new array
Parameters:
Name Type Attributes Description
lamps_type String <optional>
Lamps type ("POINT", "SPOT", "SUN", "HEMI")
Returns:
Array with lamp objects.
Type
Array.<Object3D>
Source:

get_light_color(lamp_obj, destopt, nullable) → (nullable) {RGB}

Get the light color.
Parameters:
Name Type Attributes Default Description
lamp_obj Object3D Lamp object
dest RGB <optional>
<nullable>
new Float32Array(3) Destination RGB vector
Returns:
Destination RGB vector
Type
RGB
Source:

get_light_energy(lamp_obj) → {Number}

Get the light energy.
Parameters:
Name Type Description
lamp_obj Object3D Lamp object
Returns:
Light energy value
Type
Number
Source:

get_light_params(lamp_obj) → {LightParams|null}

Get the light params.
Parameters:
Name Type Description
lamp_obj Object3D Lamp object
Returns:
Light params or null in case of error
Type
LightParams | null
Source:

get_light_type(lamp_obj) → {String}

Get the light type.
Parameters:
Name Type Description
lamp_obj Object3D Lamp object.
Returns:
Light type
Type
String
Source:

get_sun_params() → {SunParams}

Get the sun parameters.
Returns:
Sun params object
Type
SunParams
Source:

set_date(date)

Set the date.
Parameters:
Name Type Description
date Date new date
Source:

set_day_time(time)

Set the time of day.
Parameters:
Name Type Description
time Number new time (0.0...24.0)
Source:

set_light_color(lamp_obj, color)

Set the light color.
Parameters:
Name Type Description
lamp_obj Object3D Lamp object
color RGB Light color
Source:

set_light_energy(lamp_obj, energy)

Set the light energy.
Parameters:
Name Type Description
lamp_obj Object3D Lamp object
energy Number Light energy value
Source:

set_light_params(lamp_obj, light_params)

Set the light params.
Parameters:
Name Type Description
lamp_obj Object3D Lamp object
light_params LightParams Light params
Source:

set_max_sun_angle(angle)

Set the maximum sun angle
Parameters:
Name Type Description
angle Number New angle in degrees (0..90)
Source:

set_sun_params(sun_params)

Set the sun parameters.
Parameters:
Name Type Description
sun_params SunParams sun parameters
Source:

Type Definitions

LightParams

Type:
  • Object
Properties:
Name Type Description
light_type String Light type
light_energy Number Light energy
light_color RGB Light color
light_spot_blend Number Blend parameter of SPOT light
light_spot_size Number Size parameter of SPOT light
light_distance Number Light falloff distance for POINT and SPOT lights
Source: