Hi all.
Trying to create some keyboard controls so users can "walk" to next node in front of them by pressing 'up'.
I was able to get point nodes working out when they're in the center using a 'distance from edge' variable.
However our implementation uses polygon nodes to give large clickable areas.
I'm trying to 'click' them when we use the up key.
Initially I tried simulating 'up' using javascript as a click action, but for (reasonably obvious) security reasons, that didn't really count as a click to the browser.
Code: Select all
let evt = new MouseEvent("click", {
bubbles: true,
cancelable: true,
view: window,
screenX: screen.width/2,
screenY: screen.height/2
});
cb.dispatchEvent(evt);
https://gabrielsaunders.com.au/VR/jolimont-poly/
Click mouse on large polygonal hotspots gives the impression if stepping through the space etc etc.
I tried accessing the hotspots and creating an intersecting div in the middle of the screen, but I also can't see any way to list all the polygonal hotspots via the Javascript API.
The point hotspots exist, and I could theoretically get javascript to click one.
But can't for the life of me work out how to get polygonal hotspots in Javascript, and click one.
The proxyID allowed me to get the nodeID when the mouse is hovering over it, which could then feed into JS for a 'click' event.
But we need this to work independent of mouse position, and instead use "screen center".
Any ideas?