From 5a94eed5c0e29b99a61c18883d9dbdf161c4ed15 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 22 Nov 2011 12:51:50 +0000 Subject: [PATCH] + fix bug in Rotation::normalize() git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5155 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Base/Rotation.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Base/Rotation.cpp b/src/Base/Rotation.cpp index cb2a5368d2..919ea5479f 100644 --- a/src/Base/Rotation.cpp +++ b/src/Base/Rotation.cpp @@ -244,10 +244,12 @@ void Rotation::normalize() this->quat[1]*this->quat[1]+ this->quat[2]*this->quat[2]+ this->quat[3]*this->quat[3]); - this->quat[0] /= len; - this->quat[1] /= len; - this->quat[2] /= len; - this->quat[3] /= len; + if (len != 0) { + this->quat[0] /= len; + this->quat[1] /= len; + this->quat[2] /= len; + this->quat[3] /= len; + } } Rotation & Rotation::invert(void)