HeightmapRegion
Description
- Derived from
This class represents the samples of a rectangular region of a heightmap.
- See also
Public / Constants
Public / Constructors
Create
Creates a new instance of HeightmapRegion.
Instances of HeightmapRegion can be pooled by calling IDeletable.Delete.
Public / Methods
ApplyTransform
Perform an in-place Transform of the samples in the given region.
For square regions (i.e. same width and height), all Transforms can be applied in-place. For rectangular regions, width and height might be swapped ( Transforms.WillSwapAxes) while the top-left sample of the given region remains in the same place.
If this sample buffer is not big enough to hold the swapped width resp. height, output samples will be discarded.
This method reads samples from the given input region and writes samples to the transformed output region. No other sample are accessed by this method.
Gather
Fetches scattered samples from this heightmap region and stores them into the given linear buffer.
Pad
2 overloads
Computes a rectangle in this region and then calls Pad2.
If the given the heightmap in is not rectangular (see MapType.Rect), the method returns silently. Otherwise, the given bounds in are aligned to the sample step opt with CubemapFaceRect.StepAlign. Then, the aligned bounds are clipped to the size of the given heightmap in. The resulting buffer rectangle is then used to pad the buffer samples towards the buffer boundary.
Duplicates the samples on the edge of the given rectangle towards the buffer boundary.
Public / Attributes
Coverage
The buffer for HeightmapLayer.Coverage values.
- TinmanException
-
If this heightmap region does not store values of that layer.
Displacement
The buffer for HeightmapLayer.Displacement values.
- TinmanException
-
If this heightmap region does not store values of that layer.
Elevation
The buffer for HeightmapLayer.Elevation values.
- TinmanException
-
If this heightmap region does not store values of that layer.
Horizontal
The horizontal scale of the samples in this region (in UnitOfMeasure.Metre).
Defaults to 1
.
Material
The buffer for HeightmapLayer.Material values.
The heightmap region will never modify the MaterialBuffer.ScanlineMaterials property of the material buffer.
- TinmanException
-
If this heightmap region does not store values of that layer.
MaterialNull
The buffer for HeightmapLayer.Material values.
The heightmap region will never modify the MaterialBuffer.ScanlineMaterials property of the material buffer.
Slope
Returns the slope info of the samples in this region.
The slope info is computed from Vertical and Horizontal.
Texture
The buffer for HeightmapLayer.Texture values.
- TinmanException
-
If this heightmap region does not store values of that layer.
Vertical
The vertical range of the samples in this region (in UnitOfMeasure.Metre).
Defaults to VerticalRange.Default.