Skip to content

Commit 84c0be4

Browse files
committed
fix: calculate instanced mesh bounds after update
1 parent 7b0b4b8 commit 84c0be4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core/Instances.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ export const Instances: ForwardRefComponent<InstancesProps, THREE.InstancedMesh>
186186
}
187187
iterations++
188188
}
189+
190+
if (frames === Infinity || iterations === frames) {
191+
if (parentRef.current.boundingBox) parentRef.current.computeBoundingBox()
192+
if (parentRef.current.boundingSphere) parentRef.current.computeBoundingSphere()
193+
}
189194
})
190195

191196
const api = React.useMemo(

0 commit comments

Comments
 (0)