Table of Contents

Struct ViewSpacePoint

Namespace
LansMap.Core.View

A projected point in the view's camera frame, before the perspective divide, in the same pixel units TryProjectWithAltitude(MercatorPoint, double, out ScreenPoint) works in.

public readonly struct ViewSpacePoint
Inherited Members

Remarks

Screen position is X * CameraDistance / Depth (horizontal) and Y * CameraDistance / Depth (vertical) plus the screen center - the divide TryProjectWithAltitude(MercatorPoint, double, out ScreenPoint) applies after its own guards. This type carries the three quantities that divide feeds on, so a caller that does not need a screen pixel - placing a world-space object at the point instead - can skip the divide entirely and stay finite for a point behind the camera or past the far view-distance cap, where the divide either blows up or disagrees with the map's own drawn ground.

Constructors

ViewSpacePoint(double, double, double, double)

Creates a view-space point.

public ViewSpacePoint(double x, double y, double depth, double cameraDistance)

Parameters

x double

Horizontal camera-frame position in screen px, before the divide.

y double

Vertical camera-frame position in screen px, up-positive, before the divide.

depth double

Distance along the view axis in screen px, larger further from the camera; cameraDistance is the camera's own distance in the same units.

cameraDistance double

The view's camera distance in screen px, matching depth's units.

Properties

CameraDistance

The view's camera distance in screen px, matching Depth's units.

public double CameraDistance { get; }

Property Value

double

Depth

Distance along the view axis in screen px. At or below 0 the point is at or behind the camera plane; large values are far toward the horizon, past where the map draws ground.

public double Depth { get; }

Property Value

double

X

Horizontal camera-frame position in screen px, before the divide.

public double X { get; }

Property Value

double

Y

Vertical camera-frame position in screen px, up-positive, before the divide.

public double Y { get; }

Property Value

double