Vladimír Vondruš
b55f3a2071
Math: function for negating Quaternion, improved tests.
14 years ago
Vladimír Vondruš
8e93520bd6
Math: converting Quaternion to rotation matrix.
14 years ago
Vladimír Vondruš
3b92d2b9f3
Math: creating Quaternion from axis/angle.
14 years ago
Vladimír Vondruš
3126d0947d
Math: "checked" function for inverting normalized Quaternion.
14 years ago
Vladimír Vondruš
3b57d530a4
Math: test also properties of normalized Quaternion.
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š
89c2bf913c
Math: initial implementation of Quaternion class.
...
Still practically unusable.
14 years ago
Vladimír Vondruš
5de5b34c48
Math: function for projecting vector onto another.
14 years ago
Vladimír Vondruš
d981090e86
Functions for inverting Euclidean transformation matrices.
14 years ago
Vladimír Vondruš
e9e0de70d7
Implemented reflection matrices.
...
Long-standing TODO, can be used for in-game mirrors etc. I give up with
shearing, as I think that it makes sense only in 2D and I can't find any
reasonable use case for that yet.
14 years ago
Vladimír Vondruš
6ae94bffd7
Ability to construct Matrix from rotation/scaling and translation parts.
14 years ago
Vladimír Vondruš
ef779e50b2
Split out lightweight base of swizzle() function to Math namespace.
...
Will make use of SIMD instructions and can be used elsewhere in Math.
14 years ago
Vladimír Vondruš
47c0a7456c
Adapted to Corrade changes.
...
Removing of another <*stream> #include leads to more compilation time
saving, now from ~5:12 to ~4:55. Another compilation time improvements
will now be possible only by using Clang's modules, I don't know where
to optimize further (except for getting rid of <sstream> in tests).
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š
c319962d6e
Adapted to Corrade changes.
14 years ago
Vladimír Vondruš
ae013effff
Adapted to Corrade changes.
...
Optimalizations in Corrade::TestSuite and Corrade::Utility::Debug leaded
to significant reduction of compilation time - on my machine it was
~5:38 before with building of unit tests enabled, now only ~5:00.
14 years ago
Vladimír Vondruš
12817b505d
Test vector component accessors.
...
Really. To be sure. Forever.
14 years ago
Vladimír Vondruš
a9d2062efe
More checks for sanity of Matrix4::rotation().
...
These should be true for all rotation matrices.
14 years ago
Vladimír Vondruš
6dbdf58476
Component-wise comparison for Vector class.
14 years ago
Vladimír Vondruš
f184c6f005
Using real class for testing configuration value parsing.
14 years ago
Vladimír Vondruš
6dda7e4c1f
Convenience functions for accessing Matrix[34] vectors.
14 years ago
Vladimír Vondruš
1e2720eeb7
Explicit template instantiation for common matrix and vector functions.
...
Common types used in OpenGL have now explicit template instantiation for
debug operators and configuration value parsers/readers.
14 years ago
Vladimír Vondruš
b5fc786478
Renamed Matrix4::[xyz]Rotation() to Matrix4::rotation[XYZ]().
...
* "Rotation around [XYZ]" makes more sense than "[XYZ] axis rotation".
* This naming will appear in autocompletion.
* SceneGraph transformation methods will be named similarly
rotate[XYZ]() (because [xyz]Rotate() is weird even more).
14 years ago
Vladimír Vondruš
f707e91599
Better parameter names in Matrix transformation methods.
...
Mainly it is now explicitly stated in parameter name that rotation axis
must be normalized.
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š
ecad221a8b
Faster alternatives for rotation around main axes.
14 years ago
Vladimír Vondruš
93961aca65
Don't include Matrix3 in Matrix4, as it isn't used.
...
Also updated includes in dependent headers.
14 years ago
Vladimír Vondruš
fb70ef046a
Functions for getting translation part of the matrix.
14 years ago
Vladimír Vondruš
71784a777c
Functions for getting 2D rotation and scaling part of 3x3 matrix.
...
Crosslinked the documentation with 2D/3D alternatives and
"setters"/"getters".
14 years ago
Vladimír Vondruš
a385441c02
Moved type conversion constructor from Vector to RectangularMatrix.
14 years ago
Vladimír Vondruš
03f135e696
Documentation clarification, assertion update.
...
Don't yell at the user all the time.
14 years ago
Vladimír Vondruš
7c17871c90
Assuming the vectors are normalized in Matrix4::rotation().
14 years ago
Vladimír Vondruš
071afa0b7a
Point*D Vector* subclasses for homogeneous coordinates.
...
Vector4 doesn't set W component to one by default anymore, this is now
handled by Point*D itself. This finally allows creating of 2D primitives
and 2D position vectors without messing explicitly with Z = 1.
All classes which should use Point instead of Vector were updated to use
Point instead.
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š
742a75277d
Moved unary operator- from Vector to RectangularMatrix.
14 years ago
Vladimír Vondruš
e21c9ca3a5
Function for computing trace of square matrix.
14 years ago
Vladimír Vondruš
3558859cc6
Utility function for clamping value in given limits.
14 years ago
Vladimír Vondruš
8911dbdffe
Moved multiplication and division from Vector to RectangularMatrix.
14 years ago
Vladimír Vondruš
4bcc805616
Moved add/subtract operators from Vector to RectangularMatrix.
14 years ago
Vladimír Vondruš
90881e7337
New base for matrices and vectors: RectangularMatrix.
...
Currently moved only non-square functionality from Matrix there. Also
static constant members such as row/column count and size are now
lowercase, as they are variables, not types.
14 years ago
Vladimír Vondruš
0e74c3847d
Support for storing matrices and vectors in configuration.
14 years ago
Vladimír Vondruš
2b62cc4012
Prefer to use (col, row) instead of [col][row] on matrices.
...
They should be in theory both compiled to the same code, but in practice
[][] sometimes fails during optimization.
14 years ago
Vladimír Vondruš
a5b8afa122
Added Vector2::*Scale() and Vector3::*Scale().
...
Complements to *Axis for scaling.
14 years ago
Vladimír Vondruš
b8750d3702
Added Vector2::*Axis(), similar to those in Vector3.
14 years ago
Vladimír Vondruš
0e08138806
Added number*Vector and number/Vector operators.
14 years ago
Vladimír Vondruš
a4c80d18ed
Added component-wise multiplication and division to Vector.
14 years ago
Vladimír Vondruš
fec65aa6f5
Ability to construct Vector from another of different type.
14 years ago