Vixen
c7401864
csharp
public struct WaterBodyComponent

What a scene says about one body of water: a spline, a kind, and eleven numbers.

Read the guide page for this →

Remarks

[§ D6](../../docs/plan/35-water.md#d6-a-water-body-is-a-spline-and-a-profile-and-there-is-no-new-spline), and there is deliberately no new asset kind. [31 § D2](../../docs/plan/31-terrain-grass-and-trees.md) earned a .vxterrain because a heightfield is tens of megabytes of binary and merging it is not a thing. A water body is a spline reference and eleven numbers; putting it in a sidecar asset would mean a lake that cannot be moved without opening a second document, for no merge benefit at all. The rule the two cases share is put it where the merge is — and it produces opposite answers, which is how you can tell it is a rule rather than a preference.

⚠ The per-control-point profile is not here. Width, depth, velocity and audio intensity vary along the curve, and a component is a fixed-size struct in a column — so the profile travels with the spline, and what a component carries is the defaults a body with no per-point profile uses. That is the same split TerrainSplineSettings makes and for the same reason.

Fields and properties (12)

  • public WaterBodyKind Kind

    What kind of water it is.

  • public string Spline

    Which spline asset gives it its shape.

  • public float SurfaceHeight

    Where a closed body's surface sits, in world units.

  • public int Priority

    Which body wins where two overlap. Higher is on top.

  • public float ShoreFalloff

    How wide the band is over which coverage falls to zero at the boundary, in metres.

  • public float BedRamp

    How far inside the boundary the bed reaches its full depth, in metres.

  • public float HalfWidth

    How far the channel reaches either side of the curve, where the profile says nothing.

  • public float Depth

    How far below the surface the bed sits, where the profile says nothing.

  • public float Velocity

    How fast the water moves downstream, where the profile says nothing.

  • public float AudioIntensity

    How loud it is, where the profile says nothing.

  • public static WaterBodyComponent Default

    A lake: still, three metres deep, with a two-metre shore.

  • public readonly WaterProfilePoint Profile

    The profile a body with no per-control-point one uses.

Used by (15)

  • BuiltVixen.Rendering.Water
  • ComponentRegistrationVixen.Rendering.Water
  • TypeRegistrationVixen.Rendering.Water
  • UnderwaterPassTestsVixen.Rendering.Water.Tests
  • Vixen_Rendering_Water_WaterBodyComponentSerializerVixen.Rendering.Water
  • WaterDebugDrawTestsVixen.Rendering.Water.Tests
  • WaterHorizonImageTestsVixen.Graphics.Golden.Tests
  • WaterZoneSystemVixen.Rendering.Water
  • WaterZoneSystemTestsVixen.Rendering.Water.Tests
  • MaterialIconsVixen.Editor.App
  • SceneWaterComponentTestsVixen.Editor.Assets.Tests
  • WaterBodySettingsVixen.Editor.Water
  • WaterEditTestsVixen.Editor.Water.Tests
  • WaterModuleVixen.Editor.Water
  • WaterProfileCommandVixen.Editor.Water