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

fix: WebXR examples #218

Merged
merged 9 commits into from
May 20, 2022

Conversation

capnmidnight
Copy link
Contributor

@capnmidnight capnmidnight commented May 13, 2022

Why

There are a number of incorrect type definitions in the WebXR examples code. In particular:

  • ARButtons optional sessionInit constructor parameter is specified as any
  • XRControllerModelFactory is missing an envMap field
  • OculusHandModel and OculusHandPointerModel have a motionController field that is specified as Object3D, when a more specific type is avaiable
  • XREstimatedLight's lightProbe field is specified as unknown
  • XRHandModelFactory's createHandModel method's optional profile parameter includes "oculus" as a valid value, when that value has not been available for over a year.

What

  • Change the ARButtons sessionInit constructor parameter to an extension of the XRSessionInit that provides for the option of specifying a domOverlay setting
  • Add an envMap: Texture field to XRControllerModelFactory
  • Change the motionController field in OculusHandModel and OculusHandPointerModel to be XRHandMeshModel
  • Change the lightProbe field in XREstimatedLight's to be Three.js' LightProbe type.
  • Change the profile parameter in XRHandModelFactory's createHandModel method's to accept "mesh" in place of "oculus"

Checklist

  • Checked the target branch (current goes master, next goes dev)
  • Added myself to contributors table
  • Ready to be merged

ARButton can specify WebXR session initialization options when the
button is clicked. In particular, it offers the ability to define the
`domOverlay` property allow DOM elements to render on top of the AR
session.
In OculusHandModel and OculusHandPointerModel, the motionController field
will be set to an XRHandMeshModel value.
The lightProbe field is a regular Three.js LightProbe object.
The value of "oculus" has not been used for nearly a year. A more
generic "mesh" value has been available since r129.
@capnmidnight capnmidnight changed the title WebXR examples fixes fix: WebXR examples May 13, 2022
@capnmidnight
Copy link
Contributor Author

So, I recently got a big change to the @types/webxr package to get them up to date. I've now modified my open PR here to include those types, as suggested in Issue #31.

@joshuaellis
Copy link
Member

@Methuselah96 do you know why the CI is unhappy with this PR?

@Methuselah96
Copy link
Contributor

Methuselah96 commented May 19, 2022

@joshuaellis It's due to the change in package.json. yarn install needs to be run to update the lock file.

@capnmidnight
Copy link
Contributor Author

I had committed the modified yarn.lock, but the CI complained about it. So I reverted it and the CI complained again. I just ran yarn install again and the changes this time are much less than last time, so I have committed it again.

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

Successfully merging this pull request may close these issues.

3 participants