Cleanup 3

This commit is contained in:
W2.Wizard
2021-02-21 11:09:04 +01:00
parent 92fafe877c
commit 20ba37e223
24 changed files with 181 additions and 119 deletions

View File

@@ -553,7 +553,7 @@ namespace FlaxEngine
return true;
}
denominator = denominator * denominator;
denominator *= denominator;
//3x3 matrix for the first ray.
float m11 = ray2.Position.X - ray1.Position.X;

View File

@@ -782,9 +782,9 @@ namespace FlaxEngine
s = vv / v;
h = offset + (colorone - colortwo) / vv;
}
h = h / 6f;
h /= 6f;
if (h < 0f)
h = h + 1f;
h++;
}
}

View File

@@ -154,7 +154,7 @@ namespace FlaxEngine
{
float t = Repeat(target - current, 360f);
if (t > 180f)
t = t - 360f;
t -= 360f;
return t;
}
@@ -222,7 +222,7 @@ namespace FlaxEngine
{
float c = Repeat(b - a, 360f);
if (c > 180f)
c = c - 360f;
c -= 360f;
return a + c * Saturate(t);
}

View File

@@ -1205,7 +1205,7 @@ namespace FlaxEngine
while (true)
{
if ((exponent & 1) != 0)
identity = identity * temp;
identity *= temp;
exponent /= 2;
@@ -1517,14 +1517,14 @@ namespace FlaxEngine
//By separating the above algorithm into multiple lines, we actually increase accuracy.
result = value;
result.Row2 = result.Row2 - Vector4.Dot(result.Row1, result.Row2) / Vector4.Dot(result.Row1, result.Row1) * result.Row1;
result.Row2 -= Vector4.Dot(result.Row1, result.Row2) / Vector4.Dot(result.Row1, result.Row1) * result.Row1;
result.Row3 = result.Row3 - Vector4.Dot(result.Row1, result.Row3) / Vector4.Dot(result.Row1, result.Row1) * result.Row1;
result.Row3 = result.Row3 - Vector4.Dot(result.Row2, result.Row3) / Vector4.Dot(result.Row2, result.Row2) * result.Row2;
result.Row3 -= Vector4.Dot(result.Row1, result.Row3) / Vector4.Dot(result.Row1, result.Row1) * result.Row1;
result.Row3 -= Vector4.Dot(result.Row2, result.Row3) / Vector4.Dot(result.Row2, result.Row2) * result.Row2;
result.Row4 = result.Row4 - Vector4.Dot(result.Row1, result.Row4) / Vector4.Dot(result.Row1, result.Row1) * result.Row1;
result.Row4 = result.Row4 - Vector4.Dot(result.Row2, result.Row4) / Vector4.Dot(result.Row2, result.Row2) * result.Row2;
result.Row4 = result.Row4 - Vector4.Dot(result.Row3, result.Row4) / Vector4.Dot(result.Row3, result.Row3) * result.Row3;
result.Row4 -= Vector4.Dot(result.Row1, result.Row4) / Vector4.Dot(result.Row1, result.Row1) * result.Row1;
result.Row4 -= Vector4.Dot(result.Row2, result.Row4) / Vector4.Dot(result.Row2, result.Row2) * result.Row2;
result.Row4 -= Vector4.Dot(result.Row3, result.Row4) / Vector4.Dot(result.Row3, result.Row3) * result.Row3;
}
/// <summary>
@@ -1594,16 +1594,16 @@ namespace FlaxEngine
result.Row1 = Vector4.Normalize(result.Row1);
result.Row2 = result.Row2 - Vector4.Dot(result.Row1, result.Row2) * result.Row1;
result.Row2 -= Vector4.Dot(result.Row1, result.Row2) * result.Row1;
result.Row2 = Vector4.Normalize(result.Row2);
result.Row3 = result.Row3 - Vector4.Dot(result.Row1, result.Row3) * result.Row1;
result.Row3 = result.Row3 - Vector4.Dot(result.Row2, result.Row3) * result.Row2;
result.Row3 -= Vector4.Dot(result.Row1, result.Row3) * result.Row1;
result.Row3 -= Vector4.Dot(result.Row2, result.Row3) * result.Row2;
result.Row3 = Vector4.Normalize(result.Row3);
result.Row4 = result.Row4 - Vector4.Dot(result.Row1, result.Row4) * result.Row1;
result.Row4 = result.Row4 - Vector4.Dot(result.Row2, result.Row4) * result.Row2;
result.Row4 = result.Row4 - Vector4.Dot(result.Row3, result.Row4) * result.Row3;
result.Row4 -= Vector4.Dot(result.Row1, result.Row4) * result.Row1;
result.Row4 -= Vector4.Dot(result.Row2, result.Row4) * result.Row2;
result.Row4 -= Vector4.Dot(result.Row3, result.Row4) * result.Row3;
result.Row4 = Vector4.Normalize(result.Row4);
}

View File

@@ -901,7 +901,7 @@ namespace FlaxEngine
while (true)
{
if ((exponent & 1) != 0)
identity = identity * temp;
identity *= temp;
exponent /= 2;
@@ -1154,10 +1154,10 @@ namespace FlaxEngine
//By separating the above algorithm into multiple lines, we actually increase accuracy.
result = value;
result.Row2 = result.Row2 - (Vector3.Dot(result.Row1, result.Row2) / Vector3.Dot(result.Row1, result.Row1)) * result.Row1;
result.Row2 -= (Vector3.Dot(result.Row1, result.Row2) / Vector3.Dot(result.Row1, result.Row1)) * result.Row1;
result.Row3 = result.Row3 - (Vector3.Dot(result.Row1, result.Row3) / Vector3.Dot(result.Row1, result.Row1)) * result.Row1;
result.Row3 = result.Row3 - (Vector3.Dot(result.Row2, result.Row3) / Vector3.Dot(result.Row2, result.Row2)) * result.Row2;
result.Row3 -= (Vector3.Dot(result.Row1, result.Row3) / Vector3.Dot(result.Row1, result.Row1)) * result.Row1;
result.Row3 -= (Vector3.Dot(result.Row2, result.Row3) / Vector3.Dot(result.Row2, result.Row2)) * result.Row2;
}
/// <summary>
@@ -1215,11 +1215,11 @@ namespace FlaxEngine
result.Row1 = Vector3.Normalize(result.Row1);
result.Row2 = result.Row2 - Vector3.Dot(result.Row1, result.Row2) * result.Row1;
result.Row2 -= Vector3.Dot(result.Row1, result.Row2) * result.Row1;
result.Row2 = Vector3.Normalize(result.Row2);
result.Row3 = result.Row3 - Vector3.Dot(result.Row1, result.Row3) * result.Row1;
result.Row3 = result.Row3 - Vector3.Dot(result.Row2, result.Row3) * result.Row2;
result.Row3 -= Vector3.Dot(result.Row1, result.Row3) * result.Row1;
result.Row3 -= Vector3.Dot(result.Row2, result.Row3) * result.Row2;
result.Row3 = Vector3.Normalize(result.Row3);
}

View File

@@ -337,7 +337,7 @@ namespace FlaxEngine
X = -X * lengthSq;
Y = -Y * lengthSq;
Z = -Z * lengthSq;
W = W * lengthSq;
W *= lengthSq;
}
}