Fluqz
January 13, 2020, 1:07pm
1
Hey, im using WebXR using the Oculus Quest. Im trying to move objects around via controller using the selectstart
and selectend
Events.
public makeVRControls(renderer: THREE.WebGLRenderer, scene: THREE.Scene) {
this.controller1 = renderer.xr.getController(0)
this.controller1.name = 'controller1'
this.controller1.addEventListener('selectstart', this.onSelectStart.bind(this))
this.controller1.addEventListener('selectend', this.onSelectEnd.bind(this))
this.controller2 = renderer.xr.getController(1)
this.controller2.name = 'controller2'
this.controller2.addEventListener('selectstart', this.onSelectStart.bind(this))
this.controller2.addEventListener('selectend', this.onSelectEnd.bind(this))
scene.add(this.controller1)
scene.add(this.controller2)
this.raycasterVR = new THREE.Raycaster()
}
When clicking the controller button, following events are thrown
selectstart
selectend
selectstart
If I release, a final selectend
event is fired.
I’ve tested the dragging example on my Quest and everything works fine.
https://threejs.org/examples/webxr_vr_dragging
The code also uses selectstart
and selectend
events. Can you please share and entire example that shows what you are doing in your code?
Fluqz
January 13, 2020, 1:47pm
3
I duplicated the webxr_vr_dragging example and played with it. You can test it under https://test.3x60.de/riis-vr/webxr.html . And the file if you need webxr.html (6.5 KB).
1 Like
Just for clarification: The interaction of your demo works correctly. It’s just the event firing/order which is confusing, right?
Fluqz
January 13, 2020, 1:56pm
5
The interaction of the demo doesnt matter.
The problem is that (seen in console) with a click (and hold) its already firing the selectend event and two selectstart events before and after.
click:
select start
select end
select start
release:
select end
Yes, I can reproduce the issue. Since three.js
only dispatches the events to the controller objects, there might be an issue with the Oculus browser. Can you please host the following (non three.js
) example on your server and enhance the code with respective logging and event listeners? Currently, the demo only uses select
but not selectstart
and selectend
.
<!doctype html>
<!--
Copyright 2018 The Immersive Web Community Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This file has been truncated. show original
If the demo shows the same behavior, we should report an issue here:
https://developer.oculus.com/bugs/
Fluqz
January 14, 2020, 9:53am
7
Im not able to enhance this demo, but I will report the issue and ask on the oculus forum
1 Like