TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class Brush in Tinman.Terrain.Heightmaps.Painting

abstract class Brush implements IBrush

Public / Attributes

Height

Returns the brush height.

public abstract property Height { get }
type int32
value [>0] The brush height, in samples.
implements IBrush.Height

LayerMask

The mask of heightmap layers this object uses.

public abstract property LayerMask { get }
type HeightmapLayer
value Bitwise combination of HeightmapLayer values.
implements IHeightmapLayers.LayerMask

Remarks:

These heightmap layers store actual terrain data:

Missing data is represented with the 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 Coverage means that all samples are fully solid. If a LayerMask contains the Coverage layer but no others, the coverage values are used to represent 'holes' in the terrain (e.g. creating holes for caves, tunnels, etc.).

Width

Returns the brush width.

public abstract property Width { get }
type int32
value [>0] The brush width, in samples.
implements IBrush.Width

Public / Constructors

Combine

Creates a new instance of IBrush that combines the samples in the target heightmap with the given samples.

public static method Combine (HeightmapRegion samples)
type IBrush
params samples [not-null] The heightmap samples to combine with.
returns [not-null] The heightmap brush.

Remarks:

The vertical range of samples (see Vertical) will be used to translate elevation values before combining them with the target samples when the brush is applied to a heightmap.

See also:

IHeightmapOps.Combine

Eraser

Creates a new instance of IBrush that erases data from the target heightmap.

public static method Eraser (CoverageBuffer coverage, HeightmapLayer layers = HeightmapLayer.All)
type IBrush
params coverage [not-null] The coverage buffer to use for erasing data.
  layers The heightmap layers to erase. Defaults to All.
returns [not-null] The heightmap brush.

Remarks:

The eraser brush will reduce the coverage of the target heightmap (i.e. zero samples in coverage will erase data); data layer values will be modulated down until they reach their default value for zero coverage. Heightmap datasets will automatically drop all zero coverage data, freeing up disk space.

Merge

Creates a new instance of IBrush that merged the samples in the target heightmap with the given samples.

public static method Merge (HeightmapRegion samples)
type IBrush
params samples [not-null] The heightmap samples to merge with.
returns [not-null] The heightmap brush.

Remarks:

The vertical range of samples (see Vertical) will be used to translate elevation values before merging them with the target samples when the brush is applied to a heightmap.

See also:

IHeightmapOps.Merge

Public / Methods

Apply

Applies this heightmap brush to the given heightmap samples.

[ThreadSafe]
public abstract method Apply (CubemapFaceRect region, HeightmapRegion samples, HeightmapLayer layers, object userData)
params region The heightmap region of samples.
  samples The heightmap samples to update.
  layers The heightmap layers to process.
  userData Optional user data object that has been passed to UpdateRegion.
implements IBrush.Apply

Remarks:

In order to apply an IBrush object to an IHeightmap, call the UpdateRegion method and pass this method as the HeightmapRegionDelegate.

See also:

IHeightmap.UpdateRegion
HeightmapRegionDelegate

ApplyCoordinateTransform

Transforms the samples in this brush before applying them to the target heightmap.

public abstract method ApplyCoordinateTransform (Transform transform)
type IBrush
params transform The transform to apply to this brush before updating the heightmap.
returns [not-null] The resulting brush.
implements IBrush.ApplyCoordinateTransform

ApplyElevationScale

Multiplies the denormalized elevation values in this brush with the given factor before applying them to the target heightmap.

public virtual method ApplyElevationScale (float32 scale)
type IBrush
params scale The scale factor.
returns [not-null] The resulting brush.
implements IBrush.ApplyElevationScale

Remarks:

The vertical range of the buffer samples (see Vertical) are used to denormalized elevation values.

Mask

Applies the given brush mask to this brush, replacing any other masks that have been applied earlier.

public virtual method Mask (IBrushMask mask, IHeightmap heightmap)
type IBrush
params mask The brush mask to apply or null to clear the mask.
  heightmap The heightmap from which to get the samples for computing the brush mask. Will be ignored if mask is null. If null, the original heightmap samples from the brush will be used. Defaults to null.
returns [not-null] The resulting brush.
implements IBrush.Mask