Unigine.GeodeticPivot Class
Inherits: | Node |
This class is used to create and modify a geodetic pivot object that is used to place world objects on their real world positions (latitude, longitude and altitude).
Geodetic pivot object works only in the Engineering and Sim versions of UNIGINE SDK. In other editions it's equivalent to NodeDummy.
GeodeticPivot Class
Members
static GeodeticPivot()
GeodeticPivot constructor. Creates a GeodeticPivot instance with the default settings:- The origin is set to dvec3(0.0,0.0,0.0).
- The size of the curving region is 2048000×2048000 km.
- The resolution of the region texture is 2048.
GeodeticPivot cast(Node node)
Casts a GeodeticPivot out of the Node instance.Arguments
- Node node - Node instance.
Return value
GeodeticPivot instance.void setEllipsoid(Ellipsoid ellipsoid)
Sets an Ellipsoid for the GeodeticPivot object.Arguments
- Ellipsoid ellipsoid - An Ellipsoid.
Ellipsoid getEllipsoid()
Returns the Ellipsoid set for the GeodeticPivot object.void setOrigin(dvec3 origin)
Sets a new position (latitude, longitude and altitude) on the ellipsoid.// the GeodeticPivot will use WGS84 reference ellipsoid by default
GeodeticPivot pivot = new GeodeticPivot();
// update the origin
dvec3 new_york_origin = dvec3(40.71427,-74.00597,57.0);
pivot.setOrigin(new_york_origin);
ObjectMeshStatic flat_new_york_ground = new ObjectMeshStatic("flat_new_york_ground.mesh");
pivot.addChild(flat_new_york_ground); // the mesh will be bent once ObjectMeshStatic become a child of GeodeticPivot
Arguments
- dvec3 origin - Origin vector in ellipsoid coordinates.
dvec3 getOrigin()
Returns the position (latitude, longitude and altitude) on the ellipsoid.Return value
Origin vector in ellipsoid coordinates.void setOriginBasis(int basis)
Sets a new origin basis for the GeodeticPivot object:- If ORIGIN_BASIS_LOCAL is set, the binding to geo-coordinates is disabled. GeodeticPivot can be placed everywhere.
- If ORIGIN_BASIS_ENU is set, GeodeticPivot is placed to the world ECF position with ENU (East - North - Up) orientation according to the given latitude / longitude / altitude. The GeodeticPivot position is blocked.
Arguments
- int basis - One of the ORIGIN_BASIS_* variables.
int getOriginBasis()
Returns the origin basis set for the GeodeticPivot object:- If ORIGIN_BASIS_LOCAL is set, the binding to geo-coordinates is disabled. GeodeticPivot can be placed everywhere.
- If ORIGIN_BASIS_ENU is set, GeodeticPivot is placed to the world ECF position with ENU (East - North - Up) orientation according to the given latitude / longitude / altitude. The GeodeticPivot position is blocked.
Return value
One of the ORIGIN_BASIS_* variables.void mapEllipsoidToFlat(vec3 ellipsoid_point, out vec3 ret_flat_point, out vec3 ret_ellipsoid_normal)
Maps ellipsoid coordinates of a point to flat plane coordinates (using latitude and longitude as X and Y coordinates and altitude as Z).Arguments
- vec3 ellipsoid_point - Ellipsoid coordinates of the point
- out vec3 ret_flat_point - Flat plane coordinates of the point.
- out vec3 ret_ellipsoid_normal - Ellipsoid point normal coordinates.
void mapEllipsoidToFlat(dvec3 ellipsoid_point, out dvec3 ret_flat_point, out dvec3 ret_ellipsoid_normal)
Maps ellipsoid coordinates of a point to flat plane coordinates (using latitude and longitude as X and Y coordinates and altitude as Z).Arguments
- dvec3 ellipsoid_point - Ellipsoid coordinates of the point
- out dvec3 ret_flat_point - Flat plane coordinates of the point.
- out dvec3 ret_ellipsoid_normal - Ellipsoid point normal coordinates.
mat4 mapEllipsoidToFlat(mat4 ellipsoid_transform)
Maps ellipsoid transformation to the flat plane transformation (using latitude and longitude as X and Y coordinates and altitude as Z).Arguments
- mat4 ellipsoid_transform - Ellipsoid transformation.
Return value
Flat plane transformation.dmat4 mapEllipsoidToFlat(dmat4 ellipsoid_transform)
Maps ellipsoid transformation to the flat plane transformation (using latitude and longitude as X and Y coordinates and altitude as Z).Arguments
- dmat4 ellipsoid_transform - Ellipsoid transformation.
Return value
Flat plane transformation.void mapFlatToEllipsoid(vec3 flat_point, out vec3 ret_ellipsoid_point, out vec3 ret_ellipsoid_normal)
Maps flat plane coordinates to the ellipsoid (uses X and Y coordinates as latitude and longitude, and Z as altitude).Arguments
- vec3 flat_point - Flat plane coordinates of the point.
- out vec3 ret_ellipsoid_point - Ellipsoid coordinates of the point
- out vec3 ret_ellipsoid_normal - Ellipsoid point normal coordinates.
void mapFlatToEllipsoid(dvec3 flat_point, out dvec3 ret_ellipsoid_point, out dvec3 ret_ellipsoid_normal)
Maps flat plane coordinates to the ellipsoid (uses X and Y coordinates as latitude and longitude, and Z as altitude).Arguments
- dvec3 flat_point - Flat plane coordinates of the point.
- out dvec3 ret_ellipsoid_point - Ellipsoid coordinates of the point
- out dvec3 ret_ellipsoid_normal - Ellipsoid point normal coordinates.
mat4 mapFlatToEllipsoid(mat4 flat_transform)
Maps flat plane transformation to the ellipsoid transformation (uses X and Y coordinates as latitude and longitude, and Z as altitude).Arguments
- mat4 flat_transform - Flat plane transformation.
Return value
Ellipsoid transformation.dmat4 mapFlatToEllipsoid(dmat4 flat_transform)
Maps flat plane transformation to the ellipsoid transformation (uses X and Y coordinates as latitude and longitude, and Z as altitude).Arguments
- dmat4 flat_transform - Flat plane transformation.
Return value
Ellipsoid transformation.dvec3 mapFlatToGeodetic(dvec3 flat_point)
Maps flat plane coordinates to geodetic latitude / longitude / altitude coordinates according to pivot's origin.Arguments
- dvec3 flat_point - Flat plane coordinates.
Return value
Geodetic coordinates.dvec3 mapFlatToGeodetic(vec3 flat_point)
Maps flat plane coordinates to geodetic latitude / longitude / altitude coordinates according to pivot's origin.Arguments
- vec3 flat_point - Flat plane coordinates.
Return value
Geodetic coordinates.void mapFlatsToGeodetic(double[] src_x, double[] src_y, int size, double[] ret_lat, double[] ret_lon)
Pefrorms batch mapping of flat plane coordinates to geodetic latitude / longitude coordinates according to pivot's origin and puts the result to the corresponding output arrays.Arguments
- double[] src_x - Array of flat plane X coordinates.
- double[] src_y - Array of flat plane Y coordinates.
- int size - Array size.
- double[] ret_lat - Output array of geodetic latitude coordinates.
- double[] ret_lon - Output array of geodetic longitude coordinates.
dvec3 mapGeodeticToFlat(dvec3 geodetic_coords)
Maps geodetic latitude / longitude / altitude coordinates to flat plane coordinates according to pivot's latitude / longitude / altitude origin.Arguments
- dvec3 geodetic_coords - Geodetic coordinates.
Return value
Flat plane coordinates.void mapGeodeticsToFlat(double[] lat, double[] lon, int size, double[] ret_x, double[] ret_y)
Pefrorms batch mapping of geodetic latitude / longitude coordinates to flat plane coordinates according to pivot's latitude / longitude origin and puts the result to the corresponding output arrays.Arguments
- double[] lat - Array of geodetic latitude coordinates.
- double[] lon - Array of geodetic longitude coordinates.
- int size - Array size.
- double[] ret_x - Output array of flat plane X coordinates.
- double[] ret_y - Output array of flat plane Y coordinates.
mat4 mapMeshEllipsoidToFlat(Mesh mesh, mat4 ellipsoid_transform)
Maps a curved mesh to the flat plane (using latitude / longitude / altitude as X / Y / Z coordinates).Arguments
- Mesh mesh - Mesh to be mapped.
- mat4 ellipsoid_transform - Mesh ellipsoid transformation.
Return value
Position on the flat plane, where the node is to be placed.dmat4 mapMeshEllipsoidToFlat(Mesh mesh, dmat4 ellipsoid_transform)
Maps a curved mesh to the flat plane (using latitude / longitude / altitude as X / Y / Z coordinates).Arguments
- Mesh mesh - Mesh to be mapped.
- dmat4 ellipsoid_transform - Mesh ellipsoid transformation.
Return value
Position on the flat plane, where the node is to be placed.mat4 mapMeshFlatToEllipsoid(Mesh mesh, mat4 flat_transform)
Maps a flat mesh to the ellipsoid (uses X and Y coordinates as latitude and longitude, and Z as altitude).Arguments
- Mesh mesh - Mesh to be mapped.
- mat4 flat_transform - Mesh flat plane transformation.
Return value
Position on the ellipsoid, where the node is to be placed.dmat4 mapMeshFlatToEllipsoid(Mesh mesh, dmat4 flat_transform)
Maps a flat mesh to the ellipsoid (uses X and Y coordinates as latitude and longitude, and Z as altitude).Arguments
- Mesh mesh - Mesh to be mapped.
- dmat4 flat_transform - Mesh flat plane transformation.
Return value
Position on the ellipsoid, where the node is to be placed.dvec3 toGeodetic(mat4 world_transform)
Returns geodetic coordinates for a given world transformation matrix.Arguments
- mat4 world_transform - World transformation.
Return value
Geodetic coordinates.dvec3 toGeodetic(dmat4 world_transform)
Returns geodetic coordinates for a given world transformation matrix.Arguments
- dmat4 world_transform - World transformation.
Return value
Geodetic coordinates.dmat4 toWorld(dvec3 geodetic_coords)
Returns world transformation matrix for given geodetic coordinates.Arguments
- dvec3 geodetic_coords - Geodetic coordinates.
Return value
World transformation.mat4 toWorldPreserveRotation(mat4 world_transform, dvec3 geodetic_coords)
Returns new world transformation matrix preserving rotation relative to normal.Arguments
- mat4 world_transform - World transformation.
- dvec3 geodetic_coords - Geodetic coordinates.
Return value
New world transformation.dmat4 toWorldPreserveRotation(dmat4 world_transform, dvec3 geodetic_coords)
Returns new world transformation matrix preserving rotation relative to normal.Arguments
- dmat4 world_transform - World transformation.
- dvec3 geodetic_coords - Geodetic coordinates.
Return value
New world transformation.int type()
Returns the type of the object.Return value
GeodeticPivot type identifier.int ORIGIN_BASIS_ENU
Description
The origin basis East - North - Up (Earth-Centric) is used for the GeodeticPivot object. It is used to place the pivot to the world ECF position with ENU orientation according to latitude / longitude / altitude. The position of the GeodeticPivot object is blocked when this basis is used.int ORIGIN_BASIS_LOCAL
Description
The local (X - Y - Z) origin basis is used for the GeodeticPivot object. The pivot doesn't bind to geo-coordinates and can be placed anywhere.Last update: 2018-08-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)