Vladimír Vondruš
70778ac307
Math: add typedefs for single-row matrices.
...
May be useful for left-hand-side multiplication, as a counterpart for
multiplying with (column) vectors from the right hand side.
2 years ago
Vladimír Vondruš
0aff2ec600
Math: make the external conversion SFINAE template arguments unnamed.
...
It's like this in Corrade::Containers already, the reason it was still
named here is probably just historical.
2 years ago
Vladimír Vondruš
279856f239
Math: allow creating a Vector from a BitVector.
...
And document the more flexible alternative using lerp().
2 years ago
Vladimír Vondruš
2619dc33f1
doc: drop the redundant Magnum prefix from snippet files.
...
I accidentally did that at first, and then "for consistency" continued
with that for a decade.
2 years ago
Vladimír Vondruš
9cb623eaf9
Math: make MSVC 2015 correctly pick up the float*VectorNi operator.
...
This complier is making my hair gray. Fortunately the out-of-class
operator doesn't conflict with the in-class one, so it's purely an
additive workaround. Adding extra checks to all subclasses to be sure
this works correctly in all cases and not just in the base class.
2 years ago
Vladimír Vondruš
8b1026d457
Math: make all matrix and vector operators either member or friend.
...
Except for a vector and a row matrix multiplication operator, which
doesn't make sense to be a member. These are all now significantly
shorter thanks to not having to repeat that many template parameters,
and they can make use of direct access into the _data array for better
debug perf.
2 years ago
Vladimír Vondruš
5e097681cb
Math: be reasonable, <utility> is not needed for std::declval.
...
Despite what the standard tries to say. I bet a large portion of
<type_traits> is impossible to implement without it, which is why all
STL implementations define it there already.
3 years ago
Vladimír Vondruš
fa079385bf
singles: don't include StrictWeakOrdering in MagnumMath.hpp.
3 years ago
Vladimír Vondruš
bbb54a9df8
It's 2023 already!
3 years ago
Vladimír Vondruš
862c48517f
Math: add Vector2::{r,g}() and Vector3::rg().
...
For consistency with X/Y accessors. No reason to not have them.
3 years ago
Vladimír Vondruš
73c881f5ae
Math: mention that cross product can be used to calculate triangle area.
3 years ago
Vladimír Vondruš
9e796a9664
Math: clarify relation of distances and cross products.
...
I spent a significant amount of time reinventing the wheel, i.e.
figuring out how to use a cross product to calculate distance of a point
to a line. Only to subseqently have a breakthrough discovery of
Distance::linePoint() that actually does the same.
The distance APIs and 2D and 3D cross-products are now linked together
the math snippet is clarified, and both the 2D and 3D distance use the
same equation, saving one unnecessary vector subtraction. The
equivalence of the two equations is listed directly on that Wolfram
link.
4 years ago
Vladimír Vondruš
822fa0d644
Updated copyright year.
4 years ago
Vladimír Vondruš
7413d2053f
Math: doc++
5 years ago
Vladimír Vondruš
3d136503d8
Updated copyright year.
5 years ago
Vladimír Vondruš
d01364ca1f
Math: document more what's cross() good for.
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š
573125d0a9
Math: make cross() 10x faster in Debug.
...
And the Vector3 version 5% slower in Release, on GCC at least. FFS,
what was I thinking with the gather() things. Nice in user code,
extremely bad in library code.
6 years ago
Vladimír Vondruš
73c37a8339
Add Vector[324][u][hsb] convenience typedefs for small types.
...
And also Color variants, to make it complete. No half types for matrices
right now, those might come later.
6 years ago
Vladimír Vondruš
3b940f2509
doc: avoid referencing the deprecated Math::swizzle() function.
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š
acc8d8994b
Math: added scatter(), renamed swizzle() to gather().
...
The swizzle() function is still present, only marked as deprecated and
scheduled to be removed in some future release.
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š
05b1cefda5
Math: avoid operator[] calls where possible (and not too verbose).
...
In debug builds (where nothing is inlined), this makes matrix
multiplication run in 33% of the time and matrix inversion roughly twice
as fast.
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š
5fc246b908
Math: compile forgotten code snippets.
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š
49068f066d
Math: added planeEquation() helper.
8 years ago
Vladimír Vondruš
a421b50be3
Math: doc++
8 years ago
Vladimír Vondruš
468af3284a
Math: removed long-deprecated member dot(), angle(), lerp(), cross().
...
Use free functions in Math namespace instead.
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š
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š
40d60f6a3f
Math: make all constructor noexcept and test their behavior.
10 years ago
Vladimír Vondruš
23646e6690
Hell, this project is big.
10 years ago
Vladimír Vondruš
6e8c16c960
MSVC 2015 Update 1: fixed nearly all constexpr bugs.
11 years ago
Vladimír Vondruš
0aa16595eb
Use new-style debug operators everywhere.
11 years ago
Vladimír Vondruš
bfbacaa7c9
MSVC 2015 compatibility: random stuff that's causing compiler crashes.
...
Random indeed. In particular, it's causing crashes for Vector2 and
Vector3, but not for the exact same code in Vector4!
11 years ago
Vladimír Vondruš
d805e87f21
MSVC 2015 compatibility: Math conversion constructor constexpr issues.
...
Some could be worked around, but the rest is prevented by inability to
delegate constexpr constructors.
11 years ago
Vladimír Vondruš
8984904693
MSVC 2015 compatibility: single value Math constructor constexpr issues.
...
Some could be worked around, but the rest is prevented by inability to
delegate constexpr constructors.
11 years ago
Vladimír Vondruš
371adc63f9
MSVC 2015 compatibility: the issues with {} are eternal.
...
Aargh.
11 years ago