public void BoxLeafnums(leafList_t ll, int nodenum) { cplane_t plane; dnode_t node; int s; while (true) { if (nodenum < 0) { StoreLeafs(ll, nodenum); return; } node = nodes[nodenum]; plane = node.plane; s = Common.Instance.BoxOnPlaneSide(ref ll.bounds[0], ref ll.bounds[1], plane); if (s == 1) nodenum = node.children[0]; else if (s == 2) nodenum = node.children[1]; else { // go down both BoxLeafnums(ll, node.children[0]); nodenum = node.children[1]; } } }
void StoreLeafs(leafList_t ll, int nodenum) { int leafnum = -1 - nodenum; // store the lastLeaf even if the list is overflowed if (leafs[leafnum].cluster != -1) ll.lastLeaf = leafnum; if (ll.count >= ll.maxcount) { ll.overflowed = true; return; } ll.list[ll.count++] = leafnum; }
public void RunStoreLeaf(leafList_t ll, int nodenum) { StoreLeaf(ll, nodenum); }