Manos

VR touch controllers Emulator

Recommended Posts

Hello guys,

babylon newbie here :). So I have created a simple scene using WebVRFreeCamera and testing it with WebVR chrome plugin. Is there someway to emulate the touch controllers??

Share this post


Link to post
Share on other sites

Hi @Manos,

Nice to have you around :)

Of course, the controllers are already integrated in the system. If you use the VR-Helper you will have them automatically integrated in your scene (including transportation control and a lot of other nice features). You can read about the experience helper here - http://doc.babylonjs.com/how_to/webvr_helper

If you have any questions, please dont hesitate to ask

Share this post


Link to post
Share on other sites

I think what he is asking (and would like to know my self as well) is how can we emulate the controller events without actually having any physical controllers or VR-Set (if possible).

Share this post


Link to post
Share on other sites

Oh, I see :)

If this is the case - it will be hard to emulate those controllers. They are a part of the Gamepad API, and you will need to find a proper emulator that fits the newer extensions API (which also has the device pose, a main component in the vr controllers). I found this in a quick search - http://greggman.github.io/hft-gamepad-api/ , but this is more for the regular gamepads. The rest of the API will need to be emulated as well . The API is described here - https://w3c.github.io/gamepad/extensions.html

Share this post


Link to post
Share on other sites
On 3/8/2018 at 2:56 PM, RaananW said:

Hi @Manos,

Nice to have you around :)

Of course, the controllers are already integrated in the system. If you use the VR-Helper you will have them automatically integrated in your scene (including transportation control and a lot of other nice features). You can read about the experience helper here - http://doc.babylonjs.com/how_to/webvr_helper

If you have any questions, please dont hesitate to ask

Hello @RaananW,

so I have been playing with the VR-Helper and I'm trying to catch the event of gazing on a mesh. Works fine when I gaze to any mesh but there is an error when I try to insert the onSelectedMeshUnselected event. This is the code:

var VRHelper = scene.createDefaultVRExperience();
VRHelper.enableInteractions();

VRHelper.onNewMeshSelected.add((mesh)=>{
   console.log('gazed');
});

VRHelper.onSelectedMeshUnselected.add((mesh) => {
   console.log('not gazed');
});

What am I missing here?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.