Removing of another <*stream> #include leads to more compilation time
saving, now from ~5:12 to ~4:55. Another compilation time improvements
will now be possible only by using Clang's modules, I don't know where
to optimize further (except for getting rid of <sstream> in tests).
Magnum.h now doesn't include anything except OpenGL headers, thus
changes in Math library don't trigger recompilation of everything, but
only of things really depending on it.
Math constants moved to separate file for similar reasons, de-inlined
some functions to remove the need for some #includes.
Currently moved only non-square functionality from Matrix there. Also
static constant members such as row/column count and size are now
lowercase, as they are variables, not types.
It's now less confusing ("length squared" looks like it's even heavier
than length), but on the other hand it's not so obvious that these two
functions come together.
Now we can use CORRADE_COMPARE() almost exclusively for comparing
Vector, Matrix instances and all containers from STL. Tests running time
for all 31 tests is now around 0.1 sec instead of two seconds like
before.
Disabled compilation of all benchmarks, because TestSuite cannot handle
them yet.
PKGBUILD from AUR now can shamelessly use check() function without
unnecessary dependencies.
Long-standing TODO. It is better to have size first, because it is more
significant than type (e.g. because there are Vector4<T> specializations
and not VectorT<4> specializations). It is also IMHO easier for user to
distinguish/read the type than before:
Vector<float, 4> -> Vector4<float> // before
Vector<4, float> -> Vector4<float> // now
Removed functions at(), set() and add(), everything (and more) can be
now done using operator[]. Accessing matrix elements is now done through
column vectors, e.g.:
Matrix4 a;
a.at(row, col); // before
a[col][row]; // now
Note that because operator[] on Matrix returns column vector (there is
nothing like row vector), the parameter "order" is now swapped.
It should improve performance, because what can be computed at compile
time is now computed at compile time. In addition these things have been
changed or improved:
* Removed constructors from T*, as they cannot be AFAIK written using
constexpr functions only and they only do unnecessary data copying
most of the time. The functionality is now provided using static
functions Matrix*::from() and Vector*::from() which returns either
const or non-const reference to original data, so no copy is
performed. These functions also have explicit warning about unsafe
operations.
* Defaulted copy constructors and assignment operators, using
"default initialization" for arrays instead of memsetting it with
zeros. It should behave the same and this way we don't need any
memcpy(), memset() etc. from <cstring>, which is good.
Both functions convert the value to radians at compile time. For
example deg(180.0f) is converted to 3.14f. Less intuitive than
user-defined literals (C++11 feature), but works everywhere.