* Quaternion.cs:

* Quaterniond.cs: Check for W > 1.0 _or_ W < -1.0 before normalizing
  in ToAxisAngle. Resolves issue [#2465]: "Quaternion rotation bug".
This commit is contained in:
the_fiddler 2011-07-10 14:48:29 +00:00
parent 36349f667f
commit ed5c64208b
2 changed files with 2 additions and 2 deletions

View file

@ -135,7 +135,7 @@ namespace OpenTK
public Vector4 ToAxisAngle() public Vector4 ToAxisAngle()
{ {
Quaternion q = this; Quaternion q = this;
if (q.W > 1.0f) if (Math.Abs(q.W) > 1.0f)
q.Normalize(); q.Normalize();
Vector4 result = new Vector4(); Vector4 result = new Vector4();

View file

@ -135,7 +135,7 @@ namespace OpenTK
public Vector4d ToAxisAngle() public Vector4d ToAxisAngle()
{ {
Quaterniond q = this; Quaterniond q = this;
if (q.W > 1.0f) if (Math.Abs(q.W) > 1.0f)
q.Normalize(); q.Normalize();
Vector4d result = new Vector4d(); Vector4d result = new Vector4d();