-
Notifications
You must be signed in to change notification settings - Fork 5
Conversions
DIS Blueprint Function Library. Houses functions for common geospatial conversions and for common PDU accessor functions.
public class Conversions
Access | Return | Name | Description | |
---|---|---|---|---|
Public | Static | void | ApplyHeadingPitchRollToNorthEastDownVector(FHeadingPitchRoll HeadingPitchRollDegrees, FNorthEastDown NorthEastDownVectors, out Vector3 outX, out Vector3 outY, out Vector3 outZ) | Applies the given heading, pitch, and roll in degrees to the local East North Down vectors |
Private | Static | void | ApplyHeadingPitchToNorthEastDownVector(double headingDegrees, double pitchDegrees, FNorthEastDown NorthEastDownVectors, out Vector3 outX, out Vector3 outY, out Vector3 outZ) | Rotates the given East, North, and Up vectors by the given Heading and Pitch |
Private | Static | void | ApplyRollToNorthEastDownVector(double rollDegrees, FNorthEastDown NorthEastDownVectors, out Vector3 outX, out Vector3 outY, out Vector3 outZ) | Rotates the given East, North, and Up vectors by the given Heading and Pitch |
Public | Static | Vector3Double | CalculateEcefXYZFromLatLonHeight(FLatLonAlt latLonHeightDegreesMeters) | Converts Latitude, Longitude, and Height (LLH) to DIS X, Y, Z coordinates (ECEF) all in double (64-bit) precision |
Public | Static | FHeadingPitchRoll | CalculateHeadingPitchRollDegreesFromPsiThetaPhiDegreesAtLatLon(FPsiThetaPhi psiThetaPhiDegrees, double latitudeDegrees, double longitudeDegrees) | Calculates the Heading, Pitch, and Roll in degrees from the given DIS orientation values Psi, Theta, and Phi in degrees at the given Latitude and Longitude |
Public | Static | FHeadingPitchRoll | CalculateHeadingPitchRollDegreesFromPsiThetaPhiRadiansAtLatLon(FPsiThetaPhi psiThetaPhiRadians, double latitudeDegrees, double longitudeDegrees) | Calculates the Heading, Pitch, and Roll in degrees from the given DIS orientation values Psi, Theta, and Phi in radians at the given Latitude and Longitude |
Public | Static | FHeadingPitchRoll | CalculateHeadingPitchRollRadiansFromPsiThetaPhiDegreesAtLatLon(FPsiThetaPhi psiThetaPhiDegrees, double latitudeDegrees, double longitudeDegrees) | Calculates the Heading, Pitch, and Roll in radians from the given DIS orientation values Psi, Theta, and Phi in degrees at the given Latitude and Longitude |
Public | Static | FHeadingPitchRoll | CalculateHeadingPitchRollRadiansFromPsiThetaPhiRadiansAtLatLon(FPsiThetaPhi psiThetaPhiRadians, double latitudeDegrees, double longitudeDegrees) | Calculates the Heading, Pitch, and Roll in radians from the given DIS orientation values Psi, Theta, and Phi in radians at the given Latitude and Longitude |
Public | Static | void | CalculateLatLonFromNorthEastDownVectors(FNorthEastDown NorthEastDownVectors, out double latitudeDegrees, out double longitudeDegrees) | Calculates the latitude and longitude at the given East, North, and Up vectors |
Public | Static | FLatLonAlt | CalculateLatLonHeightFromEcefXYZ(Vector3Double ecefLocation) | Converts DIS X, Y, Z coordinates (ECEF) to Latitude, Longitude, and Height (LLH) all in double (64-bit) precision |
Public | Static | FNorthEastDown | CalculateNorthEastDownVectorsFromLatLon(double latitudeDegrees, double longitudeDegrees) | Calculates the East, North, and Up vectors at given latitude and longitude |
Public | Static | FPsiThetaPhi | CalculatePsiThetaPhiDegreesFromHeadingPitchRollDegreesAtLatLon(FHeadingPitchRoll HeadingPitchRollDegrees, double latitudeDegrees, double longitudeDegrees) | Calculates the DIS orientation values Psi, Theta, and Phi in degrees with the given Heading, Pitch, and Roll in degrees at the given Latitude and Longitude |
Public | Static | FPsiThetaPhi | CalculatePsiThetaPhiDegreesFromHeadingPitchRollRadiansAtLatLon(FHeadingPitchRoll HeadingPitchRollRadians, double latitudeDegrees, double longitudeDegrees) | Calculates the DIS orientation values Psi, Theta, and Phi in degrees with the given Heading, Pitch, and Roll in radians at the given Latitude and Longitude |
Public | Static | FPsiThetaPhi | CalculatePsiThetaPhiRadiansFromHeadingPitchRollDegreesAtLatLon(FHeadingPitchRoll HeadingPitchRollDegrees, double latitudeDegrees, double longitudeDegrees) | Calculates the DIS orientation values Psi, Theta, and Phi in radians with the given Heading, Pitch, and Roll in degrees at the given Latitude and Longitude |
Public | Static | FPsiThetaPhi | CalculatePsiThetaPhiRadiansFromHeadingPitchRollRadiansAtLatLon(FHeadingPitchRoll HeadingPitchRollRadians, double latitudeDegrees, double longitudeDegrees) | Calculates the DIS orientation values Psi, Theta, and Phi in radians with the given Heading, Pitch, and Roll in radians at the given Latitude and Longitude |
Public | Static | dmat4 | CreateRotationMatrix(Vector3 AxisVector, double thetaRadians) | Creates a 4x4 rotation matrix around the given axis of rotation rotating by Theta radians |
Public | Static | dmat3 | CreateRotationMatrix(dvec3 AxisVector, double ThetaRadians) | Creates a 3x3 rotation matrix around the given axis of rotation rotating by Theta radians |
Public | Static | dmat3 | CreateSkewMatrix(dvec3 nVector) | Creates a 3x3 n^x matrix used for creating a rotation matrix |
Public | Static | dmat4 | CreateSkewMatrix4x4(Vector3 nVector) | Creates a 4x4 n^x matrix used for creating a rotation matrix |
Public | Static | FEastNorthUp | GetEastNorthUpVectorsFromNorthEastDownVectors(FNorthEastDown NorthEastDownVectors) | Get the East, North, and Up vectors from the North, East, and Down vector struct |
Public | Static | void | GetEcefXYZAndPsiThetaPhiDegreesFromUnity(Vector3 UnityRotation, Vector3 UnityLocation, GeoreferenceSystem GeoReferencingSystem, out Vector3Double EcefXYZ, out FPsiThetaPhi PsiThetaPhiDegrees, Vector3 OriginRebasingOffset) | Gets the ECEF location and the Psi (Yaw), Theta (Pitch), and Phi (Roll) in degrees of the given Unity rotation at the given Unity location |
Public | Static | void | GetEcefXYZAndPsiThetaPhiRadiansFromUnity(Vector3 UnityRotation, Vector3 UnityLocation, GeoreferenceSystem GeoReferencingSystem, out Vector3Double EcefXYZ, out FPsiThetaPhi PsiThetaPhiRadians, Vector3 OriginRebasingOffset) | Gets the ECEF location and the Psi (Yaw), Theta (Pitch), and Phi (Roll) in radians of the given Unity rotation at the given Unity location |
Public | Static | FHeadingPitchRoll | GetHeadingPitchRollFromUnityRotation(Vector3 UnityRotation) | Gets the Heading, Pitch, and Roll in degrees of the given Unity rotation at the given Unity location |
Public | Static | FNorthEastDown | GetNorthEastDownVectorsFromEastNorthUpVectors(FEastNorthUp EastNorthUpVectors) | Get the North, East, and Down vectors from the East, North, and Up vector struct |
Public | Static | FPsiThetaPhi | GetPsiThetaPhiDegreesFromUnityRotation(Vector3 UnityRotation, Vector3 UnityLocation, GeoreferenceSystem GeoReferencingSystem, Vector3 OriginRebasingOffset) | Gets the Psi (Yaw), Theta (Pitch), and Phi (Roll) in degrees of the given Unity rotation at the given Unity location |
Public | Static | FPsiThetaPhi | GetPsiThetaPhiRadiansFromUnityRotation(Vector3 UnityRotation, Vector3 UnityLocation, GeoreferenceSystem GeoReferencingSystem, Vector3 OriginRebasingOffset) | Gets the Psi (Yaw), Theta (Pitch), and Phi (Roll) in radians of the given Unity rotation at the given Unity location |
Public | Static | void | GetUnityLocationAndOrientationFromEntityStatePdu(EntityStatePdu EntityStatePdu, GeoreferenceSystem GeoReferencingSystem, out Vector3 UnityLocation, out Vector3 UnityRotation, Vector3 OriginRebasingOffset) | Gets the Unity X, Y, Z coordinates and rotation from a DIS entity state PDU. Location values returned change depending on if GeoReferencing System is set to Flat Earth or Round Earth. |
Public | Static | Vector3 | GetUnityRotationFromEntityStatePdu(EntityStatePdu EntityStatePduIn) | Gets Unity rotation from a DIS entity state PDU |
Public | Static | Vector3 | GetUnityRotationFromHeadingPitchRollDegreesAtLatLon(FHeadingPitchRoll HeadingPitchRollDegrees, double LatitudeDegrees, double LongitudeDegrees) | Get the Unity rotation from the given Heading, Pitch, Roll rotation in degrees |
Public | Static | Vector3 | GetUnityRotationFromHeadingPitchRollRadiansAtLatLon(FHeadingPitchRoll HeadingPitchRollRadians, double LatitudeDegrees, double LongitudeDegrees) | Get the Unity rotation from the given Heading, Pitch, Roll rotation in radians |
Public | Static | Vector3 | GetUnityRotationFromPsiThetaPhiDegreesAtLatLon(FPsiThetaPhi PsiThetaPhiDegrees, double LatitudeDegrees, double LongitudeDegrees) | Get the Unity rotation from the given Psi, Theta, Phi rotation in degrees |
Public | Static | Vector3 | GetUnityRotationFromPsiThetaPhiRadiansAtLatLon(FPsiThetaPhi PsiThetaPhiRadians, double LatitudeDegrees, double LongitudeDegrees) | Get the Unity rotation from the given Psi, Theta, Phi rotation in radians |
Public | Static | Vector3 | RotateVectorAroundAxisByDegrees(Vector3 vectorToRotate, double thetaRadians, Vector3 axisVector) | Rotates the vector VectorToRotate around given axis AxisVector by Theta degrees |
Public | Static | dvec3 | RotateVectorAroundAxisByDegrees(dvec3 vectorToRotate, double thetaRadians, dvec3 axisVector) | Rotates the vector VectorToRotate around given axis AxisVector by Theta degrees |
Public | Static | Vector3 | RotateVectorAroundAxisByRadians(Vector3 vectorToRotate, double thetaRadians, Vector3 axisVector) | Rotates the vector VectorToRotate around given axis AxisVector by Theta radians |
Public | Static | dvec3 | RotateVectorAroundAxisByRadians(dvec3 vectorToRotate, double thetaRadians, dvec3 axisVector) | Rotates the vector VectorToRotate around given axis AxisVector by Theta radians |
Public | Static | Vector3 | UnwindRotation(Vector3 RotationDegrees) | Takes in a rotation in degrees and finds the shortest route along each axis. (ex: [348, -181, 89] becomes [-12, 179, 89]). |
public static void ApplyHeadingPitchRollToNorthEastDownVector
(
FHeadingPitchRoll HeadingPitchRollDegrees,
FNorthEastDown NorthEastDownVectors,
out Vector3 outX,
out Vector3 outY,
out Vector3 outZ)
Applies the given heading, pitch, and roll in degrees to the local East North Down vectors.
Parameter | Description |
---|---|
HeadingPitchRollDegrees | The degrees from North of the facing direction (heading), the degrees rotated about the local Y axis (pitch), and the degrees rotated about the local X axis (roll) |
NorthEastDownVectors | The vectors pointing to the North, to the East, and toward the center of the Earth |
outX | The x axis (forward) vector with the heading and pitch applied |
outY | The y axis (right) vector with the heading and pitch applied |
outZ | The z axis (down) vector with the heading and pitch applied |
public static void ApplyHeadingPitchToNorthEastDownVector(
double headingDegrees,
double pitchDegrees,
FNorthEastDown NorthEastDownVectors,
out Vector3 outX,
out Vector3 outY,
out Vector3 outZ
)
Rotates the given East, North, and Up vectors by the given Heading and Pitch.
Parameter | Description |
---|---|
headingDegrees | The degrees from North of the facing direction (spin left and right) |
pitchDegrees | The degrees rotated about the local Y axis (front tip up and down) |
NorthEastDownVectors | The vectors pointing to the North, to the East, and toward the center of the Earth |
outX | The x axis (forward) vector with the heading and pitch applied |
outY | The y axis (right) vector with the heading and pitch applied |
outZ | the z axis (up) vector with the heading and pitch applied |
public static void ApplyRollToNorthEastDownVector
(
double rollDegrees,
FNorthEastDown NorthEastDownVectors,
out Vector3 outX,
out Vector3 outY,
out Vector3 outZ
)
Rotates the given East, North, and Up vectors by the given Heading and Pitch.
Parameter | Description |
---|---|
rollDegrees | The degrees rotated about the local X axis (tilt left and right) |
NorthEastDownVectors | The vectors pointing to the North, to the East, and toward the center of the Earth |
outX | The x axis (forward) vector with the heading and pitch applied |
outY | The y axis (right) vector with the heading and pitch applied |
outZ | the z axis (up) vector with the heading and pitch applied |
public static Vector3Double CalculateEcefXYZFromLatLonHeight
(
FLatLonAlt latLonHeightDegreesMeters
)
Converts Latitude, Longitude, and Height (LLH) to DIS X, Y, Z coordinates (ECEF) all in double (64-bit) precision.
Parameter | Description |
---|---|
LatLonHeightDegreesMeters | The latitude in degrees, longitude in degrees, and height in meters |
Returns |
---|
The converted ECEF location |
public static FHeadingPitchRoll CalculateHeadingPitchRollDegreesFromPsiThetaPhiDegreesAtLatLon
(
FPsiThetaPhi psiThetaPhiDegrees,
double latitudeDegrees,
double longitudeDegrees
)
Calculates the Heading, Pitch, and Roll in degrees from the given DIS orientation values Psi, Theta, and Phi in degrees at the given Latitude and Longitude.
Parameter | Description |
---|---|
PsiThetaPhiDegrees | The rotation about the Z axis in degrees (Psi),the rotation about the Y axis in degrees (Theta), the rotation about the X axis in degrees (Phi) |
LatitudeDegrees | The target latitude given in degrees |
LongitudeDegrees | The target longitude given in degrees |
Returns |
---|
The degrees from North of the facing direction (heading), the degrees rotated about the local Y axis (pitch), and the degrees rotated about the local X axis (roll) |
public static FHeadingPitchRoll CalculateHeadingPitchRollDegreesFromPsiThetaPhiRadiansAtLatLon
(
FPsiThetaPhi psiThetaPhiRadians,
double latitudeDegrees,
double longitudeDegrees
)
Calculates the Heading, Pitch, and Roll in degrees from the given DIS orientation values Psi, Theta, and Phi in radians at the given Latitude and Longitude.
Parameter | Description |
---|---|
psiThetaPhiRadians | The rotation about the Z axis in radians (Psi),the rotation about the Y axis in radians (Theta), the rotation about the X axis in radians (Phi) |
latitudeDegrees | The target latitude given in degrees |
longitudeDegrees | The target longitude given in degrees |
Returns |
---|
The degrees from North of the facing direction (heading), the degrees rotated about the local Y axis (pitch), and the degrees rotated about the local X axis (roll) |
public static FHeadingPitchRoll CalculateHeadingPitchRollRadiansFromPsiThetaPhiDegreesAtLatLon
(
FPsiThetaPhi psiThetaPhiDegrees,
double latitudeDegrees,
double longitudeDegrees
)
Calculates the Heading, Pitch, and Roll in radians from the given DIS orientation values Psi, Theta, and Phi in degrees at the given Latitude and Longitude.
Parameter | Description |
---|---|
psiThetaPhiDegrees | The rotation about the Z axis in degrees (Psi),the rotation about the Y axis in degrees (Theta), the rotation about the X axis in degrees (Phi) |
latitudeDegrees | The target latitude given in degrees |
longitudeDegrees | The target longitude given in degrees |
Returns |
---|
The radians from North of the facing direction (heading), the radians rotated about the local Y axis (pitch), and the radians rotated about the local X axis (roll) |
public static FHeadingPitchRoll CalculateHeadingPitchRollRadiansFromPsiThetaPhiRadiansAtLatLon
(
FPsiThetaPhi psiThetaPhiRadians,
double latitudeDegrees,
double longitudeDegrees
)
Calculates the Heading, Pitch, and Roll in radians from the given DIS orientation values Psi, Theta, and Phi in radians at the given Latitude and Longitude.
Parameter | Description |
---|---|
psiThetaPhiRadians | The rotation about the Z axis in radians (Psi),the rotation about the Y axis in radians (Theta), the rotation about the X axis in radians (Phi) |
latitudeDegrees | The target latitude given in degrees |
longitudeDegrees | The target longitude given in degrees |
Returns |
---|
The radians from North of the facing direction (heading), the radians rotated about the local Y axis (pitch), and the radians rotated about the local X axis (roll) |
public static void CalculateLatLonFromNorthEastDownVectors
(
FNorthEastDown NorthEastDownVectors,
out double latitudeDegrees,
out double longitudeDegrees
)
Calculates the latitude and longitude at the given East, North, and Up vectors.
Parameter | Description |
---|---|
NorthEastDownVectors | The vectors pointing to the North, to the East, and toward the center of the Earth |
latitudeDegrees | The target latitude given in degrees |
longitudeDegrees | The target longitude given in degrees |
public static FLatLonAlt CalculateLatLonHeightFromEcefXYZ
(
Vector3Double ecefLocation
)
Converts DIS X, Y, Z coordinates (ECEF) to Latitude, Longitude, and Height (LLH) all in double (64-bit) precision.
Parameter | Description |
---|---|
ecefLocation | The ECEF location |
Returns |
---|
The converted latitude in degrees, longitude in degrees, and height in meters |
public static FNorthEastDown CalculateNorthEastDownVectorsFromLatLon
(
double latitudeDegrees,
double longitudeDegrees
)
Calculates the East, North, and Up vectors at given latitude and longitude.
Parameter | Description |
---|---|
latitudeDegrees | The target latitude given in degrees |
longitudeDegrees | The target longitude given in degrees |
Returns |
---|
The local vectors pointing North, pointing East, and toward the center of the Earth at the given latitude and longitude |
public static FPsiThetaPhi CalculatePsiThetaPhiDegreesFromHeadingPitchRollDegreesAtLatLon
(
FHeadingPitchRoll HeadingPitchRollDegrees,
double latitudeDegrees,
double longitudeDegrees
)
Calculates the DIS orientation values Psi, Theta, and Phi in degrees with the given Heading, Pitch, and Roll in degrees at the given Latitude and Longitude.
Parameter | Description |
---|---|
HeadingPitchRollDegrees | The degrees from North of the facing direction (heading), the degrees rotated about the local Y axis (pitch), and the degrees rotated about the local X axis (roll) |
latitudeDegrees | The target latitude given in degrees |
longitudeDegrees | The target longitude given in degrees |
Returns |
---|
The rotation about the Z axis in degrees (Psi),the rotation about the Y axis in degrees (Theta), the rotation about the X axis in degrees (Phi) |
public static FPsiThetaPhi CalculatePsiThetaPhiDegreesFromHeadingPitchRollRadiansAtLatLon
(
FHeadingPitchRoll HeadingPitchRollRadians,
double latitudeDegrees,
double longitudeDegrees
)
Calculates the DIS orientation values Psi, Theta, and Phi in degrees with the given Heading, Pitch, and Roll in radians at the given Latitude and Longitude.
Parameter | Description |
---|---|
HeadingPitchRollRadians | The radians from North of the facing direction (heading), the radians rotated about the local Y axis (pitch), and the radians rotated about the local X axis (roll) |
latitudeDegrees | The target latitude given in degrees |
longitudeDegrees | The target longitude given in degrees |
Returns |
---|
The rotation about the Z axis in degrees (Psi),the rotation about the Y axis in degrees (Theta), the rotation about the X axis in degrees (Phi) |
public static FPsiThetaPhi CalculatePsiThetaPhiRadiansFromHeadingPitchRollDegreesAtLatLon
(
FHeadingPitchRoll HeadingPitchRollDegrees,
double latitudeDegrees,
double longitudeDegrees
)
Calculates the DIS orientation values Psi, Theta, and Phi in radians with the given Heading, Pitch, and Roll in degrees at the given Latitude and Longitude.
Parameter | Description |
---|---|
HeadingPitchRollDegrees | The degrees from North of the facing direction (heading), the degrees rotated about the local Y axis (pitch), and the degrees rotated about the local X axis (roll) |
latitudeDegrees | The target latitude given in degrees |
longitudeDegrees | The target longitude given in degrees |
Returns |
---|
The rotation about the Z axis in radians (Psi),the rotation about the Y axis in radians (Theta), the rotation about the X axis in radians (Phi) |
public static FPsiThetaPhi CalculatePsiThetaPhiRadiansFromHeadingPitchRollRadiansAtLatLon
(
FHeadingPitchRoll HeadingPitchRollRadians,
double latitudeDegrees,
double longitudeDegrees
)
Calculates the DIS orientation values Psi, Theta, and Phi in radians with the given Heading, Pitch, and Roll in radians at the given Latitude and Longitude.
Parameter | Description |
---|---|
HeadingPitchRollRadians | The radians from North of the facing direction (heading), the radians rotated about the local Y axis (pitch), and the radians rotated about the local X axis (roll) |
latitudeDegrees | The target latitude given in degrees |
longitudeDegrees | The target longitude given in degrees |
Returns |
---|
The rotation about the Z axis in radians (Psi),the rotation about the Y axis in radians (Theta), the rotation about the X axis in radians (Phi) |
public static dmat4 CreateRotationMatrix
(
Vector3 AxisVector,
double thetaRadians
)
Creates a 4x4 rotation matrix around the given axis of rotation rotating by Theta radians.
Parameter | Description |
---|---|
AxisVector | A vector representing the axis of rotation |
ThetaRadians | The amount to rotate given in radians |
Returns |
---|
The resultant rotation matrix to rotate Theta radians around axis AxisVector |
public static dmat3 CreateRotationMatrix
(
dvec3 AxisVector,
double ThetaRadians
)
Creates a 3x3 rotation matrix around the given axis of rotation rotating by Theta radians.
Parameter | Description |
---|---|
AxisVector | A 3x1 vector representing the axis of rotation |
ThetaRadians | The amount to rotate given in radians |
Returns |
---|
The resultant rotation matrix to rotate Theta radians around axis AxisVector |
public static dmat3 CreateSkewMatrix
(
dvec3 nVector
)
Creates a 3x3 n^x matrix used for creating a rotation matrix
Parameter | Description |
---|---|
nVector | A 3x1 vector representing the axis of rotation |
Returns |
---|
A 3x3 n^x matrix used for creating a rotation matrix |
public static dmat4 CreateSkewMatrix4x4
(
dvec3 nVector
)
Creates a 4x4 n^x matrix used for creating a rotation matrix.
Parameter | Description |
---|---|
nVector | A 3x1 vector representing the axis of rotation |
Returns |
---|
A 4x4 n^x matrix used for creating a rotation matrix |
public static FEastNorthUp GetEastNorthUpVectorsFromNorthEastDownVectors
(
FNorthEastDown NorthEastDownVectors
)
Get the East, North, and Up vectors from the North, East, and Down vector struct.
Parameter | Description |
---|---|
NorthEastDownVectors | The North, East, and Down vectors representing the current orientation |
Returns |
---|
The resulting East, North, and Up vectors representing the current orientation |
public static void GetEcefXYZAndPsiThetaPhiDegreesFromUnity
(
Vector3 UnityRotation,
Vector3 UnityLocation,
GeoreferenceSystem GeoReferencingSystem,
out Vector3Double EcefXYZ,
out FPsiThetaPhi PsiThetaPhiDegrees,
Vector3 OriginRebasingOffset = default
)
Gets the ECEF location and the Psi (Yaw), Theta (Pitch), and Phi (Roll) in degrees of the given Unity rotation at the given Unity location.
Parameter | Description |
---|---|
UnityRotation | The Unity rotation in world space |
UnityLocation | The Unity location in world space |
GeoReferencingSystem | The GeoReferencing System reference |
EcefXYZ | The ECEF location of the given Unity location |
PsiThetaPhiDegrees | The Psi (Yaw), Theta (Pitch), and Phi (Roll) in degrees |
OriginRebasingOffset | Any offset that the Unity origin location has had applied to it. Used to take origin shifting into account. |
public static void GetEcefXYZAndPsiThetaPhiRadiansFromUnity
(
Vector3 UnityRotation,
Vector3 UnityLocation,
GeoreferenceSystem GeoReferencingSystem,
out Vector3Double EcefXYZ,
out FPsiThetaPhi PsiThetaPhiRadians,
Vector3 OriginRebasingOffset = default
)
Gets the ECEF location and the Psi (Yaw), Theta (Pitch), and Phi (Roll) in radians of the given Unity rotation at the given Unity location
Parameter | Description |
---|---|
UnityRotation | The Unity rotation in world space |
UnityLocation | The Unity location in world space |
GeoReferencingSystem | The GeoReferencing System reference |
EcefXYZ | The ECEF location of the given Unity location |
PsiThetaPhiRadians | The Psi (Yaw), Theta (Pitch), and Phi (Roll) in radians |
OriginRebasingOffset | Any offset that the Unity origin location has had applied to it. Used to take origin shifting into account. |
public static FHeadingPitchRoll GetHeadingPitchRollFromUnityRotation
(
Vector3 UnityRotation
)
Gets the Heading, Pitch, and Roll in degrees of the given Unity rotation at the given Unity location
Parameter | Description |
---|---|
UnityRotation | The Unity rotation in world space |
Returns |
---|
The heading from North, pitch, and roll in degrees |
public static FNorthEastDown GetNorthEastDownVectorsFromEastNorthUpVectors
(
FEastNorthUp EastNorthUpVectors
)
Get the North, East, and Down vectors from the East, North, and Up vector struct.
Parameter | Description |
---|---|
EastNorthUpVectors | The East, North, and Up vectors representing the current orientation |
Returns |
---|
The resulting North, East, and Down vectors representing the current orientation |
public static FPsiThetaPhi GetPsiThetaPhiDegreesFromUnityRotation
(
Vector3 UnityRotation,
Vector3 UnityLocation,
GeoreferenceSystem GeoReferencingSystem,
Vector3 OriginRebasingOffset = default
)
Gets the Psi (Yaw), Theta (Pitch), and Phi (Roll) in degrees of the given Unity rotation at the given Unity location
Parameter | Description |
---|---|
UnityRotation | The Unity rotation in world space |
UnityLocation | The Unity location in world space |
GeoReferencingSystem | The GeoReferencing System reference |
OriginRebasingOffset | Any offset that the Unity origin location has had applied to it. Used to take origin shifting into account. |
Returns |
---|
The Psi (Yaw), Theta (Pitch), and Phi (Roll) in degrees |
public static FPsiThetaPhi GetPsiThetaPhiRadiansFromUnityRotation
(
Vector3 UnityRotation,
Vector3 UnityLocation,
GeoreferenceSystem GeoReferencingSystem,
Vector3 OriginRebasingOffset = default
)
Gets the Psi (Yaw), Theta (Pitch), and Phi (Roll) in radians of the given Unity rotation at the given Unity location.
Parameter | Description |
---|---|
UnityRotation | The Unity rotation in world space |
UnityLocation | The Unity location in world space |
GeoReferencingSystem | The GeoReferencing System reference |
OriginRebasingOffset | Any offset that the Unity origin location has had applied to it. Used to take origin shifting into account. |
Returns |
---|
The Psi (Yaw), Theta (Pitch), and Phi (Roll) in radians |
public static void GetUnityLocationAndOrientationFromEntityStatePdu
(
EntityStatePdu EntityStatePdu,
GeoreferenceSystem GeoReferencingSystem,
out Vector3 UnityLocation,
out Vector3 UnityRotation,
Vector3 OriginRebasingOffset = default
)
Gets the Unity X, Y, Z coordinates and rotation from a DIS entity state PDU. Location values returned change depending on if GeoReferencing System is set to Flat Earth or Round Earth.
Parameter | Description |
---|---|
EntityStatePdu | The DIS PDU struct indicating the current state of the DIS entity |
GeoReferencingSystem | The GeoReferencing System reference |
UnityLocation | The location of the entity in Unity |
UnityRotation | The rotation of the entity in Unity |
OriginRebasingOffset | Any offset that the Unity origin location has had applied to it. Used to take origin shifting into account. |
public static Vector3 GetUnityRotationFromEntityStatePdu
(
EntityStatePdu EntityStatePduIn
)
Gets Unity rotation from a DIS entity state PDU.
Parameter | Description |
---|---|
EntityStatePdu | The DIS PDU struct indicating the current state of the DIS entity |
Returns |
---|
The rotation of the entity in Unity |
public static Vector3 GetUnityRotationFromHeadingPitchRollDegreesAtLatLon
(
FHeadingPitchRoll HeadingPitchRollDegrees,
double LatitudeDegrees,
double LongitudeDegrees
)
Get the Unity rotation from the given Heading, Pitch, Roll rotation in degrees.
Parameter | Description |
---|---|
HeadingPitchRollDegrees | The Heading, Pitch, Roll rotation in degrees to get the Unity rotation from |
LatitudeDegrees | The target latitude given in degrees |
LongitudeDegrees | The target longitude given in degrees |
Returns |
---|
The Unity rotation of the given Heading, Pitch, Roll rotation |
public static Vector3 GetUnityRotationFromHeadingPitchRollRadiansAtLatLon
(
FHeadingPitchRoll HeadingPitchRollRadians,
double LatitudeDegrees,
double LongitudeDegrees
)
Get the Unity rotation from the given Heading, Pitch, Roll rotation in radians.
Parameter | Description |
---|---|
HeadingPitchRollRadians | The Heading, Pitch, Roll rotation in radians to get the Unity rotation from |
LatitudeDegrees | The target latitude given in degrees |
LongitudeDegrees | The target longitude given in degrees |
Returns |
---|
The Unity rotation of the given Heading, Pitch, Roll rotation |
public static Vector3 GetUnityRotationFromPsiThetaPhiDegreesAtLatLon
(
FPsiThetaPhi PsiThetaPhiDegrees,
double LatitudeDegrees,
double LongitudeDegrees
)
Get the Unity rotation from the given Psi, Theta, Phi rotation in degrees.
Parameter | Description |
---|---|
PsiThetaPhiDegrees | The Psi, Theta, Phi rotation in degrees to get the Unity rotation from |
LatitudeDegrees | The target latitude given in degrees |
LongitudeDegrees | The target longitude given in degrees |
Returns |
---|
The Unity rotation of the given Psi, Theta, Phi rotation |
public static Vector3 GetUnityRotationFromPsiThetaPhiRadiansAtLatLon
(
FPsiThetaPhi PsiThetaPhiRadians,
double LatitudeDegrees,
double LongitudeDegrees
)
Get the Unity rotation from the given Psi, Theta, Phi rotation in radians.
Parameter | Description |
---|---|
PsiThetaPhiRadians | The Psi, Theta, Phi rotation in radians to get the Unity rotation from |
LatitudeDegrees | The target latitude given in degrees |
LongitudeDegrees | The target longitude given in degrees |
Returns |
---|
The Unity rotation of the given Psi, Theta, Phi rotation |
public static Vector3 RotateVectorAroundAxisByDegrees
(
Vector3 vectorToRotate,
double thetaDegrees,
Vector3 axisVector
)
Rotates the vector VectorToRotate around given axis AxisVector by Theta degrees.
Parameter | Description |
---|---|
vectorToRotate | The target vector to rotate |
thetaDegrees | The desired amount to rotation in degrees |
axisVector | The vector indicating the axis of rotation |
Returns |
---|
The resultant rotated vector |
public static dvec3 RotateVectorAroundAxisByDegrees
(
dvec3 vectorToRotate,
double thetaDegrees,
dvec3 axisVector
)
Rotates the vector VectorToRotate around given axis AxisVector by Theta degrees
Parameter | Description |
---|---|
vectorToRotate | The target vector to rotate |
thetaDegrees | The desired amount to rotation in degrees |
axisVector | The vector indicating the axis of rotation |
Returns |
---|
The resultant rotated vector |
public static Vector3 RotateVectorAroundAxisByRadians
(
Vector3 vectorToRotate,
double thetaRadians,
Vector3 axisVector
)
Rotates the vector VectorToRotate around given axis AxisVector by Theta radians
Parameter | Description |
---|---|
vectorToRotate | The target vector to rotate |
thetaRadians | The desired amount to rotation in radians |
axisVector | The vector indicating the axis of rotation |
Returns |
---|
The resultant rotated vector |
public static dvec3 RotateVectorAroundAxisByRadians
(
dvec3 vectorToRotate,
double thetaRadians,
dvec3 axisVector
)
Rotates the vector VectorToRotate around given axis AxisVector by Theta radians.
Parameter | Description |
---|---|
vectorToRotate | The target vector to rotate |
thetaRadians | The desired amount to rotation in radians |
axisVector | The vector indicating the axis of rotation |
Returns |
---|
The resultant rotated vector |
public static Vector3 UnwindRotation
(
Vector3 RotationDegrees
)
Takes in a rotation in degrees and finds the shortest route along each axis. (ex: [348, -181, 89] becomes [-12, 179, 89])
Parameter | Description |
---|---|
RotationDegrees | Vector3 in degrees to unwind. |
Returns |
---|
Vector3 containing shortest route rotations along each axis. |