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
Vladimír Vondruš
ae2281dfd7
Math: minor cleanup of the Bezier test.
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š
a3b425bd26
Math: properly test op-and-assign operators in Unit.
8 years ago
Vladimír Vondruš
0c49c56768
Math: forgot to execute test for Vector::minmax().
...
:(
8 years ago
Vladimír Vondruš
da7d443b67
Math: added lerp(T, T, bool).
...
Last missing piece for fully orthogonal functionality. There was a
lerp(T, T, BoolVector) before, but not a scalar version. This also makes
scalar interpolation phase in select() working with arbitrary types.
8 years ago
Vladimír Vondruš
002d2260fd
Math: added select().
...
For animations I need a constant interpolator with the same API as
lerp() and friends.
8 years ago
Vladimír Vondruš
5d60f0d350
Math: moved Geometry::Distance and Intersection directly into Math.
...
Too deep nesting, too much typing. Colon cancer. Fully preserving
backwards compatibility, except for the recently added cone/frustum
intersection functions, which were not in master yet.
8 years ago
Vladimír Vondruš
40a5b898a2
Math: ability to convert BoolVector from/to external representation.
8 years ago
Vladimír Vondruš
7df90af144
Math: work around MSVC 2017 15.7.2 ICEs.
...
Reported here:
https://developercommunity.visualstudio.com/content/problem/259204/1572-regression-ice-in-constexpr-code-involving-de.html
8 years ago
Vladimír Vondruš
b8fabec474
Math: remove unused variables from tests.
...
Thanks, Clang 6.
8 years ago
Vladimír Vondruš
d9936c40fd
Math: added Constants::piQuarter().
8 years ago
Vladimír Vondruš
92071a342c
Math: added isInf() and isNan()
8 years ago
Vladimír Vondruš
9793123fba
Math: long double issues are now only on 32-bit Android.
8 years ago
Vladimír Vondruš
f4d69c24f4
Math: drop a workaround for old Android GCC.
8 years ago
Vladimír Vondruš
623fa97970
Updated copyright year.
8 years ago
Vladimír Vondruš
2145ae9b96
Dropped NaCl support.
9 years ago
Vladimír Vondruš
8757883bea
Math: don't expect long double (de)normalization to work on MSVC.
...
Ever. Because MSVC treats long double the same way as double.
9 years ago
Krzysztof Szenk
4f746ce729
Added a test case for BoolVector::set
...
Also thought, that it'd be nice to cover bit setting from 1 to 0.
9 years ago
Vladimír Vondruš
06a7677fbe
Math: test underflow/overflow when parsing vector/matrix from Configuration.
...
Fails as overflow is not handled.
9 years ago
Vladimír Vondruš
12fa6961c8
Use CMake folders also for OBJECT libraries, executables and tests.
9 years ago
Vladimír Vondruš
46e118879f
Test: use Containers::arrayView() and arrayCast() to simplify code.
9 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