Skip to content

Comments

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

Merged
dmarcos merged 1 commit intoaframevr:masterfrom
vincentfretin:fix-layer
Jan 12, 2025
Merged

Layer component: wait referenceSpace to be set before calling initLayer#5626
dmarcos merged 1 commit intoaframevr:masterfrom
vincentfretin:fix-layer

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