This page has been translated automatically.
编程
Fundamentals
Setting Up Development Environment
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).

ObjectTerrainGlobal Class

Members


static ObjectTerrainGlobalPtr create()

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

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

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

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.

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

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 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 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 getAlbedoLodViewportMask(int num)

Returns the viewport mask for a given albedo LOD.

Arguments

  • int num - Albedo LOD number.

Return value

Viewport mask.

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.

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.

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

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.

int getHeightNumLods()

Returns the total number of height LODs.

Return value

Total number of height LODs.

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.

const char * getHeightVideoMemoryUsage()

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

Return value

Total video memory usage for all height LODs.

void removeNormalLod(int num)

Removes a given normal LOD.

Arguments

  • int num - Normal LOD number.

void removeAlbedoLod(int num)

Removes a given albedo LOD.

Arguments

  • int num - Albedo LOD number.

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

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 removeHeightLod(int num)

Arguments

  • int num - Height LOD number.

int addAlbedoLod()

Adds a new albedo LOD.

Return value

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

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.

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.

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.

int getHeightLodIntersectionMask(int num)

Sets the intersection mask for a given height LOD.

Arguments

  • int num - Height LOD number.

Return value

Intersection mask.

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

Adds a new height LOD.

Return value

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

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.

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.

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.

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.

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.

const char * getNormalVideoMemoryUsage()

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

Return value

Total video memory usage for all normal LODs.

void clear()

Removes all current terrain data from memory.

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

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.

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.

int addNormalLod()

Adds a new normal LOD.

Return value

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

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.

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 setHeightLodIntersectionMask(int num, int mask)

Sets the intersection mask for a given height LOD.

Arguments

  • int num - Height LOD number.
  • int mask - Intersection 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.

int getNormalNumLods()

Returns the total number of normal LODs.

Return value

Total number of normal LODs.

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

static int type()

Returns the type of the object.

Return value

Object Terrain Global type identifier

const char * getAlbedoVideoMemoryUsage()

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

Return value

Total video memory usage for all albedo LODs.

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 a height LOD tile, in meters per pixel.

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.

int getAlbedoNumLods()

Returns the total number of albedo LODs.

Return value

Total number of albedo LODs.

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.

int getHeightLodViewportMask(int num)

Returns the viewport mask for a given height LOD.

Arguments

  • int num - Height LOD number.

Return value

Veiwport mask.

int getHeightLodCollisionMask(int num)

Returns the collision mask for a given height LOD.

Arguments

  • int num - Height LOD number.

Return value

Collision mask.

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.

int getNormalLodViewportMask(int num)

Returns the viewport mask for a given normal LOD.

Arguments

  • int num - Normal LOD number.

Return value

Viewport mask.

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.

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.

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.
Last update: 2017-07-03
Build: ()