This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

GeodeticPivot Class

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
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 from: 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

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 (UnigineScript)
// Creating a new geodetic pivot
GeodeticPivot pivot = new GeodeticPivot();

// setting the local (X - Y - Z) origin basis for it
pivot.setOriginBasis(GEODETIC_PIVOT_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

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 (UnigineScript)
// Creating a new geodetic pivot
GeodeticPivot pivot = new GeodeticPivot();

// setting the local (X - Y - Z) origin basis for it
pivot.setOriginBasis(GEODETIC_PIVOT_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 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 ) #

Sets a new origin basis 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.
    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.

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.
    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.

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.

static int type ( ) #

Returns the type of the object.

Return value

GeodeticPivot type identifier.
Last update: 2022-03-10
Build: ()