private static void GetExtremePoints(ref Vector3 direction, RawList<Vector3> points, out float maximumDot, out float minimumDot, out int maximumIndex, out int minimumIndex)
{
maximumIndex = 0;
minimumIndex = 0;
float dot;
Vector3.Dot(ref points.Elements[0], ref direction, out dot);
minimumDot = dot;
maximumDot = dot;
for (int i = 1; i < points.Count; ++i)
{
Vector3.Dot(ref points.Elements[i], ref direction, out dot);
if (dot > maximumDot)
{
maximumDot = dot;
maximumIndex = i;
}
else if (dot < minimumDot)
{
minimumDot = dot;
minimumIndex = i;
}
}
}