This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
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::ObjectTerrain Class

Interface for object terrain handling. See also the UnigineScript analog.

To use this class, include the UnigineObjectTerrain.h file.

Unigine::ObjectTerrain Class

Members


static int type ()

ObjectTerrain type.

Return value

ObjectTerrain type identifier.

static Ptr< ObjectTerrain > create (const NodePtr & node)

ObjectTerrain constructor.

Arguments

  • const NodePtr & node - Node smart pointer.

static Ptr< ObjectTerrain > create (const ObjectPtr & object)

ObjectTerrain constructor.

Arguments

  • const ObjectPtr & object - Object smart pointer.

static Ptr< ObjectTerrain > create ()

ObjectTerrain constructor.

static Ptr< ObjectTerrain > create (const char * name)

ObjectTerrain constructor.

Arguments

  • const char * name - Terrain file name (*.ter).

virtual int create (int size_x, int size_y, float step) const =0

Creates a new terrain of a specified grid size.

Arguments

  • int size_x - Terrain width in grid cells along the X axis in range [257;32679], in units.
  • int size_y - Terrain length in grid cells along the Y axis in range [257;32679], in units.
  • float step - Step of the terrain grid cell, in units.

Return value

1 if the terrain is created successfully; otherwise, 0.

virtual int create (const ImagePtr & image, float step, float scale) const =0

Creates a new terrain from a loaded height map.

Arguments

  • const ImagePtr & image - Height map. Image size (height and width) must be power-of-two + 1 (maximum size is 32769 × 32769).
  • float step - Step of the terrain grid cell, in units.
  • float scale - Height map scale.

Return value

1 if the terrain is created successfully; otherwise, 0.

virtual int loadTerrain (const char * name) const =0

Loads a terrain from a file.

Arguments

  • const char * name - Path to the terrain file (*.ter).

Return value

1 if the terrain is loaded successfully; otherwise, 0.

virtual int saveTerrain (const char * name, int force) const =0

Saves the terrain.

Arguments

  • const char * name - Path to the terrain file (*.ter).
  • int force - Force flag. Use 1 to save the terrain file in any case or 0 to save the terrain file if changes were made.

Return value

1 if the terrain is saved successfully; otherwise, 0.

virtual void setTerrainName (const char * name) const =0

Sets the new terrain name.

Arguments

  • const char * name - Terrain name (path to the .TER file).

virtual const char * getTerrainName () const =0

Returns the current terrain name.

Return value

Terrain name (path to the .TER file).

virtual int isLoaded () const =0

Returns a value indicating whether the terrain is loaded or not.

Return value

1 if the terrain is loaded successfully; otherwise, 0.

virtual int getSizeX () const =0

Returns the terrain width along the X axis, in grid cells.

Return value

Terrain width.

virtual int getSizeY () const =0

Returns the terrain length along the Y axis, in grid cells.

Return value

Terrain length.

virtual float getStep () const =0

Returns the linear size of a grid cell, in units.

Return value

Cell size.

virtual int getSurfacesX () const =0

Returns the number of surfaces along the X axis.

Return value

Number of surfaces.

virtual int getSurfacesY () const =0

Returns the number of surfaces along the Y axis.

Return value

Number of surfaces.

virtual void setLodDistance (float distance) const =0

Sets the distance to the first level of detail. The default value is 2.0.

Arguments

  • float distance - Distance to the first LOD.

virtual float getLodDistance () const =0

Returns the distance to the first level of detail.

Return value

Distance to the first LOD.

virtual void setLodProgression (float progression) const =0

Sets the level of detail progression.

Arguments

  • float progression - LOD progression.

virtual float getLodProgression () const =0

Returns the level of detail progression.

Return value

LOD progression.

virtual void setLodThreshold (float threshold, int force) const =0

Sets the level of detail height threshold.

Arguments

  • float threshold - LOD height threshold.
  • int force - Force flag. Terrain will load all height maps into the memory and will perform height map relaxation for the smooth LOD transition for the given threshold level.

virtual float getLodThreshold () const =0

Returns the level of detail height threshold.

Return value

LOD height threshold.

virtual void setLodTerrainLeft (const Ptr< ObjectTerrain > & terrain) const =0

Sets the new left LOD for the current terrain.

Arguments

  • const Ptr< ObjectTerrain > & terrain - Left LOD.

virtual Ptr< ObjectTerrain > getLodTerrainLeft () const =0

Returns the left LOD of the current terrain.

Return value

Left LOD.

virtual void setLodTerrainRight (const Ptr< ObjectTerrain > & terrain) const =0

Sets the new right LOD for the current terrain.

Arguments

  • const Ptr< ObjectTerrain > & terrain - Right LOD.

virtual Ptr< ObjectTerrain > getLodTerrainRight () const =0

Returns the right LOD of the current terrain.

Return value

Right LOD.

virtual void setLodTerrainBottom (const Ptr< ObjectTerrain > & terrain) const =0

Sets the new bottom LOD for the current terrain.

Arguments

  • const Ptr< ObjectTerrain > & terrain - Bottom LOD.

virtual Ptr< ObjectTerrain > getLodTerrainBottom () const =0

Returns the bottom LOD of the current terrain.

Return value

Bottom LOD.

virtual void setLodTerrainTop (const Ptr< ObjectTerrain > & terrain) const =0

Sets the new top LOD for the current terrain.

Arguments

  • const Ptr< ObjectTerrain > & terrain - Top LOD.

virtual Ptr< ObjectTerrain > getLodTerrainTop () const =0

Returns the top LOD of the current terrain.

Return value

Top LOD.

virtual void setVisibleDistance (float distance) const =0

Sets the distance up to which terrain is rendered.

Arguments

  • float distance - Visibility distance, in units.

virtual float getVisibleDistance () const =0

Returns the distance up to which terrain is rendered.

Return value

Visibility distance, in units.

virtual void setShadowDistance (float distance) const =0

Sets the distance up to which the terrain relief casts shadows.

Arguments

  • float distance - Shadow distance, in units.

virtual float getShadowDistance () const =0

Returns the distance up to which the terrain relief casts shadows.

Return value

Shadow distance, in units.

virtual void setShadowRadius (float radius) const =0

Sets the distance to draw additional terrain polygons outside the view frustum. This option allows to eliminate popping of shadows at the edges of the screen when the camera is turning. The default is 0.

Arguments

  • float radius - Shadow radius, in units. If a negative value is provided, 0 will be used instead.

virtual float getShadowRadius () const =0

Returns the distance to draw additional terrain polygons outside the view frustum. This option allows to eliminate popping of shadows at the edges of the screen when the camera is turning.

Return value

Shadow radius, in units.

virtual void setHeight (int x, int y, float height) const =0

Sets a new height for a given terrain point.

Arguments

  • int x - X coordinate of the point on the terrain grid in range from 0 to the maximum terrain width.
  • int y - Y coordinate of the point on the terrain grid in range from 0 to the maximum terrain length.
  • float height - Height, in units.

virtual float getHeight (int x, int y) const =0

Returns the current height of a given terrain point.

Arguments

  • int x - X coordinate of the point on the terrain grid in range from 0 to the maximum terrain width.
  • int y - Y coordinate of the point on the terrain grid in range from 0 to the maximum terrain length.

Return value

Height, in units.

virtual float getHeight (float x, float y) const =0

Returns the interpolated height of a given terrain point.

Arguments

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

Return value

Interpolated height value of the point.

virtual int setHeights (int x, int y, const ImagePtr & image, float scale) const =0

Imports a new height map for the terrain.

Arguments

  • int x - X coordinate of the point on the terrain grid in range from 0 to the maximum terrain width.
  • int y - Y coordinate of the point on the terrain grid in range from 0 to the maximum terrain length.
  • const ImagePtr & image - Height map. The following formats are acceptable: R8, RG8, RGB8, R16, R16F, R32F.
  • float scale - Height map scale.

Return value

Returns 1 if the height map is imported successfully; otherwise, 0.

virtual int getHeights (int x, int y, int width, int height, const ImagePtr & image, int format, float scale) const =0

Exports a height map into the R16 image. The sum of the X coordinate of the point on the terrain grid and the width of the exported image must be less than or equal to the maximum terrain width. The sum of the Y coordinate of the point on the terrain grid and the height of the exported image must be less than or equal to the maximum terrain length.

Arguments

  • int x - X coordinate of the point on the terrain grid.
  • int y - Y coordinate of the point on the terrain grid.
  • int width - Width of the exported image, in grid points.
  • int height - Height of the exported image, in grid points.
  • const ImagePtr & image - Image to export a height map into.
  • int format - Image format. The following formats are acceptable: R8, RG8, RGB8, R16, R16F, R32F.
  • float scale - Height map scale.

Return value

1 if the height map is exported successfully; otherwise, 0.

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

Loads the specified terrain region into the memory.

Arguments

  • const BoundSphere & bs - Bounding sphere (terrain-relative coordinate system).
  • const BoundBox & bb - Bounding box (terrain-relative coordinate system).
  • int force - Force data loading with possible stall.

virtual void setHole (int x, int y, int hole) const =0

Adds or removes a hole at a given terrain point.

Arguments

  • int x - X coordinate of the point on the terrain grid.
  • int y - Y coordinate of the point on the terrain grid.
  • int hole - 1 to add a hole; 0 to remove a hole.

virtual int getHole (int x, int y) const =0

Returns a value indicating if there is a hole at a given point.

Arguments

  • int x - X coordinate of the point on the terrain grid in range from 0 to the maximum terrain width.
  • int y - Y coordinate of the point on the terrain grid in range from 0 to the maximum terrain length.

Return value

1 if there is a hole at a given point; otherwise, 0.

virtual int getHole (float x, float y) const =0

Returns a value indicating if there is a hole at a given point.

Arguments

  • float x - X coordinate of the point on the terrain grid in range from 0 to the maximum terrain width.
  • float y - Y coordinate of the point on the terrain grid in range from 0 to the maximum terrain length.

Return value

1 if there is a hole at a given point; otherwise, 0.

virtual int setHoles (int x, int y, const ImagePtr & image) const =0

Imports a holes texture for the terrain.

Arguments

  • int x - X coordinate of the point on the terrain grid in range from 0 to the maximum terrain width.
  • int y - X coordinate of the point on the terrain grid in range from 0 to the maximum terrain length.
  • const ImagePtr & image - Holes texture. Only R8 format is acceptable.

Return value

1 if the holes texture is imported successfully; otherwise, 0.

virtual int getHoles (int x, int y, int width, int height, const ImagePtr & image) const =0

Exports a holes texture into the R8 image. The sum of the X coordinate of the point on the terrain grid and the width of the exported image must be less than or equal to the maximum terrain width. The sum of the Y coordinate of the point on the terrain grid and the height of the exported image must be less than or equal to the maximum terrain length.

Arguments

  • int x - X coordinate of the point on the terrain grid.
  • int y - Y coordinate of the point on the terrain grid.
  • int width - Width of the exported image, in grid points.
  • int height - Height of the exported image, in grid points.
  • const ImagePtr & image - Image to export a holes texture into.

Return value

1 if the holes texture is exported successfully; otherwise, 0.

virtual vec3 getNormal (int x, int y) const =0

Returns a normal vector for a given terrain point.

Arguments

  • int x - X coordinate of the point on the terrain grid in range from 0 to the maximum terrain width.
  • int y - Y coordinate of the point on the terrain grid in range from 0 to the maximum terrain length.

Return value

Normal vector.

virtual vec3 getNormal (float x, float y) const =0

Returns a normal vector for a given terrain point.

Arguments

  • float x - X coordinate of the point on the terrain grid in range from 0 to the maximum terrain width.
  • float y - Y coordinate of the point on the terrain grid in range from 0 to the maximum terrain length.

Return value

Normal vector.

virtual int getNormals (int x, int y, int width, int height, const ImagePtr & image) const =0

Exports a normal map into the RG8 image. The sum of the X coordinate of the point on the terrain grid and the width of the exported image must be less than or equal to the maximum terrain width. The sum of the Y coordinate of the point on the terrain grid and the height of the exported image must be less than or equal to the maximum terrain length.

Arguments

  • int x - X coordinate of the point on the terrain grid.
  • int y - Y coordinate of the point on the terrain grid.
  • int width - Width of the exported image, in grid points.
  • int height - Height of the exported image, in grid points.
  • const ImagePtr & image - Image to export a normal map into.

Return value

1 if the normal map is exported successfully; otherwise, 0.

virtual int getPoint (float x, float y, float & height, vec3 & normal) const =0

Searches for a given point on the terrain grid.

Arguments

  • float x - X coordinate of the point on the terrain grid.
  • float y - Y coordinate of the point on the terrain grid.
  • float & height - Height of the point.
  • vec3 & normal - Normal vector.

Return value

1 if the point is found; 0 if the given point is a hole or it is out of the terrain.

virtual int getIntersection (const vec3 & p0, const vec3 & p1, vec3 * ret_point, vec3 * ret_normal, vec4 * ret_texcoord, int surface, int holes) const =0

Performs the search for the intersection of the given terrain surface with the given traced line. Terrain local space coordinates are used for this function.

Arguments

  • const vec3 & p0 - Start point coordinates.
  • const vec3 & p1 - End point coordinates.
  • vec3 * ret_point - Return array to write the intersection point coordinates into.
  • vec3 * ret_normal - Return array to write the intersection point normal into.
  • vec4 * ret_texcoord - Return array to write the intersection point texture coordinates into.
  • int surface - Number of the surface.
  • int holes - 0 is to return the intersection with a terrain even if it hits the hole; otherwise, 1.

Return value

1 if the intersection is found; otherwise - 0.

virtual int addMaterial (const char * name) const =0

Adds a material to the terrain.

Arguments

  • const char * name - Material name.

Return value

Number of the added material.

virtual void removeMaterial (int num) const =0

Removes the specified detail material.

Arguments

  • int num - Material number.

virtual void setNumMaterials (int num) const =0

Adds the specified number of materials to the terrain.

Arguments

  • int num - Material number.

virtual int getNumMaterials () const =0

Returns the total number of materials assigned to the terrain.

Return value

Number of materials.

virtual void setMaterialName (int num, const char * name) const =0

Sets a new name for the material.

Arguments

  • int num - Material number.
  • const char * name - Material name.

virtual const char * getMaterialName (int num) const =0

Returns the name of the specified material.

Arguments

  • int num - Material number.

Return value

Material name.

virtual void setMaterialTransform (int num, const vec4 & transform) const =0

Sets the texture coordinate transformations for detail material textures.

Arguments

  • int num - Material number.
  • const vec4 & transform - Texture coordinates transformation (tile and offset).

virtual vec4 getMaterialTransform (int num) const =0

Returns the texture coordinate transformations for detail material textures.

Arguments

  • int num - Material number.

Return value

Texture coordinates transformation of material textures (tile and offset).

virtual void setMaterialParent (int num, int parent) const =0

Sets the new parent material for the given material.

Arguments

  • int num - Material number.
  • int parent - Parent material number.

virtual int getMaterialParent (int num) const =0

Returns the number of a parent material.

Arguments

  • int num - Material number.

Return value

Parent material number.

virtual void setMaterialOverlap (int num, int overlap) const =0

Sets the new overlap detail material for the given material.

Arguments

  • int num - Material number.
  • int overlap - Overlap detail material number.

virtual int getMaterialOverlap (int num) const =0

Returns the number indicating if the Overlap mode is enabled for the given material.

Arguments

  • int num - Material number.

Return value

1 if the Overlap mode is enabled, otherwise - 0.

virtual void setMaterialMaskBase (int num, int base) const =0

Sets the mask base parameter.

Arguments

  • int num - Material number.
  • int base - Mask base parameter.

virtual int getMaterialMaskBase (int num) const =0

Returns the mask base parameter.

Arguments

  • int num - Material number.

Return value

Mask base parameter.

virtual void setMaterialMaskValue (int num, float value) const =0

Sets the new spread of a detail material in accordance with the mask. By 0 the material is rendered everywhere; by 1, it is not rendered.

Arguments

  • int num - Material number.
  • float value - Spread value.

virtual float getMaterialMaskValue (int num) const =0

Returns the spread of a detail material according to the mask. By 0 the material is rendered everywhere; by 1, it is not rendered. The default is 0.5.

Arguments

  • int num - Material number.

Return value

Spread value.

virtual void setMaterialMaskWidth (int num, float width) const =0

Sets the new width of a detail material in accordance with the mask.

Arguments

  • int num - Material number.
  • float width - Width value.

virtual float getMaterialMaskWidth (int num) const =0

Returns the width of a detail material according to the mask.

Arguments

  • int num - Material number.

Return value

Width value.

virtual void setMaterialMaskThreshold (int num, float threshold) const =0

Sets the new blending threshold that controls the smoothness of blending for detail material edges. By 0 there is no blending at all; by 1, the blended area is at its maximum size.

Arguments

  • int num - Material number.
  • float threshold - Threshold value.

virtual float getMaterialMaskThreshold (int num) const =0

Returns the blending threshold that controls the smoothness of blending for detail material edges. By 0 there is no blending at all; by 1, the blended area is at its maximum size. The default is 0.5.

Arguments

  • int num - Material number.

Return value

Threshold value.

virtual void setMaterialDiffuseTextureName (int num, const char * name) const =0

Sets a diffuse texture name for the specified detail material.

Arguments

  • int num - Material number.
  • const char * name - Diffuse texture name (path).

virtual const char * getMaterialDiffuseTextureName (int num) const =0

Returns the name of the diffuse texture of the specified detail material.

Arguments

  • int num - Material number.

Return value

Diffuse texture name (path).

virtual void setMaterialDiffuseScale (int num, float scale) const =0

Sets the visibility scale of a diffuse texture assigned to the specified detail material. The default is 0.5.

Arguments

  • int num - Material number.
  • float scale - Visibility scale value. The provided value is saturated in range [0.0;1.0].

virtual float getMaterialDiffuseScale (int num) const =0

Returns the visibility scale of a diffuse texture assigned to the specified detail material.

Arguments

  • int num - Material number.

Return value

Visibility scale value.

virtual void setMaterialNormalTextureName (int num, const char * name) const =0

Sets a normal map name for the specified detail material.

Arguments

  • int num - Material number.
  • const char * name - Normal map name (path).

virtual const char * getMaterialNormalTextureName (int num) const =0

Returns the normal map name of the specified detail material.

Arguments

  • int num - Material number.

Return value

Normal map name (path).

virtual void setMaterialNormalScale (int num, float scale) const =0

Sets the visibility scale of a normal map assigned to the specified detail material. The provided value is saturated in range [0.0;1.0]. The default is 0.5.

Arguments

  • int num - Material number.
  • float scale - Visibility scale.

virtual float getMaterialNormalScale (int num) const =0

Returns the normal map name of the specified detail material.

Arguments

  • int num - Material number.

Return value

Visibility scale.

virtual void setMaterialSpecularTextureName (int num, const char * name) const =0

Sets a specular texture name for the specified detail material.

Arguments

  • int num - Material number.
  • const char * name - Specular texture name (path).

virtual const char * getMaterialSpecularTextureName (int num) const =0

Returns the specular texture name of the specified detail material.

Arguments

  • int num - Material number.

Return value

Specular texture name (path).

virtual void setMaterialSpecularScale (int num, float scale) const =0

Sets the visibility scale of a specular texture assigned to the specified detail material. The default is 0.5.

Arguments

  • int num - Material number.
  • float scale - Visibility scale value. The provided value is saturated in range [0.0;1.0].

virtual float getMaterialSpecularScale (int num) const =0

Returns the visibility scale of a specular texture assigned to the specified detail material.

Arguments

  • int num - Material number.

Return value

Visibility scale value.

virtual void setSurfaceEnabled (int x, int y, int enable) const =0

Sets a value indicating whether a specified surface is enabled or disabled for rendering.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • int enable - Enabled flag. 1 to enable the surface; 0 to disable it.

virtual int isSurfaceEnabled (int x, int y) const =0

Returns a value indicating whether a specified surface is enabled or disabled for rendering.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

1 if the surface is enabled; otherwise, 0.

virtual void setSurfaceCastShadow (int x, int y, int cast_shadow) const =0

Sets a value indicating whether terrain geometry across the current surface should cast shadows (from all types of light sources).

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • int cast_shadow - Cast shadow flag. 1 to cast shadows; 0 not to cast shadows.

virtual int isSurfaceCastShadow (int x, int y) const =0

Returns a value indicating whether terrain geometry across the current surface should cast shadows (from all types of light sources).

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

1 if the surface casts shadows; otherwise, 0.

virtual void setSurfaceLodThreshold (int x, int y, float threshold, int force) const =0

Sets the height threshold value for the LOD of the given surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • float threshold - Threshold value of the surface LOD.
  • int force - Force flag. The terrain will load all height maps into the memory and will perform a height map relaxation for the smooth LOD transition for the given threshold level.

virtual float getSurfaceLodThreshold (int x, int y) const =0

Returns the height threshold value for the LOD of the given surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Threshold value.

virtual void setSurfaceDiffuseTextureName (int x, int y, const char * name) const =0

Sets a diffuse texture name for the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const char * name - Texture name (path).

virtual const char * getSurfaceDiffuseTextureName (int x, int y) const =0

Returns a name of the diffuse texture for the given surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Texture name (path).

virtual int setSurfaceDiffuseTextureImage (int x, int y, const ImagePtr & image) const =0

Imports a diffuse texture for the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const ImagePtr & image - Diffuse texture.

virtual int getSurfaceDiffuseTextureImage (int x, int y, const ImagePtr & image) const =0

Exports a diffuse texture of the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const ImagePtr & image - Image to export a texture into.

Return value

1 if the export was successful; otherwise, 0.

virtual TexturePtr getSurfaceDiffuseTexture (int x, int y) const =0

Returns the diffuse texture of the surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Diffuse texture.

virtual void setSurfaceNormalTextureName (int x, int y, const char * name) const =0

Sets a normal texture name for the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const char * name - Texture name (path).

virtual const char * getSurfaceNormalTextureName (int x, int y) const =0

Returns a name of the normal texture for the given surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Texture name (path).

virtual int setSurfaceNormalTextureImage (int x, int y, const ImagePtr & image) const =0

Imports a normal texture for the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const ImagePtr & image - Normal texture.

virtual int getSurfaceNormalTextureImage (int x, int y, const ImagePtr & image) const =0

Exports a normal texture of the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const ImagePtr & image - Image to export a texture into.

Return value

1 if the export was successful; otherwise, 0.

virtual TexturePtr getSurfaceNormalTexture (int x, int y) const =0

Returns the normal texture of the surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Normal texture.

virtual void setSurfaceIndexTextureName (int x, int y, const char * name) const =0

Sets a name of the index texture for the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const char * name - Texture name (path).

virtual const char * getSurfaceIndexTextureName (int x, int y) const =0

Returns a name of the index texture for the given surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Texture name (path).

virtual int setSurfaceIndexTextureImage (int x, int y, const ImagePtr & image) const =0

Imports an index texture for the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const ImagePtr & image - Index texture.

virtual int getSurfaceIndexTextureImage (int x, int y, const ImagePtr & image) const =0

Exports an index texture of the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const ImagePtr & image - Image to export a texture into.

Return value

1 if the export was successful; otherwise, 0.

virtual TexturePtr getSurfaceIndexTexture (int x, int y) const =0

Returns the index texture of the surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Index texture.

virtual void setSurfaceMaskTextureName (int x, int y, const char * name) const =0

Sets a mask texture name for the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const char * name - Texture name (path).

virtual const char * getSurfaceMaskTextureName (int x, int y) const =0

Returns a name of the mask texture for the given surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Texture name (path).

virtual int setSurfaceMaskTextureImage (int x, int y, const ImagePtr & image) const =0

Imports a mask texture for the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const ImagePtr & image - Mask texture.

virtual int getSurfaceMaskTextureImage (int x, int y, const ImagePtr & image) const =0

Exports a mask texture of the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.
  • const ImagePtr & image - Image to export the texture into.

Return value

1 if the export was successful; otherwise, 0.

virtual TexturePtr getSurfaceMaskTexture (int x, int y) const =0

Returns the mask texture of the surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Mask texture.

virtual BoundBox getSurfaceBoundBox (int x, int y) const =0

Returns the bounding box of the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Bounding box.

virtual BoundSphere getSurfaceBoundSphere (int x, int y) const =0

Returns the bounding sphere of the specified surface.

Arguments

  • int x - Number of the surface along the X axis.
  • int y - Number of the surface along the Y axis.

Return value

Bounding sphere.

virtual void setDiffuseTextureName (const char * name) const =0

Sets the name of the terrain diffuse texture.

Arguments

  • const char * name - Texture name (path).

virtual const char * getDiffuseTextureName () const =0

Returns the name of the current terrain diffuse texture.

Return value

Texture name (path).

virtual int setDiffuseTextureImage (const ImagePtr & image) const =0

Sets a new terrain diffuse texture from a given image.

Arguments

  • const ImagePtr & image - Image buffer to write a texture into.

Return value

1 if the texture has been set successfully; otherwise, 0.

virtual int getDiffuseTextureImage (const ImagePtr & image) const =0

Writes the current terrain diffuse texture into the given buffer.

Arguments

  • const ImagePtr & image - Image.

Return value

1 if the texture has been successfully written into the buffer; otherwise, 0.

virtual TexturePtr getDiffuseTexture () const =0

Returns the terrain diffuse texture.

Return value

Diffuse texture.

virtual void setNormalTextureName (const char * name) const =0

Sets the name of the terrain normal texture.

Arguments

  • const char * name - Texture name (path).

virtual const char * getNormalTextureName () const =0

Returns the name of the current terrain normal texture.

Return value

Texture name (path).

virtual int setNormalTextureImage (const ImagePtr & image) const =0

Sets a new terrain normal texture from a given image.

Arguments

  • const ImagePtr & image - Image.

Return value

1 if the texture has been set successfully; otherwise, 0.

virtual int getNormalTextureImage (const ImagePtr & image) const =0

Writes the current terrain normal texture into the given buffer.

Arguments

  • const ImagePtr & image - Image buffer to write a texture into.

Return value

1 if the texture has been successfully written into the buffer; otherwise, 0.

virtual TexturePtr getNormalTexture () const =0

Returns the terrain normal texture.

Return value

Normal texture.

virtual void setIndexTextureName (const char * name) const =0

Sets the name of the terrain index texture.

Arguments

  • const char * name - Texture name (path).

virtual const char * getIndexTextureName () const =0

Returns the name of the current terrain index texture.

Return value

Texture name (path).

virtual int setIndexTextureImage (const ImagePtr & image) const =0

Sets a new terrain index texture from a given image.

Arguments

  • const ImagePtr & image - Image.

Return value

1 if the texture has been set successfully; otherwise, 0.

virtual int getIndexTextureImage (const ImagePtr & image) const =0

Writes the current terrain index texture into the given buffer.

Arguments

  • const ImagePtr & image - Image buffer to write a texture into.

Return value

1 if the texture has been successfully written into the buffer; otherwise, 0.

virtual TexturePtr getIndexTexture () const =0

Returns the terrain index texture.

Return value

Index texture.

virtual void setMaskTextureName (const char * name) const =0

Sets the name of the terrain mask texture.

Arguments

  • const char * name - Texture name (path).

virtual const char * getMaskTextureName () const =0

Returns the name of the current terrain mask texture.

Return value

Texture name (path).

virtual int setMaskTextureImage (const ImagePtr & image) const =0

Sets a new terrain mask texture from a given image.

Arguments

  • const ImagePtr & image - Image.

Return value

1 if the texture has been set successfully; otherwise, 0.

virtual int getMaskTextureImage (const ImagePtr & image) const =0

Writes the current terrain mask texture into the given buffer.

Arguments

  • const ImagePtr & image - Image buffer to write a texture into.

Return value

1 if the texture has been successfully written into the buffer; otherwise, 0.

virtual TexturePtr getMaskTexture () const =0

Returns the terrain mask texture.

Return value

Mask texture.

virtual void setDiffuseTextureArrayName (const char * name) const =0

Sets the new name of the diffuse textures array.

Arguments

  • const char * name - Name of the array.

virtual const char * getDiffuseTextureArrayName () const =0

Returns the name of the diffuse textures array.

Return value

Name of the array.

virtual TexturePtr getDiffuseTextureArray () const =0

Returns the diffuse textures array.

Return value

Diffuse textures array.

virtual void setNormalTextureArrayName (const char * name) const =0

Sets the new name of the normal textures array.

Arguments

  • const char * name - Name of the array.

virtual const char * getNormalTextureArrayName () const =0

Returns the name of the normal textures array.

Return value

Name of the array.

virtual TexturePtr getNormalTextureArray () const =0

Returns the normal textures array.

Return value

Normal textures array.

virtual void setSpecularTextureArrayName (const char * name) const =0

Sets the new name of the specular textures array.

Arguments

  • const char * name - Name of the array.

virtual const char * getSpecularTextureArrayName () const =0

Returns the name of the specular textures array.

Return value

Name of the array.

virtual TexturePtr getSpecularTextureArray () const =0

Returns the specular textures array.

Return value

Specular textures array.
Last update: 2017-07-03
Build: ()