[][src]Struct salva2d::object::Boundary

pub struct Boundary<N: RealField> {
    pub positions: Vec<Point<N>>,
    pub velocities: Vec<Vector<N>>,
    pub volumes: Vec<N>,
    pub forces: Option<RwLock<Vec<Vector<N>>>>,
}

A boundary object.

A boundary object is composed of static particles, or of particles coupled with non-fluid bodies.

Fields

positions: Vec<Point<N>>

The world-space position of the boundary particles.

velocities: Vec<Vector<N>>

The artificial velocities of each boundary particle.

volumes: Vec<N>

The volume computed for each boundary particle.

forces: Option<RwLock<Vec<Vector<N>>>>

The forces applied to each particle of this boundary object. If this is set to None (which is the default), the boundary won't receive any force for fluids.

Methods

impl<N: RealField> Boundary<N>[src]

pub fn new(particle_positions: Vec<Point<N>>) -> Self[src]

Initialize a boundary object with the given particles.

pub fn num_particles(&self) -> usize[src]

The number of particles of this boundary object.

pub fn transform_by(&mut self, pose: &Isometry<N>)[src]

Transforms all the particle positions of this boundary by the given isometry.

pub fn apply_force(&self, i: usize, f: Vector<N>)[src]

Apply a force f to the i-th particle of this boundary object.

This call relies on thread-safe interior mutability.

pub fn clear_forces(&mut self, resize_buffer: bool)[src]

Clears all the forces applied to this boundary object's particles.

Auto Trait Implementations

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

impl<N> Send for Boundary<N> where
    N: Scalar

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

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

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

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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<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<V, T> VZip<V> for T where
    V: MultiLane<T>,