1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/// Default liquid rest density in `kg/m^3` (pure water at 20 degrees Celsius).
pub const SPH_DEFAULT_REST_DENSITY: f32 = 1000.0;
/// Default gravitational acceleration vector Y component in `m/s^2`.
pub const SPH_DEFAULT_GRAVITY_Y: f32 = -9.806_65;
/// Default pre-allocated particle capacity for `SphLiquidSolver3D`.
pub const SPH_DEFAULT_MAX_PARTICLES: usize = 2048;
/// Default power-of-two spatial hash bucket count for O(N) neighbor queries.
pub const SPH_DEFAULT_HASH_TABLE_SIZE: usize = 4096;
/// Default smoothing radius `h` in meters for 3D PBF liquid simulation.
pub const SPH_DEFAULT_SMOOTHING_RADIUS_3D: f32 = 0.20;
/// Default smoothing radius `h` in meters for 2D PBF liquid simulation.
pub const SPH_DEFAULT_SMOOTHING_RADIUS_2D: f32 = 0.125;
/// Maximum cached neighbor particle indices stored per particle in the flat zero-alloc table.
pub const SPH_MAX_NEIGHBORS: usize = 64;
/// Maximum per-call time step clamped for numerical stability in seconds.
pub const SPH_MAX_DT_SECS: f32 = 0.033_333;
/// Maximum PBF position correction magnitude per Jacobi iteration expressed as a fraction of `h`.
pub const SPH_MAX_DELTA_POS_RATIO: f32 = 0.35;
/// Spatial hash prime multiplier for integer cell X coordinate.
pub const SPH_HASH_PRIME_X: u32 = 73_856_093;
/// Spatial hash prime multiplier for integer cell Y coordinate.
pub const SPH_HASH_PRIME_Y: u32 = 19_349_663;
/// Spatial hash prime multiplier for integer cell Z coordinate.
pub const SPH_HASH_PRIME_Z: u32 = 83_492_791;
/// Default deterministic PRNG seed for particle spawn jitter and emitter dispersion.
pub const SPH_DEFAULT_SEED: u64 = 0x5048_3344_0056_0001;