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
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1

Unigine::ObjectTerrain Class

UNIGINEUNIGINE 2.0Comments
int create(const ImagePtr & image, float step, float height)int create(const ImagePtr & image, float step, float scale) Precision for height maps has been increased to 31 bits, floating point (1 bit is used for holes). So, the maximum height value is no longer required. Now the function receives the height map scale as the 3rd argument.
int create(int size_x, int size_y, float step, float height)int create(int size_x, int size_y, float step) Precision for height maps has been increased to 31 bits, floating point (1 bit is used for holes). So, the maximum height value is no longer required.
-static int type() ObjectTerrain type.
int load(const char * name)int loadTerrain(const char * name) Renamed.
int save(const char * name, int force)int saveTerrain(const char * name, int force) Renamed.
-virtual void setTerrainName(const char * name) const =0 Sets the new terrain name.
-virtual const char * getTerrainName() const =0 Returns the current terrain name.
-int getSurfacesX() Returns the number of terrain surfaces along the X axis.
-int getSurfacesY() Returns the number of terrain surfaces along the Y axis.
-void setLodDistance(float distance) Sets the distance to the first level of detail.
-float getLodDistance() Returns the distance to the first level of detail.
-void setLodProgression(float progression) Sets LOD progression value.
-float getLodProgression() Returns LOD progression value.
-void setLodThreshold(float threshold, int force) Sets the LOD height threshold.
-float getLodThreshold() Returns LOD height threshold.
-void setLodTerrainLeft(const Ptr< ObjectTerrain > & terrain) Sets a new left LOD for the current terrain.
-Ptr< ObjectTerrain > getLodTerrainLeft() Returns the left LOD of the current terrain.
-void setLodTerrainRight(const Ptr< ObjectTerrain > & terrain) Sets a new right LOD for the current terrain.
-Ptr< ObjectTerrain > getLodTerrainRight() Returns the right LOD of the current terrain.
-void setLodTerrainBottom(const Ptr< ObjectTerrain > & terrain) Sets a new bottom LOD for the current terrain.
-Ptr< ObjectTerrain > getLodTerrainBottom() Returns the bottom LOD of the current terrain.
-void setLodTerrainTop(const Ptr< ObjectTerrain > & terrain) Sets a new top LOD for the current terrain.
-Ptr< ObjectTerrain > getLodTerrainTop() Returns the top LOD of the current terrain.
-void setVisibleDistance(float distance) Updates the distance up to which terrain is rendered.
-float getVisibleDistance() Returns the distance up to which terrain is rendered.
-void setShadowDistance(float distance) Sets the distance up to which the terrain relief casts shadows.
-float getShadowDistance() Returns the distance up to which the terrain relief casts shadows.
-void setShadowRadius(float radius) Sets the distance to draw additional terrain polygons outside the view frustum.
-float getShadowRadius() Returns the distance to draw additional terrain polygons outside the view frustum.
int setHeights(int x, int y, const ImagePtr & image)int setHeights(int x, int y, const ImagePtr & image, float scale) Added the 3rd argument that enables to set the height map scale.
int getHeights(int x, int y, int width, int height, const ImagePtr & image)int getHeights(int x, int y, int width, int height, const ImagePtr & image, int format, float scale) Added 2 arguments that receive an image format and height map scale.
-int loadHeights(const BoundSphere & bs, const BoundBox & bb, int force) Enables to force the loading of the terrain region specified by the bounding volume.
-int getIntersection(const vec3 & p0, const vec3 & p1, vec3 * ret_point, vec3 * ret_normal, vec4 * ret_texcoord, int surface, int holes) Performs the search for the intersection of the given terrain surface with the given traced line.
-int addMaterial(const char * name) Adds a material to the terrain.
-void removeMaterial(int num) Removes the specified detail material.
-void setNumMaterials(int num) Adds the specified number of materials to the terrain.
-int getNumMaterials() Returns the total number of materials assigned to the terrain.
-void setMaterialName(int num, const char * name) Sets a new name for the material.
-const char * getMaterialName(int num) Returns the name of the specified material.
-void setMaterialTransform(int num, const vec4 & transform) Sets the texture coordinate transformations for detail material textures.
-vec4 getMaterialTransform(int num) Returns the texture coordinate transformations for detail material textures.
-void setMaterialParent(int num, int parent) Sets the new parent material for the given material.
-int getMaterialParent(int num) Returns the number of a parent material.
-void setMaterialOverlap(int num, int overlap) Sets the new overlap detail material for the given material.
-int getMaterialOverlap(int num) Checks if the Overlap mode is enabled for the given material.
-void setMaterialMaskBase(int num, int base) Sets the mask base parameter.
-int getMaterialMaskBase(int num) Returns the mask base parameter.
-void setMaterialMaskValue(int num, float value) Sets the new spread of a detail material in accordance with the mask.
-float getMaterialMaskValue(int num) Returns the spread of a detail material according to the mask.
-void setMaterialMaskWidth(int num, float width) Sets the new width of a detail material in accordance with the mask.
-float getMaterialMaskWidth(int num) Returns the width of a detail material according to the mask.
-void setMaterialMaskThreshold(int num, float threshold) Sets the new blending threshold that controls the smoothness of blending for detail material edges.
-float getMaterialMaskThreshold(int num) Returns the blending threshold that controls the smoothness of blending for detail material edges.
-void setMaterialDiffuseTextureName(int num, const char * name) Sets a diffuse texture name for the specified detail material.
-const char * getMaterialDiffuseTextureName(int num) Returns the diffuse texture name of the specified detail material.
-void setMaterialDiffuseScale(int num, float scale) Sets the visibility scale of a diffuse texture assigned to the specified detail material.
-float getMaterialDiffuseScale(int num) Returns the visibility scale of a diffuse texture assigned to the specified detail material.
-void setMaterialNormalTextureName(int num, const char * name) Sets a normal map name for the specified detail material.
-const char * getMaterialNormalTextureName(int num) Returns the normal map name of the specified detail material.
-void setMaterialNormalScale(int num, float scale) Sets the visibility scale of a normal map assigned to the specified detail material.
-float getMaterialNormalScale(int num) Returns the normal map name of the specified detail material.
-void setMaterialSpecularTextureName(int num, const char * name) Sets a specular texture name for the specified detail material.
-const char * getMaterialSpecularTextureName(int num) Returns the specular texture name of the specified detail material.
-void setMaterialSpecularScale(int num, float scale) Sets the visibility scale of a specular texture assigned to the specified detail material.
-float getMaterialSpecularScale(int num) Returns the visibility scale of a specular texture assigned to the specified detail material.
-void setSurfaceEnabled(int x, int y, int enable) Sets a value indicating whether a specified surface is enabled or disabled for rendering.
-int isSurfaceEnabled(int x, int y) Checks whether the specified surface is enabled or disabled for rendering.
-void setSurfaceCastShadow(int x, int y, int cast_shadow) Sets a value indicating whether terrain geometry across the current surface should cast shadows.
-int isSurfaceCastShadow(int x, int y) Checks whether terrain geometry across the current surface should cast shadows.
-void setSurfaceLodThreshold(int x, int y, float threshold, int force) Sets the height threshold value for the LOD of the given surface.
-float getSurfaceLodThreshold(int x, int y) Returns the height threshold value for the LOD of the given surface.
-void setSurfaceDiffuseTextureName(int x, int y, const char * name) Sets a diffuse texture name for the specified surface.
-const char * getSurfaceDiffuseTextureName(int x, int y) Returns the name of the diffuse texture for the given surface.
-int setSurfaceDiffuseTextureImage(int x, int y, const ImagePtr &image) Imports a diffuse texture for the specified surface.
-int getSurfaceDiffuseTextureImage(int x, int y, const ImagePtr &image) Exports a diffuse texture of the specified surface.
-TexturePtr getSurfaceDiffuseTexture(int x, int y) Returns the name of the diffuse texture for the given surface.
-void setSurfaceNormalTextureName(int x, int y, const char * name) Sets a normal texture name for the specified surface.
-const char * getSurfaceNormalTextureName(int x, int y) Returns the name of the normal texture for the given surface.
-int setSurfaceNormalTextureImage(int x, int y, const ImagePtr &image) Imports a normal texture for the specified surface.
-int getSurfaceNormalTextureImage(int x, int y, const ImagePtr &image) Exports a normal texture of the specified surface.
-TexturePtr getSurfaceNormalTexture(int x, int y) Returns the name of the normal texture for the given surface.
-void setSurfaceIndexTextureName(int x, int y, const char * name) Sets an index texture name for the specified surface.
-const char * getSurfaceIndexTextureName(int x, int y) Returns a name of the index texture for the given surface.
-int setSurfaceIndexTextureImage(int x, int y, const ImagePtr &image) Imports an index texture for the specified surface.
-int getSurfaceIndexTextureImage(int x, int y, const ImagePtr &image) Exports an index texture of the specified surface.
-TexturePtr getSurfaceIndexTexture(int x, int y) Returns the name of the index texture for the given surface.
-void setSurfaceMaskTextureName(int x, int y, const char * name) Sets a mask texture name for the specified surface.
-const char * getSurfaceMaskTextureName(int x, int y) Returns the name of the mask texture for the given surface.
-int setSurfaceMaskTextureImage(int x, int y, const ImagePtr &image) Imports a mask texture for the specified surface.
-int getSurfaceMaskTextureImage(int x, int y, const ImagePtr &image) Exports a mask texture of the specified surface.
-TexturePtr getSurfaceMaskTexture(int x, int y) Returns the mask texture of the surface.
-BoundBox getSurfaceBoundBox(int x, int y) Returns the bounding box of the specified surface.
-BoundSphere getSurfaceBoundSphere(int x, int y) Returns the bounding sphere of the specified surface.
-void setDiffuseTextureName(const char * x) Sets the name of the terrain diffuse texture.
-const char * getDiffuseTextureName() Returns the name of the current terrain diffuse texture.
-int setDiffuseTextureImage(const ImagePtr &image) Sets a new terrain diffuse texture from a given image.
-int getDiffuseTextureImage(const ImagePtr &image) Writes the current terrain diffuse texture into the given buffer.
-TexturePtr getDiffuseTexture() Returns the terrain diffuse texture.
-void setNormalTextureName(const char * x) Sets the name of the terrain normal texture.
-const char * getNormalTextureName() Returns the name of the current terrain normal texture.
-int setNormalTextureImage(const ImagePtr &image) Sets a new terrain normal texture from a given image.
-int getNormalTextureImage(const ImagePtr &image) Writes the current terrain normal texture into the given buffer.
-TexturePtr getNormalTexture() Returns the terrain normal texture.
-void setIndexTextureName(const char * x) Sets the name of the terrain index texture.
-const char * getIndexTextureName() Returns the name of the current terrain index texture.
-int setIndexTextureImage(const ImagePtr &image) Sets a new terrain index texture from a given image.
-int getIndexTextureImage(const ImagePtr &image) Writes the current terrain index texture into the given buffer.
-TexturePtr getIndexTexture() Returns the terrain index texture.
-void setMaskTextureName(const char * x) Sets the name of the terrain mask texture.
-const char * getMaskTextureName() Returns the name of the current terrain mask texture.
-int setMaskTextureImage(const ImagePtr &image) Sets a new terrain mask texture from a given image.
-int getMaskTextureImage(const ImagePtr &image) Writes the current terrain mask texture into the given buffer.
-TexturePtr getMaskTexture() Returns the terrain mask texture.
-void setDiffuseTextureArrayName(const char * name) Sets the new name of the diffuse textures array.
-const char * getDiffuseTextureArrayName() Returns the name of the diffuse textures array.
-TexturePtr getDiffuseTextureArray() Returns the diffuse textures array.
-void setNormalTextureArrayName(const char * name) Sets the new name of the normal textures array.
-const char * getNormalTextureArrayName() Returns the name of the normal textures array.
-TexturePtr getNormalTextureArray() Returns the normal textures array.
-void setSpecularTextureArrayName(const char * name) Sets the new name of the specular textures array.
-const char * getSpecularTextureArrayName() Returns the name of the specular textures array.
-TexturePtr getSpecularTextureArray() Returns the specular textures array.
Last update: 2017-07-03