Struct salva3d::LiquidWorld [−][src]
pub struct LiquidWorld { pub counters: Counters, // some fields omitted }
Expand description
The physics world for simulating fluids with boundaries.
Fields
counters: Counters
Performance counters of the whole fluid simulation engine.
Implementations
pub fn new(
solver: impl PressureSolver + 'static,
particle_radius: Real,
smoothing_factor: Real
) -> Self
pub fn new(
solver: impl PressureSolver + 'static,
particle_radius: Real,
smoothing_factor: Real
) -> Self
Initialize a new liquid world.
Parameters
particle_radius
: the radius of every particle on this world.smoothing_factor
: the smoothing factor used to compute the SPH kernel radius. The kernel radius will be computed as `particle_radius * smoothing_factor * 2.0.
Advances the simulation by dt
milliseconds.
All the fluid particles will be affected by an acceleration equal to gravity
.
pub fn step_with_coupling(
&mut self,
dt: Real,
gravity: &Vector<Real>,
coupling: &mut impl CouplingManager
)
pub fn step_with_coupling(
&mut self,
dt: Real,
gravity: &Vector<Real>,
coupling: &mut impl CouplingManager
)
Advances the simulation by dt
milliseconds, taking into account coupling with an external rigid-body engine.
Add a fluid to the liquid world.
Add a boundary to the liquid world.
Add a fluid to the liquid world.
Add a boundary to the liquid world.
The mutable set of fluids on this liquid world.
The set of boundaries on this liquid world.
The mutable set of boundaries on this liquid world.
The radius of every particle on this liquid world.
Auto Trait Implementations
impl !RefUnwindSafe for LiquidWorld
impl !Send for LiquidWorld
impl !Sync for LiquidWorld
impl Unpin for LiquidWorld
impl !UnwindSafe for LiquidWorld
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.