add QCOMPARE_QUATS macro for easier tests

This commit is contained in:
Andrew Meadows 2015-08-12 17:52:54 -07:00
parent f4e77b8200
commit f64ab8e6b0

View file

@ -59,4 +59,8 @@ inline QTextStream& operator<< (QTextStream& stream, const glm::mat4& matrix) {
stream << "]\n\t"; // hacky as hell, but this should work...
return stream;
}
#define QCOMPARE_QUATS(rotationA, rotationB, angle) \
QVERIFY(fabsf(1.0f - fabsf(glm::dot(rotationA, rotationB))) < 2.0f * sinf(angle))
#endif