libgdx/libgdx — pull request #1756 by florianbaethge (2014-04-24 11:30:21+00:00)
Title: Added "float approxLength(int samples)" to Path interface and added implementation within existing Spline-classes

Since I'm working on classes about camera paths, I have added a method to approximate the length of a path or curve.

So I've added a ```float approxLength(int samples);``` to the `Path`-interface and implemented it within ```Bezier```, ```BSpline``` and `CatmullRomSpline` classes.

The implemented method will now calculate several sample points on the curve (given by "samples") and accumulate the euclidean distances between the sample points.

The more sample points are chosen, the more precise the calculated value will be, but with costs to performance, since more curve points need to be calculated. Also, the more straight a curve is, the less sample points are needed for a precise enough result.