Unigine.LandscapeLayerMap Class
Inherits from: | Node |
This class is used to manage landscape layer maps of the Landscape Terrain object. Landscape layer map data (height, albedo, masks, settings) is stored in a .lmap file (see the LandscapeMapFileCreator and LandscapeMapFileSettings classes). A landscape map has a single resolution and density, and cannot have insets. Insets are created by adding a high-resolution landscape layer map above the low-resolution one.
Several maps can be blended with each other. Blending parameters for the landscape layer map are controlled via the corresponding methods of the LandscapeMapFilesettings class.
Maximum and Minimum Terrain Height#
This example demonstrates how to obtain minimum and maximum height values for the whole Landscape Terrain (all layer maps) along with the enclosing bounding box. For this puprose we should find all LandscapeLayerMap objects in the World, extend a bounding box to enclose all of them, and use the getExtremumHeight() method to get minimum and maximum height values.
WorldBoundBox b;
float min = 99999, max = -9999;
Vector<NodePtr> v;
World::getNodes(v);
for (auto & it : v)
{
if (it->getType() == Node::LANDSCAPE_LAYER_MAP)
{
b.expand(it->getWorldBoundBox());
auto ext = checked_ptr_cast<LandscapeLayerMap>(it)->getExtremumHeight();
if (ext.x < min)
min = ext.x;
if (ext.y > max)
max = ext.y;
}
}
vec3 minp = vec3(b.getMin());
vec3 maxp = vec3(b.getMax());
minp.z = min;
maxp.z = max;
BoundBox bb = BoundBox(minp, maxp);
Visualizer::renderBoundBox(bb, Mat4_identity, vec4_red);
LandscapeLayerMap Class
Properties
string Path#
bool Collision#
bool Intersection#
bool IntersectionBicubicFilter#
bool Culling#
int Order#
vec2 Size#
float HeightScale#
vec2 TexelSize#
bool IsInit#
ivec2 Resolution#
vec2 FadeAttenuation#
bool IsCompressed#
vec2 AlbedoFadeAttenuation#
vec2 HeightFadeAttenuation#
Landscape.BLENDING_MODE AlbedoBlending#
Landscape.BLENDING_MODE HeightBlending#
bool IsEnabledOpacityAlbedo#
bool IsEnabledOpacityHeight#
bool IsEnabledAlbedo#
bool IsEnabledHeight#
Members
LandscapeLayerMap ( ) #
The LandscapeLayerMap constructor.UGUID GetGUID ( ) #
Returns the GUID of the LandscapeLayerMap node.Return value
GUID of the LandscapeLayerMap node.vec2 GetExtremumHeight ( float precision = 1.0f ) #
Returns the minimum and maximum height of the landscape layer map as a two-component vector.Arguments
- float precision - Precision value in the [0.0f, 1.0f] range. The default value is 1.0f (maximum).