The unit test was so weak that this parenthesis error wasn't spotted
until now. Updated the unit test to don't accept the previous code and
also floats everywhere instead of ints.
* For libraries that are part of the same project using directly target
name instead of ${*_LIBRARY} variable.
* Prefixed test target names with namespace, so tests for the same
class in different namespaces won't conflict.
* Removed unneeded linking to ${CORRADE_UTILITY_LIBRARY} in some
places.
Because no operator= which took the class itself as argument (parent
class only), the compiler generated default assignment and assignment
move constructors, e.g.
Vector3<T>& operator=(const Vector3<T>&);
Vector3<T>& operator=(Vector3&&);
Resulting in conflicts when using assignment uniform initialization,
i.e. it wasn't possible to do things like this, but that's now fixed:
Vector3<int> vec;
vec = {0, 1, 2};
Other functions left untouched (they are still taking e.g. Vector<T,
3> instead of Vector3<T>), because it saves one useless dummy
constructor call (which would be visible in profiler, but without
having any performance impacts altogether).
Saves one matrix*vector multiplication per object per frame. The
position can be now Vector3 like before, because it won't be multiplied
with anything on draw call. Added unit test.
All classes moved to MeshTools::Implementation namespace and removed
from Doxygen output. They now all return tuples instead of custom
structures. Updated and improved documentation, removed references to
implementation classes.
GCC does some heavy magic optimizations in -O2 (-O1 works) and it
somewhat breaks them. It should be safe to use them outside of Matrix,
though (e.g. when not used in loops through all elements).
Before it was one constructor using bool parameter, which is massive
antipattern:
Matrix4 m(false); // Huh? No Matrix4 then or what?
Iẗ́'s now separated into two distinct constructors, of them one can be
already declared as constexpr (hooray). The usage is as follows:
Matrix4 a; // Default (identity matrix)
Matrix4 b(Matrix4::Identity); // Explicitly identity matrix
Matrix4 c(Matrix4::Zero); // Zero-filled matrix
Also deleted constructor from one parameter, so following mistakes
now cannot compile:
Matrix4 d(true); // Both would set element at [0][0] to 1,
Matrix4 e(Matrix3::Zero); // and other to 0
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.