Documentation / @ripl/3d / PositionalLight
Abstract Class: PositionalLight ​
Defined in: 3d/src/core/lights.ts:237
Base class for lights that radiate from a position and fall off with distance.
Extends ​
Extended by ​
Constructors ​
Constructor ​
new PositionalLight(
type,options?):PositionalLight
Defined in: 3d/src/core/lights.ts:273
Parameters ​
| Parameter | Type |
|---|---|
type | LightType |
options? | PositionalLightOptions |
Returns ​
PositionalLight
Overrides ​
Properties ​
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
_color | protected | string | - | Light._color | 3d/src/core/lights.ts:108 |
_decay | protected | number | - | - | 3d/src/core/lights.ts:241 |
_distance | protected | number | - | - | 3d/src/core/lights.ts:240 |
_enabled | protected | boolean | - | Light._enabled | 3d/src/core/lights.ts:110 |
_intensity | protected | number | - | Light._intensity | 3d/src/core/lights.ts:109 |
_position | protected | Vector3 | - | - | 3d/src/core/lights.ts:239 |
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 ​
decay ​
Get Signature ​
get decay():
number
Defined in: 3d/src/core/lights.ts:264
The exponent of the inverse-distance falloff.
Returns ​
number
Set Signature ​
set decay(
value):void
Defined in: 3d/src/core/lights.ts:268
Parameters ​
| Parameter | Type |
|---|---|
value | number |
Returns ​
void
distance ​
Get Signature ​
get distance():
number
Defined in: 3d/src/core/lights.ts:254
The distance at which the light falls to zero. 0 means it never does.
Returns ​
number
Set Signature ​
set distance(
value):void
Defined in: 3d/src/core/lights.ts:258
Parameters ​
| Parameter | Type |
|---|---|
value | number |
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 ​
position ​
Get Signature ​
get position():
Vector3
Defined in: 3d/src/core/lights.ts:244
The light's world-space position.
Returns ​
Set Signature ​
set position(
value):void
Defined in: 3d/src/core/lights.ts:248
Parameters ​
| Parameter | Type |
|---|---|
value | Vector3 |
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