pub struct ClothConfig {
pub iterations: usize,
pub substeps: usize,
pub gravity: Vec3Fix,
pub damping: Fix128,
pub stretch_compliance: Fix128,
pub bend_compliance: Fix128,
pub sdf_friction: Fix128,
pub thickness: Fix128,
pub self_collision: bool,
pub self_collision_distance: Fix128,
}Expand description
Cloth simulation configuration
Fields§
§iterations: usizeSolver iterations per substep
substeps: usizeNumber of substeps per step
gravity: Vec3FixGravity vector
damping: Fix128Velocity retention per frame (step() call), applied once per frame since 1.2.0
stretch_compliance: Fix128Stretch constraint compliance (0 = rigid edges)
bend_compliance: Fix128Bending constraint compliance (higher = more flexible)
sdf_friction: Fix128SDF collision friction
thickness: Fix128Cloth thickness for collision
self_collision: boolEnable self-collision
Covers the proximity passes (vertex-vs-face and edge-vs-edge) and the frame-level
repair of tunnelling: vertex chords that pierced a triangle, and edge pairs that met
inside the frame and ended on the far side of where edge a started (a swept test,
resolve_self_contact_over_frame). ⚠️ The edge-edge repair triggers only on a
completed crossing (gap < 0); a pair that met and separated again on its own
side is left to the proximity pass. Two parallel (or, in Fix128, numerically
parallel) edges are left to the vertex-face pass — see closest_points_on_segments.
remaining_self_contact_crossings counts the same two kinds of event.
self_collision_distance: Fix128Contact thickness: a vertex is kept at least this far from every non-incident triangle
Trait Implementations§
Source§impl Clone for ClothConfig
impl Clone for ClothConfig
impl Copy for ClothConfig
Source§impl Debug for ClothConfig
impl Debug for ClothConfig
Source§impl Default for ClothConfig
impl Default for ClothConfig
impl Eq for ClothConfig
Source§impl PartialEq for ClothConfig
impl PartialEq for ClothConfig
impl StructuralPartialEq for ClothConfig
Auto Trait Implementations§
impl Freeze for ClothConfig
impl RefUnwindSafe for ClothConfig
impl Send for ClothConfig
impl Sync for ClothConfig
impl Unpin for ClothConfig
impl UnsafeUnpin for ClothConfig
impl UnwindSafe for ClothConfig
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> 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 more