kBezierSpringBuilder function
SpringDescription
kBezierSpringBuilder({
- required IndicatorMode mode,
- required double offset,
- required double actualTriggerOffset,
- required double velocity,
Spring used by bezier curves.
Implementation
physics.SpringDescription kBezierSpringBuilder({
required IndicatorMode mode,
required double offset,
required double actualTriggerOffset,
required double velocity,
}) {
double mass = 6 + (offset - actualTriggerOffset) / 36;
double damping = 0.75 + velocity.abs() / 10000;
double stiffness = 1000 + velocity.abs() / 6;
return physics.SpringDescription(
mass: mass,
stiffness: stiffness,
damping: damping,
);
}