Vixen
c7401864
csharp
public sealed class WaterBody

A body of water: a spline, a profile, and a kind.

Read the guide page for this →

Remarks

The kernel half of [§ D6](../../docs/plan/35-water.md#d6-a-water-body-is-a-spline-and-a-profile-and-there-is-no-new-spline). What a scene carries is a component naming a .vxspline and eleven numbers; what the arithmetic needs is a resolved curve and a profile, which is this. No new asset kind and no new spline type — a water body is authored with the same tools a road is, because it is the same object.

The shape is a signed distance to the body's boundary, and every kind produces one. An open body's boundary is its centreline pushed out by the profile's half-width; a closed body's is its own spline. That is what lets one Sample serve a river, a lake and an ocean, and it is why a transition between two of them is resolved by rasterising both rather than by a material that has to know which two it is between.

⚠ The polygon is built once, in the constructor. Point-in-polygon over a curve re-evaluated per query is the difference between a body a hundred pontoons can ask and one they cannot — and the evaluator's stated property is that ten thousand queries allocate nothing.

Fields and properties (10)

  • public const int BoundarySamples

    How finely a closed spline is flattened into the polygon queries test against.

  • public WaterBodyKind Kind

    What kind of water it is.

  • public Spline Spline

    Its curve.

  • public WaterProfilePoint Defaults

    What it is like where the profile says nothing.

  • public int Priority

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

  • public float SurfaceHeight

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

  • 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 bool IsSubtractive

    Whether this body removes water rather than adding it.

  • public float Reach

    The furthest from its curve this body reaches, in metres.

Methods (6)

Used by (18)

  • BuiltVixen.Rendering.Water
  • BuoyancyTestsVixen.Water.Tests
  • LakeVixen.Water.Physics.Tests
  • UnderwaterShapeTestsVixen.Rendering.Water.Tests
  • WaterCarveVixen.Water
  • WaterCarveTestsVixen.Water.Tests
  • WaterDebugDrawVixen.Rendering.Water
  • WaterEvaluatorTestsVixen.Water.Tests
  • WaterFieldVixen.Water
  • WaterFieldTestsVixen.Water.Tests
  • WaterSurfaceMeshTestsVixen.Water.Tests
  • WaterZoneStateVixen.Water
  • WaterZoneSystemVixen.Rendering.Water
  • WaterZoneSystemTestsVixen.Rendering.Water.Tests
  • WaterZoneTestsVixen.Water.Tests
  • WaterCarveCommandVixen.Editor.Water
  • WaterEditVixen.Editor.Water
  • WaterEditTestsVixen.Editor.Water.Tests