Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify if/when new Gamepad objects are created #593

Closed
ddorwin opened this issue Apr 18, 2019 · 5 comments · Fixed by #650
Closed

Specify if/when new Gamepad objects are created #593

ddorwin opened this issue Apr 18, 2019 · 5 comments · Fixed by #650
Labels
editor triage Issues marked for triage/re-examination by the editors fixed by pending PR A PR that is in review will resolve this issue.
Milestone

Comments

@ddorwin
Copy link
Contributor

ddorwin commented Apr 18, 2019

The WebXR spec is not explicit about when to create new Gamepad objects. This was a source of interop problems for the Gamepad API, so we should try to avoid that.

Gamepad API implementations create a new Gamepad object when the state changes. If we decide not to do that for WebXR, we should have a good reason for the inconsistency in the platform and consider the impact on developers and use cases.

@ddorwin
Copy link
Contributor Author

ddorwin commented Apr 18, 2019

The Gamepad API spec issue is w3c/gamepad#8.

/cc @nondebug

@Manishearth
Copy link
Contributor

Ah, I stumbled across this in my implementation too -- it's not clear to me if the Gamepad is dynamic or not.

@NellWaliczek NellWaliczek added this to the June 2019 Working Draft milestone Apr 22, 2019
@NellWaliczek NellWaliczek added the editor triage Issues marked for triage/re-examination by the editors label May 14, 2019
@toji
Copy link
Member

toji commented May 15, 2019

The spec has been updated recently to specify that XRInputSources are live, and the gamepad attribute on XRInputSource has the [SameObject] extended attribute. Is that sufficient in this case? We can certainly add a line of text to indicate that the same Gamepad instance must be returned from the gamepad attribute each time, but that's literally the entire purpose of [SameObject] so it would feel strange to call this one specific attribute out further.

@ddorwin
Copy link
Contributor Author

ddorwin commented May 15, 2019

That sounds fine. This is different behavior from (some?) Gamepad API implementations, though, so it might be worth calling that out in a non-normative note.

Context: IIUC some developers were comparing Gamepad objects between frames, which is not a supported pattern for XRInputSource/WebXR.

@toji
Copy link
Member

toji commented May 15, 2019

Ah, thanks for the context! That does sound worthy of a non-normative note.

@toji toji added the fixed by pending PR A PR that is in review will resolve this issue. label May 15, 2019
@toji toji closed this as completed in #650 May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor triage Issues marked for triage/re-examination by the editors fixed by pending PR A PR that is in review will resolve this issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants