[−][src]Struct salva3d::object::Fluid
A fluid object.
A fluid object is composed of movable particles with additional properties like viscosity.
Fields
positions: Vec<Point<N>>
The world-space position of the fluid particles.
velocities: Vec<Vector<N>>
The velocities of the fluid particles.
volumes: DVector<N>
The volume of the fluid particles.
density0: N
The rest density of this fluid.
viscosity: N
The viscosity coefficient of this fluid.
Methods
impl<N: RealField> Fluid<N>
[src]
pub fn new(
particle_positions: Vec<Point<N>>,
particle_radius: N,
density0: N,
viscosity: N
) -> Self
[src]
particle_positions: Vec<Point<N>>,
particle_radius: N,
density0: N,
viscosity: N
) -> 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 num_particles(&self) -> usize
[src]
The number of particles on this fluid.
pub fn particle_mass(&self, i: usize) -> N
[src]
The mass of the i
-th particle of this fluid.
pub fn particle_inv_mass(&self, i: usize) -> N
[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<N> Send for Fluid<N> where
N: Scalar,
N: Scalar,
impl<N> Sync for Fluid<N> where
N: Scalar,
N: Scalar,
impl<N> Unpin for Fluid<N> where
N: Scalar + Unpin,
N: Scalar + Unpin,
impl<N> UnwindSafe for Fluid<N> where
N: Scalar + UnwindSafe,
N: Scalar + UnwindSafe,
impl<N> RefUnwindSafe for Fluid<N> where
N: RefUnwindSafe + Scalar,
N: RefUnwindSafe + Scalar,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,