Vixen
c7401864
csharp
public sealed class AssetTerrainSource

The terrains and grass rules a scene's components name, out of the asset system.

Read the guide page for this →

Remarks

ITerrainAssetSource's implementation, beside AssetTerrainTextures and for the same reason: this assembly is where the asset system and the render system meet. A .vxterrain ships as a raw payload — TerrainStore's own binary, not a serialized object — so it is opened as bytes and read here; a .vxgrass ships as its serialized GrassType and is opened the same way, because a typed load cannot reach it: Load``1 requires a class and the rule is deliberately a struct. Load<object> was the first attempt at this seam, and it can never answer — the database checks the chunk's type id against the type being asked for, and no chunk was written by System.Object.

Nothing here waits — AssetMeshSource's contract. A load starts on the first ask and the answer is null until it lands; the extraction system asks again next frame. A reference that fails stays failed, so a level naming a terrain somebody deleted is one counter rather than a retry per frame for the life of the run.

Fields and properties (2)

  • public int Requested

    How many references have been asked for.

  • public int Failed

    How many of them will never arrive.

Methods (5)

  • public AssetTerrainSource(AssetManager assets)

    Builds a source over a content manager.

  • public Terrain? Terrain(string reference)

    The terrain a reference names, or null while it is loading or unloadable.

  • public GrassType? Grass(string reference)

    The grass type a reference names, or null on the same terms.

  • public FoliageType? Foliage(string reference)

    The foliage type a .vxfoliage reference names, or null on the same terms.

  • public FoliageVolume? Volume(string reference, IReadOnlyList<FoliageType> palette)

    The instance volume a .vxfol reference names, or null on the same terms.

Used by (2)

  • AssetTerrainSourceTestsVixen.Engine.Renderer.Tests
  • WorldRendererVixen.Engine.Renderer