mindsnacks/moai-dev — pull request #20 by aab29 (2013-05-30 20:52:41+00:00)
Title: [WIP, but there's just one thing] - MOAIAnimCurveCustom

```MOAIAnimCurve``` doesn't have many ease functions. In fact, they're almost all just variations on ```powf(t, rate)```. That sucks. :spaghetti:

We could just add our own ease types in C++, but that's not very flexible. So here's ```MOAIAnimCurveCustom```. It's just like ```MOAIAnimCurve```, but it allows you to define a lua function (using ```curve:setCallback(easeFunction)```) that will be used for all interpolation by the curve. :curly_loop:

This will let us define a library of lua eases to use with ```ease()``` in the ActionHelpers. :smoking:

I haven't noticed any slowdown compared to using regular ```MOAIAnimCurve```, even with a bunch of eases running simultaneously, but that's something that we should be watching out for if we start having performance problems. :bread:

I should note that this is all based off my brother's work: https://github.com/IkeBart/moai-dev/commit/2e3071931da3e9ac6460645d60311857be150738

------------------------------------------

The one thing that isn't done here has to do with the fact that I don't remember C++. I'm getting a compiler warning because apparently I don't know how to do inheritance right.

MOAIAnimCurve.h:46: 'virtual void MOAIAnimCurve::GetValue(MOAIAttrOp&, const MOAIAnimKeySpan&)' was hidden
MOAIAnimCurveCustom.h:29: By 'virtual float MOAIAnimCurveCustom::GetValue(const MOAIAnimKeySpan&)'

I want ```MOAIAnimCurveCustom``` to be just like ```MOAIAnimCurve```, except that when it calls ```GetValue(const MOAIAnimKeySpan&)```, I want it to use its own method. That's all. Can anyone tell me what I'm doing wrong? :question:

Also, I had to remove a lot of ```const``` declarations on functions all over ```MOAIAnimCurveBase``` and its subclasses in order to get ```GetValue(const MOAIAnimKeySpan&)``` to reference its own ```mCallback```. Does anyone know of a better way to do this? :question: