Closed ToyboxZach closed 6 days ago
The bounds of the BVH are stored as half-widths and expanded by a small epsilon (specifically 2^-24
) to account for floating point error and ensure that the triangles are correctly contained (see #169, #170).
What specific issue is this causing for you?
Ah ok, we are using this bounding box incorrectly then. We were just depending on it to get the exact center of an object to be able to adjust a geometry’s position.
Maybe it’s an issue that it’s not symmetrical but doesn’t seem like this is the purpose of this bounding box
If you'd like to adjust the documentation to help make the behavior more clear I'd be open to a PR. Also note that by default that bounding box will be assigned to the geometry when generating the BVH if it hasn't already been generated. This behavior can be disabled with setting the setBoundingBox
option to false
, though.
Describe the bug
Calling:
On a BoxGeometry geometry creates a bounding box that is very slightly bigger than the geometry itself
To Reproduce
Expect that to be nice round numbers of 0.5 -> -0.5 instead it adds just a little bit to the edge of each edge.
Maybe I misunderstand the purpose of this bounding box, but this ended up causing us problems because we wanted to get the center of the geometry and it was just barely off for some less symetrical cases