Skip to content

Commit

Permalink
fixed string quotes type
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlhero committed Jan 3, 2023
1 parent 5961b65 commit 9bddc70
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/model-viewer/src/features/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,27 +434,29 @@ configuration or device capabilities');

const usdzOptions = {
ar: {
anchoring: { type: "plane" },
anchoring: { type: 'plane' },
planeAnchoring: {
alignment: this.arPlacement === "wall" ? "vertical" : "horizontal",
alignment: this.arPlacement === 'wall' ? 'vertical' : 'horizontal',
},
},
};

if (usdzOptions.ar.planeAnchoring.alignment === "vertical") {
// necessary because quicklook internally rotates model when placing vertical.
// See https://github.com/google/model-viewer/issues/3989
if (usdzOptions.ar.planeAnchoring.alignment === 'vertical') {
model.rotateX((-90 * Math.PI) / 180);
model.updateMatrixWorld();
}

const exporter = new USDZExporter() as any;
const arraybuffer = await exporter.parse(model, usdzOptions);
const blob = new Blob([arraybuffer], {
type: "model/vnd.usdz+zip",
type: 'model/vnd.usdz+zip',
});

const url = URL.createObjectURL(blob);

if (usdzOptions.ar.planeAnchoring.alignment === "vertical") {
if (usdzOptions.ar.planeAnchoring.alignment === 'vertical') {
model.rotateX((90 * Math.PI) / 180);
model.updateMatrixWorld();
}
Expand Down

0 comments on commit 9bddc70

Please sign in to comment.