[−][src]Struct salva2d::LiquidWorld
The physics world for simulating fluids with boundaries.
Fields
counters: Counters
Performance counters of the whole fluid simulation engine.
Implementations
impl LiquidWorld
[src]
pub fn new(
solver: impl PressureSolver + 'static,
particle_radius: Real,
smoothing_factor: Real
) -> Self
[src]
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.
pub fn step(&mut self, dt: Real, gravity: &Vector<Real>)
[src]
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
)
[src]
&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.
pub fn add_fluid(&mut self, fluid: Fluid) -> FluidHandle
[src]
Add a fluid to the liquid world.
pub fn add_boundary(&mut self, boundary: Boundary) -> BoundaryHandle
[src]
Add a boundary to the liquid world.
pub fn remove_fluid(&mut self, handle: FluidHandle) -> Option<Fluid>
[src]
Add a fluid to the liquid world.
pub fn remove_boundary(&mut self, handle: BoundaryHandle) -> Option<Boundary>
[src]
Add a boundary to the liquid world.
pub fn fluids(&self) -> &FluidSet
[src]
The set of fluids on this liquid world.
pub fn fluids_mut(&mut self) -> &mut FluidSet
[src]
The mutable set of fluids on this liquid world.
pub fn boundaries(&self) -> &BoundarySet
[src]
The set of boundaries on this liquid world.
pub fn boundaries_mut(&mut self) -> &mut BoundarySet
[src]
The mutable set of boundaries on this liquid world.
pub fn h(&self) -> Real
[src]
The SPH kernel radius.
pub fn particle_radius(&self) -> Real
[src]
The radius of every particle on this liquid world.
Auto Trait Implementations
impl !RefUnwindSafe for LiquidWorld
[src]
impl !Send for LiquidWorld
[src]
impl !Sync for LiquidWorld
[src]
impl Unpin for LiquidWorld
[src]
impl !UnwindSafe for LiquidWorld
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,