Main change is that features take reference to containing object instead
of pointer, as the feature must always belong to some object. Feature
groups now return references to features and features return reference
to containing object, as these cannot be null.
Passing `*this` to AbstractFeature (and Camera[23]D) constructor might
now clash with deleted copy constructor, added templated constructor to
catch and resolve these ambiguous cases.
Passing pointer as function parameter will now mean that it is possible
to pass `nullptr`. Some code examples now look like the parameter is
copied instead of referenced, which is misleading. Updated the
documentation to reflect that more clearly.
Makes some cases less consistent (and some convenience shortcuts
impossible), but goes well with the attitude "don't use pointer when it
can't be null".
Merged constexpr test cases into other ones to remove duplicate code.
Copied the constructors from Math::Vector as I don't feel reinventing
all that again.
Assumes that no resources of given type are referenced. The test case
for this is awful, as I can't think of a way to test which would work
without trying to decrement reference counter on already deleted
resource. Added just-to-be-sure assertion to make it fail early and not
somewhere deep in STL.
Previously was done per type (i.e. for each type delete loader and then
the data), wasn't usable when the loader stored different resource type
(which is the only case where it is useful).
Positions and normals have the same data, thus the data were simply
copied to positions and then moved to normals in return to save one
needless copying. However it seems that these two operations were
swapped by the compiler (C++ standard?) and thus there were no positions
to be copied.
Now explicitly creating copy of position array and then moving them in
return. While at it, renamed also `vertices` to `positions` to be
consistent with the rest of the engine. Also added simple (count only)
unit test to avoid this error in the future.
Print expected and actual count to simplify debugging. Also the phrase
"nothing done." is useless, as nothing is _ever_ done after assertion
failure. Probably remains from the times where that wasn't assertion but
merely harmless warning.
Currently the most used scene graph transformation implementation are
dual quaternions, which don't allow any scaling. The original code
normalized the rotation matrix, involving three dot products and one
sqrt, even if it wasn't needed in most cases -- even if using scene
graph with matrices mostly you don't scale at all and thus the shader
internally renormalized already normalized vectors for _each object_ in
each frame.
This _will_ break things, don't forget to update the code and call
`setNormalMatrix()` along with `setTransformationMatrix()`.