This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
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
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
Content Optimization
Materials
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::ObjectTerrainGlobal Class

Header: #include <UnigineObjects.h>
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

Members


static ObjectTerrainGlobalPtr create ( ) #

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.

Ptr<TerrainGlobalLods> getAlbedoLods ( ) #

Returns the group of terrain albedo LODs.

Return value

Terrain albedo LODs group.

Ptr<Texture> getAlbedoTextureArray ( ) const#

Returns the albedo textures array.

Return value

Albedo textures array.

void setAlbedoTextureArrayName ( const char * name ) #

Sets the name of the albedo textures array.

Arguments

  • const char * name - Name of the albedo textures array.

const char * getAlbedoTextureArrayName ( ) const#

Returns the name of the albedo textures array.

Return value

Name of the albedo textures array.

int addDetail ( const char * name ) #

Adds a new detail to the vector of terrain details.

Arguments

  • const char * 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.

Ptr<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 ( ) const#

Returns the total number of details.

Return value

Number of details.

void setForceIntersection ( bool intersection ) #

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

Arguments

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

bool isForceIntersection ( ) const#

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

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

int addMask ( const char * name ) #

Adds a new mask to the vector of masks.

Arguments

  • const char * 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 ( const 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

void resizeMasks ( int size ) #

Resizes the vector of masks.

Arguments

  • int size - New size.

int getNumMasks ( ) const#

Returns the total number of masks.

Return value

Number of masks.

Ptr<TerrainGlobalLods> getMaskLods ( ) #

Returns the group of terrain mask LODs.

Return value

Terrain mask LODs group.

void setMaskName ( int num, const char * name ) #

Sets the name of the mask with the specified number.

Arguments

  • int num - Mask number.
  • const char * name - New mask name.

const char * getMaskName ( int num ) const#

Returns the name for of mask with the specified number.

Arguments

  • int num - Mask number.

Return value

Mask name.

Ptr<TerrainGlobalLods> getHeightLods ( ) #

Returns the group of terrain height LODs.

Return value

Terrain height LODs group.

Ptr<Texture> getHeightTextureArray ( ) const#

Returns the height textures array.

Return value

Height textures array.

void setHeightTextureArrayName ( const char * name ) #

Sets the name of the height textures array.

Arguments

  • const char * name - Name of the height textures array.

const char * getHeightTextureArrayName ( ) const#

Returns the name of the height textures array.

Return value

Name of the height textures array.

Ptr<TerrainGlobalLods> getNormalLods ( ) #

Returns the group of terrain normal LODs.

Return value

Terrain normal LODs group.

Ptr<Texture> getNormalTextureArray ( ) const#

Returns the normal textures array.

Return value

Normal textures array.

void setNormalTextureArrayName ( const char * name ) #

Sets the name of the normal textures array.

Arguments

  • const char * name - Name of the normal textures array.

const char * getNormalTextureArrayName ( ) const#

Returns the name of the normal textures array.

Return value

Name of the normal textures array.

int fetchTopologyData ( double x, double y, Math::Vec3 & ret_point, Math::vec3 & ret_normal, Math::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.
  • Math::Vec3 & ret_point - World coordinates of the point.
  • Math::vec3 & ret_normal - Normal coordinates.
  • Math::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: 2021-04-29
Build: ()