Closed aronfiechter closed 5 years ago
In the files gltf1-bounding-box.js and gltf2-bounding-box.js the center is computed as:
gltf1-bounding-box.js
gltf2-bounding-box.js
center: { x: precise.round((boundings.max[0] + boundings.min[0]) / 2, precision + 1), y: precise.round((boundings.max[2] + boundings.min[2]) / 2, precision + 1), z: precise.round((boundings.max[1] + boundings.min[1]) / 2, precision + 1), },
However, the division by 2 is integer division and causes the number argument of precise.round to always be an integer.
2
number
precise.round
To correct this bug, I believe it is enough to divide by 2.0 instead.
2.0
Should I make a PR for this?
(I'm stupid, there's no integer division in JS.)
In the files
gltf1-bounding-box.js
andgltf2-bounding-box.js
the center is computed as:However, the division by
2
is integer division and causes thenumber
argument ofprecise.round
to always be an integer.To correct this bug, I believe it is enough to divide by
2.0
instead.Should I make a PR for this?