Skip to content

raisin::WaterFlowSource ​

struct · #include <rayrai/Water.hpp>

Where water enters or leaves a simulated body (WaterFlow::sources).

The water enters through a disc: every cell whose center lies in it gets an equal share, or the cell under the disc center when the disc holds no cell center.

Public attributes ​

position ​

cpp
glm::dvec2 position

World XY of the disc center, metres.

radius ​

cpp
float radius

Disc radius, metres, (0, 1e4].

flowRate ​

cpp
float flowRate

Volume per second, m^3/s (finite). A negative rate drains, at most the water the disc holds.

velocity ​

cpp
glm::vec2 velocity

Horizontal velocity of the entering water in the world frame, m/s (finite).

RaiSim — physics for robotics and AI.