Skip to content

Commit

Permalink
Merge pull request #712 from agargaro/Fix-BatchedMesh-import
Browse files Browse the repository at this point in the history
Fix `BatchedMesh` import `three r157-`
  • Loading branch information
gkjohnson authored Sep 11, 2024
2 parents 2bdbd51 + a58e88a commit 3e7bc7f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/ExtensionUtilities.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Ray, Matrix4, Mesh, Vector3, BatchedMesh, Sphere, REVISION } from 'three';
import { Ray, Matrix4, Mesh, Vector3, Sphere, 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.prototype.raycast;
const origBatchedRaycastFunc = BatchedMesh !== null ? BatchedMesh.prototype.raycast : null;
const _worldScale = /* @__PURE__ */ new Vector3();
const _mesh = /* @__PURE__ */ new Mesh();
const _batchIntersects = [];
Expand Down

0 comments on commit 3e7bc7f

Please sign in to comment.