Splats · interface

SplatSortRequest

One sort, as the worker protocol and as the function's own parameter list.

Explained in Gaussian splats.

interface SplatSortRequest
import type { SplatSortRequest } from '@driftengine/splats';

In depth

One object rather than eleven arguments, and the worker is the reason. createSplatSortWorker posts this and hands event.data straight to the sort, so the message shape and the call shape cannot disagree — which is the failure the 2026-08-17 rule is about, in the one place here where a decision genuinely does cross a thread boundary.

Properties

NameTypeDescription
positionsreadonlyFloat32ArrayThree per splat, in the capture's own space.
extentsreadonlyFloat32ArrayOne per splat: SplatData.extents, the largest sigma. Only read when there is a budget.
countreadonlynumber
dirXreadonlynumberThe camera's forward in the capture's own space, unit length.
More

Not the world-space forward: a batch with a model matrix is looked at from a different direction in its own frame, and resolveSplatView is what converts one to the other. One sorter therefore serves one batch and two batches need no merged order.

dirYreadonlynumber
dirZreadonlynumber
originXreadonlynumberThe camera's position in the capture's own space.
More

Invisible in the order and load-bearing in the budget. Shifting every splat by the same amount cannot reorder them, so depth alone never needed this; the size key is extent over the distance, and a distance needs a point to measure from.

originYreadonlynumber
originZreadonlynumber
budgetreadonlynumberThe most splats to keep. Zero, or anything at or above count, keeps all of them.
outreadonlyUint32ArrayThe buffer to fill and hand back, so the pair can ping-pong rather than allocate.