Skip to content

Commit

Permalink
Update three.js version to 158 so BatchedMesh is supported
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Sep 18, 2024
1 parent 7176dae commit 7981fd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"homepage": "https://github.com/gkjohnson/three-mesh-bvh#readme",
"peerDependencies": {
"three": ">= 0.151.0"
"three": ">= 0.158.0"
},
"devDependencies": {
"@babel/core": "^7.15.5",
Expand Down
6 changes: 2 additions & 4 deletions src/utils/ExtensionUtilities.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { Ray, Matrix4, Mesh, Vector3, Sphere, REVISION } from 'three';
import { Ray, Matrix4, Mesh, Vector3, Sphere, BatchedMesh, REVISION } from 'three';
import { convertRaycastIntersect } from './GeometryRayIntersectUtilities.js';
import { MeshBVH } from '../core/MeshBVH.js';
import * as THREE from 'three';

const BatchedMesh = THREE.BatchedMesh || null; // this is necessary to not break three.js r157-
const IS_REVISION_166 = parseInt( REVISION ) >= 166;
const ray = /* @__PURE__ */ new Ray();
const direction = /* @__PURE__ */ new Vector3();
const tmpInverseMatrix = /* @__PURE__ */ new Matrix4();
const origMeshRaycastFunc = Mesh.prototype.raycast;
const origBatchedRaycastFunc = BatchedMesh !== null ? BatchedMesh.prototype.raycast : null;
const origBatchedRaycastFunc = BatchedMesh.prototype.raycast;
const _worldScale = /* @__PURE__ */ new Vector3();
const _mesh = /* @__PURE__ */ new Mesh();
const _batchIntersects = [];
Expand Down

0 comments on commit 7981fd3

Please sign in to comment.