mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-05-14 07:42:09 +00:00
* 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:
parent
36349f667f
commit
ed5c64208b
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue