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

[WebXR 2019] Modes #55

Closed
jsantell opened this issue May 16, 2019 · 1 comment
Closed

[WebXR 2019] Modes #55

jsantell opened this issue May 16, 2019 · 1 comment
Assignees
Milestone

Comments

@jsantell
Copy link
Contributor

A handful of updates to the initialization routine:

  • Remove XRDevice
  • Move supportsSession/requestSession to XR
  • Update supportsSession/requestSession to handle "mode" APIs
  • Support only "inline" and "immersive-vr" for now; plumbing already exists for the WebVR polyfilled device (leveraging "exclusive" and "outputContext"'d sessions)

See #51 for more information on this effort, and development goals.

@jsantell jsantell added this to the WebXR 2019 milestone May 16, 2019
toji added a commit that referenced this issue May 19, 2019
Fixes #55. Also changes the syntax of the WebGL context compatibility
methods because they required an XRDevice to function properly.
toji added a commit that referenced this issue May 23, 2019
Fixes #55. Also changes the syntax of the WebGL context compatibility
methods because they required an XRDevice to function properly.
@toji toji self-assigned this May 23, 2019
toji added a commit that referenced this issue Jun 26, 2019
Fixes #55. Also changes the syntax of the WebGL context compatibility
methods because they required an XRDevice to function properly.
toji added a commit that referenced this issue Jun 26, 2019
Fixes #55. Also changes the syntax of the WebGL context compatibility
methods because they required an XRDevice to function properly.
@jsantell
Copy link
Contributor Author

Fixed via #59

toji added a commit that referenced this issue Aug 12, 2019
This change squashes multiple changes from @jacobcdewitt (and a couple
from myself) into one for easier history review. The comments for each
change have been preserved below. The cumulative changes enable the
polyfill to accept code that was written against the "VR complete"
version of the WebXR spec, even if support is not fully spec compliant
at this time.

Squashed commit comments
------------------------

Update XR interface and remove XRDevice

Fixes #55. Also changes the syntax of the WebGL context compatibility
methods because they required an XRDevice to function properly.

Add two new configuration params: allowCardboardOnDesktop, cardboardConfig, and move global to a configuration option rather than the first argument to WebXRPolyfill constructor, a breaking API change. Also disable babel compilation now until we can decide on an action in #63.

change WebXRPolyfill signature to match config change, and correctly export XRSessionModes

display magic window in inline session for desktop

rename XRDevicePose to XRViewerPose

update packages

npm install serve

no longer checkin build output files

Don't checkin webxr samples or media folders.

requestFrameOfReference => requestReferenceSpace

update reference space types

Implement XRSession.updateRenderState

Add views array to XRViewerPose.

This also requires implementing part of XRRigidTransform and
adding a transform to XRView.

As of this commit, I have the xr-presentation.html sample from
https://storage.googleapis.com/chromium-webxr-test/r672724/xr-presentation.html
working with this polyfill when hosting the samples locally. The only
change I had to make to the html file was how the polyfill gets injected.

I tested in the following browsers on Windows using an Oculus headeset:
- Chrome 75 with WebVR flag enabled, but WebXR flag disabled
- Firefox 67.0.4

Update reference space types.

- remove head-model
- eye-level => local
- stage => bounded-floor

XRCoordinateSystem => XRSpace, XRFrameOfReference => XRReferenceSpace

start working on XRReferenceSpace.getOffsetReferenceSpace, which requires updating XRRigidTransform to compose the matrix based on position and orientation values

comment out work in progress changes

session.inputSources attribute

more work for XRFrame.getPose

more work for getPose. Use gl-matrix to compose/decompose matrix

XRRay from external polyfill

more updates to getPose so that input-tracking.html finally works (but it does place the user too low and controllers sometimes go through the floor and a dot is shown for the gaze).

handle floor-level reference spaces in a more general way

remove log statement

more work for getOffsetReferenceSpace

fix issue in getOffsetReferenceSpace

negate quaternions in XRRigidTransform constructor to fix rotation issue

try some more things for getPose to make teleportation work, but there are still issues

always return a Cardboard device when no VR displays are connected so that inline sessions are always supported

remove console.log statements

Expose input poses and gamepad from WebVR

Made sure that the data exposed to gamepads via the WebVR API is
properly forwarded to the WebXR API surface. Includes both the poses
and repeating the original gamepad object on the XRInputSource.gamepad
attribute. No remapping of the gamepad API data is being done at this
point. Removed the XRInputPose, because it's no longer part of the API.

Allow mapping of WebVR gamepad values

Provide a mapping table that allows WebVR-style gamepads to be remapped
so that they can conform to the WebXR conventions and the `xr-standard`
mapping. Also allows for static transforms to be applied to either the
grip or the targetRay poses so that the single value that WebVR supplied
can be used for both spaces accurately.

Add Oculus Go mappings and fix some bugs

Fix some offset reference spaces and inlineVerticalFieldOfView

Add gamepad mapping for WMR controller.

Fix several mappings for Chrome 76

Cleanup

Add/update method annotations.
Remove commented-out code.
Split up long lines.

remove XRLayer

XRLayer is no longer in the spec.
XRWebGLLayer no longer inherits from XRLayer.
getViewport is now on XRWebGLLayer

Remove XRPresentationContext. It's no longer in the WebXR spec.

Teleportation seems to work now. Had to remove the quaternion inversion in XRRigidTransform

cleanup

Make XRViewerPose inherit from XRPose. Now the positional-audio sample works.

remove stale comment

Remove XRRay

Fix error when loading with polyfill when native WebXR is enabled on mobile devices. Don't try to patch in a cardboard display in this situation because it's a rare corner case.

Throw exception when trying to create bounded reference space since the polyfill does not support them.

Cleanup XRReferenceSpace + XRViewerPose code.

Remove unused function.

Only expose views array via XRViewerPose.

Update getViewport comments.

Added a small shim to allow spec-compliant code to run on Chrome 76

Co-Authored-By: jacobcdewitt <jacobcdewitt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants