Skip to main content

gizmo_physics_core/components/
fluid.rs

1use gizmo_math::Vec3;
2
3#[derive(Debug, Clone)]
4#[non_exhaustive]
5pub struct FluidSimulation {
6    pub target_density: f32,
7    pub pressure_multiplier: f32,
8    pub viscosity: f32,
9    pub particle_radius: f32,
10    pub bounds_min: Vec3,
11    pub bounds_max: Vec3,
12}
13
14impl Default for FluidSimulation {
15    fn default() -> Self {
16        Self {
17            target_density: 1000.0,
18            pressure_multiplier: 100.0,
19            viscosity: 0.01,
20            particle_radius: 0.1,
21            bounds_min: Vec3::new(-10.0, 0.0, -10.0),
22            bounds_max: Vec3::new(10.0, 10.0, 10.0),
23        }
24    }
25}
26
27gizmo_core::impl_component!(FluidSimulation);