From 10688c0168fc010671abc59f367c19357bb6776c Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 16 Apr 2009 08:02:54 +1000 Subject: Rename QQuaternion::interpolate() to slerp() slerp() is the more common-place name in the 3D community. Reviewed-by: trustme --- src/gui/math3d/qquaternion.cpp | 2 +- src/gui/math3d/qquaternion.h | 2 +- tests/auto/math3d/qquaternion/tst_qquaternion.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/math3d/qquaternion.cpp b/src/gui/math3d/qquaternion.cpp index 4c6230a..1348fed 100644 --- a/src/gui/math3d/qquaternion.cpp +++ b/src/gui/math3d/qquaternion.cpp @@ -485,7 +485,7 @@ QQuaternion QQuaternion::fromAxisAndAngle If \a t is less than or equal to 0, then \a q1 will be returned. If \a t is greater than or equal to 1, then \a q2 will be returned. */ -QQuaternion QQuaternion::interpolate +QQuaternion QQuaternion::slerp (const QQuaternion& q1, const QQuaternion& q2, qreal t) { // Handle the easy cases first. diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index a03b53b..ad6fddf 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -124,7 +124,7 @@ public: static QQuaternion fromAxisAndAngle (qreal x, qreal y, qreal z, qreal angle); - static QQuaternion interpolate + static QQuaternion slerp (const QQuaternion& q1, const QQuaternion& q2, qreal t); private: diff --git a/tests/auto/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/math3d/qquaternion/tst_qquaternion.cpp index fd7c7f8..6a69755 100644 --- a/tests/auto/math3d/qquaternion/tst_qquaternion.cpp +++ b/tests/auto/math3d/qquaternion/tst_qquaternion.cpp @@ -88,8 +88,8 @@ private slots: void fromAxisAndAngle_data(); void fromAxisAndAngle(); - void interpolate_data(); - void interpolate(); + void slerp_data(); + void slerp(); }; // qFuzzyCompare isn't quite "fuzzy" enough to handle conversion @@ -693,7 +693,7 @@ void tst_QQuaternion::fromAxisAndAngle() } // Test spherical interpolation of quaternions. -void tst_QQuaternion::interpolate_data() +void tst_QQuaternion::slerp_data() { QTest::addColumn("x1"); QTest::addColumn("y1"); @@ -740,7 +740,7 @@ void tst_QQuaternion::interpolate_data() << (qreal)0.5f << (qreal)1.0f << (qreal)2.0f << (qreal)-3.0f << (qreal)-45.0f; } -void tst_QQuaternion::interpolate() +void tst_QQuaternion::slerp() { QFETCH(qreal, x1); QFETCH(qreal, y1); @@ -760,7 +760,7 @@ void tst_QQuaternion::interpolate() QQuaternion q2 = QQuaternion::fromAxisAndAngle(x2, y2, z2, angle2); QQuaternion q3 = QQuaternion::fromAxisAndAngle(x3, y3, z3, angle3); - QQuaternion result = QQuaternion::interpolate(q1, q2, t); + QQuaternion result = QQuaternion::slerp(q1, q2, t); QVERIFY(fuzzyCompare(result.x(), q3.x())); QVERIFY(fuzzyCompare(result.y(), q3.y())); -- cgit v0.12