Vixen
02b45cc4
csharp
public sealed class FoliageEdit

The volume being painted, and the drag in flight over it.

Read the guide page for this →

Remarks

What TerrainEdit is to a heightfield. The mode owns keys, a strip and a claim on the viewport; this owns the volume, the palette selection and the stroke — which is the split that lets a test drive a whole stroke with world points and assert the trees, with no shell and no window.

⚠ Selection is by address and is re-resolved after every edit. An address is only valid until its chunk changes: removing an instance shifts the ones after it, so a selection held across an erase stroke points at somebody else's tree.

Fields and properties (9)

  • public FoliageVolume? Volume

    The volume being painted, or while none is.

  • public TerrainBrushSettings Brush

    The brush every tool in both modes shares.

  • public FoliageSettings Settings

    What foliage adds to it.

  • public IFoliageSurface? Surface

    What answers "what is the ground here", or null while nothing does.

  • public IReadOnlySet<int> Chosen

    Which palette entries a stroke places, by index.

  • public IReadOnlyList<FoliageAddress> Selection

    What is selected, for the gizmo.

  • public bool IsStroking

    Whether a drag is in flight.

  • public string? Refusal

    What the last Begin refused for, or .

  • public bool CanStroke

    Whether a stroke could start.

Events (1)

  • public Action<FoliageVolume>? Changed

    Told which instances changed, whenever any do.

Methods (8)

  • public void Choose(int type, bool add = false)

    Chooses a palette entry, or adds it to the choice.

  • public bool Begin(Vector2 ground, bool invert = false)

    Starts a stroke at a point on the ground.

  • public void Extend(Vector2 ground, bool invert = false)

    Carries the stroke to a point.

  • public IEditorCommand? Commit()

    Ends the stroke and hands back the entry that undoes it.

  • public void Cancel()

    Abandons the stroke, putting the instances back the way they were.

  • public int Select(Vector2 ground, bool add = false)

    Selects everything of the chosen types within the brush.

  • public void Deselect()

    Drops the selection.

  • public IEditorCommand? MoveSelection(Vector3 offset)

    Moves the selected instances, as a gizmo drag does.

Used by (3)

  • FoliageModeVixen.Editor.Terrain
  • FoliageModeTestsVixen.Editor.Terrain.Tests
  • TerrainModuleVixen.Editor.Terrain