Vladimír Vondruš
bd4ed9ae0e
Math: make batch functions accept strided array views.
...
The obvious improvement.
7 years ago
Vladimír Vondruš
2a9f4a1fed
Math: hint that lerpInverted() can be used for rane mapping.
7 years ago
Vladimír Vondruš
d38303505d
Math: added batch isInf() and isNan().
7 years ago
Vladimír Vondruš
571ba7b17f
Math: group the free functions to make them easier to look up.
7 years ago
Vladimír Vondruš
d9da018af7
Math: don't hide the vector/scalar overloads from docs.
...
People should be able to see the IsScalar requirements and how the
vector types are passed around as well.
7 years ago
Vladimír Vondruš
75ffd39fe0
Math: make it possible to use Deg/Rad in all functions.
...
This should have been here ages ago, haha.
7 years ago
Vladimír Vondruš
5cf4f6bb19
Math: be nicer to people and preserve compatibility.
...
This broke backwards compatibility pretty heavily for little reason.
Putting back a compat include.
7 years ago
Vladimír Vondruš
754c84525e
The <cmath> header is not allowed anymore.
7 years ago
Vladimír Vondruš
c12680ec38
Math: move batch functionality to FunctionsBatch.h.
...
Avoids including a (relatively) large ArrayView in Functions.h. Yes,
we are now at a point where 500 lines matter.
7 years ago
Vladimír Vondruš
563dee0436
Math: provide our own min() / max().
...
The one from std:: needs to #include <algorithm> to be used portably.
That's insane, so it's a big nope. Also, the standard implementation
takes the value always by reference, making it unnecessarily slow for
small types. We do better here.
7 years ago
Vladimír Vondruš
8ee5f5cc6d
Math: include proper header for std::div().
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š
5c5ecb5ff8
Math: removed deprecated (and confusing) normalize() / denormalize().
...
Deprecated since dd2058cee3 (December
2016), use more clearly named Math::pack() and unpack() instead.
8 years ago
Vladimír Vondruš
ebedbce2f2
Math: vector overloads for isInf() and isNan().
8 years ago
Vladimír Vondruš
edff639204
Math: functions were not inline by mistake.
...
It's inline for all others of similar size, so why not this.
8 years ago
Vladimír Vondruš
7a0bf3018f
Math: new min(), max() and minmax() overloads taking plain C arrays.
8 years ago
Vladimír Vondruš
e997344b8c
Math: new CubicHermite class.
...
For spline interpolation.
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š
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š
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š
cc51bff893
Math: make lerp() take any type.
...
Needed in order to easily pass interpolators to the Animation library.
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š
6e74966d94
Math: doc++
...
Make the whole vector bold, including the subscript.
8 years ago
Vladimír Vondruš
92071a342c
Math: added isInf() and isNan()
8 years ago
Vladimír Vondruš
39b14ae29d
Math: Android supports std::hypot(), round() and fma() now.
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š
2145ae9b96
Dropped NaCl support.
9 years ago
Vladimír Vondruš
7a16273e5d
Updated copyright year.
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š
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š
bfa259fb18
Math: min() and max() for pointer ranges.
...
The test is for the initializer list version, so it covers these as
well.
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š
a960a3d8cd
Math: initialize BoolVector to silence compiler warnings.
9 years ago
Vladimír Vondruš
dd2058cee3
Math: renamed {de,}normalize() to {,un}pack() in a new Packing.h header.
...
To be more consistent with GLSL naming. Also, the original naming was
quite misleading, as normalize() is used in GLSL for something
completely different.
If building with deprecated APIs, the Functions.h header includes the
new Packing.h header and the {de,}normalize() functions are defined as
deprecated aliases to the new functions. This will be removed at some
point in the future.
9 years ago
Vladimír Vondruš
dba0ea320d
Math: vector/scalar overload for pow().
10 years ago
Vladimír Vondruš
41aaf1321f
Math: construct fully-overwritten outputs in functions with NoInit.
...
Slightly faster on non-optimized builds (I would assume the optimizer
does this anyway).
10 years ago
Vladimír Vondruš
e2cc33f9d3
Math: don't use std::fma() on Emscripten.
...
With -O2 the test works, but with -O1 the compiler complains about
missing instruction. I guess -O2 just optimizes it away in this
particular case, so the safe option is to not use it at all.
10 years ago
Vladimír Vondruš
9fa0d8c796
Math: fix lerp() with BoolVector.
...
For some reason I swapped the order and took from the second parameter
when the value was 0. Probably because of the ?: operator.
10 years ago
Vladimír Vondruš
23646e6690
Hell, this project is big.
10 years ago
Vladimír Vondruš
6e73dee096
Math: avoid dependency on Functions.h in DualQuaternion.h.
...
Is it still justifiable to do things like this or am I too paranoid
about compilation times now?
11 years ago
Vladimír Vondruš
9ebd6ad46d
Math: added pow(), log() and exp().
...
Just wrappers around std::pow(), std::log() and std::exp() to have the
complete toolbox consistent.
11 years ago
Vladimír Vondruš
ab35741221
Math: minor cleanup, reordering and test renaming.
11 years ago
Vladimír Vondruš
2d44f46f14
Math: fix compiler warning.
11 years ago
Vladimír Vondruš
247d8dba6f
Math: added lerp(T, T, BoolVector).
...
In GLSL this is called mix() and I thought this is there for a long
time, but apparently it got included only in GL 4.5 / ES 3.1.
11 years ago
Vladimír Vondruš
609df779f5
Math: added sincos() for Dual numbers.
...
Calculating sin of Dual number involves also calculating the cos value,
thus a helper function is in order.
11 years ago
Vladimír Vondruš
e7cae67e9f
Math: added sincos().
...
Mainly a convenience function in case you want to compute sin and cos of
the same, potentially longer expression, and you don't want to have
repeated code or temporary variables. On some architectures might use
faster instruction that computes both values in one shot.
11 years ago