Class WaterQuery
The water of a scene, for the simulation: where a character swims, how deep an agent would have to go, what drowns or burns. Keyed by scene, as WeatherQuery is, and answered at a synced server tick, so the server and a predicting client get the identical answer.
public static class WaterQuery
- Inheritance
-
WaterQuery
- Inherited Members
Remarks
Not SurfaceWater. That is the weather's view of the scene being drawn: global, with no
scene key (a scene server runs many scenes at once), and its sea moves with the frame's clock and its waves.
This answers from what both peers hold alike: the sea's SeaTide at a tick, and the scene's lakes
and rivers (SceneWaterBodies), which never move.
The sea is everywhere. A sea's level is returned at any place in its scene: whether the ground there stands above it is the caller's to compare, since a character knows its ground and this does not. A lake or a river stands only where it is, and the highest water over a place answers. An inland lake or river of lava (SurfaceWater.ILavaAreaSource) answers as Lava, as a lava sea does.
Methods
Clear()
public static void Clear()
HasWater(Scene)
True when scene has any water at all.
public static bool HasWater(Scene scene)
Parameters
sceneScene
Returns
RegisterInland(Scene, IAreaSource)
Lakes and rivers standing in scene.
public static void RegisterInland(Scene scene, SurfaceWater.IAreaSource inland)
Parameters
sceneSceneinlandSurfaceWater.IAreaSource
RegisterSea(Scene, ISeaLevel, bool)
The sea of scene: its tide, and whether it is lava.
public static void RegisterSea(Scene scene, ISeaLevel sea, bool lava)
Parameters
Sample(Scene, float, float, float, uint)
The water a height stands in or over at a place in scene at a synced server tick (2026-10-21): the
highest surface of the lakes and rivers whose floor lies under it (SurfaceWater.IStackedAreaSource), so a
swimmer in a cave's stream is not under a lava tube's river on the level over it. Positive infinity for
y is the highest over the place.
public static WaterSample Sample(Scene scene, float x, float y, float z, uint tick)
Parameters
Returns
Sample(Scene, float, float, uint)
The water over a place in scene at a synced server tick: the highest surface standing there.
public static WaterSample Sample(Scene scene, float x, float z, uint tick)
Parameters
Returns
Sample(Scene, Vector3)
The water a position stands in or over now (CurrentTick): for anything not predicted.
public static WaterSample Sample(Scene scene, Vector3 position)
Parameters
sceneScenepositionVector3
Returns
TryGetSea(Scene, out ISeaLevel, out bool)
The sea of scene, when it has one.
public static bool TryGetSea(Scene scene, out ISeaLevel sea, out bool lava)
Parameters
Returns
UnregisterInland(Scene, IAreaSource)
public static void UnregisterInland(Scene scene, SurfaceWater.IAreaSource inland)
Parameters
sceneSceneinlandSurfaceWater.IAreaSource
UnregisterSea(Scene, ISeaLevel)
public static void UnregisterSea(Scene scene, ISeaLevel sea)
Parameters
sceneSceneseaISeaLevel