class

FGpuFlip

FLIP water on the GPU: particles carry it, a MAC grid solves pressure with red-black Gauss-Seidel sweeps, the walls of the domain and the scene's colliders (a signed distance field per cell) bound it.

Module
GpuEcs
Header
#include "GpuEcs/GpuFlip.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
std::vector<Vec4>MakeBlockA block of water filling [boxMin, boxMax] (local), particlesPerAxis^3 jittered particles per cell.
std::vector<float>BuildSdfNegative inside the solids: the domain's one-cell rim and every obstacle.
boolCreate
boolUpdateSdf
boolRecord
boolRecordRecords one step with the parameters as they were when it was queued, so the render thread never reads what the game thread is editing.
boolStepImmediate
boolReadParticles
boolReadDivergence
boolReadDensity
boolReadDensityLatched
const FGpuFlipParams&Params
FGpuFlipParams&MutableParams
FGpuWorld&World

Function details

MakeBlock

C++
static std::vector<Vec4> MakeBlock(const FGpuFlipParams& params, const Vec3& boxMin, const Vec3& boxMax, uint32_t particlesPerAxis, uint32_t seed)

A block of water filling [boxMin, boxMax] (local), particlesPerAxis^3 jittered particles per cell.

BuildSdf

C++
static std::vector<float> BuildSdf(const FGpuFlipParams& params, const std::vector<FGpuFlipObstacle>& obstacles)

Negative inside the solids: the domain's one-cell rim and every obstacle.

Create

C++
bool Create(const FGpuFlipParams& params, const std::vector<Vec4>& particles, const std::vector<float>& sdf, uint32_t pressureSweeps, std::string* error = nullptr)

UpdateSdf

C++
bool UpdateSdf(const std::vector<float>& sdf)

Record

C++
bool Record(float dt)

Record

C++
bool Record(const FGpuFlipParams& snapshot)

Records one step with the parameters as they were when it was queued, so the render thread never reads what the game thread is editing.

StepImmediate

C++
bool StepImmediate(float dt)

ReadParticles

C++
bool ReadParticles(std::vector<Vec4>& positions, std::vector<Vec4>& velocities)

ReadDivergence

C++
bool ReadDivergence(std::vector<float>& before, std::vector<float>& after)

ReadDensity

C++
bool ReadDensity(std::vector<uint32_t>& density)

ReadDensityLatched

C++
bool ReadDensityLatched(std::vector<uint32_t>& density)

Params

C++
const FGpuFlipParams& Params() const

MutableParams

C++
FGpuFlipParams& MutableParams()

World

C++
FGpuWorld& World()
Generated from GpuEcs/GpuFlip.h via gpuecs.json · Oct 31, 2026Version 1.0.0