Protected_Protected Optional_Protected_Meshes in auto mode with at least this many triangles get a BVH
Time for building trees after each frame, in ms. A geometry that takes longer is still built whole.
Optionallibthree-mesh-bvh, once loaded. Trees are built after it is.
OptionaluiStaticLIBRARY_The module specifier of the default loader's native import(), resolved by the browser (an import map entry, or
a full URL here). A property, so the build cannot fold it into a literal import('three-mesh-bvh'), which
bundlers of apps that use threepipe would then try to resolve (and fail without three-mesh-bvh installed).
Static Optional ReadonlyOldStatic ReadonlyPluginThe time it took to build the trees, in ms
The number of geometries with a tree built by the plugin
The memory of the trees built by the plugin, in MB
Protected_Protected_Optionalprefix: stringOptionalmeta: SerializationMetaTypeThe tree of a mesh or geometry, built now when it has none (for physics, queries, path tracing). Undefined until three-mesh-bvh is loaded, and for geometries without positions.
Build or drop the trees of all meshes again (after a change of the settings)
Build or drop the tree of one object's geometry (after a change of its mode)
OptionalsetShow the boxes of an object's tree (a BVHHelper in the scene, not saved). The helper belongs to the mesh: it goes
when the mesh leaves the scene, gets another geometry, is off or not supported, when the tree is dropped, and
when the plugin is disabled or removed.
Optionalmeta: SerializationMetaTypeWhether a geometry should have a tree: one of its meshes wants one
BVH Plugin
Builds a bounding volume hierarchy (three-mesh-bvh) for mesh geometries, so a raycast tests a few boxes and triangles instead of every triangle: picking, hover, snapping and placing things on surfaces stay fast on big models. Other plugins can use the same trees with getBVH.
automode get a BVH from autoMinTriangles triangles.object.userData.bvhsetsonoroffper object (the object's UI has a BVH section).geometry.boundsTree. The geometry is not changed (indirecttrees: the index keeps its order).acceleratedRaycast. The Raycaster API does not change.rangeoption of three-mesh-bvh, or before a draw range change, can have fewer or others).threepipe does not depend on three-mesh-bvh: install it (
npm i three-mesh-bvh, 0.9.5 or newer) and give it to the plugin. With a bundler, pass a loader:new BVHPlugin(true, {load: () => import('three-mesh-bvh')})(a separate chunk, loaded when the plugin is added), or the module:{lib: bvh}. Without options, the plugin loadsthree-mesh-bvhwith a native dynamic import that bundlers do not process: mapthree-mesh-bvhin an import map (CDN builds).