#How to change constants for Transition Types

3 messages · Page 1 of 1 (latest)

hexed vapor
#

When using Tweens, the transition types Elastic, Bounce, Back, and Spring purportedly have constants in their equations. (E.g. controlling how far the value will Spring past the target value.) How do I modify these constants, either on a case-by case basis or globally in the project?

Example from easings.net for Elastic:

const c4 = (2 * Math.PI) / 3;

return x === 0
  ? 0
  : x === 1
  ? 1
  : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1;
}```
pulsar yoke
#

Write your own?

hexed vapor
#

I mean sure, but I’m wondering if there’s any access to the constants. If i wrote my own I’d want to extend the tween classes with c++ and that’d be a whole thing.