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

WebXRManager: Introduce updateCamera() and refactor getCamera(). #21886

Merged
merged 4 commits into from
May 26, 2021

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented May 25, 2021

Related issue: Fixed #21002.

Description

Since the new XR hand examples use getCamera() on app level, it's important to fix #21002 and avoid unnecessary computations when getCamera() is called.

Like suggested by @gkjohnson, the PR introduce a new flag cameraAutoUpdate and a new update method that allows the app to perform the Kamera update manually. This is important to ensure up-to-date matrices so frame-late effects can be avoided.

Copy link
Collaborator

@gkjohnson gkjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the change -- just a couple documentation comments!

docs/api/en/renderers/webxr/WebXRManager.html Outdated Show resolved Hide resolved
docs/api/en/renderers/webxr/WebXRManager.html Outdated Show resolved Hide resolved
@mrdoob mrdoob added this to the r129 milestone May 26, 2021
@mrdoob
Copy link
Owner

mrdoob commented May 26, 2021

I like the change too 👍

this.getCamera = function ( camera ) {
this.updateCamera = function ( camera ) {

if ( session === null ) return;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented May 26, 2021

@elalish I think this should solve your raycasting-in-ar issues.

@mrdoob mrdoob merged commit ec96437 into mrdoob:dev May 26, 2021
@mrdoob
Copy link
Owner

mrdoob commented May 26, 2021

Thanks!

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.

WebXRManager: Provide API for getting VR Camera transform, joined Frustum
3 participants