three-mesh-bvh
Advanced tools
Changelog
[0.5.6] - 2022-03-15
MeshBVH.closestPointToGeometry
would return an incorrect value.SeparatingAxisTriangle.intersectsTriangle
would return incorrect intersection lines. Performance of the function improved as a side effect.Changelog
[0.5.5] - 2022-02-01
onProgress
callback now always reports 1.0
when the BVH creation is complete instead of just passing intermmediate progress.Changelog
[0.5.4] - 2022-01-20
RGBFormat
and RGBIntegerFormat
for compatibility with three.js r137.Changelog
[0.5.3] - 2022-01-08
onProgress
callback option to enable the ability to display BVH build percentage.shapecast
and bvhcast
types to be more correct.Changelog
[0.5.2] - 2021-11-02
Changelog
[0.5.1] - 2021-11-02
VertexAttributeTexture
, BVHStructUniform
, and associated helper shader functions for performing raytracing in a fragment shader.src/workers/GenerateMeshBVHWorker
to use a proper webworker syntax compatible with esm-capable bundlers.Changelog
[0.5.0] - 2021-10-10
useSharedArrayBuffer
option to MeshBVH
so SharedArrayBuffers
are created rather than ArrayBuffers
making it easier to share and reuse BVH memory across workers.target
field to retrieve the edge describing the intersection./* @__PURE__ */
indicator to reusable variables.raycast
and raycastFirst
not properly accounting for material sidedness with geometry groups.GenerateMeshBVHWorker
not setting the geometry index correctly on return.intersectsGeometry
, shapecast
, intersectsBox
, intersectsSphere
, closestPointToGeometry
, closestPointToPoint
, raycast
, and raycastFirst
. Specifically at least the first "mesh" argument has been removed. Calling functions with the old signature will log a warning. See documentation for current signatures.raycast
and raycastFirst
now return hits in the local space of the geometry rather than world space when querying the BVH directly to conform with other cast functions. Results still match three.js' original results when using Raycaster.intersectObject(s)
functions. See documentation for more details.MeshBVHDebug
class has been removed and the function getJSONStructure
and validateBounds
are now exported individually.MeshBVH.serialize
and MeshBVH.deserialize
have changed. See documentation for more new signature.refit
function to take just a single argument with traversed node indices. Calling the function with the old signature will log a warning. See documentation for current signature.distanceToGeometry
and distanceToPoint
functions.Changelog
[0.4.3] - 2021-08-20
getBVHExtremes
object to compare BVH structure quality.displayEdges
, meshMaterial
, and edgeMaterial
to MeshBVHVisualizer to enable displaying bounds as solid meshes.getBVHExtremes
"total" return value in favor of nodeCount
.Changelog
[0.4.2] - 2021-08-04
intersectsRangeFunc
could be passed the incorrect node id in shapecast.distanceToGeometry
and closestPointToGeometry
which would likely result in some closest points being missed. This fix greatly degrades performance in the case where the passed geometry does not have a BVH. It is recommended that the passed in geometry include a computed bounds tree.closestPointToGeometry
.MeshBVHVisualizer
render and update performance.distanceToGeometry
and closestPointToGeometry
fast path when the passed in geometry has a bounds tree.