pmndrs / react-three-rapier

🤺 Rapier physics in React
https://react-three-rapier.pmnd.rs
MIT License
1.05k stars 58 forks source link

textures disappear on InstancedRigidBodies when moving or changing pointer #683

Open s0-david opened 4 months ago

s0-david commented 4 months ago

when i move around or change the pointer direction, the textures on InstancedRigidBodies vanish. it works fine with instances from drei.

"@react-three/rapier": "^1.3.1", "three": "^0.165.0", "next": "14.2.3",

Screenshot 2024-06-06 at 1 25 50 AM

https://github.com/pmndrs/react-three-rapier/assets/54137057/1f75a827-8438-4b2f-aa72-7e144ca9a7b8

any help or suggestions would be appreciated!

s0-david commented 4 months ago
useEffect(() => {
    meshRef.current?.computeBoundingBox()
  }, [blocks])

ok so calling the method solved the issue

s0-david commented 4 months ago

and computeBoundingSphere too...

s0-david commented 4 months ago

on onAfterShadow