Skip to content

Commit

Permalink
fix USDZExporterOptions type to be able to build
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed May 13, 2024
1 parent 22765ae commit b6d4cbb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/model-viewer/src/features/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ let isSceneViewerBlocked = false;
const noArViewerSigil = '#model-viewer-no-ar-fallback';

export type ARMode = 'quick-look'|'scene-viewer'|'webxr'|'none';
// TODO PR to be done in https://github.com/three-types/DefinitelyTyped/blob/master/types/three/examples/jsm/exporters/USDZExporter.d.ts
// once the patch to be able to {ar: undefined} is merged in three.js repo.
interface USDZExporterOptions {
ar: undefined | { anchoring: { type: 'plane' }, planeAnchoring: { alignment: 'horizontal' | 'vertical' } };
quickLookCompatible?: boolean;
maxTextureSize?: number;
}

const deserializeARModes = enumerationDeserializer<ARMode>(
['quick-look', 'scene-viewer', 'webxr', 'none']);
Expand Down Expand Up @@ -442,7 +449,7 @@ configuration or device capabilities');

// QuickLook places the model on both floor and wall correctly when
// the usdz doesn't contain the anchoring and planeAnchoring properties.
const usdzOptions = this.arPlacement === 'wall' ? {ar: undefined} : {
const usdzOptions: USDZExporterOptions = this.arPlacement === 'wall' ? {ar: undefined} : {
ar: {
anchoring: {type: 'plane'},
planeAnchoring: {
Expand Down

0 comments on commit b6d4cbb

Please sign in to comment.