API to control light sources.
Summary
Methods
- get_lamps(lamps_typeopt) → {Array.<Object3D>}
- get_light_color(lamp_obj, destopt, nullable) → (nullable) {RGB}
- get_light_energy(lamp_obj) → {number}
- get_light_params(lamp_obj) → {module:lights~LightParams|null}
- get_light_type(lamp_obj) → {string}
- get_sun_params() → {SunParams}
- set_date(date)
- set_day_time(time)
- set_light_color(lamp_obj, color)
- set_light_energy(lamp_obj, energy)
- set_light_params(lamp_obj, light_params)
- set_max_sun_angle(angle)
- set_sun_params(sun_params)
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_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}
set_date(date)
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_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: