I am trying to use three-mesh-bvh to quickly calculate the raycast in a mesh. However, when I run the intersectObjects function it throws the exception tmpInverseMatrix.copy(...).invert is not a function
Code
import * as Three from "three";
import { computeBoundsTree, disposeBoundsTree, acceleratedRaycast } from 'three-mesh-bvh';
Three.BufferGeometry.prototype.computeBoundsTree = computeBoundsTree;
Three.BufferGeometry.prototype.disposeBoundsTree = disposeBoundsTree;
Three.Mesh.prototype.raycast = acceleratedRaycast;
let mesh = new Three.Mesh();
mesh.geometry = new Three.BufferGeometry();
...
mesh.geometry.computeBoundsTree();
let raycaster = new Three.Raycaster();
raycaster.firstHitOnly = true;
raycaster.intersectObjects( [ mesh ] );
Hello! You are using an older version of three.js that doesn't support Matrix4.invert which was introduced in v0.123.0. You'll have to upgrade or shim the function yourself in order to use this package.
Describe the bug
I am trying to use three-mesh-bvh to quickly calculate the raycast in a mesh. However, when I run the intersectObjects function it throws the exception
tmpInverseMatrix.copy(...).invert is not a function
Code
Platform:
Screenshots