Is there an variable that returns the VR target cursor position, or does it have to be calculated from the controller position and the direction vector?
The depth/distance of the target position need to be given from somewhere, e.g. when hitting a hotspot there is the hitd variable which defines the distance to the hitpoint on the hotspot plane.
See the in webvr.xml the 'vrcontroller_target_point' action as example.
I've looked at the webvr.xml the 'vrcontroller_target_point', but the calculations used there don't seem to return the correct values in my js plugin. Am I using the right krpano hotspot variables? Also the distance (hitd) is always 0 for some reason.
I'm using Oculus GO headset with Firefox reality browser installed for remote debugging. I'm testing this on 'webvr-controllers' pano.
And here's the relevant piece of code:
Code
var controllers = krpano.get("webvr.vrcontrollers");
var mainController = controllers[0];
var distance;
if(mainController.hs.hitd > 0)
distance = mainController.hs.hitd;
else
distance = 1000;
var clickX = mainController.hs.tx + mainController.hs.dx * distance;
var clickY = mainController.hs.ty + mainController.hs.dy * distance;