Vladimír Vondruš
6edc26ff01
Math: more explicit Quaternion-from-Vector constructor test.
...
For better readability, nothing more.
13 years ago
Vladimír Vondruš
b0d79bbad8
Math: minor code cleanup.
13 years ago
Vladimír Vondruš
d59b620fd9
Math: transforming vectors with complex numbers.
13 years ago
Vladimír Vondruš
4ebd204482
Math: angle between two complex numbers.
...
Also crosslinked the documentation with similar functions in Vector and
Quaternion.
13 years ago
Vladimír Vondruš
728b9a3f2e
Math: construct identity transformation by default.
...
Square matrices already had that, (dual) quaternions too, making that
the default also with complex numbers. Updated the documentation to
reflect that.
13 years ago
Vladimír Vondruš
9464e805e1
Use {} instead of "".
...
Calls default std::string constructor instead of converting from const
char*, might possibly save unneeded allocation.
13 years ago
Vladimír Vondruš
9dbd8c9356
Math: renamed Quaternion::rotateVector*() to transformVector*().
...
Now it is consistent with Matrix and can be easily used in templates.
13 years ago
Vladimír Vondruš
3cbeb43078
Cleaned up includes.
13 years ago
Vladimír Vondruš
c293630c7c
Math: using Rad for Quaternion and DualQuaternion functions.
13 years ago
Vladimír Vondruš
dccfc1f8ba
Math: test constexpr methods on Quaternion.
13 years ago
Vladimír Vondruš
83346ce023
Math: converting DualQuaternion to matrix.
...
Also updated and simplified Quaternion to matrix test.
13 years ago
Vladimír Vondruš
a49bb0d718
Math: convenience functions for transforming vectors with matrices.
...
It's now possible to conveniently transform 2D vectors and points with
3x3 matrices and 3D vectors/points with 4x4 matrices. Previous most
low-level solution:
Matrix4 m;
Vector3 v;
Vector3 a = (m*Vector4(v, 1.0f)).xyz();
Vector4 b = (m*Vector4(v, 0.0f)).xyz();
Another, more generalized solution for points was with Point2D/Point3D,
adding a lot of confusion (what is that class and what does .vector()?):
Vector3 a = (m*Point3D(v)).vector();
And the worst solution was with generic 2D/3D code (WTF!):
auto a = (m*typename DimensionTraits::PointType(v)).vector();
Now it is just this, similar for both dimensions:
Vector3 a = m.transformPoint(v);
Vector3 b = m.transformVector(v);
Note that transformation three-component vectors with 3x3 matrices or
four-component vectors with 4x4 matrices is easy enough so it doesn't
need any special convenience functions whatsoever:
Vector3 c = m.rotation()*v;
13 years ago
Vladimír Vondruš
0f130ad55d
Math: simplified Quaternion::rotateVector*() tests.
...
Comparing to Matrix4 transformation.
13 years ago
Vladimír Vondruš
4c1608378a
Math: document that Quaternion::rotationAxis() might return NaN vector.
13 years ago
Vladimír Vondruš
5d6b2b4ecd
Math: properly test Quaternion comparison.
13 years ago
Vladimír Vondruš
95982e5176
Math: various code cleanup.
13 years ago
Vladimír Vondruš
a0b8dcc067
Math: rename Quaternion::fromRotation() to rotation().
...
Now it is similar in usage to Matrix4 functions and is now also
crossreferenced in documentation. Also updated the test to also check
assertion.
13 years ago
Vladimír Vondruš
93ac7f0d3c
Math: rotating vectors with Quaternion.
13 years ago
Vladimír Vondruš
730c09567d
Math: ability to explicitly create Quaternion for given vector.
13 years ago
Vladimír Vondruš
7c81755152
Math: slightly reorganize Quaternion test.
13 years ago
Vladimír Vondruš
e58962dc43
Don't use fully qualified Corrade::Utility::Debug when not needed.
13 years ago
Vladimír Vondruš
f06b53724c
Math: spherical linear Quaternion interpolation.
14 years ago
Vladimír Vondruš
b9f21d1430
Removed unnecessary prefix from test filename.
...
My brain is lagging behind my keyboard.
14 years ago
Vladimír Vondruš
669a08daa5
Math: angle between two quaternions.
...
Also updated related Vector test.
14 years ago
Vladimír Vondruš
53a95b6296
Math: test also parameterless Quaternion::dot().
...
Just to be sure (and to be consistent with Vector test).
14 years ago
Vladimír Vondruš
23a94b2709
Math: Quaternion has dot product too!
...
Original lengthSquared() renamed to parameterless dot(), it is now
consistent with what Vector has. Also updated related Vector
documentation.
14 years ago
Vladimír Vondruš
ed147ebe40
Math: linear Quaternion interpolation.
14 years ago
Vladimír Vondruš
eaa819755f
Math: added Quaternion addition and subtraction.
14 years ago
Vladimír Vondruš
705bf3f597
Math: reverse scalar/quaternion multiplication and division operators.
...
Also updated related documentation in RectangularMatrix.
14 years ago
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š
89c2bf913c
Math: initial implementation of Quaternion class.
...
Still practically unusable.
14 years ago