Documentation / @ripl/3d / DirectionalLight
Class: DirectionalLight ​
Defined in: 3d/src/core/lights.ts:202
A light infinitely far away, casting parallel rays in a single direction.
Extends ​
Constructors ​
Constructor ​
new DirectionalLight(
options?):DirectionalLight
Defined in: 3d/src/core/lights.ts:227
Parameters ​
| Parameter | Type |
|---|---|
options? | DirectedLightOptions |
Returns ​
DirectionalLight
Overrides ​
Properties ​
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
_color | protected | string | - | Light._color | 3d/src/core/lights.ts:108 |
_enabled | protected | boolean | - | Light._enabled | 3d/src/core/lights.ts:110 |
_intensity | protected | number | - | Light._intensity | 3d/src/core/lights.ts:109 |
type | readonly | LightType | The kind of illumination this light contributes. | Light.type | 3d/src/core/lights.ts:106 |
Accessors ​
color ​
Get Signature ​
get color():
string
Defined in: 3d/src/core/lights.ts:116
The light's colour.
Returns ​
string
Set Signature ​
set color(
value):void
Defined in: 3d/src/core/lights.ts:120
Parameters ​
| Parameter | Type |
|---|---|
value | string |
Returns ​
void
Inherited from ​
direction ​
Get Signature ​
get direction():
Vector3
Defined in: 3d/src/core/lights.ts:208
The direction the light travels in, normalized on assignment.
Returns ​
Set Signature ​
set direction(
value):void
Defined in: 3d/src/core/lights.ts:212
Parameters ​
| Parameter | Type |
|---|---|
value | Vector3 |
Returns ​
void
enabled ​
Get Signature ​
get enabled():
boolean
Defined in: 3d/src/core/lights.ts:136
Whether the light contributes at all.
Returns ​
boolean
Set Signature ​
set enabled(
value):void
Defined in: 3d/src/core/lights.ts:140
Parameters ​
| Parameter | Type |
|---|---|
value | boolean |
Returns ​
void
Inherited from ​
intensity ​
Get Signature ​
get intensity():
number
Defined in: 3d/src/core/lights.ts:126
How strongly the light contributes.
Returns ​
number
Set Signature ​
set intensity(
value):void
Defined in: 3d/src/core/lights.ts:130
Parameters ​
| Parameter | Type |
|---|---|
value | number |
Returns ​
void
Inherited from ​
space ​
Get Signature ​
get space():
LightSpace
Defined in: 3d/src/core/lights.ts:218
Whether direction is fixed in world space or follows the camera.
Returns ​
Set Signature ​
set space(
value):void
Defined in: 3d/src/core/lights.ts:222
Parameters ​
| Parameter | Type |
|---|---|
value | LightSpace |
Returns ​
void
Methods ​
invalidate() ​
invalidate():
void
Defined in: 3d/src/core/lights.ts:158
Requests a repaint of whatever this light is attached to. Call after mutating derived state.
Returns ​
void