Skip to content

Commit

Permalink
fix: calculate instanced mesh bounds after update
Browse files Browse the repository at this point in the history
  • Loading branch information
davidboy committed Dec 12, 2024
1 parent 7b0b4b8 commit 84c0be4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/Instances.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ export const Instances: ForwardRefComponent<InstancesProps, THREE.InstancedMesh>
}
iterations++
}

if (frames === Infinity || iterations === frames) {
if (parentRef.current.boundingBox) parentRef.current.computeBoundingBox()
if (parentRef.current.boundingSphere) parentRef.current.computeBoundingSphere()
}
})

const api = React.useMemo(
Expand Down

0 comments on commit 84c0be4

Please sign in to comment.