Renderer · class
RainField
Explained in Hello world.
class RainFieldimport { RainField } from '@driftengine/core';Constructor
new
constructor(options: RainFieldOptions)| Parameter | Type | Description |
|---|---|---|
options | RainFieldOptions |
Properties
| Name | Type | Description |
|---|---|---|
segmentsreadonly | LineSegments | |
speedMps | number | Fall speed, metres a second. Rain is about 9, drizzle 2, hail 14. |
streakSec | number | The shutter time the streak shows, seconds: 0.02 is a crisp dash, 0.1 a long exposure.MoreIt changes how long a drop looks and never where it is, so a downpour can smear without falling any faster. |
Accessors
| Name | Type | Description |
|---|---|---|
shelteredCountget | number | Drops that were over the viewer's head and under something else, last update. |
Methods
update
update(dt: number, viewerX: number, viewerY: number, viewerZ: number, windX?: number, windZ?: number): voidFall for dt, then rebuild the streaks around a viewer.
| Parameter | Type | Description |
|---|---|---|
dt | number | |
viewerX | number | |
viewerY | number | |
viewerZ | number | |
windX? | number | |
windZ? | number |
More
windX and windZ are metres per second sideways, and the same numbers the rest of the scene
is answering to: rain leaning one way while the smoke beside it leans another is the failure
this parameter exists to prevent, and it is why the wind is passed in rather than owned here.