pub struct Deformation {
pub mode: DeformationMode,
pub weight: f32,
pub active: bool,
pub falloff: FalloffFunction,
pub falloff_center: Vec3,
pub falloff_radius: f32,
}Expand description
A single deformation with its parameters and time influence.
Fields§
§mode: DeformationMode§weight: f32Weight/intensity of this deformation (0 = off, 1 = full).
active: boolWhether the deformation is active.
falloff: FalloffFunctionFalloff function: distance from center of effect -> weight multiplier.
falloff_center: Vec3Center of the falloff region (in local space).
falloff_radius: f32Radius of the falloff region.
Implementations§
Source§impl Deformation
impl Deformation
Sourcepub fn new(mode: DeformationMode) -> Self
pub fn new(mode: DeformationMode) -> Self
Create a new deformation at full weight with no falloff.
Sourcepub fn with_weight(self, weight: f32) -> Self
pub fn with_weight(self, weight: f32) -> Self
Set the weight of this deformation.
Sourcepub fn with_falloff(
self,
center: Vec3,
radius: f32,
falloff: FalloffFunction,
) -> Self
pub fn with_falloff( self, center: Vec3, radius: f32, falloff: FalloffFunction, ) -> Self
Set a spherical falloff region.
Trait Implementations§
Source§impl Clone for Deformation
impl Clone for Deformation
Source§fn clone(&self) -> Deformation
fn clone(&self) -> Deformation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Deformation
impl RefUnwindSafe for Deformation
impl Send for Deformation
impl Sync for Deformation
impl Unpin for Deformation
impl UnsafeUnpin for Deformation
impl UnwindSafe for Deformation
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
Mutably borrows from an owned value. Read more
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.