Example #1
0
 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);
 }
Example #2
0
 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);
 }