compressDistance

function compressDistance
placement.ts:93
compressDistance(distance: number) → number

Compressed radial distance.

shellStart + shellSpan · ln(1 + (d − nearLimit)/nearLimit). With shellSpan = shellStart = nearLimit this is continuous and has derivative 1 at the boundary, so an object crossing into the near field neither pops nor changes its apparent rate of approach.

It is non-decreasing everywhere, so rendered depth never inverts real depth. It is strictly increasing only while the separation survives double precision: past ~1e17 m the slope is around 1e-11, so two objects a hundred meters apart compress to the same value. They are also the same pixel, so this costs nothing — but it is a property of the mapping, not an accident, and the tests state it that way.

distancenumber
Undocumented
Returnsnumber