I've successfully integrated react-xr and I love it. One thing I'd like to improve is adding feedback whenever useHitTest returns negative.
In the current implementation of the hook, the callback won't be called if there isn't a hit. For an initial state that would be fine if I only set a state to scanning until the useHitTest hook is called. However, even after a successful hit result. It can happen that later hitTests fail. In that case, I wouldn't get a callback with the current implementation.
For better UX I propose adding an else case to return an empty (undefined or null) hit property.
Hi,
I've successfully integrated react-xr and I love it. One thing I'd like to improve is adding feedback whenever useHitTest returns negative. In the current implementation of the hook, the callback won't be called if there isn't a hit. For an initial state that would be fine if I only set a state to scanning until the useHitTest hook is called. However, even after a successful hit result. It can happen that later hitTests fail. In that case, I wouldn't get a callback with the current implementation. For better UX I propose adding an else case to return an empty (undefined or null) hit property.
See PR https://github.com/pmndrs/react-xr/pull/275