[][src]Struct salva3d::object::Fluid

pub struct Fluid<N: RealField> {
    pub positions: Vec<Point<N>>,
    pub velocities: Vec<Vector<N>>,
    pub volumes: DVector<N>,
    pub density0: N,
    pub viscosity: N,
}

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]

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

impl<N> Sync for Fluid<N> where
    N: Scalar

impl<N> Unpin for Fluid<N> where
    N: Scalar + Unpin

impl<N> UnwindSafe for Fluid<N> where
    N: Scalar + UnwindSafe

impl<N> RefUnwindSafe for Fluid<N> where
    N: RefUnwindSafe + Scalar

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,