|
numerics
|
3D SPH fluid simulation – hose demo with scene rotation More...
#include "raylib.h"#include "raymath.h"#include "fluid3d.hpp"#include <cmath>#include <algorithm>Go to the source code of this file.
Classes | |
| struct | Hose |
Functions | |
| int | main () |
3D SPH fluid simulation – hose demo with scene rotation
Two water jets aimed at the centre of the domain: H – toggle hot hose (top-left corner, 80 degC) C – toggle cold hose (top-right corner, 5 degC)
Arrow keys orbit the camera AND physically tilt the scene so that gravity always points along the camera's "down" direction. Particles therefore fall toward whichever wall is currently at the bottom of the screen.
Controls: H / C – hot / cold hose on-off Arrow keys – rotate scene (gravity tilts with pitch) SPACE – pause / resume R – reset (clear particles, keep hose state)
Definition in file main.cpp.
| int main | ( | ) |
Definition at line 131 of file main.cpp.
References Hose::active, physics::FluidSolver3D::clear(), physics::FluidParams3D::dt, Hose::emit(), physics::FluidParams3D::gx, Hose::init(), physics::FluidSolver3D::max_temp(), physics::FluidSolver3D::min_temp(), physics::FluidSolver3D::params(), physics::FluidSolver3D::params_mut(), physics::FluidSolver3D::particles(), Hose::pos(), and physics::FluidSolver3D::step().