pub struct SpringConfig {
pub stiffness: f32,
pub damping: f32,
pub mass: f32,
pub rest_eps: f32,
}Expand description
物理弹簧刚度、阻尼与质量参数配置。
Fields§
§stiffness: f32弹簧刚度系数 k(越大响应越迅速,默认 220.0)。
damping: f32阻尼系数 c(越大过冲越少,默认 24.0)。
mass: f32振子质量 m(越大惯性越强,默认 1.0)。
rest_eps: f32静止收敛阈值(位移差与速度均小于此阈值后锁定在目标值并进入 0% CPU 休眠)。
Implementations§
Source§impl SpringConfig
impl SpringConfig
Trait Implementations§
Source§impl Clone for SpringConfig
impl Clone for SpringConfig
impl Copy for SpringConfig
Source§impl Debug for SpringConfig
impl Debug for SpringConfig
Auto Trait Implementations§
impl Forget for SpringConfig
impl Freeze for SpringConfig
impl Move for SpringConfig
impl RefUnwindSafe for SpringConfig
impl Send for SpringConfig
impl Sync for SpringConfig
impl Unpin for SpringConfig
impl UnsafeUnpin for SpringConfig
impl UnwindSafe for SpringConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。