Fixes/cleanups from b026ee7ef8, And misc fixes/crashes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user