public sealed class AssetWaterSourceThe curves and sea states a scene's water names, out of the asset system.
Remarks
AssetTerrainSource's arrangement, one subsystem over, and this assembly is where it belongs for the same reason: WaterZoneSystem takes its splines and its waves through seams rather than holding an AssetManager, because a test's spline is a literal, an editor's is a document being dragged and a game's is a loaded file. Something has to be the game's answer, and it needs one of the asset system and one of the render system.
Nothing here waits — AssetMeshSource's contract, kept. A load starts on the first ask and the answer is null until it lands; the fold asks again next frame and counts what it did not get. A reference that fails stays failed, so a scene naming a spline somebody deleted is one counter rather than a retry per frame for the life of the run.
⚠ The spline is built once per placement, not once per name. A curve is geometry and is asked for in world space, so two lakes sharing one .vxspline at different transforms are two curves — and a cache keyed by name alone would give the second one the first one's position. The transform is part of the key.
⚠ The sea state has no placement and must not acquire one. [35 § D7](../../docs/plan/35-water.md#d7-waves-are-a-spectrum-summed-as-gerstner-and-the-fft-is-deferred-with-arithmetic) makes determinism an exit criterion: a spectrum that varied with where a zone entity sat is one a client and a server could disagree about, which is a boat in a different place on each.
Fields and properties (2)
public int RequestedHow many references have been asked for.
public int FailedHow many of them will never arrive.
Methods (3)
public AssetWaterSource(AssetManager assets)Builds a source over a content manager.
public Spline? SplineFor(string name, in Matrix4x4 placement)The curve a body names, or if it is not available.
public WaterWaveSpectrum? SpectrumFor(string name)The sea state a zone names, or if it is not available.
Used by (1)
- AssetWaterSourceTestsVixen.Engine.Renderer.Tests