-
Notifications
You must be signed in to change notification settings - Fork 1.2k
How to set raycasters in React 360? #471
Comments
Yes, raycasters are still customizable – if anything, they are far more configurable with React 360 now. Raycasters now must implement this interface: https://github.com/facebook/react-360/blob/master/React360/js/Controls/Raycasters/Types.js Raycasters are no longer initialized at start, since you may want to change them after React has been initialized.
Between the three of these, you should be able to achieve any desired effect. |
I have read all articles and codes you mention above, and then tried a lot. However, I still fail to create a raycaster for users of mobile browser and Google Cardboard. Could you provide an example? |
I have provided three full examples in this repository, available at https://github.com/facebook/react-360/tree/master/React360/js/Controls/Raycasters Your code needs to implement all of the methods. I will try to explain more about each one here.
If all of these are implemented, your raycaster should be usable. The easiest way to test is to |
I have created a new example for By the way, I think the |
@mathdroid the fill behavior is a very intentional architectural choice made throughout the new Runtime. If you return a new array every single frame, you very frequently encounter garbage collection, which can lead to "hiccups" in rendering. We are working towards building our own renderer, and entirely eliminating memory allocation each frame. If we can reach that, React 360 will only allocate new memory when objects are created, which means that the average experience will see significantly improved performance, especially on low-end devices. |
@mathdroid thanks for an example. How to get the cursor visibility working with your example? |
Anyway we can have a raycaster to work for 3D models using location? Or can the gaze event work for 3D models and not just 2D surfaces? |
When I add a simple raycaster (for the purpose of adding gaze buttons) nothing happens unless I call I suppose I could add a mouse one back in manually but is there an easier way to add the simple raycaster without having to remove the others. I am working only on desktop for this part of the development process. |
I try to use the same way as react-vr, but fail.
Is there any way to set
raycasters
in React 360? It is really important for users of mobile browser and Google Cardboard to interact with React 360 websites ("click" something).The text was updated successfully, but these errors were encountered: