Vixen
02b45cc4
csharp
public sealed class TerrainGrowthSettings

The growth section of the foliage panel — what [docs/plan/31 § T9]'s four sliders are.

Read the guide page for this →

Remarks

A mutable settings object beside the immutable FoliageGrowthSettings, for TerrainBrushSettings's reason: a simulation has to be the same settings from its first step to its last, so what a panel edits and what a run is begun with are two objects and ToSettings is where they meet.

⚠ The seed is a field and not a hidden number, and that is the whole feature. "The same rules, a different forest" is what a procedural forest is for; a generator that reseeded itself every run would make an author who liked what they saw unable to get it back, and one that never reseeded would make every hillside the same hillside.

⚠ The plant cap is announced rather than silent. Spread is exponential until shade catches up with it, so a region an author made ten times too large is ten thousand times the plants — and a simulation that quietly stopped sowing reads as a rule that stopped working. Capped is what the panel shows instead.

Fields and properties (11)

  • public const float MinimumSize

    The smallest region worth simulating, in metres on a side.

  • public const float MaximumSize

    And the largest a panel offers, which is a kilometre.

  • public float OriginX

    Where the region's low corner is, along X.

  • public float OriginZ

    And along Z.

  • public float SizeX

    How far the region reaches along X, in metres.

  • public float SizeZ

    And along Z.

  • public int Steps

    How many steps to run.

  • public int Seed

    What every random draw derives from.

  • public int MaxPlants

    How many plants the region may hold before the simulation stops sowing.

  • public bool Replace

    Whether an existing scatter layer is emptied before the run.

  • public bool IsValid

    Whether a run would be accepted.

Methods (3)

  • public FoliageGrowthSettings ToSettings()

    What a run of these settings is.

  • public string? Validate()

    What is wrong with these settings, or if nothing is.

  • public void CentreOn(Vector2 centre)

    Centres the region on a place, keeping its size.

Used by (3)

  • Describes_Vixen_Editor_Terrain_TerrainGrowthSettingsVixen.Editor.Terrain
  • TerrainModuleVixen.Editor.Terrain
  • TerrainPanelTestsVixen.Editor.App.Tests