public void Update() { CurrentVelocity += AmortizedImpulse * Time.deltaTime; AmortizedImpulse = Vector3.Lerp(AmortizedImpulse, Vector3.zero, 1.0f - Mathf.Pow(ImpulseFalloff, Time.deltaTime)); MathExts.SpringDamperTo(CurrentValue, CurrentVelocity, TargetValue, Damping, Strength, Time.deltaTime, out CurrentValue, out CurrentVelocity); }
public void Update() { foreach (var eulerAngles in ThrottledImpulses.Update()) { AmortizedImpulse += eulerAngles; } CurrentVelocity += AmortizedImpulse * Time.deltaTime; AmortizedImpulse = Vector3.Lerp(AmortizedImpulse, Vector3.zero, 1.0f - Mathf.Pow(ImpulseFalloff, Time.deltaTime)); MathExts.SpringDamperTo(CurrentValue, CurrentVelocity, TargetValue, Damping, Strength, Time.deltaTime, out CurrentValue, out CurrentVelocity); }