Skip to content

five-on-it / apps/client/src/renderer/effects / TracerLines

Class: TracerLines ​

Defined in: apps/client/src/renderer/effects.ts:140

The tracers of the lines of a swing.

Constructors ​

Constructor ​

new TracerLines(capacity): TracerLines

Defined in: apps/client/src/renderer/effects.ts:158

Room for capacity lines in a ring of segments, two corners each (6 floats of position, 8 of colour with the opacity in the fourth), that fade out over a swing's life; past the cap the oldest line gives way. A dead line is all zeros (nothing drawn).

Parameters ​

capacity ​

number

Returns ​

TracerLines

Properties ​

colors ​

readonly colors: Float32Array

Defined in: apps/client/src/renderer/effects.ts:144

Corner colours with their opacity, 8 floats a line.


indices ​

readonly indices: Uint32Array

Defined in: apps/client/src/renderer/effects.ts:146

Line indices, fixed: two a line.


live ​

live: number = 0

Defined in: apps/client/src/renderer/effects.ts:148

Lines alive now.


positions ​

readonly positions: Float32Array

Defined in: apps/client/src/renderer/effects.ts:142

Corner positions, 6 floats a line.

Methods ​

add() ​

add(a, b, color, now): void

Defined in: apps/client/src/renderer/effects.ts:167

Adds a line from a to b in color, born at now (s).

Parameters ​

a ​

Vec

b ​

Vec

color ​

Color3

now ​

number

Returns ​

void


update() ​

update(now): number

Defined in: apps/client/src/renderer/effects.ts:177

Fades every line to now (s) and clears the ones whose time is up; returns how many are left.

Parameters ​

now ​

number

Returns ​

number