GltfGaussianLoader

class GltfGaussianLoader(rawSpzLoader: SpzGaussianLoader = SpzGaussianLoader(options = SpzDecodeOptions.ANISOTROPIC)) : GaussianLoader

Loader for glb-wrapped Gaussian splats — glTF 2.0 binary declaring KHR_gaussian_splatting + KHR_gaussian_splatting_compression_spz_2, with the SPZ stream as a bufferView in the BIN chunk. The de-facto production wire format (Cesium, gs_view, Niantic Lightship VPS). Also accepts raw .spz (NGSP) so a single registration on earth.worldwind.layer.ogc3d.Ogc3dTilesLayer.gaussianLoader handles both.

Unwrap: parse GLB → slice SPZ bufferView → outer inflate (the whole header+body is gzipped as one chunk, unlike raw .spz which only gzips the body) → run uncompressed SPZ decode → bake the primitive's glTF node transform (typically Y-up → Z-up + a translation) into per-splat positions + orientation quaternions.

Constructors

Link copied to clipboard
constructor(rawSpzLoader: SpzGaussianLoader = SpzGaussianLoader(options = SpzDecodeOptions.ANISOTROPIC))

Functions

Link copied to clipboard
open override fun parse(bytes: ByteArray): GaussianPayload

Parse bytes into a GaussianPayload. Called only after supports returns true. May throw to signal a malformed payload — the layer treats throws as a tile load failure (the tile transitions to FAILED and stays without content).

Link copied to clipboard
open override fun supports(bytes: ByteArray): Boolean

Cheap magic-bytes / shape check. Returns true when this loader can parse bytes. Must not allocate or throw — called once per fetched payload before the engine decides which loader pipeline owns the content.