Skip to main content

class WPSTangentialTransform

(Niantic.Experimental.Lightship.AR.WPS.WPSTangentialTransform)

Overview

The WPSTangentialTransform class represents a transform from a Euclidean tangential coordinate system to geographic coordinates and provides methods to convert between the two.

class WPSTangentialTransform {
public:
// fields

Matrix4x4 TangentialToEUN;
double OriginLatitude;
double OriginLongitude;
double OriginAltitude;
static double DEGREES_TO_METRES = 111139.0;
static double METRES_TO_DEGREES = 1.0 / DEGREES_TO_METRES;

// methods

WPSTangentialTransform();

WPSTangentialTransform(
Matrix4x4 tangentialToEUN,
double originLatitude,
double originLongitude,
double originAltitude
);

void WorldToTangential(
double latitudeDegrees,
double longitudeDegrees,
double altitudeMetres,
Quaternion worldRotationEUN,
out Vector3 tangentialTranslationRUF,
out Quaternion tangentialRotationRUF
);

void WorldToTangential(
double latitudeDegrees,
double longitudeDegrees,
double altitudeMetres,
out Vector3 tangentialTranslationRUF
);

void TangentialToWorld(
Vector3 tangentialTranslationRUF,
Quaternion tangentialRotationRUF,
out double latitudeDegrees,
out double longitudeDegrees,
out double altitudeMetres,
out Quaternion worldRotationEUN
);

void TangentialToWorld(
Transform tangentialPose,
out double latitudeDegrees,
out double longitudeDegrees,
out double altitudeMetres,
out Quaternion worldRotationEUN
);
};

Detailed Documentation

The WPSTangentialTransform class represents a transform from a Euclidean tangential coordinate system to geographic coordinates and provides methods to convert between the two.

It is common to approximate world geographic coordinates within a small region using a tangential Euclidean coordinate system. WPS uses this class to represent the transform between the AR tracking tangential coordinates and world geographic coordinates. WPSTangentialTransform can also be used to convert any map data which is provided in a tangential coordinate system. The representation is similar to that used by GeoPose but with a left-handed East-Up-North coordinate system to align with Unity rather than the East-North-Up coordinate system defined in the GeoPose standard.

TangentialToEUN the matrix transform from local tangential coordinates to tangential EUN (East-Up-North) coordinates

originLatitude the latitude of the origin for the tangential world coordinate system

originLongitude the longitude of the origin for the tangential world coordinate system

originAltitude the altitude of the origin for the tangential world coordinate system

Methods

WPSTangentialTransform

WPSTangentialTransform(
Matrix4x4 tangentialToEUN,
double originLatitude,
double originLongitude,
double originAltitude
)

Creates a new WPSTangentialTransform

    Parameters:

    tangentialToEUN - the matrix transform from local tangential coordinates to tangential EUN (East-Up-North) coordinates

    originLatitude - the latitude of the origin for the tangential world coordinate system

    originLongitude - the longitude of the origin for the tangential world coordinate system

    originAltitude - the altitude of the origin for the tangential world coordinate system

WorldToTangential

void WorldToTangential(
double latitudeDegrees,
double longitudeDegrees,
double altitudeMetres,
Quaternion worldRotationEUN,
out Vector3 tangentialTranslationRUF,
out Quaternion tangentialRotationRUF
)

Converts a pose in world geographic coordinates to a pose in the tangential Euclidean coordinate system

    Parameters:

    latitudeDegrees - The latitude of the object measured in degrees

    longitudeDegrees - The longitude of the object measured in degrees

    altitudeMetres - The altitude of the object measured in metres above sea level

    worldRotationEUN - The rotation of the object relative to East-Up-North axes

    tangentialTranslationRUF - The corresponding translation in the tangential Euclidean coordinate system

    tangentialRotationRUF - The corresponding rotation in the tangential Euclidean coordinate system

WorldToTangential

void WorldToTangential(
double latitudeDegrees,
double longitudeDegrees,
double altitudeMetres,
out Vector3 tangentialTranslationRUF
)

Converts a position in world geographic coordinates to a position in the tangential Euclidean coordinate system

    Parameters:

    latitudeDegrees - The latitude of the object measured in degrees

    longitudeDegrees - The longitude of the object measured in degrees

    altitudeMetres - The altitude of the object measured in metres above sea level

    tangentialTranslationRUF - The corresponding rotation in the tangential Euclidean coordinate system

TangentialToWorld

void TangentialToWorld(
Vector3 tangentialTranslationRUF,
Quaternion tangentialRotationRUF,
out double latitudeDegrees,
out double longitudeDegrees,
out double altitudeMetres,
out Quaternion worldRotationEUN
)

Converts a position in the tangential Euclidean coordinate system to a position in world geographic coordinates

    Parameters:

    tangentialTranslationRUF - The translation in the tangential Euclidean coordinate system

    tangentialRotationRUF - The rotation in the tangential Euclidean coordinate system

    latitudeDegrees - The corresponding latitude of the object measured in degrees

    longitudeDegrees - The corresponding longitude of the object measured in degrees

    altitudeMetres - The corresponding altitude of the object measured in metres above sea level

    worldRotationEUN - The rotation of the object relative to East-Up-North axes

TangentialToWorld

void TangentialToWorld(
Transform tangentialPose,
out double latitudeDegrees,
out double longitudeDegrees,
out double altitudeMetres,
out Quaternion worldRotationEUN
)

Converts a position in the tangential Euclidean coordinate system to a position in world geographic coordinates

    Parameters:

    tangentialPose - The pose of the object in the local tangential Euclidean coordinate system

    latitudeDegrees - The corresponding latitude of the object measured in degrees

    longitudeDegrees - The corresponding longitude of the object measured in degrees

    altitudeMetres - The corresponding altitude of the object measured in metres above sea level

    worldRotationEUN - The rotation of the object relative to East-Up-North axes