Vive Focus Controller (WebVR)

#1

Hello.

I just tested BabylonJS with the Vive Focus and identified some issues.

The trigger button (id: 1) does not initiate a call to scene.onPointerDown.

Furthermore the position of the controller in VR is somehow weird.
At the beginning the controller appears in the middle of the head.
When I move up/down, forwards, backwards or left/right (6DOF tracking) the controller in VR keeps its position in VR space.

Since it is only a 3DOF controller, the real position cannot be tracked.
I think the correct behavior in that situation is that the position of the controller is always updated from the head position and than added some delta so that it appears right down relative to the head position.

https://www.babylonjs-playground.com/#JA1ND3#149

I tested with the latest version of “Firefox Reality” since the “Vive Browser” does not support WebVR at all.

If there is anything I can do to assist, like further testing etc. please let me know.

Edit: The issue with the controller position could also be a problem of Firefox Reality since the demo from webvr.info also shows this problem. XX - VR Controllers

Best regards,
Torsten

#2

Pinging our VR expert @trevordev

#3

Hey @tortru,

Unfortunately, I don’t have easy access to a Vive Focus to test for me to easily fix this so it might be tricky.

The poseEnabledController.ts contains an InitiateController method which is likely creating the wrong controller type, when you look at the controller what does it look like? (Vive controller, gearVR controller etc). When the controller is loaded would you be able to print out gamepad.browserGamepad Im interested in the id property to help figure out what controller type it is detected as. If we add it as a case in the gearVRController.ts file’s canCreate method I think it might resolve your issue.

#4

Erm Wat
Wish i had one of these to play with.

#5

Hi @trevordev,

The controller looks like a Gear VR controller.

The value of controller.browserGamepad.id is “HTC Vive Focus Controller”.

controller.browserGamepad: Gamepad
​​{
axes: Array [ 0, 0 ]
​​buttons: Array [ GamepadButton, GamepadButton ]
​​connected: true
​​displayId: 1
​​hand: “right”
​​hapticActuators: Array []
​​id: “HTC Vive Focus Controller”
​​index: 0
​​mapping: “”
​​pose: GamepadPose { hasOrientation: true, hasPosition: false, position: null, … }
​​timestamp: 172470
​​prototype: GamepadPrototype { id: Getter, index: Getter, mapping: Getter, … }
}
​

#6

I think it is not worth investing time into compatibility with the “Vive Browser” since “Firefox Reality” will become the default browser on Vive Headsets.

#7

@tortru Thanks for the info, from this I think the issue is its being detected as a generic controller (which shows gearVR looking controller), I will try to make it detected as a gearVR controller so it has similar 3dof interactions (Oculus GO is also handled this way). After it’s merged you can try it again and let me know if you still have issues.

#8

Great.
I will re-test on the playground and inform you about the result as soon as the new alpha version has been released.

2 Likes
#9

Hi,

I tested with the latest 4.1.0-alpha.1 and the controller is now behaving correctly.
Also onPointerDown is now correctly called when pulling the trigger.

Best regards

2 Likes