Skip to content

five-on-it / apps/client/src/renderer/tracers / Streaks

Class: Streaks ​

Defined in: apps/client/src/renderer/tracers.ts:72

The streaks of the scene.

Constructors ​

Constructor ​

new Streaks(capacity): Streaks

Defined in: apps/client/src/renderer/tracers.ts:89

Room for capacity streaks.

Parameters ​

capacity ​

number

Returns ​

Streaks

Properties ​

colors ​

readonly colors: Float32Array

Defined in: apps/client/src/renderer/tracers.ts:76

Corner colours with their opacity, 16 floats a streak.


indices ​

readonly indices: Uint32Array

Defined in: apps/client/src/renderer/tracers.ts:78

Triangle indices, fixed: two a streak.


live ​

live: number = 0

Defined in: apps/client/src/renderer/tracers.ts:80

Streaks in flight now.


positions ​

readonly positions: Float32Array

Defined in: apps/client/src/renderer/tracers.ts:74

Corner positions, 12 floats a streak.

Methods ​

add() ​

add(from, to, style, now): void

Defined in: apps/client/src/renderer/tracers.ts:105

A streak from from to to in style, fired at now (s); past the cap the oldest gives way.

Parameters ​

from ​

Vec

to ​

Vec

style ​

TracerStyle

now ​

number

Returns ​

void


headOf() ​

headOf(q): Vec | undefined

Defined in: apps/client/src/renderer/tracers.ts:131

Where the head of the streak in slot q is drawn now, for the tests; undefined for a free slot.

Parameters ​

q ​

number

Returns ​

Vec | undefined


update() ​

update(now, eye?): number

Defined in: apps/client/src/renderer/tracers.ts:120

Flies every streak on to now (s), each turned to face eye (the camera; straight up without one), and clears the ones gone into their impact (each drawn once at least); returns how many are left.

Parameters ​

now ​

number

eye? ​

Vec

Returns ​

number