From 5224a5dd996cb28b57f0ec4a66eb34a8c1563b80 Mon Sep 17 00:00:00 2001 From: jeunathe Date: Thu, 23 Aug 2012 22:08:09 +0000 Subject: [PATCH] Added test in slerp to avoid -1 quat members --- src/math/vector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/vector.cpp b/src/math/vector.cpp index f93a52ab..21edf220 100644 --- a/src/math/vector.cpp +++ b/src/math/vector.cpp @@ -492,7 +492,7 @@ template<> quat quat::slerp(quat QuatA, quat QuatB, float const &Scalar) //btAssert(magnitude > btScalar(0)); float product = lol::dot(QuatA,QuatB) / magnitude; - if (product != 1.0f) + if (product > -1.0f && product < 1.0f) { // Take care of long angle case see http://en.wikipedia.org/wiki/Slerp const float sign = (product < 0.0f) ? -1.0f : 1.0f;