Renderer · function

traceField

March a ray through the composed world field.

Explained in Hello world.

function traceField(field: GlobalField, point: ReadonlyVec3, normal: ReadonlyVec3, direction: ReadonlyVec3, march: FieldMarch, out: FieldHit): boolean
import { traceField } from '@driftengine/core';

Parameters

ParameterTypeDescription
fieldGlobalField
pointReadonlyVec3
normalReadonlyVec3
directionReadonlyVec3
marchFieldMarch
outFieldHit

In depth

Returns whether it arrived at a surface. A false is the chain's cue to go one level further down; FieldHit.escaped says which of the two misses it was.