Fix bad tagging

This commit is contained in:
Paul Mathieu 2021-12-17 15:27:32 -08:00
parent 2fc6e91ee2
commit 0739abbaf2

View File

@ -325,7 +325,7 @@ function rayThroughGrid(origin, direction, maxDistance) {
const nextGrid = range(3).map(i => direction[i] > 0 ? const nextGrid = range(3).map(i => direction[i] > 0 ?
Math.floor(origin[i] + 0.5) + 0.5 : Math.floor(origin[i] + 0.5) + 0.5 :
Math.floor(origin[i] + 0.5) - 0.5); Math.floor(origin[i] + 0.499) - 0.5);
const distanceToGrid = range(3).map(i => (nextGrid[i] - origin[i]) / direction[i]) const distanceToGrid = range(3).map(i => (nextGrid[i] - origin[i]) / direction[i])
.map(v => v === 0.0 ? Number.POSITIVE_INFINITY : v); .map(v => v === 0.0 ? Number.POSITIVE_INFINITY : v);
const axis = minIndex(distanceToGrid); const axis = minIndex(distanceToGrid);