|
|
|
@ -61,9 +61,12 @@ public record Box(@NotNull AABB box, @NotNull Material material) implements Hitt
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tlmax >= tumin) return Optional.empty();
|
|
|
|
|
assert entry != null && exit != null;
|
|
|
|
|
return hit0(tlmax, tumin, entry, exit, ray, range);
|
|
|
|
|
if (tlmax < tumin && tumin >= range.min() && tlmax <= range.max()) {
|
|
|
|
|
assert entry != null && exit != null;
|
|
|
|
|
return hit0(tlmax, tumin, entry, exit, ray, range);
|
|
|
|
|
} else {
|
|
|
|
|
return Optional.empty();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private @NotNull Optional<HitResult> hit0(double tmin, double tmax, @NotNull Side entry, @NotNull Side exit, @NotNull Ray ray, @NotNull Range range) {
|
|
|
|
|