[−][src]Struct salva2d::object::Fluid
A fluid object.
A fluid object is composed of movable particles with additional properties like viscosity.
Fields
nonpressure_forces: Vec<Box<dyn NonPressureForce>>
Nonpressure forces this fluid is subject to.
positions: Vec<Point<Real>>
The world-space position of the fluid particles.
velocities: Vec<Vector<Real>>
The velocities of the fluid particles.
accelerations: Vec<Vector<Real>>
The accelerations of the fluid particles.
volumes: Vec<Real>
The volume of the fluid particles.
density0: Real
The rest density of this fluid.
Implementations
impl Fluid
[src]
pub fn new(
particle_positions: Vec<Point<Real>>,
particle_radius: Real,
density0: Real
) -> Self
[src]
particle_positions: Vec<Point<Real>>,
particle_radius: Real,
density0: Real
) -> Self
Initializes a new fluid object with the given particle positions, particle radius, density, and viscosity.
The particle radius should be the same as the radius used to initialize the liquid world.
pub fn delete_particle_at_next_timestep(&mut self, particle: usize)
[src]
Mark the given particle to be deleted at the next timestep.
pub fn num_deleted_particles(&self) -> usize
[src]
The number of particles that will be deleted at the next timestep.
pub fn deleted_particles_mask(&self) -> &[bool]
[src]
The mask of particles that will be deleted at the next timestep.
pub fn particle_radius(&self) -> Real
[src]
The radius of this fluid's particles.
pub fn default_particle_volume(&self) -> Real
[src]
The default volume given to each of this fluid's particles.
pub fn add_particles(
&mut self,
positions: &[Point<Real>],
velocities: Option<&[Vector<Real>]>
)
[src]
&mut self,
positions: &[Point<Real>],
velocities: Option<&[Vector<Real>]>
)
Add a set of particles to this fluid.
If velocities
is None
the velocity of each particle will be initialized at zero.
If it is not None
, then it must be a slice with the same length than positions
.
pub fn z_sort(&mut self)
[src]
Sorts all the particles of this fluids according to morton order.
pub fn transform_by(&mut self, t: &Isometry<Real>)
[src]
Apply the given transformation to each particle of this fluid.
pub fn num_particles(&self) -> usize
[src]
The number of particles on this fluid.
pub fn particle_mass(&self, i: usize) -> Real
[src]
The mass of the i
-th particle of this fluid.
pub fn particle_inv_mass(&self, i: usize) -> Real
[src]
The inverse mass of the i
-th particle of this fluid.
Returns 0 if the i
-th particle has a zero mass.
Auto Trait Implementations
impl !RefUnwindSafe for Fluid
impl Send for Fluid
impl Sync for Fluid
impl Unpin for Fluid
impl !UnwindSafe for Fluid
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>,