Skip to main content

SoftRecoverySettings

Struct SoftRecoverySettings 

Source
pub struct SoftRecoverySettings {
Show 27 fields pub authored_velocity_margin: bool, pub edge_speculation: bool, pub inverted_cell_detection: bool, pub self_crossing_detection: bool, pub detection_motion_gating: bool, pub cross_body_detection: bool, pub self_stand_down: bool, pub cross_body_expel_gate: bool, pub edge_stand_down: bool, pub crossing_repulsion: bool, pub crossing_repulsion_guide: bool, pub crossing_repulsion_self_guide: bool, pub recovery_pace: f32, pub overlap_constraints: bool, pub overlap_rigid: bool, pub overlap_skip_self_tangled: bool, pub overlap_edge_stand_down: bool, pub overlap_constraint_pace: f32, pub overlap_patch_constraints: SoftPatchConstraints, pub overlap_skin_volume: bool, pub overlap_kept_depth: f32, pub overlap_self_regions: bool, pub overlap_normal_push: bool, pub overlap_multi_volume: bool, pub overlap_split: u32, pub overlap_patience: u32, pub overlap_progress_margin: f32,
}
Expand description

Runtime configuration of the soft-body tangle detection and recovery stack. It lives on crate::dynamics::SoftBodiesSettings::recovery (itself on IntegrationParameters::soft_bodies), so it can be changed between steps.

Fields§

§authored_velocity_margin: bool

Raise the speculative contact margin from velocities authored between steps (insertion, set_particle_velocity), so the coming step’s reach covers them and a fast fresh body does not tunnel. (default: true)

§edge_speculation: bool

Give the edge-vs-edge pass a speculative reach (motion margin plus the closing-speed rule) and, in 3D, edge constraints for closed-vs-closed pairs, so bodies crossing corner-first collide; on, those constraints leave pressed 3D piles crossed. (default: false)

§inverted_cell_detection: bool

Detect inverted cells (material locally inside out) each step; feeds the self stand-down. (default: true)

§self_crossing_detection: bool

Detect surface self-crossings each step (the BVTT sweep); feeds the self stand-down. (default: true)

§detection_motion_gating: bool

Skip the self-crossing sweep while the surface’s accumulated travel could not have bridged half a skin (crossings only form through motion). Off: sweep every step. (default: true)

§cross_body_detection: bool

Detect boundary crossings between pairs of soft surfaces; feeds the cross-body expel-only gate, the edge-pass stand-down and the intersection-volume constraints. (default: true)

§self_stand_down: bool

Self contacts of tangled features (inverted cells, self-crossings) stand down so the elasticity resolves the tangle instead of freezing it at skin distance. (default: true)

§cross_body_expel_gate: bool

A vertex constraint touching a boundary crossing between two surfaces may only expel, never hold (a keep-apart constraint there is wrong-sided by construction). (default: true)

§edge_stand_down: bool

Edge constraints touching a cross-body boundary crossing stand down (thin open bodies meet through their edge constraints, so the vertex gate alone cannot free them). (default: true)

§crossing_repulsion: bool

Constraints on crossing-flagged features repel instead of standing down: the vertex is pushed to the side of the element where its one-ring centroid lies, through to skin distance; a neighborhood straddling the element still stands down. (default: false)

§crossing_repulsion_guide: bool

Guide the crossing repulsion by the pair’s volume normal (the separating direction of the two intruding patches’ intersection-volume gradients, per grid cell) instead of the pierced element’s plane normal. Closed pairs only; needs no volume constraint. (default: false)

§crossing_repulsion_self_guide: bool

Guide the self-crossing repulsion by the fold’s volume normal: the vertices inside their own body’s self-intersection region are pulled toward the surface they face along the region’s mean normal. Closed meshes only; needs no volume constraint. (default: false)

§recovery_pace: f32

Material recovery pace, in length units per second (scaled by IntegrationParameters::length_unit): the corrective rate allowed to deep recovery, demoted intruders and untangling pulls. (default: 0.5)

§overlap_constraints: bool

Intersection-volume contact (Allard et al. 2010) for closed surfaces: one coupled constraint per overlapping pair (soft-soft or soft-rigid) over both sides’ intruding patches, corrected by the intersection volume; master switch of the knobs below. (default: true)

§overlap_rigid: bool

Overlap constraints against rigid colliders too (the surface vertices inside the shape; a dynamic rigid body takes the reaction, a fixed or kinematic one is a wall). (default: true)

§overlap_skip_self_tangled: bool

A self-crossed mesh takes no pair constraint: part of its winding is mirrored, so its volume gradient points the wrong way there (two crossed eights exploded without this). (default: true)

§overlap_edge_stand_down: bool

The 3D closed-closed edge constraints stand down on a pair an overlap constraint owns (inside the overlap they are wrong-sided and freeze it). (default: true)

§overlap_constraint_pace: f32

Bound on the velocity change the coupled constraint may hand any side per step, in multiples of Self::recovery_pace; Real::MAX makes it hard. (default: 1.0)

§overlap_patch_constraints: SoftPatchConstraints

What the per-point constraints (manifold constraints against rigid colliders, vertex constraints against soft surfaces) of the features inside a volume constraint’s patch do, feature by feature (see SoftPatchConstraints). (default: AlongNormal)

§overlap_skin_volume: bool

Measure the intersection volume on the contact skins (surfaces dilated by their skin), not the geometric surfaces: a resting pair then has a hard volume constraint with speculative slack before the skins meet. (default: false)

§overlap_kept_depth: f32

The skin overlap kept at rest, as a fraction of the pair’s skins (the paper’s maintained interpenetration layer): the correction removes only the volume beyond it, holding the patch’s average depth there; 0.0 rests the surfaces at their skins. (default: 0.0)

§overlap_self_regions: bool

Volume constraints on a body’s self-overlaps between distinct surface regions: the vertices behind another part of their own surface form one patch per connected region, each coupled with the surface it faces like a pair of bodies. Closed meshes only. (default: false)

§overlap_normal_push: bool

Push along each constraint’s normal instead of the volume gradients: every entry keeps its gradient’s magnitude but takes the constraint’s mean direction, so the whole patch separates along one axis. (default: true)

§overlap_multi_volume: bool

Multi-volume grid (the paper’s section 5): each pair’s patch is split into a regular grid of cells along its tangent axes, each with its own constraint and multiplier, so the pressure and friction state vary across the patch. (default: false)

§overlap_split: u32

Cells per tangent axis of the multi-volume grid. (default: 3)

§overlap_patience: u32

Steps without progress of a pair’s volume estimate before its positional correction stands down (a wedged pair jiggled forever otherwise); it re-arms when the estimate drops again. (default: 240)

§overlap_progress_margin: f32

Relative drop of the estimate that counts as progress for the patience. (default: 0.02)

Trait Implementations§

Source§

impl Clone for SoftRecoverySettings

Source§

fn clone(&self) -> SoftRecoverySettings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SoftRecoverySettings

Source§

impl Debug for SoftRecoverySettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for SoftRecoverySettings

Source§

fn default() -> SoftRecoverySettings

Returns the “default value” for a type. Read more
Source§

impl PartialEq for SoftRecoverySettings

Source§

fn eq(&self, other: &SoftRecoverySettings) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SoftRecoverySettings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromTemplate for T
where T: Clone + Default + Unpin,

Source§

type Template = T

The Template for this type.
Source§

impl<T> FromWorld for T
where T: Default,

Source§

fn from_world(_world: &mut World) -> T

Creates Self using default().

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> Template for T
where T: Clone + Unpin,

Source§

type Output = T

The type of value produced by this Template.
Source§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a Template::Output.
Source§

fn clone_template(&self) -> T

Clones this template. See Clone.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of self.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more