9

for ActionScript there are quite a few "tweening" frameworks to facilitate animating objects. for example TweenLite: http://www.greensock.com/tweenlite/

it allows to animate an arbitrary object with a single line of code:

Pseudocode: tween(myObject, 3.0f, {xpos:300});

what this line of code does is instanciating a new tweening object, which will step by step, during 3 seconds, animate the "xpos" property of 'myObject' from whatever value it currently has to 300. additionally it allows to use a variaty of different interpolation functions.

So in order to animate an object to a new point, i can write a single line of code and forget about it (the tweening object will destroy itself once it finished animating the value).

My Question is, whether there is anything comparable for c++?

I know that those languages are completely different. Anyway - i think it should be possible and would be highly convenient so if anyone knows a framework that does the trick, would be welcome :)

thanks!

skaffman
  • 398,947
  • 96
  • 818
  • 769
Mat
  • 841
  • 1
  • 9
  • 5

2 Answers2

5

I have stumbled upon libClaw's tweeners, and it looks promising - well documented, pretty mature and more or less alive.

I'm not sure I like the fact that it operates on doubles only whereas I would need it primarily for floats and sometimes ints, but I don't think the double calculation and casting performance penalty should be too big...

nietaki
  • 8,758
  • 2
  • 45
  • 56
3

How about cpptweener. Of course which is ported from the awesome as3 tweener library.

Ryan Christensen
  • 7,843
  • 1
  • 27
  • 25
  • It's looks like the cpptweener has a lot of bugs and don't works some times – peko Feb 02 '11 at 14:05
  • Just look at comments to the function Quad::easeInOut in http://code.google.com/p/cpptweener/source/browse/trunk/src/CppTweener.cpp :) Undefined behavior almost everywhere... – fdermishin Apr 09 '14 at 14:49