Vladimír Vondruš
45a10cefdf
Making includes absolute, part 1: moving files around.
...
Everything what was in src/ is now in src/Corrade, everything from
src/Plugins is now in src/MagnumPlugins, everything from external/ is in
src/MagnumExternal. Added new CMakeLists.txt file and updated the other
ones for the moves, no other change was made. If MAGNUM_BUILD_DEPRECATED
is set, everything compiles and installs like previously except for the
plugins, which are now in MagnumPlugins and not in Magnum/Plugins.
12 years ago
Vladimír Vondruš
282ee58c62
Math: work around missing std::round() in NaCl newlib.
...
Also test that our implementation behaves the same.
13 years ago
Vladimír Vondruš
4059bd752f
Math: added minmax() and Vector2::minmax().
...
No Vector<size, T> and std::initializer_list versions yet, as the
algorithm for it is pretty complicated and I'm not sure that they will
be used frequently enough to deserve their existence.
13 years ago
Vladimír Vondruš
f009e5c47f
Math: added rounding functions.
13 years ago
Vladimír Vondruš
186c522fe5
Math: added lerpInverted().
13 years ago
Vladimír Vondruš
5787d66d45
Math: test also vector as interpolation phase in Math::lerp().
13 years ago
Vladimír Vondruš
31ce072f39
Math: added initializer list overloads for min() and max().
...
Hopefully including <algorithm> doesn't do much harm to compilation
time.
13 years ago
Vladimír Vondruš
f6ae87376b
Math: added function fma().
13 years ago
Vladimír Vondruš
6124ad3c27
Math: added sqrtInverted() function.
...
There are SIMD instructions for that, so why not have it in place.
13 years ago
Vladimír Vondruš
5e8606a755
Math: added sign() function.
13 years ago
Vladimír Vondruš
d95c44fcc8
Math: test that trigonometric functions work with Unit base class.
...
The test fails.
13 years ago
Vladimír Vondruš
83bda8bbe6
Math: fixed test for denormalize<UnsignedLong, long double>().
...
Amazing what single forgotten literal can do.
13 years ago
Vladimír Vondruš
35eb876303
Various other compilation fixes for OpenGL ES target.
13 years ago
Vladimír Vondruš
4744b631bb
Math: test pow() constexpr.
13 years ago
Vladimír Vondruš
c5ab86794b
Relicensing to MIT/Expat license, part 3: source files.
...
Added license header also to shader sources. Hopefully it won't harm
compilation times too much.
13 years ago
Vladimír Vondruš
90a60ce7e9
Math: disable denormalize() test for UnsignedLong.
...
It works with GCC and -O3, but fails on unoptimized code.
13 years ago
Vladimír Vondruš
231f3277ab
Adapted to Corrade changes.
...
Allowing to instantiate Trade::AbstractImporter subclasses directly
without plugin manager.
13 years ago
Vladimír Vondruš
6a90b0231b
Math: using new aliases for builtin types in whole Math namespace.
13 years ago
Vladimír Vondruš
5ff0e29950
Math: fix warning about literal types in normalize().
...
C++11 changed type of character literal (i.e. '\x7F') from int to char,
thus the documentation is wrong (also mistakenly used octal literal).
Added test to properly test the behavior.
13 years ago
Vladimír Vondruš
c2f4359bd7
Math: added strongly-typed asin(), acos() and atan().
13 years ago
Vladimír Vondruš
c0a5e5dadd
Math: added sin(), cos() and tan() accepting either Rad or Deg.
13 years ago
Vladimír Vondruš
fec6822187
Math: added sqrt() scalar/vector overload.
13 years ago
Vladimír Vondruš
0144c38a54
Math: moved lerp() from Vector to Functions.h.
...
It does nothing special for vectors (unlike e.g. quaternion LERP) and
scalar overload is useful too.
13 years ago
Vladimír Vondruš
8a63939134
Math: added vector/scalar abs() function.
13 years ago
Vladimír Vondruš
263d8351b6
Math: vector overloads for normalize() and denormalize().
13 years ago
Vladimír Vondruš
4d6d3fde88
Math: scalar/vector implementation of min(), max() and clamp().
...
This is gonna be some ugly template hell.
13 years ago
Vladimír Vondruš
cade175304
Math: finally implemented precise signed/unsigned normalization.
...
(De)normalization from/to [0, 1] for unsigned types and from/to [-1, 1]
for signed types. -1.0 is always denormalized to min+1.
Also updated some tests for Color, as they depended on previous
imprecise implementation.
14 years ago
Vladimír Vondruš
7dc0fc4a4c
Math: Renamed Math.h to Functions.h
...
Math.h is reserved for forward declaration header.
14 years ago
Vladimír Vondruš
52300cf402
Math: function for base-2 logarithm.
...
Verbatim copy from Corrade, might be better to have it here too
(possibly some SIMD optimizations?).
14 years ago
Vladimír Vondruš
fcb8a7b768
Got rid of header files in tests.
...
They have no practical use and they only bloat codebase size and add
maintenance burden.
14 years ago
Vladimír Vondruš
0f889369f4
No `using namespace std` anywhere.
...
Also added missing std:: prefix to remaining cases of std::size_t,
std::[u]int[0-9]+_t, std::sin() etc., std::exit().
14 years ago
Vladimír Vondruš
c1cf94fb46
Using fixed-size integer types also everywhere else.
...
It solves issues with int/long int/long long int ambiguity, which is
good.
14 years ago
Vladimír Vondruš
eb803200d6
Disabled denormalization test for long double altogether.
...
Fails in Debug, but passes in Release mode on my GCC 4.7 @ x86_64. Not
sure what to do about it.
14 years ago
Vladimír Vondruš
3d77885555
Revert "Overflow test for large types in Math::normalize() started working."
...
It was working because of some weird state of my build dir, expecting
fail again.
This reverts commit 75d0505a60 .
14 years ago
Vladimír Vondruš
75d0505a60
Overflow test for large types in Math::normalize() started working.
...
I don't know what caused that... :-)
14 years ago
Vladimír Vondruš
fe62f547de
Reduced #includes in headers.
...
Magnum.h now doesn't include anything except OpenGL headers, thus
changes in Math library don't trigger recompilation of everything, but
only of things really depending on it.
Math constants moved to separate file for similar reasons, de-inlined
some functions to remove the need for some #includes.
14 years ago
Vladimír Vondruš
3558859cc6
Utility function for clamping value in given limits.
14 years ago
Vladimír Vondruš
51f2478b1e
More precise double Math constants.
...
Double has 15-17 significant decimal digits precision, extended
the constant to have 15 decimal digits. On the other hand, float has
only 6-9 digits, so there is no need to have more than 9.
Added just-to-be-sure test for sqrt* constants.
14 years ago
Vladimír Vondruš
3bcaed6322
Using round() in denormalization.
...
Gives more precise results for smaller types, but creates overflow for
large types.
14 years ago
Vladimír Vondruš
2553e50444
Functions for normalizing and denormalizing numeric values.
14 years ago
Vladimír Vondruš
27e1dce533
Got rid of Qt's QtTest in favor of Corrade's TestSuite.
...
Now we can use CORRADE_COMPARE() almost exclusively for comparing
Vector, Matrix instances and all containers from STL. Tests running time
for all 31 tests is now around 0.1 sec instead of two seconds like
before.
Disabled compilation of all benchmarks, because TestSuite cannot handle
them yet.
PKGBUILD from AUR now can shamelessly use check() function without
unnecessary dependencies.
14 years ago
Vladimír Vondruš
7f6f81afc7
Math::Constants are now inline functions instead of static variables.
...
Static variables were compiled into the library and then linked on
every use, which was not good for performance.
14 years ago
Vladimír Vondruš
925cc3d2ff
Make Math::pow() templated on type.
14 years ago
Vladimír Vondruš
f0d88fbf9f
Added templated Math::Constants structure to replace PI #define.
...
And added sqrt(2) and sqrt(3) constants while we are at it.
14 years ago
Vladimír Vondruš
c14715962d
Use T() instead of static_cast<T>() for numeric types.
14 years ago
Vladimír Vondruš
b945f5f68b
Happy New Year.
15 years ago
Vladimír Vondruš
e536c892c4
Added Math::pow() and Math::log() functions.
...
Math::pow() is templated on exponent, so it should be as fast as
possible (without recursion).
15 years ago
Vladimír Vondruš
e74168bb88
Added test for Math::deg() and Math::rad().
15 years ago
Vladimír Vondruš
8555475807
Support for printing Matrix and Vector to debug output.
...
Added tests for Matrix3, Vector2 just to be sure that debug output works
also there.
15 years ago
Vladimír Vondruš
c7b331d100
(Ahem...) Happy New Year!
15 years ago