Table of Contents

Struct SurfaceMercatorFrame

Namespace
LansMap.Markers.World
public readonly struct SurfaceMercatorFrame
Inherited Members

Fields

AxisU

Plane-local displacement per unit of anchor-relative mercator X.

public readonly Vector3 AxisU

Field Value

Vector3

AxisV

Plane-local displacement per unit of anchor-relative mercator Y.

public readonly Vector3 AxisV

Field Value

Vector3

LocalPerMarkerPx

Plane-local units per render-texture pixel; converts a marker's pixel size into a world size on the table.

public readonly float LocalPerMarkerPx

Field Value

float

LocalPerMercAltitude

Plane-local units per unit of mercator altitude, so a marker's lift is altitudeMercator * LocalPerMercAltitude along Normal. Chosen so height uses the same scale the map imagery is drawn at: a 300 m building rises as far off the table as 300 m of ground distance spans across it.

public readonly float LocalPerMercAltitude

Field Value

float

Normal

Plane-local up, from the mesh (unit length).

public readonly Vector3 Normal

Field Value

Vector3

Origin

Plane-local position of the anchor's ground point.

public readonly Vector3 Origin

Field Value

Vector3

UvAxisU

Texture UV displacement per unit of anchor-relative mercator X.

public readonly Vector2 UvAxisU

Field Value

Vector2

UvAxisV

Texture UV displacement per unit of anchor-relative mercator Y.

public readonly Vector2 UvAxisV

Field Value

Vector2

UvOrigin

Texture UV of the anchor's ground point.

public readonly Vector2 UvOrigin

Field Value

Vector2

Methods

Build(MapViewTransform, in SurfaceUvMap, MercatorPoint)

Builds the frame for one surface view. Rebuild whenever the view or the anchor changes; construction is three projections and no allocation.

public static SurfaceMercatorFrame Build(MapViewTransform view, in SurfaceUvMap uvMap, MercatorPoint anchor)

Parameters

view MapViewTransform

The surface's own view (pitch 0; a pitched view would make mercator -> screen non-affine and the recovered axes wrong).

uvMap SurfaceUvMap

UV parameterization of the table mesh.

anchor MercatorPoint

The marker anchor instance data is relative to, in normalized mercator.

Returns

SurfaceMercatorFrame

LocalWithAltitude(Vector2, float)

Plane-local position of a marker: ground point from its anchor-relative mercator offset, lifted along the normal by its mercator altitude.

public Vector3 LocalWithAltitude(Vector2 mercRel, float altMercator)

Parameters

mercRel Vector2
altMercator float

Returns

Vector3

UvOf(Vector2)

Texture UV of a ground point; outside [0,1] on either axis means the point is off the table. The same test the shader's hide-outside-surface clip runs, so CPU picking and GPU clipping can never disagree about which markers exist.

public Vector2 UvOf(Vector2 mercRel)

Parameters

mercRel Vector2

Returns

Vector2