Real-time fluid physics library The goal was to create a physics library, specialized on water fluid physics, for real-time applications.
Why? • Water motion is appealing and it should be possible to use it more in games for enhanced experience. • A physics-based system is needed to enable interaction between solid objects and fluid.
What is it? • Real-time • 3D motion integrator • Solid object/fluid interactor (currently support for liquid)
But it's not: • Not a simulator • Not a graphics renderer
Capabilities • Colliding contacts • Volume determination • Buoyancy forces • Drag forces
How is it done? • Mesh/mesh collision detection • Uses OPCODE library • Collision resolving • Time step bisection (to specified resolution) • Computes closest contacts before • Best effort contacts • Impulse
How is it done? • Buoyancy/drag forces • Archimedes’ principle: F = ρ * V * g • Volume approximation • Numerical integration • Drag force: F = -ρ * v o v * A * c / 2 * v / |v| • Area approximation • Liquid dynamics • Wave equation: • ∂2h / ∂t2 = v2 * (∂2h / ∂x2 + ∂2h / ∂z2) • Mass conservation: ∂m / ∂t = 0
Extendable? • Mesh loaders • Integrators • Fluid kernels