Vladimír Vondruš
bd00adc437
Math: test copy construction from base classes.
...
Copy construction from the same class should just work.
13 years ago
Vladimír Vondruš
7427292173
Math: test "implicitness" of value constructors.
13 years ago
Vladimír Vondruš
8669907346
Math: merge constexpr test of BoolVector into other test cases.
13 years ago
Vladimír Vondruš
845b8982e5
Reducing pointer chasings, part 2: don't use `this->` so often.
...
It clarifies some things (e.g. from what base given member is). Not
changed where it would be too long to write.
13 years ago
Vladimír Vondruš
20dcab0c88
Math: added Matrix[34]::rotationNormalized().
...
Useful to pass normal matrices to shader, namely with recent commit
b349ca54ad .
13 years ago
Vladimír Vondruš
56bb116305
Fix loud linker error on mingw32.
...
Mingw for some reasons instantiates depending template before dependent
one, causing the dependent one to be instantiated twice.
13 years ago
Vladimír Vondruš
759a28ef45
Math: improved documentation for *::isNormalized().
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š
5bbe3df0ef
Math: use both const and constexpr.
...
Spotted by Clang.
13 years ago
Vladimír Vondruš
9ccc63b4aa
Math: fixed strict aliasing warning.
...
Is there _any_ use case of reinterpret_cast where GCC won't loudly
complain?
13 years ago
Vladimír Vondruš
5a368c4fba
Math: ability to read and write Rectangle to configuration.
13 years ago
Vladimír Vondruš
3f9d449f58
Math: fix compilation with Clang.
...
It seems that with Clang you cannot split declaration and definition of
`constexpr` function. These should be as short as possible anyway, thus
it is non-issue.
13 years ago
Vladimír Vondruš
330794d710
Documentation fixes.
13 years ago
Vladimír Vondruš
06a4e297bc
Math: deinlined heavy functions, removed redundant `inline`.
...
Also fixed unary RectangularMatrix::operator-() and Vector::operator-()
documentation (was stating that the operation is done in-place, which is
impossible.
13 years ago
Vladimír Vondruš
db05553e65
Math: another C++14 todo :-)
13 years ago
Vladimír Vondruš
316a2d1c37
Math: removed superfluous instantiation sources.
...
Moved all instantiation into instantiation.cpp and removed the rest
(~200 lines of mainly license headers). Saves another ~3 seconds (4:06
before, 4:03 now). I'm done with these micro-optimizations for now.
13 years ago
Vladimír Vondruš
a63fea570a
Math: don't include <algorithm> in header file.
...
31ce072f39 was wrong, this header is
harmful. This beast includes ~46k LOC, much more than <*stream> class of
headers. Rewritten min() and max() manually, which surprisingly leads to
shorter implementation than previously. Compilation time on my machine
reduced from ~4:30 to ~4:21, not bad.
13 years ago
Vladimír Vondruš
fc58631aa5
Math: added convenience function Vector::resized().
13 years ago
Vladimír Vondruš
09ec2006be
Use `\bot` instead of `\perp` in math formulas.
...
`\perp` is for relations, `\bot` is usable as "name". Thanks @JanDupal
for hints :-)
13 years ago
Vladimír Vondruš
1f675cae25
Math::Geometry: cleaned up Distance, removed use of Matrix.
...
The same functionality is now provided in Vector2::cross() which is
also more meaningful.
13 years ago
Vladimír Vondruš
bf09b037da
Math::Geometry: cleaned up Distance test.
...
Everything is working as expected, which is ahem... unexpected.
13 years ago
Vladimír Vondruš
a4a962f686
Math: fixed matrix tests (spotted by Clang).
...
Either GCC 4.8 poorly implements C++11 or it already has support for
some proposed C++14 feature, which allows to elide successive
initializer braces.
13 years ago
Vladimír Vondruš
446b108bde
Added TODOs.
13 years ago
Vladimír Vondruš
a21fd0df07
Math: ability to convert matrices from/to external representation.
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š
2447ca9fb5
Added some TODOs.
13 years ago
Vladimír Vondruš
e147cc3992
Doc++, TODO++
13 years ago
Vladimír Vondruš
7ef8432fbe
Doxygen: ignore specific namespaces instead of whole directories.
...
Less maintenance burden with `#ifndef DOXYGEN_GENERATING_OUTPUT`,
removed the ones which are not needed anymore.
13 years ago
Vladimír Vondruš
458e146765
Math: std::fma() is not available in NaCl's newlib.
13 years ago
Vladimír Vondruš
f6ae87376b
Math: added function fma().
13 years ago
Vladimír Vondruš
1402833553
Math: added TODO.
13 years ago
Vladimír Vondruš
3f696533ff
Math: algorithm for computing intersection of two lines in 2D.
13 years ago
Vladimír Vondruš
6385ae1478
Math: more Intersection test cleanup.
13 years ago
Vladimír Vondruš
fd531b5101
Math: cleaned up plane/line intersection.
...
The function now accepts starting point and direction of the line (not
starting and ending point). Also improved the documentation and test a
bit.
13 years ago
Vladimír Vondruš
4ab3ab6534
Math: added Vector::lengthInverted().
...
Also because there are SIMD instructions for that.
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š
7c3cb652bd
Math: doc++
13 years ago
Vladimír Vondruš
bf58bb3cb1
Math: rework of component-wise matrix and vector functions.
...
First, removed functions which can be done with Vector's member
functions and functions from Functions.h. More flexibility and less
redundant code which leads to easier SIMD implementation later.
Vector4 a;
Float b = a.maxAbs(); // before
Float b = Math::abs(a).max(); // now
Second, removed all functions from RectangularMatrix which are
implemented in Vector and added conversion from RectangularMatrix to
Vector and back. Also for more flexibility and less redundant code (i.e.
reusing SIMD-optimized Vector::max() instead of writing it again).
Matrix4x3 a;
Float b = a.max(); // before
Float b = a.toVector().max(); // now
13 years ago
Vladimír Vondruš
a80b4b146d
Math: write Vector2::cross() in terms of perpendicular() and dot().
13 years ago
Vladimír Vondruš
49154f30c4
Math: added Vector2::perpendicular().
...
Also updated and crosslinked related documentation.
13 years ago
Vladimír Vondruš
bba3755da1
GCC 4.8 compilation fixes.
13 years ago
Vladimír Vondruš
b7aeccad4c
Clang compilation fixes.
13 years ago
Vladimír Vondruš
0cd98456da
Math: Added Vector2::cross().
13 years ago
Vladimír Vondruš
b0883f8d6b
Doc++
13 years ago
Vladimír Vondruš
5e8606a755
Math: added sign() function.
13 years ago
Vladimír Vondruš
56139ae365
Math: no need to provide implementation just for Doxygen.
13 years ago
Vladimír Vondruš
8d5b2cae71
Math: std::hypot() is not available in NaCl newlib.
...
Probably bug / not-yet-implemented feature.
13 years ago
Vladimír Vondruš
64585ca4fd
GCC 4.6 compatibility: vector conversion is not constexpr.
13 years ago
Vladimír Vondruš
2d71c86942
Math: make trignometric functions working with Unit base class.
...
The test now passes again.
13 years ago