Cleanup 5

This commit is contained in:
W2.Wizard
2021-02-21 11:50:30 +01:00
parent ee76440477
commit 694b20148d
30 changed files with 93 additions and 103 deletions

View File

@@ -52,8 +52,10 @@ namespace FlaxEngine
/// <returns>The float value</returns>
public static float Unpack(ushort h)
{
var conv = new FloatToUint();
conv.uintValue = HalfToFloatMantissaTable[HalfToFloatOffsetTable[h >> 10] + (((uint)h) & 0x3ff)] + HalfToFloatExponentTable[h >> 10];
var conv = new FloatToUint
{
uintValue = HalfToFloatMantissaTable[HalfToFloatOffsetTable[h >> 10] + (((uint)h) & 0x3ff)] + HalfToFloatExponentTable[h >> 10]
};
return conv.floatValue;
}
@@ -64,8 +66,10 @@ namespace FlaxEngine
/// <returns>The half value</returns>
public static ushort Pack(float f)
{
FloatToUint conv = new FloatToUint();
conv.floatValue = f;
FloatToUint conv = new FloatToUint
{
floatValue = f
};
return (ushort)(FloatToHalfBaseTable[(conv.uintValue >> 23) & 0x1ff] + ((conv.uintValue & 0x007fffff) >> FloatToHalfShiftTable[(conv.uintValue >> 23) & 0x1ff]));
}

View File

@@ -695,20 +695,22 @@ namespace FlaxEngine
Orthonormalize(ref temp, out Q);
Q.Transpose();
R = new Matrix();
R.M11 = Vector4.Dot(Q.Column1, Column1);
R.M12 = Vector4.Dot(Q.Column1, Column2);
R.M13 = Vector4.Dot(Q.Column1, Column3);
R.M14 = Vector4.Dot(Q.Column1, Column4);
R = new Matrix
{
M11 = Vector4.Dot(Q.Column1, Column1),
M12 = Vector4.Dot(Q.Column1, Column2),
M13 = Vector4.Dot(Q.Column1, Column3),
M14 = Vector4.Dot(Q.Column1, Column4),
R.M22 = Vector4.Dot(Q.Column2, Column2);
R.M23 = Vector4.Dot(Q.Column2, Column3);
R.M24 = Vector4.Dot(Q.Column2, Column4);
M22 = Vector4.Dot(Q.Column2, Column2),
M23 = Vector4.Dot(Q.Column2, Column3),
M24 = Vector4.Dot(Q.Column2, Column4),
R.M33 = Vector4.Dot(Q.Column3, Column3);
R.M34 = Vector4.Dot(Q.Column3, Column4);
M33 = Vector4.Dot(Q.Column3, Column3),
M34 = Vector4.Dot(Q.Column3, Column4),
R.M44 = Vector4.Dot(Q.Column4, Column4);
M44 = Vector4.Dot(Q.Column4, Column4)
};
}
/// <summary>
@@ -720,20 +722,22 @@ namespace FlaxEngine
{
Orthonormalize(ref this, out Q);
L = new Matrix();
L.M11 = Vector4.Dot(Q.Row1, Row1);
L = new Matrix
{
M11 = Vector4.Dot(Q.Row1, Row1),
L.M21 = Vector4.Dot(Q.Row1, Row2);
L.M22 = Vector4.Dot(Q.Row2, Row2);
M21 = Vector4.Dot(Q.Row1, Row2),
M22 = Vector4.Dot(Q.Row2, Row2),
L.M31 = Vector4.Dot(Q.Row1, Row3);
L.M32 = Vector4.Dot(Q.Row2, Row3);
L.M33 = Vector4.Dot(Q.Row3, Row3);
M31 = Vector4.Dot(Q.Row1, Row3),
M32 = Vector4.Dot(Q.Row2, Row3),
M33 = Vector4.Dot(Q.Row3, Row3),
L.M41 = Vector4.Dot(Q.Row1, Row4);
L.M42 = Vector4.Dot(Q.Row2, Row4);
L.M43 = Vector4.Dot(Q.Row3, Row4);
L.M44 = Vector4.Dot(Q.Row4, Row4);
M41 = Vector4.Dot(Q.Row1, Row4),
M42 = Vector4.Dot(Q.Row2, Row4),
M43 = Vector4.Dot(Q.Row3, Row4),
M44 = Vector4.Dot(Q.Row4, Row4)
};
}
/// <summary>