bvh installed like this https://github.com/gkjohnson/three-mesh-bvh?tab=readme-ov-file#use
then did
for (const geometryUuid in geometries) {
const geometry = geometries[geometryUuid]
const geoId = batchedMesh.addGeometry(geometry)
batchedMesh.computeBoundsTree(geoId)
}
then placed all the instances to their respective locations
now i want to know if a box3 intersects with the entire batched mesh
i tried this but its always returning true
inverseMatrix.copy(batchedMesh.matrixWorld).invert()
for (let i = 0; i < batchedMesh.boundsTrees.length; i++) {
if (batchedMesh.boundsTrees[i].intersectsBox(box3, inverseMatrix)) {
hasIntersects = true
break
}
}
i also tried a version where instead of batched mesh the default mesh was used , using intersectsBox worked well in this case.