diff --git a/src/Math/Matrix4.h b/src/Math/Matrix4.h index 0e4a94cee..7fda233b9 100644 --- a/src/Math/Matrix4.h +++ b/src/Math/Matrix4.h @@ -73,8 +73,8 @@ template class Matrix4: public Matrix<4, T> { * @param angle Rotation angle (counterclockwise, in radians) * @param normalizedAxis Normalized rotation axis * - * If possible, use faster alternatives like xRotation(), yRotation() - * or zRotation(). + * If possible, use faster alternatives like rotationX(), rotationY() + * and rotationZ(). * @see rotation() const, Matrix3::rotation(T), Vector3::xAxis(), * Vector3::yAxis(), Vector3::zAxis(), deg(), rad() * @attention Assertion fails on non-normalized rotation vector and @@ -117,10 +117,10 @@ template class Matrix4: public Matrix<4, T> { * @param angle Rotation angle (counterclockwise, in radians) * * Faster than calling `Matrix4::rotation(angle, Vector3::xAxis())`. - * @see rotation(T, const Vector3&), yRotation(), zRotation(), + * @see rotation(T, const Vector3&), rotationY(), rotationZ(), * rotation() const, Matrix3::rotation(T), deg(), rad() */ - static Matrix4 xRotation(T angle) { + static Matrix4 rotationX(T angle) { T sine = std::sin(angle); T cosine = std::cos(angle); @@ -137,10 +137,10 @@ template class Matrix4: public Matrix<4, T> { * @param angle Rotation angle (counterclockwise, in radians) * * Faster than calling `Matrix4::rotation(angle, Vector3::yAxis())`. - * @see rotation(T, const Vector3&), xRotation(), zRotation(), + * @see rotation(T, const Vector3&), rotationX(), rotationZ(), * rotation() const, Matrix3::rotation(T), deg(), rad() */ - static Matrix4 yRotation(T angle) { + static Matrix4 rotationY(T angle) { T sine = std::sin(angle); T cosine = std::cos(angle); @@ -157,10 +157,10 @@ template class Matrix4: public Matrix<4, T> { * @param angle Rotation angle (counterclockwise, in radians) * * Faster than calling `Matrix4::rotation(angle, Vector3::zAxis())`. - * @see rotation(T, const Vector3&), xRotation(), yRotation(), + * @see rotation(T, const Vector3&), rotationX(), rotationY(), * rotation() const, Matrix3::rotation(T), deg(), rad() */ - static Matrix4 zRotation(T angle) { + static Matrix4 rotationZ(T angle) { T sine = std::sin(angle); T cosine = std::cos(angle); diff --git a/src/Math/Test/Matrix4Test.cpp b/src/Math/Test/Matrix4Test.cpp index b65142c53..a124d2b4c 100644 --- a/src/Math/Test/Matrix4Test.cpp +++ b/src/Math/Test/Matrix4Test.cpp @@ -36,9 +36,9 @@ Matrix4Test::Matrix4Test() { &Matrix4Test::translation, &Matrix4Test::scaling, &Matrix4Test::rotation, - &Matrix4Test::xRotation, - &Matrix4Test::yRotation, - &Matrix4Test::zRotation, + &Matrix4Test::rotationX, + &Matrix4Test::rotationY, + &Matrix4Test::rotationZ, &Matrix4Test::rotationScalingPart, &Matrix4Test::rotationPart, &Matrix4Test::translationPart, @@ -108,31 +108,31 @@ void Matrix4Test::rotation() { CORRADE_COMPARE(Matrix4::rotation(deg(-74.0f), Vector3(-1.0f, 2.0f, 2.0f).normalized()), matrix); } -void Matrix4Test::xRotation() { +void Matrix4Test::rotationX() { Matrix4 matrix(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.90096887f, 0.43388374f, 0.0f, 0.0f, -0.43388374f, 0.90096887f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); CORRADE_COMPARE(Matrix4::rotation(rad(Math::Constants::pi()/7), Vector3::xAxis()), matrix); - CORRADE_COMPARE(Matrix4::xRotation(rad(Math::Constants::pi()/7)), matrix); + CORRADE_COMPARE(Matrix4::rotationX(rad(Math::Constants::pi()/7)), matrix); } -void Matrix4Test::yRotation() { +void Matrix4Test::rotationY() { Matrix4 matrix(0.90096887f, 0.0f, -0.43388374f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.43388374f, 0.0f, 0.90096887f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); CORRADE_COMPARE(Matrix4::rotation(rad(Math::Constants::pi()/7), Vector3::yAxis()), matrix); - CORRADE_COMPARE(Matrix4::yRotation(rad(Math::Constants::pi()/7)), matrix); + CORRADE_COMPARE(Matrix4::rotationY(rad(Math::Constants::pi()/7)), matrix); } -void Matrix4Test::zRotation() { +void Matrix4Test::rotationZ() { Matrix4 matrix( 0.90096887f, 0.43388374f, 0.0f, 0.0f, -0.43388374f, 0.90096887f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); CORRADE_COMPARE(Matrix4::rotation(rad(Math::Constants::pi()/7), Vector3::zAxis()), matrix); - CORRADE_COMPARE(Matrix4::zRotation(rad(Math::Constants::pi()/7)), matrix); + CORRADE_COMPARE(Matrix4::rotationZ(rad(Math::Constants::pi()/7)), matrix); } void Matrix4Test::rotationScalingPart() { diff --git a/src/Math/Test/Matrix4Test.h b/src/Math/Test/Matrix4Test.h index 7e22e979a..783c6adb2 100644 --- a/src/Math/Test/Matrix4Test.h +++ b/src/Math/Test/Matrix4Test.h @@ -28,9 +28,9 @@ class Matrix4Test: public Corrade::TestSuite::Tester { void translation(); void scaling(); void rotation(); - void xRotation(); - void yRotation(); - void zRotation(); + void rotationX(); + void rotationY(); + void rotationZ(); void rotationScalingPart(); void rotationPart(); void translationPart();