This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine.GeodeticPivot Class

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Engineering / Sim SDK edition to use it.
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). The geodetic pivot contains an ellipsoid with a pivot point.

Notice
In UNIGINE SDK editions other than Engineering and Sim, the geodetic pivot object is equivalent to NodeDummy.

See also#

A UnigineScript API sample <UnigineSDK>/data/samples/geodetics/pivot_00

GeodeticPivot Class

Properties

int OriginBasis#

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.
    Notice
    The Up-axis (Z+) direction in ENU points upward along the ellipsoid normal, while in UNIGINE implementation of ENU it goes from the Earth's center.
set
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.
    Notice
    The Up-axis (Z+) direction in ENU points upward along the ellipsoid normal, while in UNIGINE implementation of ENU it goes from the Earth's center.
set value - One of the ORIGIN_BASIS_* variables.

dvec3 Origin#

The position (latitude, longitude and altitude) on the ellipsoid.
set
Sets a new position (latitude, longitude and altitude) on the ellipsoid.
Source code (C#)
// 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
set value - Origin vector in ellipsoid coordinates.

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.

void SetEllipsoid ( Ellipsoid ellipsoid ) #

Sets an Ellipsoid to be used for the Geodetic Pivot.
Notice
Modifying the ellipsoid of the Geodetic Pivot directly makes the pivot's state inconsistent. You should force the GeodeticPivot node to update its internal state according to the modified ellipsoid by setting it via the setEllipsoid() method.
Source code (C#)
// Creating a new geodetic pivot
GeodeticPivot pivot = new GeodeticPivot();

// setting the local (X - Y - Z) origin basis for it
pivot.setOriginBasis(GeodeticPivot.ORIGIN_BASIS_LOCAL);

// getting an ellipsoid currently used by the geodetic pivot
Ellipsoid ellipsoid = pivot.getEllipsoid();

// setting a fast calculation mode for the ellipsoid
ellipsoid.setMode(Ellipsoid.MODE_FAST);

// setting a new semimajor axis for the ellipsoid
ellipsoid.setSemimajorAxis(6378137.0f - 500.0f);

/* ... */

// force updating the geodetic pivot according to the modified ellipsoid
pivot.setEllipsoid(ellipsoid);

Arguments

Ellipsoid GetEllipsoid ( ) #

Returns the Ellipsoid currently used by the Geodetic Pivot.
Notice
Modifying the ellipsoid of the Geodetic Pivot directly makes the pivot's state inconsistent. You should force the GeodeticPivot node to update its internal state according to the modified ellipsoid by setting it via the setEllipsoid() method.
Source code (C#)
// Creating a new geodetic pivot
GeodeticPivot pivot = new GeodeticPivot();

// setting the local (X - Y - Z) origin basis for it
pivot.setOriginBasis(GeodeticPivot.ORIGIN_BASIS_LOCAL);

// getting an ellipsoid currently used by the geodetic pivot
Ellipsoid ellipsoid = pivot.getEllipsoid();

// setting a fast calculation mode for the ellipsoid
ellipsoid.setMode(Ellipsoid.MODE_FAST);

// setting a new semimajor axis for the ellipsoid
ellipsoid.setSemimajorAxis(6378137.0f - 500.0f);

/* ... */

// force updating the geodetic pivot according to the modified ellipsoid
pivot.setEllipsoid(ellipsoid);

Return value

Ellipsoid currently used by the Geodetic Pivot.

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.

static int type ( ) #

Returns the type of the object.

Return value

GeodeticPivot type identifier.
Last update: 2021-04-01
Build: ()