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

Layer component: wait referenceSpace to be set before calling initLayer #5626

Merged
merged 1 commit into from
Jan 12, 2025

Conversation

vincentfretin
Copy link
Contributor

Description:

I got an error space argument required when calling xrGLFactory.createQuadLayer here

this.layer = xrGLFactory.createQuadLayer({
space: this.referenceSpace,
viewPixelHeight: 2048,
viewPixelWidth: 2048,
height: this.data.height / 2 || this.texture.image.height / 1000,
width: this.data.width / 2 || this.texture.image.width / 1000
});

In onEnterVR, this.referenceSpace is set asynchronously via

xrSession.requestReferenceSpace('local-floor').then(this.onRequestedReferenceSpace);

that does
this.referenceSpace = referenceSpace;

so in my case createQuadLayer was called before this.referenceSpace was set.

Changes proposed:

  • Wait this.referenceSpace to be set before calling this.initLayer

@dmarcos
Copy link
Member

dmarcos commented Jan 12, 2025

Thanks!

@dmarcos dmarcos merged commit fed4845 into aframevr:master Jan 12, 2025
3 checks passed
@vincentfretin vincentfretin deleted the fix-layer branch January 12, 2025 09:58
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.

2 participants