Lovelly bug in Interval Tree

This commit is contained in:
IlyaShurupov 2024-10-08 14:39:30 +03:00 committed by Ilya Shurupov
parent 5e3f5594b8
commit 3f49ee11ae
2 changed files with 8 additions and 3 deletions

View file

@ -16,8 +16,11 @@ struct Interval {
bool ignore = false;
void random(halnf span, halnf scale = 1.f) {
start = ((halnf) randomFloat()) * (span);
end = ((halnf) randomFloat()) * (span);
auto offset = 0;
start = ((halnf) randomFloat()) * (span) - offset;
end = ((halnf) randomFloat()) * (span) - offset;
if (start > end) swap(start, end);
auto len = (end - start) * scale * 0.5f;