The TerrainLayer class represents a layer of a terrain mesh.
sealed class
|
TerrainLayer
|
extends
|
Disposable
|
||
implements
|
IComparable<TerrainLayer>
|
Each terrain layer has three sub-layers, which can be enabled or disabled individually:
The terrain layer flags.
public
property
|
Flags
{
get
set
}
|
||
type
|
TerrainLayerFlags
|
||
value
|
The terrain layer flags. |
Remarks:
Defaults to None.
Does this layer have vertex colors?
public
property
|
HasColors
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
layer
renders
vertex
colors,
false
if
not. |
See also:
TerrainLayerFlags.ShowColorsDoes this layer have a highlighted dataset region?
public
property
|
HasRegion
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
layer
highlights
dataset
regions,
false
if
not. |
See also:
TerrainLayerFlags.ShowRegionsDoes this layer have a texture pyramid?
public
property
|
HasTexture
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
layer
has
a
texture
pyramid,
false
if
not. |
See also:
TerrainLayerFlags.ShowTextureIs this terrain layer opaque, i.e. it fully occludes all layers below?
public
property
|
IsOpaque
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
terrain
layer
is
opaque,
false
if
not. |
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
Human-readable name of this layer.
public
property
|
Name
{
get
set
}
|
||
type
|
string
|
||
value
|
The
layer
name
or
null . |
The pixel pyramid of this terrain layer.
public
property
|
PixelPyramid
{
get
}
|
||
type
|
IPixelPyramid
|
||
value
|
The
pixel
pyramid
or
null . |
See also:
TextureSetThe pixel pyramid ID to use for caching (see PyramidFileCache).
public
property
|
PixelPyramidId
{
get
}
|
||
type
|
int32
|
||
value
|
|
The
pixel
pyramid
ID
or
-1
if
caching
is
disabled. |
The distance range in which this terrain layer is visible.
public
property
|
Range
{
get
set
}
|
||
type
|
Vec2F
|
||
value
|
The layer distance range. |
Remarks:
The terrain layer is fully faded in when the camera distance is equal to X and fully faded out when the distance is equal to Y.
If X is equal to Y, the distance range is disabled and the terrain layer is visible everywhere.
Defaults to Zero.
The color to use for highlighting existing data regions.
public
property
|
RegionColor
{
get
set
}
|
||
type
|
int64
|
||
value
|
The color (see Colors). |
Remarks:
Defaults
to
0
.
See also:
TerrainLayerFlags.ShowRegionsThe dataset for which to highlight existing data regions.
[OwnerValue]
|
||||
public
property
|
RegionDataset
{
get
set
}
|
|||
type
|
IHeightmap
|
|||
value
|
The
dataset
or
null . |
Remarks:
Defaults
to
null
.
See also:
TerrainLayerFlags.ShowRegionsThe sort index value of this terrain layer.
public
property
|
SortIndex
{
get
set
}
|
||
type
|
int32
|
||
value
|
The layer sort index. |
Remarks:
Layers with larger sort index values are rendered on top of those with smaller sort index values.
The texel pyramid of this terrain layer.
public
property
|
TexelPyramid
{
get
}
|
||
type
|
ITexelPyramid
|
||
value
|
The
texel
pyramid
or
null . |
See also:
TextureSetAcquires a strong reference to this disposable object.
[OwnerReturn, ThreadSafe]
|
||||
public
method
|
AcquireTry
()
|
|||
type
|
IDisposable
|
|||
returns
|
this
if
a
new
strong
reference
has
been
acquired,
null
if
this
object
is
already
being
disposed.
|
|||
inherited
|
Disposable.AcquireTry
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Compares this object with the given one.
[Pure]
|
||||
public
method
|
CompareTo
(TerrainLayer other)
|
|||
type
|
int32
|
|||
params
|
other
|
The object to compare to. | ||
returns
|
<
0
:
if
this
object
is
less
than
other, = 0 : if this object is equal to other, > 0 : if this object is greater than other. |
|||
implements
|
IComparable.CompareTo
|
Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
Removes the layer texture.
public
method
|
TextureClear
()
|
See also:
TerrainLayerFlags.ShowTextureSets the layer texture.
public
method
|
TextureSet
([Owner]
IPixelPyramid pyramid,
int32 pyramidId = -1)
|
||
params
|
pyramid
|
[not-null]
|
The pixel pyramid. |
pyramidId
|
The
pyramid
cache
ID.
Defaults
to
-1 . |
Remarks:
Because of adjustments that might be necessary for the given pyramid, the actual pixel pyramid of the layer (see PixelPyramid) can be a different instance than the given pyramid.
Once a pixel pyramid has been assigned to the persistent cache, modifications made to it will invalidate the cache contents.
The Alpha flag is used to choose the texture atlas (see TextureAtlasOpaque and TextureAtlasTransparent) to use for the given layer pyramid.
See also:
TerrainLayerFlags.ShowTexture