public sealed class TerrainEditThe terrain being sculpted, and the drag in flight over it.
Remarks
What MeshEdit is to a blockout mesh. The mode owns keys, a toolbar and a claim on the viewport; this owns the terrain, the layer being written and the stroke — which is the split that lets a test drive a whole stroke with world points and assert the ground, with no shell and no window.
Pointer down, drag, pointer up is one command — [§ D11]. Begin starts a TerrainStroke, every Extend records before it writes and applies the kernel immediately, and Commit hands back one IEditorCommand. The composite is resolved as the drag goes, so the viewport shows the ground moving under the brush rather than at pointer-up.
⚠ The brush is snapshotted at Begin and not read again. The panel can change while a drag is in flight — a pen with a barrel wheel, a key press, another window — and a stroke whose radius changed halfway through has an undo record sized to a footprint that no longer matches what it wrote.
⚠ The colliders are rebuilt at Commit, not per stamp. A stroke marks one or two tiles over and over; building a Jolt height field per stamp is the version of this that makes the brush stutter. What is per stamp is the composite, because that is what the artist is looking at.
Fields and properties (11)
public Terrain? TerrainThe terrain being edited, or while none is.
public TerrainEditLayer? LayerWhich edit layer the tools write, or for none.
public TerrainBrushSettings BrushThe brush every tool in both modes shares.
public TerrainToolSettings ToolsWhat each tool does beyond what the brush says.
public ITerrainColliders? CollidersWhat rebuilds collision when the ground moves, or null for a scene with no physics.
public bool IsStrokingWhether a drag is in flight.
public TerrainTool HeldToolWhich tool the drag in flight is running.
public TerrainCategory HeldCategoryWhich half of the toolset the drag in flight belongs to.
public int TargetWhich paint layer the paint tools write, or −1 for none.
public string? RefusalWhat the last Begin refused for, or .
public bool CanStrokeWhether the terrain and layer are in a state a stroke could start from.
Events (1)
public Action<TerrainRect>? ChangedTold which samples moved, whenever any do. Where a renderer hangs its upload.
Methods (4)
public bool Begin(Vector2 ground, bool invert = false)Starts a stroke at a point on the ground.
public void Extend(Vector2 ground)Carries the stroke to a point.
public IEditorCommand? Commit(bool rebuildColliders = true)Ends the stroke and hands back the entry that undoes it.
public void Cancel()Abandons the stroke, putting the ground back the way it was.
Used by (7)
- GroundVixen.Editor.Terrain.Tests
- SculptSessionTestsVixen.Editor.Terrain.Tests
- TerrainEditTestsVixen.Editor.Terrain.Tests
- TerrainModeVixen.Editor.Terrain
- TerrainModeTestsVixen.Editor.Terrain.Tests
- TerrainModuleVixen.Editor.Terrain
- TerrainPaintModeTestsVixen.Editor.Terrain.Tests