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

Unigine.ObjectTerrainGlobal 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 from: 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

Properties

bool ForceIntersection#

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

Texture HeightTextureArray#

The height textures array.

string HeightTextureArrayName#

The name of the height textures array.

Texture NormalTextureArray#

The normal textures array.

string NormalTextureArrayName#

The name of the normal textures array.

Texture AlbedoTextureArray#

The albedo textures array.

string AlbedoTextureArrayName#

The name of the albedo textures array.

int NumDetails#

The total number of details.

int NumMasks#

The total number of masks.

Members


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.

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

  • string[] names - New list of masks.

void ResizeMasks ( int size ) #

Resizes the vector of masks.

Arguments

  • int size - New size.

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.

TerrainGlobalLods GetNormalLods ( ) #

Returns the group of terrain normal LODs.

Return value

Terrain normal LODs group.

int FetchTopologyData ( double x, double y, out Vec3 ret_point, out vec3 ret_normal, out vec3 ret_up, int force = 0 ) #

Returns topology data for a given terrain point.

Arguments

  • double x - X coordinate of the point.
  • double y - Y coordinate of the point.
  • out Vec3 ret_point - World coordinates of the point.
  • out vec3 ret_normal - Normal coordinates.
  • out vec3 ret_up - "Up" vector coordinates.
  • int force - Force flag. Use 1 to load files in any case; otherwise, 0. The default value is 0.

Return value

1 if the topology data was fetched successfully; otherwise, 0.
Last update: 2022-12-14
Build: ()