InstancedLoopColumns
Defined in: core/backend.ts:286
SoA for a batch of instanced self-link loops (#505, #542, core/loop-drop.ts): one loop per instance, a
teardrop on its node drawn as ONE shape. A loop leaves its node’s rim at its start, runs straight out, bends round
on a cubic and comes back straight to the rim at its end, where it ends as InstancedLoopHead.head says.
With r the distance from the centre to the rim ends and u0 / u1 the unit directions to them, the straight
pieces run from the centre to E_k = centre + (r + h)·u_k (drawn from the rim out) and the cubic is E0,
E0 + ℓ·u0, E1 + ℓ·u1, E1 with ℓ = legLength·r; h = max(2·arrowSize, 10·∛width) in every variant (see
InstancedLoopHead), so the path is the same with or without a head.
Plain draws only: no index, so every column is per loop.
Properties
Section titled “Properties”centers
Section titled “centers”centers:
Float32Array
Defined in: core/backend.ts:290
[x, y] world centre of each loop’s node, length 2 * count. Uploaded whole every update, as line positions are,
unless offsetsChanged is given while this is the array the layer holds: then only those ranges (none for
an empty array).
colors
Section titled “colors”colors:
Uint8Array
Defined in: core/backend.ts:307
RGBA bytes per loop, length 4 * count.
count:
number
Defined in: core/backend.ts:320
endOffsets
Section titled “endOffsets”endOffsets:
Float32Array
Defined in: core/backend.ts:299
Where each loop comes back to its node (the head’s tip, on the rim), as startOffsets. The two ends sit
spread apart round the centre: the loop’s centre is recovered from them. Length 2 * count.
groups?
Section titled “groups?”
optionalgroups?:Float32Array<ArrayBufferLike>
Defined in: core/backend.ts:317
Per-loop highlight group (#162): the loop’s node id. Length count.
legLength?
Section titled “legLength?”
optionallegLength?:number
Defined in: core/backend.ts:310
The length of the loops’ cubic arms ℓ, in multiples of each loop’s radius r (the centre-to-rim distance).
One value per layer (a uniform). Absent ⇒ 1 (LOOP_LEG).
offsetsChanged?
Section titled “offsetsChanged?”
optionaloffsetsChanged?:Uint32Array<ArrayBufferLike>
Defined in: core/backend.ts:303
The loops whose centers / startOffsets / endOffsets were rewritten in place since the last emit (#509), as
flat [start, end) ranges, uploaded alone while the arrays are the ones the layer holds (see
InstancedCirclesData.offsetsChanged).
samples?
Section titled “samples?”
optionalsamples?:number
Defined in: core/backend.ts:315
Path samples (M) along the cubic; a draw setting, not per-instance. Default 2.
selected?
Section titled “selected?”
optionalselected?:Uint8Array<ArrayBufferLike>
Defined in: core/backend.ts:319
Per-loop selected flag (0/1) for shader-driven dim/recolour (#162). Length count.
spread?
Section titled “spread?”
optionalspread?:number
Defined in: core/backend.ts:313
The angle between each loop’s two straight pieces at the centre, in radians: the angle between its rim ends.
One value per layer (a uniform). Absent ⇒ 25° (LOOP_SPREAD).
startOffsets
Section titled “startOffsets”startOffsets:
Float32Array
Defined in: core/backend.ts:296
Where each loop leaves its node: the rim point as an offset from its centre (#509), in the layer’s size units —
drawn at project(centre) + offset px in screen mode and at centre + offset in world mode. Length
2 * count. Uploaded only when the array is a new object, or by offsetsChanged.
widths
Section titled “widths”widths:
Float32Array
Defined in: core/backend.ts:305
Line width per loop, in the layer’s size units; length count.