* Camera is now templated also on underlying floating-point type.
* Drawable objects can be split into groups (e.g. for separated
rendering of transparent objects)
* Added (long time missing) test for draw() function.
Lowecase didn't prove to be better, because Doxygen cannot implicitly
link to it and it collides with non-type template parameters and private
variables.
* The user might not want to call Framebuffer::clear(), because there
could be something already rendered with another camera.
* The user might not want to call Framebuffer::setViewport(), because
there could be different framebuffer attached.
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.
Resulting (debug) executables are ~100 kB smaller, all operations
which were previously logarithmic are now done in constant time and
the whole implementation is a lot simpler.
Now it is possible to render without using any Object, Scene or Camera
classes. Framebuffer class now manages features, clearing and setting
viewport. Added position parameter to setViewport(), ability to clear
specified features in clear().
Now it is exposed as protected function, so it can be called from
subclasses. It now clears() only set features, so when stencil or depth
test is not enables, it doesn't clear their buffers.
Object::setClean() now computes absolute transformation while traversing
through object parents and passes it as parameter to clean(), which is
now virtual a meant to be reimplemented instead of setClean().
Updated and greatly improved unit test.
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.
Mainly to be consistent with Matrix::transposed() function name,
furthermore calling
Matrix::inverse()
could look like the original matrix is being inversed, while calling
Matrix::inversed()
implies that the function doesn't change the original matrix, but
returns the result instead.
With C++11, objects can be passed nearly as easy as without these
convenience functions, for example:
Matrix4::scaling({0.5f, 1.0f, 0.5f});
which is nearly the same as the following, using convenience function:
Matrix4::scaling(0.5f, 1.0f, 0.5f);
Convenience functions can also be pretty confusing, for example:
Matrix4::rotation(1.0f, -1.0f, 2.0f, 2.0f); // wtf?
Matrix4::rotation(1.0f, {-1.0f, 2.0f, 2.0f}); // ah, okay!
There are also a few neat tricks, which cannot be done using convenience
functions, for example:
Matrix4::translate(Vector3::xAxis(3.0f)); // {3.0f, 0.0f, 0.0f}
Camera::setClearColor({0.1f, 0.1f, 0.1f}); // default 1.0f for alpha
It was overengineered and unnecessarily complicated. Now the camera is
specified only in Scene::draw(), which eliminates all the needs for
recalculating absolute object transformations on each camera
transformation change. Absolute object transformation is now computed
relative to root object or relative to camera object passed as
parameter. Because of that it is now also possible to draw the scene
using multiple cameras at once.