Vladimír Vondruš
6ce892f939
Math: doc++
5 years ago
Vladimír Vondruš
ff1b0ab307
Math: add off-center variants of 2D/3D orthographic projection as well.
...
Was just perspective projection right now.
5 years ago
Vladimír Vondruš
3697125c7d
Math: disallow reflections in {Complex,Quaternion}::fromMatrix().
...
And update docs in Matrix[34]::rotation() and related functions to note
this. This is a breaking change that may cause existing code to start
asserting.
5 years ago
Vladimír Vondruš
3097c4c1f0
Math: class-level documentation for Matrix3 and Matrix4.
...
Another one that was long on my TODO list.
5 years ago
Vladimír Vondruš
7072befbdb
Math: generalize slicing and expanding to arbitrarily-sized matrices.
...
Originally was done only for square matrices, but now I need that for
converting 3x3 -> 3x4 and back (UBO packing, ugh ugh), so let's
generalize.
5 years ago
Vladimír Vondruš
7413d2053f
Math: doc++
5 years ago
Vladimír Vondruš
3d136503d8
Updated copyright year.
5 years ago
Vladimír Vondruš
34a52e48ed
Math: link to the corresponding classic GL/GLU functions.
...
I was porting some PyOpenGL code and knowing how the ancient GL API maps
to Magnum helped tremendously.
5 years ago
Squareys
f69f3393ec
Math: Add DualQuaternion/DualComplex::from(rotation, translation)
...
Signed-off-by: Squareys <squareys@googlemail.com>
6 years ago
Vladimír Vondruš
553034da9e
Math: doc++
6 years ago
Vladimír Vondruš
1026aee80e
Moved the NoInit tag from Math to the root namespace.
...
The old one is deprecated, and will be removed in a future release.
Unfortunately, to avoid deprecation warnings, all use of NoInit in the
Math library temporarily have to be Magnum::NoInit This will be cleaned
up when the deprecated alias is removed.
6 years ago
Vladimír Vondruš
19e0e96d74
Updated copyright year.
6 years ago
Vladimír Vondruš
c85b537937
Revert "Math: preserve signs in the Matrix[34]::scaling() getter."
...
Turns out this seriously broke properites that should always hold, such
as that R*S = M for a R and S extracted out of M. Another way to fix
this would be flipping signs in the rotation() / rotationShear() / ...
queries as well, but that adds extra operations to both rotation() and
scaling() and at that point it's just better to do what was done the
whole decade before.
To ensure this doesn't happen again and doesn't cost me a whole day of
debugging in an end-user app (SceneGraph TRS transformations got broken
because those assume that rotation() and scaling() *do* combine back,
which is a reasonable thing to assume), the docs are extended to note
this and there's an explicit test for both negative scale and large
angle corner cases as well.
This reverts commit 9aa68715db .
6 years ago
Nghia Truong
1ef813fdad
Math: add reflect() and refract() functions.
...
Co-authored-by: Vladimír Vondruš <mosra@centrum.cz>
6 years ago
Vladimír Vondruš
9aa68715db
Math: preserve signs in the Matrix[34]::scaling() getter.
...
This is a breaking change, but I think it is worth doing. Because now
Matrix4::scaling(vec).scaling() == vec
which was true also for translation and other.
6 years ago
Vladimír Vondruš
6fbedd8f52
Revert "doc: pile on more Doxygen workarounds."
...
This reverts commit 0b7831c1ad .
6 years ago
Vladimír Vondruš
0b7831c1ad
doc: pile on more Doxygen workarounds.
...
Sad! https://github.com/doxygen/doxygen/issues/7472
6 years ago
Vladimír Vondruš
a920722839
doc: label deprecated APIs and stuff new since 2019.10 with version info.
...
Should make new things more discoverable, avoid confusion when a
documented API isn't there and reduce the need for maintaining multiple
separate versions of the docs.
7 years ago
Vladimír Vondruš
515637c76a
Math: implement a robust and faster Matrix4::normalMatrix().
...
This change makes the operations split into a bunch of separate
functions, making the parts easier to document, however with a slight
negative effect on debug performance:
Starting Magnum::Math::Test::MatrixBenchmark with 16 test cases...
INFO Benchmarking a debug build.
BENCH [01] 94.54 ± 3.62 ns multiply3()@499x10000 (wall time)
BENCH [02] 183.47 ± 7.50 ns multiply4()@499x10000 (wall time)
BENCH [03] 318.11 ± 11.59 ns comatrix3()@49x10000 (wall time)
BENCH [04] 379.51 ± 12.17 ns invert3()@49x10000 (wall time)
BENCH [05] 448.23 ± 17.61 ns invert3GaussJordan()@49x10000 (wall time)
BENCH [06] 338.96 ± 11.61 ns invert3Rigid()@49x10000 (wall time)
BENCH [07] 206.37 ± 10.59 ns invert3Orthogonal()@49x10000 (wall time)
BENCH [08] 879.40 ± 20.03 ns comatrix4()@49x10000 (wall time)
BENCH [09] 1.16 ± 0.03 µs invert4()@49x10000 (wall time)
BENCH [10] 825.40 ± 17.34 ns invert4GaussJordan()@49x10000 (wall time)
BENCH [11] 534.86 ± 15.73 ns invert4Rigid()@49x10000 (wall time)
BENCH [12] 347.36 ± 11.62 ns invert4Orthogonal()@49x10000 (wall time)
BENCH [13] 65.70 ± 6.73 ns transformVector3()@999x10000 (wall time)
BENCH [14] 62.56 ± 3.09 ns transformPoint3()@999x10000 (wall time)
BENCH [15] 81.25 ± 2.78 ns transformVector4()@999x10000 (wall time)
BENCH [16] 82.14 ± 4.26 ns transformPoint4()@999x10000 (wall time)
Finished Magnum::Math::Test::MatrixBenchmark with 0 errors out of 5500 checks.
7 years ago
Vladimír Vondruš
a1cc0cb62d
Math: off-center Matrix4::perspectiveProjection().
7 years ago
Vladimír Vondruš
637e8ecd44
Math: de-duplicate code in Matrix4::perspectiveProjection().
7 years ago
Vladimír Vondruš
1253a60046
Math: doc++
7 years ago
Vladimír Vondruš
4b4b8efc1b
Math: doc++
...
Fixing Engrish while doing the Python bindings.
7 years ago
Vladimír Vondruš
3fb90cdf5c
Math: remove obsolete Doxygen workarounds.
7 years ago
Vladimír Vondruš
36ba5f4333
Math: ensure ZeroInit and IdentityInit constructors are explicit.
...
Like NoInit ones. Not sure what I was doing there.
7 years ago
Vladimír Vondruš
64bc7f9c8e
Math: moved configuration value parsers to a dedicated header.
...
There's a lot of string operations and that's nothing good to have
included everywhere. Should speed up the compilation quite a bit.
7 years ago
Vladimír Vondruš
e6b7aa12fa
Updated copyright year.
7 years ago
Vladimír Vondruš
f5e30bb5d3
Math: minor coding style cleanup.
8 years ago
Borislav Stanimirov
f7f2ab8cb5
Math: added StrictWeakOrdering for math types
8 years ago
Vladimír Vondruš
0cf65741ae
Math: helpfully print the offending values in all assertions.
8 years ago
Vladimír Vondruš
8d5454b8ff
Math: ability to slice or expand square matrices.
8 years ago
Vladimír Vondruš
4b7dab10e1
Math: improve docs of Matrix4::perspectiveProjection().
8 years ago
Vladimír Vondruš
fbd3dedeb3
Math: add Matrix[34]::rotationShear(), scalingSquared() and scaling().
...
Important: the rotation() accessor now allows non-uniform scaling but
expects orthogonality (previously it allowed non-orthogonal rotation
axes but disallowed non-uniform scaling).
Documentation of all these accessors is further improved now as well.
8 years ago
Vladimír Vondruš
086ed8a278
Math: improve docs of matrix queries.
8 years ago
Vladimír Vondruš
f9dbaef465
Math: add more GLU search keywords.
8 years ago
Vladimír Vondruš
2136466f0f
Math: doc++, add search aliases for GLSL functions.
8 years ago
Vladimír Vondruš
623fa97970
Updated copyright year.
8 years ago
Vladimír Vondruš
05bb8b419a
Math: updates for the new documentation theme.
8 years ago
Vladimír Vondruš
7a16273e5d
Updated copyright year.
9 years ago
Vladimír Vondruš
ae9095de16
Remove most of the "MSVC 2015 can't handle {} here" workarounds.
9 years ago
Vladimír Vondruš
025ef780b2
Workaround for that one damn Doxygen bug.
9 years ago
Vladimír Vondruš
aa69bbcc19
Math: ability to create matrices with one value for all components.
...
In order to do that with the previous API, one had to write an
abomination like
auto a = Matrix4x4::fromVector(Math::Vector<16, Float>{0.5f});
Ugh.
9 years ago
Vladimír Vondruš
6e10b2e205
Math: doc++
...
The TODOs were removed and put into GitHub projects to be a bit more
visible to random strangers.
9 years ago
Vladimír Vondruš
28c31bfc96
Math: I don't see why we should have those overloads.
...
The compiler does that for us. Probably a brain fart from 2010. On the
other hand, the ConfigurationValue specializations need to be there,
because the type is used explicitly as template parameter.
10 years ago
Vladimír Vondruš
5fcdd48808
Math: clarify what Matrix4::lookAt() does.
10 years ago
Vladimír Vondruš
5c7b1a0eb2
Math: simplify Matrix4::lookAt().
10 years ago
Vladimír Vondruš
87074202c8
Math: support infinite far plane in Matrix::perspectiveProjection().
10 years ago
Vladimír Vondruš
98735f50f4
Math: document the math behind 2D/3D matrix transformations.
10 years ago
Vladimír Vondruš
40d60f6a3f
Math: make all constructor noexcept and test their behavior.
10 years ago
Vladimír Vondruš
c2d2737ca6
Math: test and document Matrix4::*projection() harder.
10 years ago