Large worlds · function
toRenderSpace
A world position in render space, as single precision.
Explained in Coordinates and units.
function toRenderSpace(worldX: number, worldY: number, worldZ: number, origin: Float64Array, out: Float32Array): voidimport { toRenderSpace } from '@driftengine/core';Parameters
| Parameter | Type | Description |
|---|---|---|
worldX | number | |
worldY | number | |
worldZ | number | |
origin | Float64Array | |
out | Float32Array |
In depth
The subtraction happens in double precision and only the result narrows, which is the whole point: subtracting two large doubles and then narrowing keeps the precision, where narrowing first and subtracting loses it before the subtraction can help.