I also don't like that way of thinking :)
Performance for me is very important. That's why v3.0 is about 10x faster in the rendering, and about 3x faster on visit, etc, compared to v2.
And the engine should be (among other things):
- easy to use
- easy to maintain and extend
- and fast
And it is a question of balancing all the features.
For example, we could write the engine in Python: it would be super easy to use, extend and maintain, but with terrible performance.
We could write the engine in asm to gain some performance, but it will be impossible to use, maintain and extend.
C++11 has great features (like lambda objects), but dispatching them are slower than non-virtual functions.
So, should we use the new features in order to gain a better API, but at the cost of losing some performance ?
Well, it depends the cost of the performance and the feature, and should be decided in a case-by-case basis.
But for the particles, I want to see what is the performance penalty of using the std::function for the new math.
In any case, the two existing modes (gravity and radial) could be hard-coded as they are now, and only call std::function<> code only if a new one is set.