This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
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
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
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.

ObjectTerrainGlobal 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 UnigineScipt (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: Object

This class is used to create a global terrain object representing a certain fragment of Earth's surface on the basis of available GIS data (elevation and imagery). The global terrain is rendered using pre-generated tilesets which represent LODs for different data layers (heights, albedo, normals, and masks). Tilesets are managed via the TileSet class. Tileset data is stored in tileset files on the disk, these files are managed via the TileSetFile class

See Also#

  • A TerrainGlobalDetail class to manage global terrain via C++, C# or UnigineScript API.
  • A TerrainGlobalLod class to manage a global terrain LOD via C++, C# or UnigineScript API.
  • A TerrainGlobalLodHeight class to manage a global terrain height LOD via C++, C# or UnigineScript API.
  • A TerrainGlobalLods class to manage a group of global terrain LODs via C++, C# or UnigineScript API.
  • A Tileset class to manage tileset data of of the ObjectTerrainGlobal via C++, C# or UnigineScript API.
  • A TilesetFile class to manage tileset files of the ObjectTerrainGlobal via C++, C# or UnigineScript API.
  • A UnigineScript API sample <UnigineSDK>/data/samples/objects/terrain_global_00

ObjectTerrainGlobal Class

Members


static ObjectTerrainGlobal ( ) #

Constructor. Creates a new empty global terrain object with default properties.

void clear ( ) #

Clears all terrain data (lods, textures, details, masks etc.).

static int type ( ) #

Returns the type of the object.

Return value

ObjectTerrainGlobal type identifier.

TerrainGlobalLods getAlbedoLods ( ) #

Returns the group of terrain albedo LODs.

Return value

Terrain albedo LODs group.

void setAlbedoTextureArrayName ( string name ) #

Sets the name of the albedo textures array.

Arguments

  • string name - Name of the albedo textures array.

string getAlbedoTextureArrayName ( ) #

Returns the name of the albedo textures array.

Return value

Name of the albedo textures array.

int addDetail ( string name ) #

Adds a new detail to the vector of terrain details.

Arguments

  • string name - Detail name.

Return value

Number of the new detail.

int cloneDetail ( int num ) #

Clones the detail with the specified number.

Arguments

  • int num - Detail number.

Return value

Number of the new cloned terrain detail.

TerrainGlobalDetail getDetail ( int num ) #

Returns the terrain detail with the specified number.

Arguments

  • int num - Detail number.

Return value

Terrain detail.

void removeDetail ( int num ) #

Removes the detail with the specified number.

Arguments

  • int num - Detail number.

void swapDetail ( int num_0, int num_1 ) #

Swaps two details of the terrain.

Arguments

  • int num_0 - Number of the first detail.
  • int num_1 - Number of the second detail.

void resizeDetails ( int size ) #

Resizes the vector of terrain details.

Arguments

  • int size - New size.

int getNumDetails ( ) #

Returns the total number of details.

Return value

Number of details.

void setForceIntersection ( int intersection ) #

Enables or disables forced loading of necessary terrain tiles to ensure correct intersection detection.

Arguments

  • int intersection - 1 to load necessary terrain tiles for intersection detection; otherwise, 0. The default value is 0.
    Notice
    When enabled, this option may significantly reduce performance. Thus, it is recommended to enable it, perform intersection check, and disable it again.

int isForceIntersection ( ) #

Returns a value indicating if forced loading of terrain tiles for intersection detection is enabled.
Notice
This option is used to enable force loading of terrain tiles to ensure correct intersection detection.

Return value

1 if forced loading of terrain tiles for intersection detection is enabled; otherwise, 0.

int addMask ( string name ) #

Adds a new mask to the vector of masks.

Arguments

  • string name - Mask name.

Return value

Number of the new mask, if the mask was added successfully; otherwise, -1.

int cloneMask ( int num ) #

Clones the mask with the specified number.

Arguments

  • int num - Mask number.

Return value

Number of the new cloned mask.

void removeMask ( int num ) #

Removes the mask with the specified number from the vector of masks.

Arguments

  • int num - Mask number.

void swapMask ( int num_0, int num_1 ) #

Swaps two masks.

Arguments

  • int num_0 - Number of the first mask.
  • int num_1 - Number of the second mask.

void replaceMasks ( Vector<String> names ) #

Replaces the list of masks with a given one.
Notice
If a mask used by some detail is missing in the new list, such detail will be considered as having no mask assigned, otherwise it will keep its mask.

Arguments

  • Vector<String> names - New list of masks.

void resizeMasks ( int size ) #

Resizes the vector of masks.

Arguments

  • int size - New size.

int getNumMasks ( ) #

Returns the total number of masks.

Return value

Number of masks.

TerrainGlobalLods getMaskLods ( ) #

Returns the group of terrain mask LODs.

Return value

Terrain mask LODs group.

void setMaskName ( int num, string name ) #

Sets the name of the mask with the specified number.

Arguments

  • int num - Mask number.
  • string name - New mask name.

string getMaskName ( int num ) #

Returns the name for of mask with the specified number.

Arguments

  • int num - Mask number.

Return value

Mask name.

TerrainGlobalLods getHeightLods ( ) #

Returns the group of terrain height LODs.

Return value

Terrain height LODs group.

void setHeightTextureArrayName ( string name ) #

Sets the name of the height textures array.

Arguments

  • string name - Name of the height textures array.

string getHeightTextureArrayName ( ) #

Returns the name of the height textures array.

Return value

Name of the height textures array.

TerrainGlobalLods getNormalLods ( ) #

Returns the group of terrain normal LODs.

Return value

Terrain normal LODs group.

void setNormalTextureArrayName ( string name ) #

Sets the name of the normal textures array.

Arguments

  • string name - Name of the normal textures array.

string getNormalTextureArrayName ( ) #

Returns the name of the normal textures array.

Return value

Name of the normal textures array.

Vec3 fetchTopologyPoint ( Scalar x, Scalar y ) #

Returns topology data for a given terrain point.

Arguments

  • Scalar x - X coordinate of the point.
  • Scalar y - Y coordinate of the point.

Return value

World coordinates of the point.
Last update: 2020-07-31
Build: ()