Now using const reference to the shape instead of non-const one, also
removed some duplicated code and unneeded includes from the switch,
these operations are done in renderer implementations themselves.
The feature is now templated on shape type, which makes it actually
useful, as it is possible to conveniently query shape parameters from
it. It has now non-templated base and ObjectShapeGroup operates only
with it.
Allows to use them in (future) ObjectShape construction without unneded
verbosity:
new Physics::ObjectShape<Physics::Point2D>(o, {{1.0f, -2.5f}});
instead of:
new Physics::ObjectShape<Physics::Point2D>(o, Physics::Point2D(...));
This class now stores the tree in flat array, making it easier for user
to query the contents, but the internals are much more complicated. This
solution already reduces allocation count by count of nodes in the tree,
future work might remove the per-shape allocation altogether by using
large typeless array and placement-new etc.
Now line 41 of third added file is marked as 3(41). Source 0 is the
`#version` string added in Shader constructor.
Huh, deinlining that Shader::addSource() function also significantly
reduced debug binary sizes.
All work is now done in AbstractQuery, subclasses define only
strongly-typed interface around it. No heap allocations, no virtual
destructors needed. Added also asserts into result(), begin() and end()
to harden the implementation.
The methods return reference instead of pointer, as the class is
commonly created on the stack. Removed static functions
Shader::fromFile() and Shader::fromData(), as they are not needed now.
Also asserting that the file exists and is readable in addFile().
There is no point in using this class at compile-time. Ever. Moreover
clang called through Emscripten complains that it cannot be constexpr.
Clang called normally doesn't complain, don't know why.
Brain fart in 39348ddf06 (or probably f'ed
up merge conflict after crashed KDevelop while being interrupted for
lack of attention). Next time commit, stash and _then_ test.