Fixes/cleanups from b026ee7ef8, And misc fixes/crashes.

This commit is contained in:
hondacrx
2021-11-16 19:45:02 -05:00
parent 2b2b0fe076
commit 705a2fe3a1
8 changed files with 49 additions and 28 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ namespace Framework.GameMath
}
else
{
float t = -(-plane.D + Vector3.Dot(Origin, plane.Normal)) / rate;
float t = -(plane.D + Vector3.Dot(Origin, plane.Normal)) / rate;
return Origin + Direction * t;
}
}
+1 -16
View File
@@ -292,22 +292,7 @@ namespace System
public static Matrix4x4 fromEulerAnglesZYX(float fYAngle, float fPAngle, float fRAngle)
{
float fCos = (float)Math.Cos(fYAngle);
float fSin = (float)Math.Sin(fYAngle);
Matrix4x4 kZMat = new(fCos, -fSin, 0, 0, fSin, fCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
fCos = (float)Math.Cos(fPAngle);
fSin = (float)Math.Sin(fPAngle);
Matrix4x4 kYMat = new(fCos, 0, fSin, 0, 0, 1, 0, 0, -fSin, 0, fCos, 0, 0, 0, 0, 0);
fCos = (float)Math.Cos(fRAngle);
fSin = (float)Math.Sin(fRAngle);
Matrix4x4 kXMat = new(1, 0, 0, 0, 0, fCos, -fSin, 0, 0, fSin, fCos, 0, 0, 0, 0, 0);
return (kZMat * (kYMat * kXMat));
return Matrix4x4.CreateFromYawPitchRoll(fPAngle, fRAngle, fYAngle);
}
#region Strings