You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was intended to avoid superfluous recomputation of the BVH. Unfortunately it prevents all recomputation of the BVH.
Not exactly the same, but has the same effect... the useBVH hook suffers from the same issue for a different reason. Here the dependency list uses a ref to the mesh object, which necessarily never changes as long as the mesh exists even if the underlying geometry changes.
Suggested solution:
Rather than using zero dependencies in the dependencies list here we should use a variable that changes if the underlying geometry changes.
Workaround:
For those looking for a workaround for the Bvh component, you can force the BVH to rebuild by using a key that changes if you know the geometry has changed eg `{children}
Also worth noting that ideally the underlying geometry wouldn't change, but in my specific use case it must 😅
The text was updated successfully, but these errors were encountered:
I believe this would also present a problem if you simply add an object to the children wrapped by the component, those new children would not have computeBoundsTree called on their geometry.
three
version: 0.161.0@react-three/fiber
version: 8.17.10@react-three/drei
version: 9.114.3node
version: 18.20.3npm
(oryarn
) version: 10.7.0Problem description:
Relevant code:
This PR was intended to avoid superfluous recomputation of the BVH. Unfortunately it prevents all recomputation of the BVH.
Not exactly the same, but has the same effect... the useBVH hook suffers from the same issue for a different reason. Here the dependency list uses a ref to the mesh object, which necessarily never changes as long as the mesh exists even if the underlying geometry changes.
Suggested solution:
Rather than using zero dependencies in the dependencies list here we should use a variable that changes if the underlying geometry changes.
Workaround:
For those looking for a workaround for the
Bvh
component, you can force the BVH to rebuild by using akey
that changes if you know the geometry has changed eg `{children}Also worth noting that ideally the underlying geometry wouldn't change, but in my specific use case it must 😅
The text was updated successfully, but these errors were encountered: