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
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š
61e511dbc4
Math: component-wise comparison for RectangularMatrix.
...
Required for TestSuite::Compare::Around.
9 years ago
Vladimír Vondruš
0aad8f756e
Math: utility function for conversion between CIE xyY and CIE XYZ.
9 years ago
Vladimír Vondruš
eeac7e2868
Math: minmax() for a pointer range.
...
Thanks @Squareys for unblocking my brain!
9 years ago
Vladimír Vondruš
9204156485
Math: constexpr issues with MSVC 2015.
9 years ago
Vladimír Vondruš
353d7ff59d
Math: implemented minmax() for arbitrary vectors.
9 years ago
Vladimír Vondruš
4cf9459110
Math: return default-constructed value for min()/max() on empty range.
9 years ago
Vladimír Vondruš
9e796b76c8
Math: added clamp(Vector, Vector, Vector), {min,max}(Vector, T)
...
In order to provide consistent API with GLSL. Pretty annoying omission.
9 years ago
Vladimír Vondruš
8637cbdc31
Math: Color4::{xyz,rgb}() should return Color3, not Vector3.
9 years ago
Vladimír Vondruš
9de8fb9a67
Math: expect minor sRGB monotonicity test failure on Emscripten -O3 build.
...
The debug output isn't even able to print the difference as it is
differing *very* little.
9 years ago
Vladimír Vondruš
5a0be1dfee
Math: document the test repeats to avoid confusion.
9 years ago
Vladimír Vondruš
bdb6daec82
Math: new Half literal class.
9 years ago