Re: [w3c/gamepad] extensions: Add vibrationActuator and dual-rumble effect (PR #163)

@marcoscaceres commented on this pull request.



> +      <table class="simple">
+        <tr>
+          <th>
+            Internal slot
+          </th>
+          <th>
+            Initial value
+          </th>
+          <th>
+            Description (non-normative)
+          </th>
+        </tr>
+        <tr>
+          <td>
+            <dfn data-dfn-for=
+            "GamepadHapticActuator">[[\playingEffectPromise]]</dfn>

This guard might be better as just a boolean/flag to control the state machine. This is because the actual promise to play something can only be returned once.

However, I'm worried about something... 

Consider the case where you want to do the following:

 1. Lightly "rumble" the right-side of the controller. 
 2. Simultaneously, "rumble" one of the triggers.
 
In theory, it should be possible to activate multiple actuators at the same time, no? 

The current design would prevent this from working:

```JS
const rumble = gamepad.vibrationActuator.play("double-rumble", {intensity: 0.2, duration: 2000});
// reject :( 
const trigger = gamepad.vibrationActuator.play("trigger-rumble", {intensity: 2.0, duration: 2000});  
```

So, I think the guard is actually a Map `map<GamepadHapticActuatorType, boolean>`.  Something like: 

```
GamepadHapticActuator -> "dual-rumble" -> isPlaying ?
GamepadHapticActuator -> "left-trigger" -> isPlaying ?
GamepadHapticActuator -> "right-trigger" -> isPlaying ?
```



-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/pull/163#pullrequestreview-1016418738
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/gamepad/pull/163/review/1016418738@github.com>

Received on Thursday, 23 June 2022 05:48:31 UTC