From 648edf3ac720bb065889748c8335081339a51d22 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Sat, 19 Aug 2023 19:55:42 +0900 Subject: [PATCH] adjust function call --- src/core/MeshBVH.js | 2 +- src/core/build/buildTree.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/MeshBVH.js b/src/core/MeshBVH.js index 05fd6c2d..a41596a4 100644 --- a/src/core/MeshBVH.js +++ b/src/core/MeshBVH.js @@ -157,7 +157,7 @@ export class MeshBVH { this._roots = null; if ( ! options[ SKIP_GENERATION ] ) { - this._roots = buildPackedTree( geometry, options ); + buildPackedTree( geometry, options, this ); if ( ! geometry.boundingBox && options.setBoundingBox ) { diff --git a/src/core/build/buildTree.js b/src/core/build/buildTree.js index 38e675d3..b9574199 100644 --- a/src/core/build/buildTree.js +++ b/src/core/build/buildTree.js @@ -142,7 +142,7 @@ function buildTree( geo, options ) { } -export function buildPackedTree( geo, options ) { +export function buildPackedTree( geo, options, target ) { // boundingData : 6 float32 // right / offset : 1 uint32 @@ -168,7 +168,8 @@ export function buildPackedTree( geo, options ) { } - return packedRoots; + target._roots = packedRoots; + return; function countNodes( node ) {