Skip to content

five-on-it / apps/client/src/ui/minimap-data / mapProjection

Function: mapProjection() ​

mapProjection(half, size): object

Defined in: apps/client/src/ui/minimap-data.ts:161

Where the world lands on a square map size pixels wide showing [-half, half] on both axes, north up like the camera (which looks along +z in a right-handed world: +x is to the left): k pixels per metre, the pixel of an x and of a z, and back.

Parameters ​

half ​

number

size ​

number

Returns ​

object

k ​

k: number

px ​

px: (x) => number

Parameters ​

x ​

number

Returns ​

number

pz ​

pz: (z) => number

Parameters ​

z ​

number

Returns ​

number

x ​

x: (px) => number

Parameters ​

px ​

number

Returns ​

number

z ​

z: (pz) => number

Parameters ​

pz ​

number

Returns ​

number