The .drft container · interface

DrftSplats

A capture, as the writer is handed it.

Explained in The .drft container.

interface DrftSplats
import type { DrftSplats } from '@driftengine/drft';

In depth

positions is read and never stored, which is the one surprising field here. The writer needs them to decide the coarse-first block layout, and the reader gets them back out of the records — so writing them a second time would be twelve bytes a splat of duplicate in the one place this format is trying hardest to be small.

Properties

NameTypeDescription
countreadonlynumber
positionsreadonlyFloat32ArrayThree per splat, in the capture's own space. Read for layout only.
recordsreadonlyUint32ArraywordsPerSplat u32s per splat, in count order. Opaque here.
wordsPerSplatreadonlynumber
boundsMinreadonlyFloat32Array
boundsMaxreadonlyFloat32Array
sphericalHarmonicsreadonlyoptionalnumberCoefficients the source carried and the packer did not read. Carried as a number.
blocksreadonlyoptionalnumberHow many blocks to split the capture into, or absent for a size this writer chooses.
More

More blocks means a capture that opens sooner and a longer chunk table; each entry is sixteen bytes, so even thirty-two blocks is half a kilobyte against megabytes of records.