robb / RBBAnimation

Block-based animations made easy, comes with easing functions and a CASpringAnimation replacement.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implementation inconsistent with CASpringAnimation

lmcd opened this issue · comments

Not sure whether RBBSpringAnimation is less performant than its Apple-authored counterpart (animated CATransform3D transformations appear noticeably slower), or if the implementation is different.

My setup:

animation.velocity = 0.0;
animation.mass = 3.0;
animation.stiffness = 1000.0;
animation.damping = 500.0;

(these values were reverse engineered and pulled straight out of iOS 7)

This is probably because the high damping results in an overdamped osciallation which isn't modeled by CASpringAnimation, it seems just to use critical damping in those cases.

I'll add a flag to enable that behavior, until then choose your damping b for RBBSpringAnimation so that

eqn3355

i.e. for a mass m of 3 and a stiffness k of 1000 it should be

eqn3355-1

@robb Perfect!
Perhaps have overdamping off by default so we can have a 1:1 implementation with reproducible results. Otherwise, I can see this tripping up users expecting to use RBBSpringAnimation as a shim for CASpringAnimation.

yeah, totally