insertionSortZ static method

List<Body> insertionSortZ(
  1. List<Body> a
)

insertionSortZ

Implementation

static List<Body> insertionSortZ(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.z <= v.aabb.lowerBound.z) {
        break;
      }
      a[j + 1] = a[j];
    }
    a[j + 1] = v;
  }
  return a;
}