This page has been translated automatically.
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
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
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::ObjectTerrainGlobal Class

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

ObjectTerrainGlobal Class

Members


static ObjectTerrainGlobalPtr create()

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

static Ptr<ObjectTerrainGlobal> cast(const Ptr<Node> & node)

Casts an ObjectTerrainGlobal out of the Node instance.

Arguments

  • const Ptr<Node> & node - Pointer to Node.

Return value

Pointer to ObjectTerrainGlobal.

static Ptr<ObjectTerrainGlobal> cast(const Ptr<Object> & base)

Casts an ObjectTerrainGlobal out of the Object instance.

Arguments

  • const Ptr<Object> & base - Pointer to Object.

Return value

Pointer to ObjectTerrainGlobal.

void setAlbedoLodClearDistance(int num, float distance)

Sets the clear distance of a given albedo LOD. Starting from this distance the tiles of the LOD are removed from memory.

Arguments

  • int num - Albedo LOD number.
  • float distance - Clear distance, in units.

float getAlbedoLodClearDistance(int num)

Returns the clear distance of a given albedo LOD. Starting from this distance the tiles of the LOD are removed from memory.

Arguments

  • int num - Albedo LOD number.

Return value

Clear distance, in units.

void setAlbedoLodEnabled(int num, int enabled)

Enables or disables a given albedo LOD.

Arguments

  • int num - Albedo LOD number.
  • int enabled - 1 to enable the LOD, 0 to disable it.

int getAlbedoLodEnabled(int num)

Returns a value indicating if a given albedo LOD is enabled.

Arguments

  • int num - Albedo LOD number.

Return value

1 if a given albedo LOD is enabled; otherwise, 0.

void setAlbedoLodLoadDistance(int num, float distance)

Sets the load distance for a given albedo LOD. Starting from this distance the tiles of the LOD are loaded into memory.

Arguments

  • int num - Albedo LOD number.
  • float distance - Load distance, in units.

float getAlbedoLodLoadDistance(int num)

Returns the load distance for a given albedo LOD. Starting from this distance the tiles of the LOD are loaded into memory.

Arguments

  • int num - Albedo LOD number.

Return value

Load distance, in units.

void setAlbedoLodPath(int num, const char * path)

Sets the path to the folder where a given albedo LOD is stored.

Arguments

  • int num - Albedo LOD number.
  • const char * path - Path to the folder where a given albedo LOD is stored.

const char * getAlbedoLodPath(int num)

Returns the path to the folder where a given albedo LOD is stored.

Arguments

  • int num - Albedo LOD number.

Return value

Path to the folder where a given albedo LOD is stored.

void setAlbedoLodTileDensity(int num, float density)

Sets the density of a tile of a given albedo LOD.

Arguments

  • int num - Albedo LOD number.
  • float density - Density of a albedo LOD tile, in meters per pixel.

float getAlbedoLodTileDensity(int num)

Returns the density of a tile of a given albedo LOD.

Arguments

  • int num - Albedo LOD number.

Return value

Density of an albedo LOD tile, in meters per pixel.

Ptr<Tileset> getAlbedoLodTileset(int num)

Returns the tileset for a given albedo LOD.

Arguments

  • int num - Albedo LOD number.

Return value

Albedo LOD tileset.

void setAlbedoLodViewportMask(int num, int mask)

Sets the viewport mask for a given albedo LOD.

Arguments

  • int num - Albedo LOD number.
  • int mask - Viewport mask.

int getAlbedoLodViewportMask(int num)

Returns the viewport mask for a given albedo LOD.

Arguments

  • int num - Albedo LOD number.

Return value

Viewport mask.

void setAlbedoLodVisibleDistance(int num, float distance)

Sets the visible distance of a given albedo LOD. Starting from this distance the tiles of the LOD become visible.

Arguments

  • int num - Albedo LOD number.
  • float distance - Visible distance, in units.

float getAlbedoLodVisibleDistance(int num)

Returns the visible distance of a given albedo LOD. Starting from this distance the tiles of the LOD become visible.

Arguments

  • int num - Albedo LOD number.

Return value

Visible distance, in units.

int getAlbedoNumLods()

Returns the total number of albedo LODs.

Return value

Total number of albedo LODs.

String getAlbedoVideoMemoryUsage()

Returns information about the total video memory usage for all albedo LODs.

Return value

Total video memory usage for all albedo LODs.

void setHeightLodClearDistance(int num, float distance)

Returns the clear distance of a given height LOD. Starting from this distance the tiles of the LOD are removed from memory.

Arguments

  • int num - Height LOD number.
  • float distance - Clear distance, in units.

float getHeightLodClearDistance(int num)

Returns the clear distance of a given height LOD. Starting from this distance the tiles of the LOD are removed from memory.

Arguments

  • int num - Height LOD number.

Return value

Clear distance, in units.

void setHeightLodCollision(int num, int enabled)

Enables or disables collision detection for a given height LOD.

Arguments

  • int num - Height LOD number.
  • int enabled - 1 to enable collision detection, 0 to disable it.

int getHeightLodCollision(int num)

Returns a value indicating if collision detection for a given height LOD is enabled.

Arguments

  • int num - Height LOD number.

Return value

1 if collision detection for a given LOD is enabled; otherwise, 0.

void setHeightLodCollisionMask(int num, int mask)

Sets the collision mask for a given height LOD.

Arguments

  • int num - Height LOD number.
  • int mask - Collision mask.

int getHeightLodCollisionMask(int num)

Returns the collision mask for a given height LOD.

Arguments

  • int num - Height LOD number.

Return value

Collision mask.

void setHeightLodEnabled(int num, int enabled)

Enables of disables a given height LOD.

Arguments

  • int num - Height LOD number.
  • int enabled - 1 to enable the LOD, 0 to disable it.

int getHeightLodEnabled(int num)

Returns a value indicating if a given height LOD is enabled.

Arguments

  • int num - Height LOD number.

Return value

1 if a given height LOD is enabled; otherwise, 0.

void setHeightLodIntersection(int num, int enabled)

Enables or disables intersection detection for a given height LOD.

Arguments

  • int num - Height LOD number.
  • int enabled - 1 to enable intersection detection, 0 to disable it.

int getHeightLodIntersection(int num)

Returns a value indicating if intersection detection for a given height LOD is enabled.

Arguments

  • int num - Height LOD number.

Return value

1 if intersection detection for a given LOD is enabled; otherwise, 0.

void setHeightLodIntersectionMask(int num, int mask)

Sets the intersection mask for a given height LOD.

Arguments

  • int num - Height LOD number.
  • int mask - Intersection mask.

int getHeightLodIntersectionMask(int num)

Sets the intersection mask for a given height LOD.

Arguments

  • int num - Height LOD number.

Return value

Intersection mask.

void setHeightLodLoadDistance(int num, float distance)

Sets the load distance for a given height LOD. Starting from this distance the tiles of the LOD are loaded into memory.

Arguments

  • int num - Height LOD number.
  • float distance - Load distance, in units.

float getHeightLodLoadDistance(int num)

Returns the load distance for a given height LOD. Starting from this distance the tiles of the LOD are loaded into memory.

Arguments

  • int num - Height LOD number.

Return value

Load distance, in units.

void setHeightLodPath(int num, const char * path)

Sets the path to the folder where a given height LOD is stored.

Arguments

  • int num - Height LOD number.
  • const char * path - Path to the folder where a given height LOD is stored.

const char * getHeightLodPath(int num)

Returns the path to the folder where a given height LOD is stored.

Arguments

  • int num - Height LOD number.

Return value

Path to the folder where a given height LOD is stored.

void setHeightLodTileDensity(int num, float density)

Sets the density of a tile of a given height LOD.

Arguments

  • int num - Height LOD number.
  • float density - Density of a height LOD tile, in meters per pixel.

float getHeightLodTileDensity(int num)

Returns the density of a tile of a given height LOD.

Arguments

  • int num - Height LOD number.

Return value

Density of a height LOD tile, in meters per pixel.

Ptr<Tileset> getHeightLodTileset(int num)

Returns the tileset for a given height LOD.

Arguments

  • int num - Height LOD number.

Return value

Height LOD tileset.

void setHeightLodViewportMask(int num, int mask)

Sets the viewport mask for a given height LOD.

Arguments

  • int num - Height LOD number.
  • int mask - Viewport mask.

int getHeightLodViewportMask(int num)

Returns the viewport mask for a given height LOD.

Arguments

  • int num - Height LOD number.

Return value

Veiwport mask.

void setHeightLodVisibleDistance(int num, float distance)

Sets the visible distance of a given height LOD. Starting from this distance the tiles of the LOD become visible.

Arguments

  • int num - Height LOD number.
  • float distance - Visible distance, in units.

float getHeightLodVisibleDistance(int num)

Returns the visible distance of a given height LOD. Starting from this distance the tiles of the LOD become visible.

Arguments

  • int num - Height LOD number.

Return value

Visible distance, in units.

int getHeightNumLods()

Returns the total number of height LODs.

Return value

Total number of height LODs.

String getHeightVideoMemoryUsage()

Returns information about the total video memory usage for all height LODs.

Return value

Total video memory usage for all height LODs.

void setNormalLodClearDistance(int num, float distance)

Sets the clear distance of a given normal LOD. Starting from this distance the tiles of the LOD are removed from memory.

Arguments

  • int num - Normal LOD number.
  • float distance - Clear distance, in units.

float getNormalLodClearDistance(int num)

Returns the clear distance of a given normal LOD. Starting from this distance the tiles of the LOD are removed from memory.

Arguments

  • int num - Normal LOD number.

Return value

Clear distance, in units.

void setNormalLodEnabled(int num, int enabled)

Enables or disables a given normal LOD.

Arguments

  • int num - Normal LOD number.
  • int enabled - 1 to enable the LOD, 0 to disable it.

int getNormalLodEnabled(int num)

Returns a value indicating if a given normal LOD is enabled.

Arguments

  • int num - Normal LOD number.

Return value

1 if a given normal LOD is enabled; otherwise, 0.

void setNormalLodLoadDistance(int num, float distance)

Sets the load distance for a given normal LOD. Starting from this distance the tiles of the LOD are loaded into memory.

Arguments

  • int num - Normal LOD number.
  • float distance - Load distance, in units.

float getNormalLodLoadDistance(int num)

Returns the load distance for a given normal LOD. Starting from this distance the tiles of the LOD are loaded into memory.

Arguments

  • int num - Normal LOD number.

Return value

Load distance, in units.

void setNormalLodPath(int num, const char * path)

Sets the path to the folder where a given normal LOD is stored.

Arguments

  • int num - Normal LOD number.
  • const char * path - Path to the folder where a given normal LOD is stored.

const char * getNormalLodPath(int num)

Returns the path to a given normal LOD.

Arguments

  • int num - Normal LOD number.

Return value

Returns the path to a given normal LOD.

void setNormalLodTileDensity(int num, float density)

Sets the density of a tile of a given normal LOD.

Arguments

  • int num - Normal LOD number.
  • float density - Density of a normal LOD tile, in meters per pixel.

float getNormalLodTileDensity(int num)

Returns the density of a tile of a given normal LOD.

Arguments

  • int num - Normal LOD number.

Return value

Density of a normal LOD tile, in meters per pixel.

Ptr<Tileset> getNormalLodTileset(int num)

Returns the tileset for a given height LOD.

Arguments

  • int num - Normal LOD number.

Return value

Normal LOD tileset.

void setNormalLodViewportMask(int num, int mask)

Sets the viewport mask for a given normal LOD.

Arguments

  • int num - Normal LOD number.
  • int mask - Viewport mask.

int getNormalLodViewportMask(int num)

Returns the viewport mask for a given normal LOD.

Arguments

  • int num - Normal LOD number.

Return value

Viewport mask.

void setNormalLodVisibleDistance(int num, float distance)

Sets the visible distance of a given normal LOD. Starting from this distance the tiles of the LOD become visible.

Arguments

  • int num - Normal LOD number.
  • float distance - Visible distance, in units.

float getNormalLodVisibleDistance(int num)

Returns the visible distance of a given normal LOD. Starting from this distance the tiles of the LOD become visible.

Arguments

  • int num - Normal LOD number.

Return value

Visible distance, in units.

int getNormalNumLods()

Returns the total number of normal LODs.

Return value

Total number of normal LODs.

String getNormalVideoMemoryUsage()

Returns information about the total video memory usage for all normal LODs.

Return value

Total video memory usage for all normal LODs.

int addAlbedoLod()

Adds a new albedo LOD.

Return value

1 if a new albedo LOD was added successfully; otherwise, 0.

int addHeightLod()

Adds a new height LOD.

Return value

1 if a new height LOD was added successfully; otherwise, 0.

int addNormalLod()

Adds a new normal LOD.

Return value

1 if a new normal LOD was added successfully; otherwise, 0.

void clear()

Removes all current terrain data from memory.

int fetchAlbedoes(const BoundSphere & bs, const BoundBox & bb, int force = 0)

Loads the data of all albedo LODs for the tiles within a given bounding box and a bounding sphere.

Arguments

  • const BoundSphere & bs - Bounding sphere.
  • const BoundBox & bb - Bounding sphere.
  • int force - Force flag. Use 1 to load files in any case; otherwise, 0. The default value is 0.

Return value

1 if the data of all albedo LODs was fetched successfully; otherwise, 0.

int fetchHeights(const BoundSphere & bs, const BoundBox & bb, int force = 0)

Loads the data of all height LODs for the tiles within a given bounding box and a bounding sphere.

Arguments

  • const BoundSphere & bs - Bounding sphere.
  • const BoundBox & bb - Bounding box.
  • int force - Force flag. Use 1 to load files in any case; otherwise, 0. The default value is 0.

Return value

1 if the data of all height LODs was fetched successfully; otherwise, 0.

int fetchNormals(const BoundSphere & bs, const BoundBox & bb, int force = 0)

Loads the data of all normal LODs for the tiles within a given bounding box and a bounding sphere.

Arguments

  • const BoundSphere & bs - Bounding sphere.
  • const BoundBox & bb - Bounding box.
  • int force - Force flag. Use 1 to load files in any case; otherwise, 0. The default value is 0.

Return value

1 if the data of all normal LODs was fetched successfully; otherwise, 0.

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.

void removeAlbedoLod(int num)

Removes a given albedo LOD.

Arguments

  • int num - Albedo LOD number.

void removeHeightLod(int num)

Arguments

  • int num - Height LOD number.

void removeNormalLod(int num)

Removes a given normal LOD.

Arguments

  • int num - Normal LOD number.

static int type()

Returns the type of the object.

Return value

Object Terrain Global type identifier
Last update: 2017-07-03
Build: ()