Class Height
- Namespace
- AlphaFramework.Editor.World.TerrainModifiers
- Assembly
- AlphaFramework.Editor.dll
Abstract base class for interactively changing the height of an area on a ITerrain.
public abstract class Height : Base
- Inheritance
-
Height
- Derived
- Inherited Members
- Extension Methods
Constructors
Height(ITerrain, Terrain, Action)
Creates a new terrain height modifier.
protected Height(ITerrain terrain, Terrain engineTerrain, Action refreshHandler)
Parameters
terrain
ITerrainThe ITerrain to modify.
engineTerrain
TerrainThe Terrain to live-update while modifying.
refreshHandler
ActionCalled when the presenter needs to be reset.
Methods
Apply(Vector2, TerrainBrush)
Applies and accumulates a modification to the Terrain.
public override void Apply(Vector2 terrainCoords, TerrainBrush brush)
Parameters
terrainCoords
Vector2The center coordinates of the area to modify in world space.
brush
TerrainBrushThe shape and size of the area around
terrainCoords
to modify.
GetCommand()
Creates a pre-executed undo command representing the accumulated Apply(Vector2, TerrainBrush) calls to this instance.
public override IUndoCommand GetCommand()
Returns
ModifyTerrain(Point, TerrainBrush, byte[,], byte[,])
Modifies the ITerrain and fills arrays with undo/redo data.
protected abstract void ModifyTerrain(Point offset, TerrainBrush brush, byte[,] oldData, byte[,] newData)
Parameters
offset
PointThe HeightMap index that corresponds to the top-left corner of the area to modify.
brush
TerrainBrushThe shape and size of the area to the lower-right of
offset
to modify.oldData
byte[,]An array to be filled with data from HeightMap before the modification. Both dimensions must be equal to Size.
newData
byte[,]An array to be filled with data from HeightMap after the modification. Both dimensions must be equal to Size.