A 3D Smoothed Particle Hydrodynamics (SPH) water simulation engine.

This is the three dimensional counterpart of the 2D FluidEngine. The simulation pipeline is identical to the 2D version:

  1. apply the external forces(gravity + shake disturbance) and predict positions
  2. rebuild the spatial hash(Grid3D) for the neighbour search
  3. calculate the density and near density of each particle
  4. calculate the pressure force
  5. calculate the viscosity force
  6. integrate the positions and resolve the box boundary collisions

The fluid is contained inside an axis aligned box volume [0,BoxSize.x] x [0,BoxSize.y] x [0,BoxSize.z] and gravity pulls the water toward the +Y face(the bottom of the container).