Skip to content

Commit

Permalink
fix: check for xrSession to setOriginAnchor
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-liang committed Jan 16, 2024
1 parent 0ceff43 commit d4641e7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/systems/armarker/armarker-reloc.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,16 @@ export default class ARMarkerRelocalization {
*/

const { xrSession } = this.arenaScene;
xrSession.requestAnimationFrame((time, frame) => {
this.arMakerSystem.setOriginAnchor({
// Copy values
...this.cameraRigObj3D.position,
...this.cameraSpinnerObj3D.quaternion,
frame,
if (xrSession) {
xrSession.requestAnimationFrame((time, frame) => {
this.arMakerSystem.setOriginAnchor({
// Copy values
...this.cameraRigObj3D.position,
...this.cameraSpinnerObj3D.quaternion,
frame,
});
});
});
}

this.arMakerSystem.initialLocalized = true;
}
Expand Down

0 comments on commit d4641e7

Please sign in to comment.