Renderer · function
apparentSize
The angular radius of a bounded object, in radians, as seen from a point.
Explained in Hello world.
function apparentSize(bounds: Bounds, model: ReadonlyMat4, eyeX: number, eyeY: number, eyeZ: number): numberimport { apparentSize } from '@driftengine/core';Parameters
| Parameter | Type | Description |
|---|---|---|
bounds | Bounds | |
model | ReadonlyMat4 | |
eyeX | number | |
eyeY | number | |
eyeZ | number |
In depth
radius / distance rather than atan(radius / distance): the two agree to within a percent
out to about a quarter of a radian, which is far larger than anything a level threshold cares
about, and this is a per-object per-frame path.
Returns Infinity for a viewpoint inside the object's own sphere. That is the honest answer —
it fills the view — and it makes the comparison below pick the finest level without a special
case.