From 84c0be46b7d2f28eda0e18b6194debbc62885c9f Mon Sep 17 00:00:00 2001 From: David Reed Date: Wed, 11 Dec 2024 19:22:46 -0600 Subject: [PATCH] fix: calculate instanced mesh bounds after update --- src/core/Instances.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/Instances.tsx b/src/core/Instances.tsx index 61c54f9ce..6abf3fcf2 100644 --- a/src/core/Instances.tsx +++ b/src/core/Instances.tsx @@ -186,6 +186,11 @@ export const Instances: ForwardRefComponent } iterations++ } + + if (frames === Infinity || iterations === frames) { + if (parentRef.current.boundingBox) parentRef.current.computeBoundingBox() + if (parentRef.current.boundingSphere) parentRef.current.computeBoundingSphere() + } }) const api = React.useMemo(