react-three-legacy icon indicating copy to clipboard operation
react-three-legacy copied to clipboard

Performance with pointer events if a lot of objects are on the scene

Open macrozone opened this issue 8 years ago • 1 comments

The function projectPointerEvent raycasts on every child, no matter if a certain child needs pointer events.

It would probably better to filter out children that not have defined onClick3D or similar.

Also it would probably good to be able to assign additional event listeners to the <Scene>-Component (e.g. as mentioned here https://github.com/Izzimach/react-three/issues/87)

macrozone avatar Jan 18 '17 13:01 macrozone

I don't really want to proscribe a specific baked-in strategy to handle many objects, since it can depend on how the scene is specifically set up.

Maybe allow the user to provide a custom raycast handler, with the fallback/default being what it is now, just iterating over all children?

Izzimach avatar Jan 19 '17 18:01 Izzimach