Vladimír Vondruš
07c36b4a64
[wip] Math: SIMD-enabled index array packing/unpacking functions.
...
TODO: well, the compiler generates the same code as I do with AVX2, so
there's really no benefit. But could act as a sandbox.
TODO: properly handle cases of element count not being a multiple of 16
TODO: implement other variants
TODO: implement a pack version
[ci skip]
7 years ago
Vladimír Vondruš
2149f7b869
Wrap all tests in unnamed namespaces.
...
This makes the compiler warn about test cases that aren't ever used,
which is a good thing.
7 years ago
Vladimír Vondruš
e6b7aa12fa
Updated copyright year.
7 years ago
Vladimír Vondruš
3e3eb21181
Math: correct order for test implementations.
8 years ago
Vladimír Vondruš
f5b90cefba
Math: whoops, forgot about StrictWeakOrdering for Frustum.
...
Just a stretched version of the test for Matrix4. Hope that's okay.
8 years ago
Vladimír Vondruš
cf8db303dc
Updated credits and changelog.
8 years ago
Vladimír Vondruš
8dc62b5a49
Math: deduplicate test code.
8 years ago
Vladimír Vondruš
7738fcc011
Math: use CORRADE_COMPARE() to compare non-boolean values.
...
Gives better error diagnostics.
8 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š
8be57d1a21
Math: I should have tested this.
...
Did I ever check the CIs?
8 years ago
Vladimír Vondruš
d7d8e49de2
Math: make all literals usable with Utility::Tweakable.
8 years ago
Vladimír Vondruš
6d7558672d
Math: MSVC 2015 constexpr fun!
8 years ago
Vladimír Vondruš
0226ab26c4
Math: make one-dimensional range just from scalar types.
...
Since Range1D is now used all over Animation, the vector made it very
annoying to use. That's fixed now. This is a backwards-incompatible
change, but I don't expect the 1D range to be used much, mainly because
it was so shitty to use. Generic code that needs a vector can always
cast to it, like this:
Math::Vector<dimensions, T>{range.min()}
Test for the constructor from pair is no longer accepting pairs of 1D
vectors. I have no idea what I meant by that test case (it's testing the
same thing twice), so I removed one of these.
8 years ago
Vladimír Vondruš
597223e993
Math: test a bit more.
8 years ago
Vladimír Vondruš
ebedbce2f2
Math: vector overloads for isInf() and isNan().
8 years ago
Vladimír Vondruš
5792d7f06a
Math: fun with printing NaNs :(
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š
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š
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š
7a0bf3018f
Math: new min(), max() and minmax() overloads taking plain C arrays.
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š
13a6ba8a23
Math: benchmark quaternion interpolation methods.
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š
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š
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š
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š
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
Vladimír Vondruš
49068f066d
Math: added planeEquation() helper.
8 years ago
Vladimír Vondruš
8a35299636
Math: added Math::Range::contains() with Range as a parameter.
8 years ago
Vladimír Vondruš
6cb57534e6
Math: implemented intersect() and intersects() for Range.
...
One returns the intersection range, the other a boolean.
8 years ago
Vladimír Vondruš
59852ace85
Math: ability to slice Range into lower dimensions.
8 years ago
Vladimír Vondruš
d88e79cd9e
Math: new Color[34]::fromSrgb[Alpha]() and Color[34]::toSrgb[Alpha]Int().
...
For easier conversion of packed 24-/32-bit colors to the Color types.
8 years ago