Vladimír Vondruš
5792d7f06a
Math: fun with printing NaNs :(
8 years ago
Vladimír Vondruš
24af174f5e
Math: minor cleanup.
8 years ago
Vladimír Vondruš
0cf65741ae
Math: helpfully print the offending values in all assertions.
8 years ago
Vladimír Vondruš
2fd8bae26d
Math: added Range::scaledFromCenter().
8 years ago
Vladimír Vondruš
0f33107efc
Math: no need to de-inline such tiny functions.
8 years ago
Vladimír Vondruš
e3e61d8865
Math: ability to multiply/divide a Complex with a Vector2.
8 years ago
Vladimír Vondruš
1a253af761
Math: added Constants::sqrtHalf().
8 years ago
Vladimír Vondruš
9f7512bf2b
Math: improve Constants docs, show useful identities.
8 years ago
Vladimír Vondruš
66a313bc0d
Math: doc++
8 years ago
Vladimír Vondruš
08d51ec116
Math: oh, MSVC 2015 constexpr fun is here again.
8 years ago
Vladimír Vondruš
8d5454b8ff
Math: ability to slice or expand square matrices.
8 years ago
Vladimír Vondruš
2c1da5466e
Math: added data() accessors to all remaining types.
8 years ago
Vladimír Vondruš
18f9118995
Math: fix Intersection::lineSegmentLineSegment() math docs.
...
I spent 30 minutes looking at the equations totally lost, not realizing
that the bold s and the non-bold s are the same thing. Ugh.
8 years ago
Vladimír Vondruš
eabe118266
Math: doc++
8 years ago
Vladimír Vondruš
7a0bf3018f
Math: new min(), max() and minmax() overloads taking plain C arrays.
8 years ago
Vladimír Vondruš
28a19f5add
Math: adapt to m.css Doxygen theme updates.
...
In particular, there's now warning about ignored documented friend
declarations. I don't have them documented, that's just Doxygen being
shitty.
8 years ago
Vladimír Vondruš
4a9e63ebdd
Math: doc++
...
I re-posted the tweet in a failed attempt to gain more attention. Yes, I
know I should post that on Connect, but that didn't really made the bug
fixed last time anyway.
8 years ago
Vladimír Vondruš
6725f6ed2f
Math: doc++
8 years ago
Vladimír Vondruš
b44166b238
Math: work around a MSVC 2017 15.8 ICE.
...
Four hours of my life, gone. Minimal repro case here:
https://twitter.com/czmosra/status/1038610648568147968
8 years ago
Vladimír Vondruš
523c16779d
Math: added missing CubicHermite [s]lerp[ShortestPath]() overloads.
8 years ago
Vladimír Vondruš
dfcd33ffe8
Math: properly test also (s)lerpShortestPath() assertions.
...
And boom, there was a bug.
8 years ago
Vladimír Vondruš
d5e6012824
Math: simplify CubicHermite test.
...
Not sure why I brainfarted so bad here.
8 years ago
Vladimír Vondruš
2975a1ba2d
Doc++
...
Removed redundant equations and linking just to the relevant docs
instead, these would be hard to maintain otherwise.
8 years ago
Vladimír Vondruš
4b7dab10e1
Math: improve docs of Matrix4::perspectiveProjection().
8 years ago
Alan
3bbb4088a8
Update Range.h
8 years ago
Vladimír Vondruš
13a6ba8a23
Math: benchmark quaternion interpolation methods.
8 years ago
Vladimír Vondruš
eadf8986f6
Math: fuzzy compare for division-by-zero in quaternion s(c)lerp.
...
Also remove a totally unneeded conversion.
8 years ago
Vladimír Vondruš
780e5258cc
Math: consistently use arccos() in math equations.
8 years ago
Vladimír Vondruš
ec34009025
Math: document the usual notation for complex/dual/quat numbers.
8 years ago
Vladimír Vondruš
1f507d81d4
Math: make docs of slerp() for Complex consistent with Quaternion.
8 years ago
Vladimír Vondruš
737104f2c7
Math: added "shortest path" alternatives to lerp(), slerp() and sclerp().
...
Before neither of the lerp(), slerp() had the shortest path check, while
sclerp() had it. Now, to be consistent, none of them has it and there
are lerpShortestPath(), slerpShortestPath() and sclerpShortestPath()
functions that have the shortest path check.
This is different from other engines, where there's usually only the
shortest path interpolation by default and either an optional
"non-shortest-path" interpolation or no alternative at all. I like to
give the users a choice, so there's both versions and the
non-shortest-path version is the default, because -- at least in case of
lerp() -- this results in a quite significant perf difference (15%
faster), so why not have it. Preprocess your data instead ;)
8 years ago
Vladimír Vondruš
d156a60943
Math: fix sclerp() behavior with dual quaternions having the same angle.
...
The fix done with https://github.com/mosra/magnum/pull/122
(0e05c7289e ) was not tested properly (see
previous commit) and thus this code path never worked. This properly
lerps the translation part and recombines it with the rotation instead
of interpolating just a part of it.
Also I'm no longer having any "dotResult" that's done only on the
vector part of the rotation, but instead using the full
rotation quaternion dot product. I have no idea why it was done this
way. This branch was also never properly tested -- it'll be with the
introduction of "shortest path" variants in the next commit.
8 years ago
Vladimír Vondruš
425d31fb5c
Math: no, this is testing it wrong.
...
And causes an assertion message. Obviously the test doesn't pass anymore
after this fix.
8 years ago
Vladimír Vondruš
f583d1c853
Math: cleaned up the sclerp() test.
...
No need to have the precision so crazy.
8 years ago
Vladimír Vondruš
68f34b3283
Math: STUPID EFFING DOXYGEN GODDAMIT I HATE YA WITH PASSION
8 years ago
Vladimír Vondruš
6c8a2a46b8
Math: implement cubic Bezier <-> cubic Hermite conversion.
8 years ago
Vladimír Vondruš
e997344b8c
Math: new CubicHermite class.
...
For spline interpolation.
8 years ago
Vladimír Vondruš
8c7c74c22e
Math: mutable getters for Complex, Dual and Quaternion.
...
Not sure why these were omitted. Everything else has them.
8 years ago
Vladimír Vondruš
c2c6b9f22b
Math: added lerp() and slerp() for complex numbers.
...
It's a straight copy of the code for quaternions -- it could probably be
simplified a bit, but I don't have the necessary brain cells at the
moment. I tried the following but failed:
retun Complex::rotation(acos(cosAngle)*t)*normalizedA;
8 years ago
Vladimír Vondruš
0f4b88870a
Math: simplify angle() implementation for Complex.
...
Not sure why that wasn't done before.
8 years ago
Vladimír Vondruš
bb9b41057f
Math: separate assertion tests into a dedicated test case.
8 years ago
Vladimír Vondruš
a77a46c926
Math: debug output for Half with proper amount of decimal places.
...
The totally random places after were not exactly useful. This file was
sitting here for a while, not sure why I didn't commit that earlier.
8 years ago
Vladimír Vondruš
87a951fc5d
Math: I have no idea what happened here.
...
Even after the change I am not sure what I originally meant to do here.
Discovered by PVS-Studio, thanks to @alexesDev for gathering the report.
8 years ago
Vladimír Vondruš
bff7ae8d7e
Math: added Range::fromCenter().
8 years ago
Vladimír Vondruš
bb8fbcef9c
Math: doc++
8 years ago
Vladimír Vondruš
b9c96d76e8
Math: ability to use [Dual]Complex and [Dual]Quaternion in configuration.
8 years ago
Vladimír Vondruš
4de8a1d3d2
Math: minor cleanup.
8 years ago
Vladimír Vondruš
e54b1fdbc4
Math: hmm, MSVC 2015 and constexpr. Fun.
8 years ago
Vladimír Vondruš
64f8a90095
Math: ability to construct a Range from std::pair.
...
Useful to feed the output from Math::minmax() directly to a Range.
8 years ago
Vladimír Vondruš
fe10dbece8
Math: use plane equation in Intersection::planeLine().
...
The old overload taking a separate "position" and normal is a deprecated
alias, passing a calculated plane equation to the new one.
8 years ago