SpacesApi (Class)

Namespace: Wrld.Space

Contains functionality for working with object transforms and positions in various coordinate systems.

Methods

DoubleRay ScreenPointToRay (Vector2)

Obtain a ray in ECEF coordinates from the current camera location and passing through the specified screen point.

Returns: An ECEF ray.

Argument Type Description
screenPoint Vector2 The screen point, in pixels, with screen origin bottom-left.

DoubleRay LatLongToVerticallyDownRay (LatLong)

Obtain a ray in ECEF coordinates in a vertically downwards direction, and starting at a point high above the Earth’s surface at the specified LatLong point.

Returns: An ECEF ray.

Argument Type Description
latLong LatLong A LatLong point through which the vertical ray passes.

Vector3 GeographicToWorldPoint (LatLongAltitude)

Transforms a point from a LatLongAltitude to a Unity transform position. Note: If using the ECEF coordinate system, the returned position will only be valid until the camera is moved. To robustly position an object on the map, use the GeographicTransform component.

Returns: The transformed geographic LatLongAltitude in local space.

Argument Type Description
position LatLongAltitude The geographical coordinates of the position to transform to local space.

LatLongAltitude WorldToGeographicPoint (Vector3)

Transforms a point from a Unity transform position to a LatLongAltitude. Note: If using the ECEF coordinate system, the returned position will only be valid until the camera is moved. To robustly position an object on the map, use the GeographicTransform component.

Returns: The transformed world position as a LatLongAltitude.

Argument Type Description
position Vector3 The world position to transform into a geographic coordinate.