rename to make it more obvious

This commit is contained in:
vis2k 2021-08-07 21:47:24 +08:00
parent 6e87337792
commit 59b7d79db6

View File

@ -21,7 +21,7 @@ public static int LargestAbsoluteComponentIndex(Vector4 value, out float largest
// set largest to first abs (x) // set largest to first abs (x)
largestAbs = abs.x; largestAbs = abs.x;
withoutLargest = new Vector3(value.y, value.z, value.w); withoutLargest = new Vector3(value.y, value.z, value.w);
int index = 0; int largestIndex = 0;
// compare to the others, starting at second value // compare to the others, starting at second value
// performance for 100k calls // performance for 100k calls
@ -29,24 +29,24 @@ public static int LargestAbsoluteComponentIndex(Vector4 value, out float largest
// manual checks: 22ms // manual checks: 22ms
if (abs.y > largestAbs) if (abs.y > largestAbs)
{ {
index = 1; largestIndex = 1;
largestAbs = abs.y; largestAbs = abs.y;
withoutLargest = new Vector3(value.x, value.z, value.w); withoutLargest = new Vector3(value.x, value.z, value.w);
} }
if (abs.z > largestAbs) if (abs.z > largestAbs)
{ {
index = 2; largestIndex = 2;
largestAbs = abs.z; largestAbs = abs.z;
withoutLargest = new Vector3(value.x, value.y, value.w); withoutLargest = new Vector3(value.x, value.y, value.w);
} }
if (abs.w > largestAbs) if (abs.w > largestAbs)
{ {
index = 3; largestIndex = 3;
largestAbs = abs.w; largestAbs = abs.w;
withoutLargest = new Vector3(value.x, value.y, value.z); withoutLargest = new Vector3(value.x, value.y, value.z);
} }
return index; return largestIndex;
} }
// scale a float within min/max range to an ushort between min/max range // scale a float within min/max range to an ushort between min/max range