Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

three-mesh-bvh

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-mesh-bvh - npm Package Versions

1
7

0.5.6

Diff

Changelog

Source

[0.5.6] - 2022-03-15

Fixed

  • Case where MeshBVH.closestPointToGeometry would return an incorrect value.
  • Automatically dispose of textures on update instead of just "needsUpdate".
  • Case where SeparatingAxisTriangle.intersectsTriangle would return incorrect intersection lines. Performance of the function improved as a side effect.
gkjohnson
published 0.5.5 •

Changelog

Source

[0.5.5] - 2022-02-01

Changed

  • onProgress callback now always reports 1.0 when the BVH creation is complete instead of just passing intermmediate progress.
gkjohnson
published 0.5.4 •

Changelog

Source

[0.5.4] - 2022-01-20

Fixed

  • Removed use of RGBFormat and RGBIntegerFormat for compatibility with three.js r137.
gkjohnson
published 0.5.3 •

Changelog

Source

[0.5.3] - 2022-01-08

Changed

  • Improved SAH build time by ~20% by checking every triangle split once fewer than 8 triangles are present which also improves the split cost.
  • GenerateMeshBVHWorker / MeshBVH: Add onProgress callback option to enable the ability to display BVH build percentage.

Fixed

  • MeshBVH.bvhcast incorrectly using the same geometry for both bvh.
  • shapecast and bvhcast types to be more correct.
gkjohnson
published 0.5.2 •

Changelog

Source

[0.5.2] - 2021-11-02

Fixed

  • src/utils incorrectly being published as src/Utils in the previous release.
gkjohnson
published 0.5.1 •

Changelog

Source

[0.5.1] - 2021-11-02

Added

  • Typescript definition files.
  • VertexAttributeTexture, BVHStructUniform, and associated helper shader functions for performing raytracing in a fragment shader.
  • Warning when passing in an unknown split strategy option value.

Changed

  • src/workers/GenerateMeshBVHWorker to use a proper webworker syntax compatible with esm-capable bundlers.
gkjohnson
published 0.5.0 •

Changelog

Source

[0.5.0] - 2021-10-10

Added

  • useSharedArrayBuffer option to MeshBVH so SharedArrayBuffers are created rather than ArrayBuffers making it easier to share and reuse BVH memory across workers.
  • SeparatingAxisTriangle.intersectsTriangle: added target field to retrieve the edge describing the intersection.
  • "box" argument to shapecast "intersectsRange" function.
  • /* @__PURE__ */ indicator to reusable variables.

Fixed

  • raycast and raycastFirst not properly accounting for material sidedness with geometry groups.
  • Case where the BVH root bounds would be incorrect if the geometry bounding box was incorrect / out of date.
  • MeshBVH.closestPointTGeometry not returning a proper intersection point if triangles intersect.
  • Shapecast function will now ensure a unique triangle / box is provided for each recursive call.
  • Fix GenerateMeshBVHWorker not setting the geometry index correctly on return.

Changed

  • Changed function signature for 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.
  • Small observed performance improvements possibly a result of simplified function arguments.
  • The function signatures and options for MeshBVH.serialize and MeshBVH.deserialize have changed. See documentation for more new signature.
  • Changed 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.

Removed

  • distanceToGeometry and distanceToPoint functions.
gkjohnson
published 0.4.3 •

Changelog

Source

[0.4.3] - 2021-08-20

Fixed

  • Fixed Surface Area Heuristic (SAH) split strategy to function correctly, improve build performance, and produce more optimal bounds and improved a memory footprint.

Added

  • Return "surfaceAreaCost" in returned getBVHExtremes object to compare BVH structure quality.
  • Support for displayEdges, meshMaterial, and edgeMaterial to MeshBVHVisualizer to enable displaying bounds as solid meshes.

Changed

  • Deprecated the getBVHExtremes "total" return value in favor of nodeCount.
gkjohnson
published 0.4.2 •

Changelog

Source

[0.4.2] - 2021-08-04

Fixed

  • Case where intersectsRangeFunc could be passed the incorrect node id in shapecast.
  • Bug in 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.
  • Cases where passed in geometry that did not include an index buffer could throw an error when calling functions like closestPointToGeometry.
  • Case where raycastFirst would return the incorrect result.
  • Greatly improved MeshBVHVisualizer render and update performance.
  • Case where MeshBVHVisualizer would not correctly display a BVH for geometry with multiple groups.

Added

  • distanceToGeometry and closestPointToGeometry fast path when the passed in geometry has a bounds tree.
  • Support for position BufferAttribute to be interleaved.
gkjohnson
published 0.4.1 •

Changelog

Source

[0.4.1] - 2021-06-21

Changed

  • package.json "main" field to use a .cjs file extension
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc