VR - Pointer Mesh

I do enjoy that a lot of the pointer work is done for me, but I don’t have two infinite length lasers coming out of my arms so interacting in a vr world with them isn’t very immersive.

What would it take to make the pointer an area enclosed by a mesh? Take this example from a VR game named Abode.

I would guess you would need to register before every frame and check if each interactible mesh is colliding with every pointer mesh. I don’t believe this feasible once you get into dozens of meshes in a scene.

Once you do that, you’d need to keep track of what meshes are colliding, and trigger events when a new one is added or when one is no longer inside. Then you’d need to handle each controller’s interaction events to then start/stop interacting with one of the meshes (or all, that’s subjective). I believe this part might be straight forward, just a bit of work.

Yep, this would be the right way to go, of course filtering unneeded interactions to avoid performance hits.

I recommend taking a look at the pointer selection feature code to see how it is currently done - Babylon.js/WebXRControllerPointerSelection.ts at master · BabylonJS/Babylon.js · GitHub . Try using Babylon’s native functionality as much as you can, but i can understand it is not always 100% possible.

I found a snippet that does this here:

I’m making a class that has an array of ‘pointers’ and an array of ‘objects’. Is it worth it to check distance of a mesh from a pointer’s point before using the bounding boxes to determine if the pointer’s point is inside the mesh’s bounding box? This might be a a bit redundant but I’m not sure.