Vladimír Vondruš
263d8351b6
Math: vector overloads for normalize() and denormalize().
13 years ago
Vladimír Vondruš
ec23a3d13c
Minor code cleanup.
13 years ago
Vladimír Vondruš
ad9a55a867
Doc++
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š
bdba6b7221
Math: no need to have two versions of denormalize(), they are the same.
...
Overlooked in cade175304 .
13 years ago
Vladimír Vondruš
3daefd70a9
Math: simplified internal pow<n>() implementation.
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š
7183110eee
Doc++, @todo++
14 years ago
Vladimír Vondruš
c7d7fdad28
Math: removed done TODO.
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š
cdc2e5302c
Using fixed-size 32bit integer instead of size_t for log/pow.
...
I want something like "use 32bit on x86, but 64bit on x86_64 and
x86_32", but <cstdint> header has nothing like that.
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š
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š
d96cb96d60
Documented convenience functions on vectors and angles.
14 years ago
Vladimír Vondruš
eeca90c17c
Added @todos .
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š
45d1cb1225
Anonymized unused function parameters.
14 years ago
Vladimír Vondruš
6f65dd972c
Renamed visibility configuration headers to resemble library names.
14 years ago
Vladimír Vondruš
4af08d04c1
Renamed visibility headers to distinguish them from API headers.
...
Also added note about that to coding style documentation.
14 years ago
Vladimír Vondruš
952f8ebb27
Compiling with -fvisibility=hidden.
...
Reusing macros MAGNUM_EXPORT and friends already used for Windows
builds. For exported classes added MAGNUM_LOCAL to private members which
are not referenced from any inline function. Added explicit
MAGNUM_EXPORT to private members which are referenced. CMake provides
its own macro <target>_EXPORTS, using that instead of
set_target_properties().
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š
09acfa711f
Documented directories containing various namespaces.
14 years ago
Vladimír Vondruš
2b7aa09520
Added some TODOs.
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š
1cf69616a3
Documentation updates, "markdownization".
...
All HTML code and Doxygen shortcuts such as @c , @b and @em are now
rewritten using Markdown syntax, which makes it more readable.
Also updated Doxyfile. Doxygen 1.8 at least is required to generate
the documentation now.
14 years ago
Vladimír Vondruš
8efb5a1e42
Added dllimport/dllexport macros for Windows builds.
14 years ago
Vladimír Vondruš
8d525be511
Using TypeTraits::epsilon and TypeTraits::equals instead of EPSILON.
...
Improves comparison performance on integral Matrix and Vector, fixes NaN
comparison bug (but infinity bug is still present).
14 years ago
Vladimír Vondruš
e0b4fca4fe
Doc++
...
Removed doc/namespaces.dox, moved namespace documentation to main files
of given namespace.
15 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š
be3dd97d0a
Renamed Math/{constants.h => Math.h}.
15 years ago
Vladimír Vondruš
3c1f5392e8
Useful functions for making angle entering less error-prone.
...
Both functions convert the value to radians at compile time. For
example deg(180.0f) is converted to 3.14f. Less intuitive than
user-defined literals (C++11 feature), but works everywhere.
15 years ago
Vladimír Vondruš
c7b331d100
(Ahem...) Happy New Year!
15 years ago
Vladimír Vondruš
e746fc88c0
Lowered fuzzy compare precision even more
...
Reason for that was that Matrix(m)*Matrix(m).inverse() == Matrix() shouldn't
fail with overprecision.
16 years ago
Vladimír Vondruš
dc420e69fc
Even smaller precision for floating point comparison.
16 years ago
Vladimír Vondruš
c41d6ad582
New namespace Magnum::Math.
16 years ago
Vladimír Vondruš
2a2d8c3dd5
Template vector class.
16 years ago
Vladimír Vondruš
8f0bacd2f8
Function for transposing matrix.
16 years ago
Vladimír Vondruš
09d74422d9
Initial commit
16 years ago