Skip to content

Allow poses to be null in more situations #1042

Closed

Description

@Manishearth

https://immersive-web.github.io/webxr/#populate-the-pose

Currently pose is only ever set to null when space’s pose relative to baseSpace has never been determined, otherwise it's returned with the last known pose with emulatedPosition=true.

As we add more and more spaces, I think it's worthwhile to allow poses to be null in more situations. For example, this behavior isn't great for joint spaces: if my hand is behind me and I turn around, there will be this weird floating claw with the current spec behavior. This also applies somewhat to general input spaces. Emulation is sometimes possible, but not always, and it might be worth allowing user choice here.

Furthermore, currently we throw a SecurityError when poses may not be reported. The current conditions for that are about:

  • where the request comes from
  • document focus
  • user intent
  • whether we "know the pose is not exposing fingerprintable data"

It seems incorrect to throw an error for situations that can unpredictably change, in particular the "document focus" and "do we know if the pose is exposing fingerprintable data" should probably cause populate the pose to return null, not throw an error.

This also handles the case of input poses during visible-blurred sessions (which is discussed in #1008). We should just null them out.

It seems like overall we should be allowing poses to be null when:

  • the pose cannot be reported for temporary security reasons (visible-blurred, fingerprintable, document focus)
  • the pose is unknown and cannot be emulated, where "can I emulate this" is up to the user agent. "Report the last known value of the pose" is a valid form of emulation so user agents can continue with the current specced behavior.

Applications need to deal with null poses anyway, so it seems like this change should be fine.

Activity

  1. Manishearth commented on May 15, 2020

    @Manishearth
    ContributorAuthor

    I also believe that sometimes returning null poses mid-session is the current behavior in Chromium (see XRSpace::getPose returning null), and it is the current behavior in Servo.

  2. Manishearth commented on May 22, 2020

    @Manishearth
    ContributorAuthor

    These changes are included in #1058 : getViewerPose() never returns null, but getPose() has more flexibility in returning null. The unpredictable security check was also moved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions