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).
Notice
The geodetic pivot contains an ellipsoid with a pivot point.
Geodetic pivot object works only in Sim version of Unigine Engine. 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.
void setOrigin(dvec3 origin)
Sets a new position (latitude, longitude and altitude) on the ellipsoid.Source code (UnigineScript)
// 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)
Arguments
- int basis
int getOriginBasis()
Returns the origin basis set for the GeodeticPivot object:- If GEODETIC_PIVOT_ORIGIN_BASIS_LOCAL is set, the binding to geo-coordinates is disabled. GeodeticPivot can be placed everywhere.
- If GEODETIC_PIVOT_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
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.dmat4 toWorld(dvec3 geodetic_coords)
Returns world transformation matrix for given geodetic coordinates.Arguments
- dvec3 geodetic_coords - Geodetic coordinates.
Return value
World transformation.int type()
Returns the type of the object.Return value
GeodeticPivot type identifier.int GEODETIC_PIVOT_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 GEODETIC_PIVOT_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: 2017-12-21
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)