Пример #1
0
 public void fill(FloatBuffer buffer) {
   if (depth == 1) {
     for (OctTree child : children) {
       if (child != null) {
         buffer.put((float) child.point.x);
         buffer.put((float) child.point.y);
         buffer.put((float) child.point.z);
       }
     }
   } else {
     for (OctTree child : children) {
       if (child != null) {
         child.fill(buffer);
       }
     }
   }
 }
Пример #2
0
 public int getSize() {
   int count = 0;
   if (depth == 1) {
     for (OctTree child : children) {
       if (child != null) {
         count++;
       }
     }
   } else {
     for (OctTree child : children) {
       if (child != null) {
         count += child.getSize();
       }
     }
   }
   return count;
 }