How to set laserToggle to false in XR

webVROptions had an option to set laserToggle to false if desired, how can we do the same in XR?

Hi, I look at the code and could not figure out an easy solution, its almost as if in XR we are constrained to the XR options, but that XR seems to use some of the VR options (that we don’t have access anymore).

The reason why I need this is that in my application the user can manipulate two objects, one in each hand, at the same time, so I need the laser pointer on each controller for the user to know which object he will grab for each hand.

adding @RaananW

of course, you can disable the laser pointer or the pointer selection feature altogether.

WebXRControllerPointerSelection | Babylon.js Documentation

if you wat to disable the pointer system, you can find it in the xr experience helper:
WebXRDefaultExperience | Babylon.js Documentation

The laser pointer system works well but the API and the behavior is as if only a single controller can be the pointer controller at a time and only show the laser for that “selection active” controller.

When I put xr.pointerSelection.displayLaserPointer to true, only one laser pointer is visible (corresponding to the toggle behaviour of the WebVR API) at a time.

So the question is how can I make both laser pointers visible and active at all time?

On this topic of the laser pointer, @RaananW , I’ve been having a hard time interacting with things at a distance in XR. Would it be possible to somehow adjust the visible length or thickness of the laser pointer?

Yeah, it seems like I never exposed the laser pointer’s mesh definition. Would a scale factor be enough?

Oh, and one important question for me - how far away are the items you can’t interact with? Is it really a visual problem, or the fact that the ray is limited to maxPointerDistance?

1 Like

Yikes, good question @RaananW - and I’m not entirely sure. It’s certainly a visual problem, at the very least. I have a very hard time grabbing a scale handle on the gizmos when I am even a little far away from it, for example! The line is just so thin and in most cases it’s just guesswork until I see the scale handle turn white and then I know I’m hovering over it!

1 Like

I can only assume the selection disc is also not visible. Probably because it is too small? I guess it is more important to clearly see what you hit, because you can see the general direction.

Let me think of a global solution for this (apart from exposing the mesh properties, or at least a scale factor which will be done very soon). I think what we need is distance-based scale, which might be a little tricky the way the current ray is constructed.

1 Like