pmndrs / react-three-fiber

🇨🇭 A React renderer for Three.js
https://docs.pmnd.rs/react-three-fiber
MIT License
27.62k stars 1.6k forks source link

Performance degradation with `onDoubleClick` Event Handler #3292

Open alouis-jpg opened 5 months ago

alouis-jpg commented 5 months ago

Description

When using onDoubleClick event handler on a group component wrapping several mesh, navigation considerably slows dow. It seems like raycasting is happening continuously instead of only on double-click events.

Expected Behavior

The onDoubleClick event should only trigger raycasting when a double-click action is performed, without causing a continuous performance degradation during normal navigation.

Actual Behavior

Navigation becomes noticeably slower, and the frame rate drops, suggesting that raycasting might be happening continuously, similar to the behavior seen with onPointerOver events.

Environment