Closed takahirox closed 4 years ago
.getViewerPose() of a XRFrame instance always returns the same XRViewerPose instance.
.getViewerPose()
XRFrame
XRViewerPose
getViewerPose(space) { this[PRIVATE].viewerPose._updateFromReferenceSpace(space); return this[PRIVATE].viewerPose; }
https://github.com/immersive-web/webxr-polyfill/blob/master/src/api/XRFrame.js#L55-L58
So if I get two or more viewer poses of difference reference spaces in an animation frame, the returned viewer poses instances are identical and overridden by the last .getViewerPose() call.
const viewerSpaceViewerPose = frame.getViewrPose(viewerReferenceSpace); const localSpaceViewerPose = frame.getViewerPose(localReferenceSpace); // viewerSpaceViewerPose === localSpaceViewerPose is true
Is this design intentional? (Sorry if I'm missing something in the spec.)
If not I think .getViewerPose() should create a new XRViewerPose instance for each call.
Looks like PR #122 takes care of this.
Yes, it will.
Closing in favor of #122, thanks!
.getViewerPose()
of aXRFrame
instance always returns the sameXRViewerPose
instance.https://github.com/immersive-web/webxr-polyfill/blob/master/src/api/XRFrame.js#L55-L58
So if I get two or more viewer poses of difference reference spaces in an animation frame, the returned viewer poses instances are identical and overridden by the last
.getViewerPose()
call.Is this design intentional? (Sorry if I'm missing something in the spec.)
If not I think
.getViewerPose()
should create a newXRViewerPose
instance for each call.