pointer-events raycaster support layers
for react-three/xr use the default raycaster (if not possible make sure to use its layers)
Thanks! In Triplex I'm using a custom raycaster to side step the event system for the selection system, code is here: https://github.com/trytriplex/triplex/blob/main/packages/renderer/src/features/selection-three-fiber/resolver.tsx#L165
Currently it uses the default layers defined on Canvas to enable / disable userland events. This solution doesn't work with xr right now (but would if it starts using its raycaster / layers!).
I'm happy to contribute this. Where would I start?
Awesome!
The steps should be
-
in pmndrs/pointer-events: adding a layers option to here: https://github.com/pmndrs/xr/blob/4ec7f30ab1a2617923b74ecc84d9473bedaeae84/packages/pointer-events/src/intersections/index.ts#L43
-
in pmndrs/pointer-events: syncing the layers with the raycasters for all the Intersectors
-
in r3/xr: automatically providing the layers configured for the default raycaster in r3f to the interesection options at useLinesPointer, useRayPointer, ... and in the PointerEvents component when setting up
forwardHtmlEvents