Documentation / @ripl/3d / SpotLight
Class: SpotLight ​
Defined in: 3d/src/core/lights.ts:293
A light radiating from a point, confined to a cone with an optionally soft edge.
Extends ​
Constructors ​
Constructor ​
new SpotLight(
options?):SpotLight
Defined in: 3d/src/core/lights.ts:340
Parameters ​
| Parameter | Type |
|---|---|
options? | SpotLightOptions |
Returns ​
SpotLight
Overrides ​
Properties ​
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
_color | protected | string | - | PositionalLight._color | 3d/src/core/lights.ts:108 |
_decay | protected | number | - | PositionalLight._decay | 3d/src/core/lights.ts:241 |
_distance | protected | number | - | PositionalLight._distance | 3d/src/core/lights.ts:240 |
_enabled | protected | boolean | - | PositionalLight._enabled | 3d/src/core/lights.ts:110 |
_intensity | protected | number | - | PositionalLight._intensity | 3d/src/core/lights.ts:109 |
_position | protected | Vector3 | - | PositionalLight._position | 3d/src/core/lights.ts:239 |
type | readonly | LightType | The kind of illumination this light contributes. | PositionalLight.type | 3d/src/core/lights.ts:106 |
Accessors ​
angle ​
Get Signature ​
get angle():
number
Defined in: 3d/src/core/lights.ts:321
Half-angle of the cone, in radians, clamped to below a right angle.
Returns ​
number
Set Signature ​
set angle(
value):void
Defined in: 3d/src/core/lights.ts:325
Parameters ​
| Parameter | Type |
|---|---|
value | number |
Returns ​
void
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
Inherited from ​
direction ​
Get Signature ​
get direction():
Vector3
Defined in: 3d/src/core/lights.ts:301
The direction the cone points in, normalized on assignment.
Returns ​
Set Signature ​
set direction(
value):void
Defined in: 3d/src/core/lights.ts:305
Parameters ​
| Parameter | Type |
|---|---|
value | Vector3 |
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
Inherited from ​
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 ​
penumbra ​
Get Signature ​
get penumbra():
number
Defined in: 3d/src/core/lights.ts:331
How softly the cone fades at its edge, from 0 (hard) to 1 (fully soft).
Returns ​
number
Set Signature ​
set penumbra(
value):void
Defined in: 3d/src/core/lights.ts:335
Parameters ​
| Parameter | Type |
|---|---|
value | number |
Returns ​
void
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
Inherited from ​
space ​
Get Signature ​
get space():
LightSpace
Defined in: 3d/src/core/lights.ts:311
Whether direction and PositionalLight.position are fixed in world space or follow the camera.
Returns ​
Set Signature ​
set space(
value):void
Defined in: 3d/src/core/lights.ts:315
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