import Light from '@mobilizing/library/js/Mobilizing/renderer/3D/three/scene/Light.js'
Light
Light will enable object to be seen in space. Camera and Light are requiered for a basic scene.
Constructor Summary
Public Constructor | ||
public | constructor(params: Object) |
Member Summary
Public Members | ||
public | color: * | |
public | distance: * | |
public | intensity: * | |
public | target: * | |
public | transform: * | |
public | type: * |
Private Members | ||
private | _light: * |
Method Summary
Public Methods | ||
public | getAngle | |
public | getColor | |
public | Gets the light's distance factor | |
public | getIntensity(val: Object): * Gets the light's intensity | |
public | getNativeObject(): * | |
public | ||
public | Maximum extent of the spotlight, in radians, from its direction. | |
public | setCastShadow(enabled: Boolean) setCastShadow | |
public | setColor | |
public | setDistance(val: Number) Sets the light's distance factor | |
public | setIntensity(val: Object) Sets the light's intensity | |
public | setPenumbra(val: Object) Smoothness of the spot impact shape (makes the light circle blurry) | |
public | setShadowDistance(near: Number, far: Number) setShadowDistance | |
public | setShadowSize(width: Number, height: Number) set the Shadow map Size | |
public | setTargetPosition(x: Object, y: Object, z: Object) Position in space to where the spot light points | |
public | setVisible(value: Boolean) |
Public Constructors
public constructor(params: Object) source
Params:
Name | Type | Attribute | Description |
params | Object | Parameters object, given by the constructor. | |
params.type | String |
| one of "point", "directional", "ambient", "spot" |
params.intensity | Number |
| |
params.distance | Number |
| distance is taken in account only for point lights |
params.color | Color |
|
Public Members
public color: * source
public distance: * source
public intensity: * source
public target: * source
public transform: * source
public type: * source
Private Members
private _light: * source
Public Methods
public getDistance(): Number source
Gets the light's distance factor
Return:
Number | the light distance factor |
public getIntensity(val: Object): * source
Gets the light's intensity
Params:
Name | Type | Attribute | Description |
val | Object |
Return:
* |
public getNativeObject(): * source
Return:
* | the Three.js native object used in this class |
public setAngle(angle: Number) source
Maximum extent of the spotlight, in radians, from its direction. Should be no more than Math.PI/2. The default is Math.PI/3.
Params:
Name | Type | Attribute | Description |
angle | Number | the spot angle |
public setCastShadow(enabled: Boolean) source
setCastShadow
Params:
Name | Type | Attribute | Description |
enabled | Boolean |
public setDistance(val: Number) source
Sets the light's distance factor
Params:
Name | Type | Attribute | Description |
val | Number |
public setIntensity(val: Object) source
Sets the light's intensity
Params:
Name | Type | Attribute | Description |
val | Object |
public setPenumbra(val: Object) source
Smoothness of the spot impact shape (makes the light circle blurry)
Params:
Name | Type | Attribute | Description |
val | Object | between 0 and 1 |