New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

three-mesh-bvh

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-mesh-bvh - npm Package Versions

123467

0.5.8

Diff
gkjohnson
published 0.5.8 •

Changelog

Source

[0.5.8] - 2022-03-27

Fixed

  • Improved type definitions.

Changed

  • GenerateMeshBVHWorker: Added "dispose" function. Deprecated "terminate" function.
gkjohnson
published 0.5.7 •

Changelog

Source

[0.5.7] - 2022-03-22

Fixed

  • WebWorker BVH generation not accounting for geometry groups.
  • Export and document "OrientedBox" and "ExtendedTriangle" classes for more clarity and enable use of internal mathematical functions.
gkjohnson
published 0.5.6 •

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.