Constructor
new Light3D(pos3Dopt, radiusopt, coloropt, intensityopt)
Create a point light
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
pos3D | Vector3 | <optional> | Where it is | |
radius | number | <optional> | 5 | Distance where the light fades to nothing |
color | Color | <optional> | Light color, its alpha fades it | |
intensity | number | <optional> | 1 | Brightness, multiplies the color, above 1 is brighter than white |
- Source
const torch = new Light3D(vec3(0, 3, 0), 10, hsl(.1, 1, .65));Extends
- EngineObject3D
Members
directional
Properties| Type | Description |
|---|---|
| boolean | Shine from far away, from its position toward the origin, instead of out from its position with a falloff; DirectionalLight3D sets it |
- Source
glow
Properties| Type | Description |
|---|---|
| number | Size of a soft hazy glow drawn over the light, like a lamp at night, 0 for none; it is added onto what is behind it, and what is in front of the light hides it |
- Source
glowFalloff
Properties| Type | Description |
|---|---|
| number | How fast the glow fades from its middle: 1 by default, .5 a wide haze, 2 a tight bright core |
- Source
intensity
Properties| Type | Description |
|---|---|
| number | Brightness, multiplies the color, above 1 is brighter than white |
- Source
radius
Properties| Type | Description |
|---|---|
| number | Distance where the light fades to nothing |
- Source
Methods
render3D()
Draw the glow, a quad facing the camera with a soft round glow on it, pulled toward the camera by half its size so a lamp at the light does not cut into it, but never past the camera
- Source