Vixen
caa30e12
csharp
public sealed class WaterMode

The viewport mode water is authored in.

Read the guide page for this →

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 ModeId

    What the mode is called, everywhere an id is wanted.

  • public const string WaterContext

    The command context the mode claims while it is active.

  • public const string PanelId

    What the panel the mode opens is registered as.

  • public string Id

    What everything refers to it by: select, blockout.

  • public StringId Title

    What the mode bar's button says.

  • public PathBuilder? Icon
  • public string? Context

    Which command context the mode claims while it is active, or .

  • public string? Panel

    A panel opened while the mode is active, or for none.

  • public IReadOnlyList<ToolbarEntry> Toolbar

    What the mode puts on the mode bar beside the mode buttons.

  • public static IReadOnlyList<WaterTool> Tools

    The three tools, in the order the strip lists them.

  • public const int SlotCount

    How many digits the mode claims.

  • public WaterEdit Editing

    The editing state the mode drives.

  • public SceneDocument? Document

    The document a committed gesture goes onto, or null while the mode drives none.

  • public WaterBodySettings Body

    What a new body is created with.

  • public WaterZoneSettings Zone

    And what a new zone is.

  • public float Reach

    How far a pointer ray looks for a surface, in metres.

  • public float GroundHeight

    Where the ground is, for a ray that meets no surface.

  • public WaterTool Tool

    Which tool a click runs.

  • public const string FinishCommand

    Finishes the curve being drawn and makes a body of it.

  • public const string UndoPointCommand

    Takes the last point back.

  • public const string CancelCommand

    Drops the draw.

  • public const string CreateZoneCommand

    Places a zone at the view, without which nothing renders.

  • public const string PreviewCarveCommand

    Shows or hides what the water did to the ground.

  • public static IReadOnlyList<string> Commands

    Every verb the mode registers besides the tools.

Events (2)

  • public Action<Spline, WaterBodyKind>? Drawn

    Raised when a curve has been laid, with the curve and the kind it was drawn as.

  • public Action<WaterTool>? ToolChanged

    Raised 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