insertionSortX static method
insertionSortX
Implementation
static List<Body> insertionSortX(List<Body> a){
for (int i = 1, l = a.length; i < l; i++) {
final v = a[i];
int j;
for (j = i - 1; j >= 0; j--) {
if (a[j].aabb.lowerBound.x <= v.aabb.lowerBound.x) {
break;
}
a[j + 1] = a[j];
}
a[j + 1] = v;
}
return a;
}