Renderer · function

lodForBounds

The index of the level this object has earned.

Explained in Hello world.

function lodForBounds(bounds: Bounds, model: ReadonlyMat4, eyeX: number, eyeY: number, eyeZ: number, thresholds: readonly number[]): number
import { lodForBounds } from '@driftengine/core';

Parameters

ParameterTypeDescription
boundsBounds
modelReadonlyMat4
eyeXnumber
eyeYnumber
eyeZnumber
thresholdsreadonly number[]

In depth

thresholds are apparent sizes in descending order — the size at which each level stops being good enough. An object larger than the first threshold gets level 0; one smaller than the last gets the last level, rather than an index off the end of whatever array the caller is about to look this up in.

An empty thresholds gives 0, which is the only level a caller with no thresholds has.