Vladimír Vondruš
b6ac0125dc
"Initializer-list" constructor also for Matrix.
14 years ago
Vladimír Vondruš
f8d44a19ed
Removed wrong TODO.
...
Math types cannot be implicitly shared, because they often need to be
casted to float[], for example.
14 years ago
Vladimír Vondruš
7a03e48df8
Finally "initializer-list" constructor for Vector.
...
It's not actually initializer list, because it is only for
variable-length types, which is unusable here. Variadic templates do
better job here.
14 years ago
Vladimír Vondruš
7911c22eff
Removed convenience functions with "unwrapped" Vector parameters.
...
With C++11, objects can be passed nearly as easy as without these
convenience functions, for example:
Matrix4::scaling({0.5f, 1.0f, 0.5f});
which is nearly the same as the following, using convenience function:
Matrix4::scaling(0.5f, 1.0f, 0.5f);
Convenience functions can also be pretty confusing, for example:
Matrix4::rotation(1.0f, -1.0f, 2.0f, 2.0f); // wtf?
Matrix4::rotation(1.0f, {-1.0f, 2.0f, 2.0f}); // ah, okay!
There are also a few neat tricks, which cannot be done using convenience
functions, for example:
Matrix4::translate(Vector3::xAxis(3.0f)); // {3.0f, 0.0f, 0.0f}
Camera::setClearColor({0.1f, 0.1f, 0.1f}); // default 1.0f for alpha
14 years ago
Vladimír Vondruš
28adf2c98b
Added length parameter to Vector3::[xyz]Axis().
...
Now you can write e.g.
Matrix4::translation(Vector3::xAxis(5.0f));
instead of these:
Matrix4::translation(Vector3::xAxis()*5.0f); // slow!
Matrix4::translation({5.0f, 0.0f, 0.0f}); // boring!
14 years ago
Vladimír Vondruš
aedc90e712
Doc++
...
Fixed mainly unwanted Doxygen autolinks.
14 years ago
Vladimír Vondruš
9e81d4b6c3
Fixed awesome mistake in Math::TypeTraits.
...
Epsilon value for integral types should be 1, not 0. Updated
documentation and test to reflect the change.
14 years ago
Vladimír Vondruš
c1374155b0
Math: function to compute product of all values in the vector.
...
Is this mathematic operation at all?
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š
f585d39146
Added Math::TypeTraits, implementing fuzzy comparison based on type.
...
Fuzzy comparison is implemented only on floating-point types with
type-specific epsilon, on integral types classic operator== is used.
TypeTraits class is now extension of Math::TypeTraits (where it makes
sense).
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š
9f8bb86dbb
Preserve space before and after printing Matrix/Vector to Debug output.
...
Modified unit tests to check that.
15 years ago
Vladimír Vondruš
7f24696021
Don't return reference to temporary object in Debug output.
15 years ago
Vladimír Vondruš
cb0efb5d47
Vector3 constructor from Vector2 and optional Z/B value (default 0).
15 years ago
Vladimír Vondruš
31c70f2c08
Doc++
15 years ago
Vladimír Vondruš
eaf7232943
Don't compile Math as static library, as unused symbols are discarded.
...
Currently the files are compiled directly into Magnum library, static
library is used only for testing purposes.
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š
be3dd97d0a
Renamed Math/{constants.h => Math.h}.
15 years ago
Vladimír Vondruš
0d2f2c966f
Doc++
...
Updated and simplified Main page of documentation, finally fixed doxygen
warnings with @copydoc in Math namespace.
15 years ago
Vladimír Vondruš
03289b18ac
Doc++
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š
58ace7d678
Fixed errors with template two-phase lookup, discovered with GCC 4.7.
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š
614373e1af
Magnum now depends on Corrade.
...
Corrade will provide necessary things like plugin management and many
other useful utilities.
15 years ago
Vladimír Vondruš
80a10c9e6c
Doc++
15 years ago
Vladimír Vondruš
32a7f6d082
New class Math::GeometryUtils.
...
GeometryUtils::intersection() computes intersection of a plane and a
line.
15 years ago
Vladimír Vondruš
b27d5efc04
Propagated dot product operator to Vector specializations.
...
Otherwise GCC doesn't see the operator.
15 years ago
Vladimír Vondruš
79aabfc0cc
Store template parameters in Vector class for later retrieving.
15 years ago
Vladimír Vondruš
c7b331d100
(Ahem...) Happy New Year!
15 years ago
Vladimír Vondruš
6f71ba5193
Allow constructing Vector4 from Vector3 with optional W value.
16 years ago
Vladimír Vondruš
2e14f57560
Minor refactoring, documentation.
16 years ago
Vladimír Vondruš
aafecfb4ec
Simple templated multidimensional texture class.
16 years ago
Vladimír Vondruš
6720bc19f0
Specialization should return also specialized class.
16 years ago
Vladimír Vondruš
a1fc2de3a9
Functions for getting/setting particular matrix column.
16 years ago
Vladimír Vondruš
e597ad489f
Added Matrix3 specialization (will be needed for normals, lighting etc.).
16 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š
58398c3059
Function for computing inverse matrix.
16 years ago
Vladimír Vondruš
7f83e821ca
Recursive computation of matrix determinant.
16 years ago
Vladimír Vondruš
c72c36deaa
Don't create identity matrix when it's fully overwritten anyway.
16 years ago
Vladimír Vondruš
252278c91d
Function for skipping given row and column from an matrix.
16 years ago
Vladimír Vondruš
e128b3ab2d
Removed superfluous includes, documentation updates.
16 years ago
Vladimír Vondruš
9e516b97a1
Mathematically correct order of row, col parameters in Matrix functions.
16 years ago
Vladimír Vondruš
00dbbd5ce2
Optimization: using dot product for computing vector length.
16 years ago
Vladimír Vondruš
2745471226
Don't even try to assign self to self.
16 years ago
Vladimír Vondruš
9d9fed3b23
Convenience functions for axes in Vector3.
16 years ago
Vladimír Vondruš
4e2f56c78b
Function for negating a vector.
16 years ago
Vladimír Vondruš
75358451ea
Function for angle between vectors.
16 years ago