稳定的合并排序。
Parameters:
array
(Array)
要排序的数组。
userDefinedObject
(*)
作为第三个参数传递给comparator
的任何项。
Example
// Assume array contains BoundingSpheres in world coordinates.
// Sort them in ascending order of distance from the camera.
var position = camera.positionWC;
bmgl.mergeSort(array, function(a, b, position) {
return bmgl.BoundingSphere.distanceSquaredTo(b, position) - bmgl.BoundingSphere.distanceSquaredTo(a, position);
}, position);