Browse Source

Merge pull request #1419 from irei1as/patch-1

mQuat.h change to fix QuatF::angleBetween
Anis 10 years ago
parent
commit
168a2fe029
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Engine/source/math/mQuat.h

+ 2 - 2
Engine/source/math/mQuat.h

@@ -227,8 +227,8 @@ inline F32 QuatF::dot( const QuatF &q ) const
 
 inline F32 QuatF::angleBetween( const QuatF & q )
 {
-   // angle between to quaternions
-   return mAcos(x * q.x + y * q.y + z * q.z + w * q.w);
+   // angle between two normalized quaternions.
+   return mAcos(q.dot(*this)) * 2.0f;
 }
 
 #endif // _MQUAT_H_