From 855b3676e832dcf4d235aab92ad6d0bf96f88519 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 24 Oct 2012 18:21:33 +0200 Subject: [PATCH] Fixed quaternion interpolation Former-commit-id: b43671708fb9e64517a67ba070167587688457fb --- include/Nazara/Math/Quaternion.inl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/Nazara/Math/Quaternion.inl b/include/Nazara/Math/Quaternion.inl index 6969aa3f4..ed88e5f5b 100644 --- a/include/Nazara/Math/Quaternion.inl +++ b/include/Nazara/Math/Quaternion.inl @@ -375,7 +375,13 @@ NzQuaternion NzQuaternion::Lerp(const NzQuaternion& from, const NzQuaterni } #endif - return from + interpolation*(to-from); + NzQuaternion interpolated; + interpolated.w = NzLerp(from.w, to.w, interpolation); + interpolated.x = NzLerp(from.x, to.x, interpolation); + interpolated.y = NzLerp(from.y, to.y, interpolation); + interpolated.z = NzLerp(from.z, to.z, interpolation); + + return interpolated; } template