Skip to content

Commit bc28579

Browse files
committed
fix(soba/performances): hide bvh group when retrying setting up geometries
1 parent 00fde0c commit bc28579

File tree

1 file changed

+5
-0
lines changed
  • libs/soba/performances/src/lib

1 file changed

+5
-0
lines changed

libs/soba/performances/src/lib/bvh.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export class NgtsBVH {
124124
raycaster.firstHitOnly = firstHitOnly;
125125

126126
let timeoutId: ReturnType<typeof setTimeout> | undefined;
127+
group.visible = false;
127128
group.traverse((child) => {
128129
if (
129130
is.three<THREE.Mesh>(child, 'isMesh') &&
@@ -141,6 +142,8 @@ export class NgtsBVH {
141142
return;
142143
}
143144

145+
if (!group.visible) group.visible = true;
146+
144147
child.raycast = acceleratedRaycast;
145148
child.geometry.computeBoundsTree = computeBoundsTree;
146149
child.geometry.disposeBoundsTree = disposeBoundsTree;
@@ -158,6 +161,8 @@ export class NgtsBVH {
158161
child.raycast = THREE.Mesh.prototype.raycast;
159162
}
160163
});
164+
165+
if (!group.visible) group.visible = true;
161166
});
162167
});
163168

0 commit comments

Comments
 (0)