public sealed class WaterModeThe viewport mode water is authored in.
Remarks
One mode, and most of the time not even that — [35 § One mode, not two](../../docs/plan/35-water.md#one-mode-not-two). Doc 31 needed a sculpt mode and a foliage mode because each owns the viewport and has an incompatible idea of what a click means. Placing a lake is placing an entity and editing its shape is editing a spline, and the editor already does both — so this mode exists for the three things that are neither.
Draw lays a body's curve by clicking points on the ground, at the ground's own height, closing it for a lake or an ocean and leaving it open for a river. It is the one gesture SplineEdit does not already serve. Profile drags the width handles on each side of a river and the depth handle down, which is Unreal's three viewport visualisations and the reason its river authoring is good. Preview toggles the reserved layer's contribution, so an author can see what the water did to the ground.
⚠ Escape cancels the draw and does not leave the mode, which is FoliageMode's rule: a half-laid curve belongs to a gesture, and a gesture that survived a mode switch would be committed by the next click in a mode that does not know what it is.
Fields and properties (24)
public const string ModeIdWhat the mode is called, everywhere an id is wanted.
public const string WaterContextThe command context the mode claims while it is active.
public const string PanelIdWhat the panel the mode opens is registered as.
public string IdWhat everything refers to it by: select, blockout.
public StringId TitleWhat the mode bar's button says.
public PathBuilder? Iconpublic string? ContextWhich command context the mode claims while it is active, or .
public string? PanelA panel opened while the mode is active, or for none.
public IReadOnlyList<ToolbarEntry> ToolbarWhat the mode puts on the mode bar beside the mode buttons.
public static IReadOnlyList<WaterTool> ToolsThe three tools, in the order the strip lists them.
public const int SlotCountHow many digits the mode claims.
public WaterEdit EditingThe editing state the mode drives.
public SceneDocument? DocumentThe document a committed gesture goes onto, or null while the mode drives none.
public WaterBodySettings BodyWhat a new body is created with.
public WaterZoneSettings ZoneAnd what a new zone is.
public float ReachHow far a pointer ray looks for a surface, in metres.
public float GroundHeightWhere the ground is, for a ray that meets no surface.
public WaterTool ToolWhich tool a click runs.
public const string FinishCommandFinishes the curve being drawn and makes a body of it.
public const string UndoPointCommandTakes the last point back.
public const string CancelCommandDrops the draw.
public const string CreateZoneCommandPlaces a zone at the view, without which nothing renders.
public const string PreviewCarveCommandShows or hides what the water did to the ground.
public static IReadOnlyList<string> CommandsEvery verb the mode registers besides the tools.
Events (2)
public Action<Spline, WaterBodyKind>? DrawnRaised when a curve has been laid, with the curve and the kind it was drawn as.
public Action<WaterTool>? ToolChangedRaised when Tool changes.
Methods (13)
public bool SelectSlot(int slot)Selects the th tool, 0-based.
public static string ToolCommand(WaterTool tool)What the command that selects a tool is called.
public static string SlotCommand(int slot)What the command bound to a digit is called.
public void Register(EditorShell shell)Puts the mode's commands, bindings and panels into the shell.
public void Unregister(EditorShell shell)Takes them back out.
public void Activated()The mode has become the active one.
public void Deactivated()public bool Pointer(PointerEvent args)First refusal on a pointer event in the viewport.
public bool Key(KeyEvent args)First refusal on a key event in the viewport.
public bool Pointer(SceneViewport pane, PointerEvent args)public bool Key(SceneViewport pane, KeyEvent args)Offers a key event to it.
public Spline? Finish()Ends the draw, makes a body of the curve, and clears the gesture.
public Entity CreateZone()Places a zone at the origin of the document, undoably.
Used by (3)
- EditorModeTestsVixen.Editor.App.Tests
- WaterModeTestsVixen.Editor.Water.Tests
- WaterModuleVixen.Editor.Water