[vibration] Vibration related thread on webapps list

fyi, There is a vibration related thread on web apps list…

regards, Frederick

Frederick Hirsch
Nokia



Begin forwarded message:

Resent-From: <public-webapps@w3.org<mailto:public-webapps@w3.org>>
From: ext Brandon Jones <bajones@google.com<mailto:bajones@google.com>>
Subject: Re: [gamepad] Haptic Feedback/Controller Vibration
Date: March 24, 2014 at 1:04:50 AM EDT
To: Patrick Martin <patrick.martin.r@gmail.com<mailto:patrick.martin.r@gmail.com>>
Cc: Webapps WG <public-webapps@w3.org<mailto:public-webapps@w3.org>>

Mozilla has played around with gamepad vibration a bit already: https://bugzilla.mozilla.org/show_bug.cgi?id=680289
There's been some mixed messages, but so far the basic idea seems to be to either extend the existing Vibration API<http://www.w3.org/TR/2014/WD-vibration-20140211/> to handle multiple motors (and presumably associate it back to a specific pad) or to add a very similar looking "vibrate" function to the gamepad API. Something like:

vibrate(int motorIndex, float intensity);

Personally I think that there's got to be a little more to it than that. For one, you'll want to be able to query not only how many motors a device has but have a way of expressing what type of feedback that motor provides (is it a heavy motor, etc.) and possibly some description of it's locality (The Xbox One controller has motors in each trigger, and the Steam controller has motors under each touchpad.) I have no idea how to concisely and robustly communicate that information. This also assumes that the device has simple X-Input style feedback, not the more complicated joystick force feedback that was all the rage in the 90s. (Which is far more complicated and fairly dead, so I doubt it's worth addressing at all.)

As for controller speakers, I see the argument that it's a type of controller feedback, but I don't think it should be conflated with controller vibration. I see them as two very distinct features. It is an interesting feature to consider on it's own, though.



On Sun, Mar 23, 2014 at 11:19 AM, Patrick Martin <patrick.martin.r@gmail.com<mailto:patrick.martin.r@gmail.com>> wrote:
Hello,

Is there a reason that haptic feedback support is missing from the gamepad api? I feel that this would prevent developers from fully utilizing modern gamepads which nearly always include some form of a haptic feedback mechanism, (from the speaker on the wiimote to the dual vibrators in an xbox 360 controller). In order for this to work however, we need a mechanism for detecting supported "haptic feedback modes" which could then be used on the gamepad with the WebAudio API.

Here is an example of one such mechanism:

var ctx = new AudioContext();
var rumble_audio = document.getElementById("rumbleAudio");
var rumble_audio_source = ctx.createMediaElementSource(rumble_audio)
var modes = gamepad.getSupportedFeedbackModes();
var feedback_node = null;
if (typeof(modes.RUMBLE_STEREO) !== "undefined"){ // like the xbox 360
feedback_node = gamepad.getFeedbackNode(ctx,modes.RUMBLE_STEREO);
}else if(typeof(modes.RUMBLE_MONO) !=="undefined"){ // like some pc gamepads
feedback_node = gamepad.getFeedbackNode(ctx,modes.RUMBLE_MONO);
}else if(typeof(modes.GAMEPAD_AUDIO)){ // like the wii remote
feedback_node = gamepad.getFeedbackNode(ctx,modes.GAMEPAD_AUDIO);
}else{
feedback_node = ctx.destination
}
rumble_audio_source.connect(feedback_node);
rumble_audio.play();

A system like this would allow both greater access to the controller's functionality and allow feedback to be dynamically generated or modified by the WebAudio API.


I hope this suggestion helps,
Patrick Martin

Received on Monday, 24 March 2014 17:17:29 UTC