Renderer · interface

FieldSource

A baked object field, as this package can describe one.

Explained in Hello world.

interface FieldSource
import type { FieldSource } from '@driftengine/core';

In depth

Structural rather than imported, because @driftengine/core does not depend on @driftengine/assets and must not start: the baker is a build step and this is a frame. What bakeObjectSdf returns satisfies this shape, and so does what readSdfv hands back from a container. That is the arrangement Terrain already has with Heightfield across the physics boundary and DTEX has with @driftengine/texture across the container one.

Properties

NameTypeDescription
fieldreadonlyFloat32ArrayDistance in metres, negative inside. x fastest, then y, then z.
dimsreadonlyreadonly [number, number, number]
boundsreadonlyFloat32ArrayThe field's own extent in object space, [minX, minY, minZ, maxX, maxY, maxZ].