Vixen
02b45cc4
csharp
public interface ITerrainScene

What terrains a viewport should draw, and where each one is.

Read the guide page for this →

Remarks

The seam between a presenter with no asset database and a toolset with no device — the same division SceneMeshes.Meshes and IMeshBaker already make. A TerrainComponent names a .vxterrain; turning that name into a heightfield means reading a file, caching it and reporting when it is not there, none of which belongs beside a draw call.

⚠ Here rather than in the editor, because the two ends are in different assemblies now. The implementation is Vixen.Editor.Terrain's — it is the thing that reads a .vxterrain and caches it — and the consumer is the editor's scene presenter. Doc 36 § P3 moved the first out of the application, and a contract owned by one end would have been a reference back to it.

⚠ The origin is the entity's translation and there is no rotation. TerrainComponent offers none on purpose: a terrain's samples are its space, so a rotated one would make every tool that maps a world position to a sample carry an inverse. A presenter that took a full transform would be offering something no tool could honour.

Methods (1)

  • IReadOnlyList<(Terrain Terrain, Vector3 Origin)> Terrains()

    Every terrain in the scene, and where its low corner is in world space.

Used by (6)

  • EditorApplicationVixen.Editor.App
  • OneTerrainVixen.Editor.App.Tests
  • ScenePresenterVixen.Editor.App
  • SceneTerrainsVixen.Editor.Terrain
  • TerrainModuleVixen.Editor.Terrain
  • TwoPlacementsVixen.Editor.App.Tests