# Glass

class in `@dioramajs/particles/drops`

```ts
import { Glass } from '@dioramajs/particles/drops'
```

Water on the glass: drops that rest and dry, heavy ones that slide down in fits and starts,
leave a wet trail and beads, and swallow what they meet. Deterministic for a seed; px, y down.

```ts
class Glass
```

## Members

| Name | Type | Description |
| --- | --- | --- |
| `constructor` | `constructor(seed: number, pool?: number): Glass` |  |
| `drops` | `Drop[]` |  |
| `head` | `number` | Next trail slot, and pieces written so far (capped at TRAILS). |
| `laid` | `number` |  |
| `pool` | `number` |  |
| `time` | `number` |  |
| `trails` | `Float32Array` | Trail pieces: x0, y0, x1, y1, width, birth time. |
| `wet` | `number` | Last trail piece written, s. |
| `thawing` | `boolean` | True while a thaw spreads. |
| `add` | `add(x: number, y: number, r: number, weather: Weather): Drop \| undefined` | A drop of radius `r` at `x`, `y`; merges with one it lands on. |
| `radius` | `radius(scale: number, heavy?: number): number` | A radius from the mix of a melt or a shower: mostly beads, some drops, a few heavy ones. |
| `shower` | `shower(count: number, weather: Weather): void` | A shower of `count` drops at once. |
| `step` | `step(seconds: number, weather: Weather, rate?: number): 'moving' \| 'drying' \| 'still'` | Advances by `seconds` with new rain at `rate` drops a second. Returns 'moving' while drops slide or appear, 'drying' while only drops at rest and trails dry, 'still' when the glass is bare. |
| `thaw` | `thaw(x: number, y: number, count: number, duration: number): void` | Starts a thaw from `x`, `y` that leaves `count` drops behind its front over `duration`. |

Defined in [packages/particles/src/drops.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/particles/src/drops.ts#L155).
