Renderer · interface

FieldHit

Where a march ended. Reused rather than returned, because the chain runs this per ray.

Explained in Hello world.

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

Properties

NameTypeDescription
hitboolean
xnumberWhere it arrived, in world metres.
ynumber
znumber
distanceMnumberHow far along the ray, world metres, from the lifted origin.
More

The lift is FIELD_START_VOXELS voxels along the normal, so this differs from the distance to the point a caller passed in by at most that — and by nothing at all where the caller passed no normal, which is what a ray from open space does.

radiusMnumberThe cone's radius there, which is how broad a patch of surface this hit stands for.
stepsnumberHow many samples it took. Diagnostic, and the thing a convergence test asserts on.
escapedbooleanWhether it left the field rather than running out of reach.
More

The two misses are different and the chain acts on the difference. A ray that escaped has gone somewhere this level has no information about, and the probe volume behind it is what answers. A ray that ran out of reach travelled its whole budget through open space, which is a statement about the world rather than about the field.