Core/Misc: Fixed rotation of many gameobjects summoned in garrison and various scripts
This commit is contained in:
@@ -476,10 +476,15 @@ namespace Framework.GameMath
|
||||
public Quaternion ToUnit()
|
||||
{
|
||||
Quaternion copyOfThis = this;
|
||||
copyOfThis *= rsq(dot(this));
|
||||
copyOfThis.unitize();
|
||||
return copyOfThis;
|
||||
}
|
||||
|
||||
public void unitize()
|
||||
{
|
||||
this *= rsq(dot(this));
|
||||
}
|
||||
|
||||
float dot(Quaternion other)
|
||||
{
|
||||
return (float)((X * other.X) + (Y * other.Y) + (Z * other.Z) + (W * other.W));
|
||||
@@ -490,6 +495,11 @@ namespace Framework.GameMath
|
||||
return 1.0f / (float)Math.Sqrt(x);
|
||||
}
|
||||
|
||||
public static Quaternion fromEulerAnglesZYX(float z, float y, float x)
|
||||
{
|
||||
return new Quaternion(Matrix3.fromEulerAnglesZYX(z, y, x));
|
||||
}
|
||||
|
||||
#region Public Static Complex Special Functions
|
||||
/// <summary>
|
||||
/// Calculates the logarithm of a given quaternion.
|
||||
|
||||
Reference in New Issue
Block a user