Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added linear easing to animations.
Very useful when you want to create e.g. a continuous rotating graph. Now you
can do:

var n = 0;
var duration = 1000;
var spin = function() {
  mathbox.animate('surface', { worldRotation: [0, 0, n++ * τ] }, { duration: duration, ease: 'linear' });
  setTimeout(spin, duration);
};
spin();

For a continuous spin. I'd still like to see better support for this, but full
support would require allowing properties (such as worldRotation above) to be
functions that return the new result instead of being values.
  • Loading branch information
So8res committed Jan 30, 2013
commit 9f723e34cb0dd3a6d2003cb19f7e73a555ec9186
3 changes: 3 additions & 0 deletions src/Animator.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ MathBox.Animator.Animation.prototype = {
case 'out':
rolloff = fraction * fraction;
break;
case 'linear':
rolloff = fraction;
break;
default:
rolloff = .5-.5*Math.cos(fraction * π);
break;
Expand Down