HeightmapPainter
Description
- Derived from
-
Disposable abstract
IHeightmapLayers
The heightmap painter paints brushes onto heightmaps using background tasks.
Public / Methods
PaintCursorBounds
Computes the bounds of the decal that represents the paint cursor on the canvas.
The following figure shows how the cursor decal vertices are arranged before applying the cursor transformation:
(a)---------(b) | | a := (-0.5 | -0.5) | | b := (+0.5 | -0.5) | x | c := (+0.5 | +0.5) | | d := (-0.5 | +0.5) | | x := ( 0.0 | 0.0) (d)---------(c)
The default cursor vertices are transformed as follows:
-
Scaling by:
X
: brush width (see IBrush.Width) multiplied with cursor scale (see CursorScale).
Y
: brush height (see IBrush.Height) multiplied with cursor scale (see CursorScale). -
Simple 2D transform (see CursorTransform).
-
Counter-clockwise rotation around
x
(see CursorRotation). -
Translation to cursor center (see CursorCenter).
If CanPaintCursor returns false
, the a out, b out, c out and d out output parameters will be set to Vec2D.Undefined.
PaintHeightmap
Applies the current brush to the current heightmap.
This method does not perform any resampling or projection, instead it maps brush samples directly to heightmap samples.
The current LayerMask will be used for the paint job.
- See also
Public / Attributes
CanPaintCanvas
Can PaintCanvas perform painting using the current settings?
The following settings are required:
-
Brush: not-null
-
CanvasCoordinates: not-null
CanPaintCursor
Can PaintCursor perform painting using the current settings?
The following settings are required:
-
Brush: not-null
-
CanvasCoordinates: not-null
-
CursorCenter: not undefined
-
CursorScale: not zero
CanPaintHeightmap
Can PaintHeightmap perform painting using the current settings?
The following settings are required:
-
Brush: not-null
CanvasCoordinates
The coordinate system of the heightmap painter canvas.
On-the-fly projection will be performed in order to map the canvas to the current target heightmap.
LayerMask
The mask of heightmap layers this object uses.
These heightmap layers store actual terrain data:
-
HeightmapLayer.Elevation:
The terrain elevation, measured upwards from the base geometry (usually an ellipsoid). See VerticalRange. -
HeightmapLayer.Displacement:
The terrain displacement, measured upwards from the terrain geometry. See VerticalRange. -
HeightmapLayer.Texture:
A 64-bit ARGB color value that describes the terrain surface (e.g. surface reflectance). See Colors. -
HeightmapLayer.Material:
A 64-bit ARGB material token that describes the terrain surface (e.g. land cover). See MaterialToken.
Missing data is represented with the HeightmapLayer.Coverage layer. It describes how much information is present in a stored heightmap sample. The semantics of coverage with heightmap samples is the same as premultiplied alpha with texture samples. A LayerMask without HeightmapLayer.Coverage means that all samples are fully solid. If a LayerMask contains the HeightmapLayer.Coverage layer but no others, the coverage values are used to represent 'holes' in the terrain (e.g. creating holes for caves, tunnels, etc.).