Skip to content

raisin::WaterFlowSample ​

struct · #include <rayrai/Water.hpp>

Simulated water at one horizontal position (RayraiWindow::sampleWaterFlow()).

Moving bodies are not part of the bed it reports. Where one stands or floats in the water the sample holds the water around it: the surface and velocity of the nearest water the moving bodies leave uncovered and the depth of that surface over the bed below the body, so a body can sample the water it sits in to apply buoyancy and drag.

Public attributes ​

inside ​

cpp
bool inside

The position lies within a simulated body.

wet ​

cpp
bool wet

The water there is deeper than 1 mm.

surfaceHeight ​

cpp
double surfaceHeight

World z of the water surface (the bed where dry), metres.

bedHeight ​

cpp
double bedHeight

World z of the bed without the moving bodies, metres.

depth ​

cpp
double depth

Water depth, metres.

velocity ​

cpp
glm::dvec2 velocity

Depth-averaged horizontal velocity in the world frame, m/s.

timeSeconds ​

cpp
double timeSeconds

Water time of the simulated state sampled; it trails the last render by a frame or two.

RaiSim — physics for robotics and AI.