зеркало из https://github.com/stride3d/opentk.git
A couple more maths functions
This commit is contained in:
Родитель
11114ca4ea
Коммит
b20b21d228
|
@ -280,6 +280,17 @@ namespace OpenTK
|
|||
Row2.Xyz = Row2.Xyz.Normalized();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an inverted copy of this instance.
|
||||
/// </summary>
|
||||
public Matrix4 Inverted()
|
||||
{
|
||||
Matrix4 m = this;
|
||||
if (m.Determinant != 0)
|
||||
m.Invert();
|
||||
return m;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the translation component of this instance.
|
||||
/// </summary>
|
||||
|
@ -343,7 +354,8 @@ namespace OpenTK
|
|||
q.Y = (float)((Row2[1] + Row1[2]) * sq);
|
||||
}
|
||||
|
||||
return q.Normalized();
|
||||
q.Normalize();
|
||||
return q;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,6 @@ namespace OpenTK
|
|||
/// <summary>
|
||||
/// Returns a copy of the Quaternion scaled to unit length.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Quaternion Normalized()
|
||||
{
|
||||
Quaternion q = this;
|
||||
|
@ -200,6 +199,18 @@ namespace OpenTK
|
|||
return q;
|
||||
}
|
||||
|
||||
public void Invert()
|
||||
{
|
||||
W = -W;
|
||||
}
|
||||
|
||||
public Quaternion Inverted()
|
||||
{
|
||||
var q = this;
|
||||
q.Invert();
|
||||
return q;
|
||||
}
|
||||
|
||||
#region public void Normalize()
|
||||
|
||||
/// <summary>
|
||||
|
|
Загрузка…
Ссылка в новой задаче