pub struct Cloth {Show 14 fields
pub width: f32,
pub height: f32,
pub segments: i32,
pub pin: ClothPin,
pub stiffness: f32,
pub damping: f32,
pub gravity_scale: f32,
pub wind: Vec3,
pub gust: f32,
pub drag: f32,
pub tear: f32,
pub collide_ground: bool,
pub ground_y: f32,
pub collide_objects: bool,
/* private fields */
}Expand description
Verlet cloth attached to an entity. Structural edits rebuild the particle grid; wind and other simulation controls can change while running.
Fields§
§width: f32Rest width of the sheet in metres.
height: f32Rest height of the sheet in metres.
segments: i32Particles along the width (more = finer folds, slower).
pin: ClothPinBoundary particles fixed to the entity transform.
stiffness: f320..1: how rigid the cloth is (solver iterations).
damping: f32Per-step motion damping; values near zero retain motion.
gravity_scale: f32Multiplier of the cloth solver gravity.
wind: Vec3World-space wind velocity acting on triangle surfaces.
gust: f32How much the wind varies in space and time (0 = steady).
drag: f32Air resistance of the surface.
tear: f32Links snap when stretched past this multiple of their length (0 = never tear).
collide_ground: boolWhether particles collide with the horizontal ground plane.
ground_y: f32World-space height of the optional ground plane.
collide_objects: boolCollide with Sphere and Box colliders in the scene.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cloth
impl<'de> Deserialize<'de> for Cloth
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Cloth
impl RefUnwindSafe for Cloth
impl Send for Cloth
impl Sync for Cloth
impl Unpin for Cloth
impl UnsafeUnpin for Cloth
impl UnwindSafe for Cloth
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.