pub struct ClothStack {
pub layers: Vec<ClothMaterial>,
}Expand description
A layered cloth setup: multiple material layers (e.g., shirt + jacket).
Fields§
§layers: Vec<ClothMaterial>Implementations§
Source§impl ClothStack
impl ClothStack
Sourcepub fn push(&mut self, mat: ClothMaterial)
pub fn push(&mut self, mat: ClothMaterial)
Push a material layer onto the stack.
Sourcepub fn effective_material(&self) -> ClothMaterial
pub fn effective_material(&self) -> ClothMaterial
Compute the blended effective material for the full stack.
Returns an average over all layers weighted equally.
If the stack is empty, returns a default ClothMaterial::new("empty").
Sourcepub fn total_surface_density(&self) -> f32
pub fn total_surface_density(&self) -> f32
Compute total surface density across all layers (kg/m²).
Sourcepub fn layer_count(&self) -> usize
pub fn layer_count(&self) -> usize
Number of layers in the stack.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClothStack
impl RefUnwindSafe for ClothStack
impl Send for ClothStack
impl Sync for ClothStack
impl Unpin for ClothStack
impl UnsafeUnpin for ClothStack
impl UnwindSafe for ClothStack
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> 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>
Converts
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>
Converts
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 more