pub struct SolverConfig {
pub substeps: usize,
pub iterations: usize,
pub gravity: Vec3Fix,
pub damping: Fix128,
pub warm_start_factor: Fix128,
pub solver_backend: SolverBackend,
}Expand description
XPBD physics solver configuration
Fields§
§substeps: usizeNumber of substeps per frame
iterations: usizeNumber of constraint solver passes per substep (default 1 since 1.2.0,
Small Steps: prefer more substeps over more iterations)
gravity: Vec3FixGravity vector
damping: Fix128Global velocity-retention factor, applied once per frame (step()),
independent of substeps (1.0 = no damping). Before 1.2.0 it was applied
per substep, which made the result depend on substeps.
warm_start_factor: Fix128No effect since 1.2.0 (kept for struct compatibility).
Distance constraints follow standard XPBD (lambda = 0 at substep
start, accumulated over iterations) and contacts are re-detected every
substep and accumulate their multiplier within it, so there is no
previous-substep multiplier left to warm-start from. Before 1.2.0 the
factor biased both solvers and was the source of the iteration-dependent
stiffness (distance) and the energy-creating re-push (contact).
0.8〜0.95 が安定的。デフォルト 0.85。
solver_backend: SolverBackendWhich integrator PhysicsWorld::step dispatches to. Default
SolverBackend::Xpbd — selecting it is structurally a no-op (the
TGS dispatch branch is behind a runtime matches! check that is
never taken), so every existing caller that does not set this field
keeps today’s step behavior bit-for-bit. See SolverBackend for
the Tgs path’s documented gaps.
Trait Implementations§
Source§impl Clone for SolverConfig
impl Clone for SolverConfig
impl Copy for SolverConfig
Source§impl Debug for SolverConfig
impl Debug for SolverConfig
Source§impl Default for SolverConfig
impl Default for SolverConfig
impl Eq for SolverConfig
Source§impl PartialEq for SolverConfig
impl PartialEq for SolverConfig
impl StructuralPartialEq for SolverConfig
Auto Trait Implementations§
impl Freeze for SolverConfig
impl RefUnwindSafe for SolverConfig
impl Send for SolverConfig
impl Sync for SolverConfig
impl Unpin for SolverConfig
impl UnsafeUnpin for SolverConfig
impl UnwindSafe for SolverConfig
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