Skip to content

Commit

Permalink
Try fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkashin committed Dec 19, 2024
1 parent 3d24535 commit f337d11
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/main_lbvh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,21 +1036,18 @@ void findRegion(int *i_begin, int *i_end, int *bit_index, const std::vector<mort
throw std::runtime_error("842384298293482");
}

int found_bit = -1;
int dir = 0;
for (int b = NBITS - 1; b >= 0; --b) {
int l = getBit(codes[i_node-1], b);
int m = getBit(codes[i_node], b);
int r = getBit(codes[i_node+1], b);
if (l == 0 && m == 0 && r == 1) {
int i_bit = NBITS-1;
for (; i_bit >= 0; --i_bit) {
int b2 = getBit(codes[i_node - 1], i_bit);
int b1 = getBit(codes[i_node], i_bit);
int b0 = getBit(codes[i_node + 1], i_bit);
int mask = (b2 << 2) | (b1 << 1) | (b0);
if (mask == 0b001) {
dir = -1;
found_bit = b;
break;
}

if (l == 0 && m == 1 && r == 1) {
} else if (mask == 0b011) {
dir = 1;
found_bit = b;
break;
}
}
Expand Down

0 comments on commit f337d11

Please sign in to comment.