Vixen
caa30e12
csharp
public readonly record struct WaterSample

What the surface is like at one place and time.

Read the guide page for this →

Remarks

The one answer the vertex stage, the buoyancy solver and a gameplay query all get. That there is exactly one of these is [§ D2](../../docs/plan/35-water.md#d2-one-evaluator-two-hosts-and-the-seam-is-a-test), and it is what makes a boat float at the height the water is drawn at.

Fields and properties (7)

  • public float Height

    Where the surface is, in world units.

  • public Vector3 Normal

    Which way it faces. Unit length, and up where there is no water.

  • public Vector2 Flow

    How fast the water moves, in metres per second, on the ground plane.

  • public float Depth

    How deep the water is, in metres — surface minus ground.

  • public float Coverage

    Whether there is water here at all, 0…1.

  • public static WaterSample None

    Dry land.

  • public bool IsWet

    Whether there is water here.

Methods (1)

  • public WaterSample(float Height, Vector3 Normal, Vector2 Flow, float Depth, float Coverage)

    What the surface is like at one place and time.

Used by (8)

  • BuoyancyVixen.Water
  • UnderwaterRendererVixen.Rendering.Water
  • UnderwaterShapeVixen.Rendering.Water
  • WaterEvaluatorVixen.Water
  • WaterEvaluatorTestsVixen.Water.Tests
  • WaterQueryVixen.Water
  • WaterZoneTestsVixen.Water.Tests
  • WaterPresenterVixen.Editor.App