pub struct SoftBodyParticle { /* private fields */ }Expand description
One particle (point mass) of a soft body: plain state owned by its
crate::dynamics::SoftBody, given its own solver body for the step when the body is awake.
A pinned particle (inv_mass == 0) is kinematic: it moves at its velocity or toward its target.
Implementations§
Source§impl SoftBodyParticle
impl SoftBodyParticle
Sourcepub fn force(&self) -> Vector
pub fn force(&self) -> Vector
The user force currently applied to this particle (see crate::dynamics::SoftBody::add_particle_force).
Sourcepub fn kinematic_target(&self) -> Option<Vector>
pub fn kinematic_target(&self) -> Option<Vector>
The position a pinned particle is moving to over the next step, if one was set with
crate::dynamics::SoftBody::set_particle_kinematic_target.
Sourcepub fn rest_position(&self) -> Vector
pub fn rest_position(&self) -> Vector
The position of this particle in the rest shape (relative to the rest center of mass).
With a plastic material the rest shape follows the elements’ flow (see
SoftBodyMaterial::plastic_yield); Self::initial_rest_position predates any flow.
Sourcepub fn initial_rest_position(&self) -> Vector
pub fn initial_rest_position(&self) -> Vector
The position of this particle in the soft body’s rest shape before any plastic flow (its position at insertion, relative to the rest center of mass).
Sourcepub fn is_pinned(&self) -> bool
pub fn is_pinned(&self) -> bool
Whether this particle is pinned (infinite mass, moved kinematically).
Sourcepub fn is_damaged(&self) -> bool
pub fn is_damaged(&self) -> bool
Whether an element touching this particle has torn (or crate::dynamics::SoftBody::set_particle_damaged
marked it). The elements around a damaged particle lose the interior strength of
SoftBodyMaterial::interior_strength: a tear runs on from where it started.
Sourcepub fn is_on_surface(&self) -> bool
pub fn is_on_surface(&self) -> bool
Whether this particle is a vertex of the body’s surface (a boundary segment in 2D, a
boundary triangle in 3D). An element whose particles are all interior gets the material’s
SoftBodyMaterial::interior_strength.
Trait Implementations§
Source§impl Clone for SoftBodyParticle
impl Clone for SoftBodyParticle
Source§fn clone(&self) -> SoftBodyParticle
fn clone(&self) -> SoftBodyParticle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SoftBodyParticle
Auto Trait Implementations§
impl Freeze for SoftBodyParticle
impl RefUnwindSafe for SoftBodyParticle
impl Send for SoftBodyParticle
impl Sync for SoftBodyParticle
impl Unpin for SoftBodyParticle
impl UnsafeUnpin for SoftBodyParticle
impl UnwindSafe for SoftBodyParticle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSync for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.