diff --git a/CREDITS b/CREDITS index 1722a8414..b40cd7198 100644 --- a/CREDITS +++ b/CREDITS @@ -97,3 +97,6 @@ Contributed updated and improved xcode workspaces - drparallax Contributed the /samples/SimpleAssimpViewX sample + +- Carsten Fuchs +Contributed a fix for the Normalize method in aiQuaternion. diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 07baa759f..489479ea4 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -112,6 +112,8 @@ SOURCE_GROUP( Common FILES ScenePreprocessor.h SkeletonMeshBuilder.cpp SkeletonMeshBuilder.h + SplitByBoneCountProcess.cpp + SplitByBoneCountProcess.h SmoothingGroups.h StandardShapes.cpp StandardShapes.h @@ -615,6 +617,8 @@ ADD_LIBRARY( assimp SHARED SceneCombiner.h ScenePreprocessor.cpp ScenePreprocessor.h + SplitByBoneCountProcess.cpp + SplitByBoneCountProcess.h SkeletonMeshBuilder.cpp SkeletonMeshBuilder.h SmoothingGroups.h diff --git a/include/aiQuaternion.h b/include/aiQuaternion.h index 1b54dcc3e..0b3032a85 100644 --- a/include/aiQuaternion.h +++ b/include/aiQuaternion.h @@ -264,13 +264,14 @@ inline void aiQuaternion::Interpolate( aiQuaternion& pOut, const aiQuaternion& p inline aiQuaternion& aiQuaternion::Normalize() { // compute the magnitude and divide through it - const float mag = x*x+y*y+z*z+w*w; + const float mag = sqrt(x*x + y*y + z*z + w*w); if (mag) { - x /= mag; - y /= mag; - z /= mag; - w /= mag; + const float invMag = 1.0f/mag; + x *= invMag; + y *= invMag; + z *= invMag; + w *= invMag; } return *this; }