@roomle/web-sdk 3.6.0-alpha.5 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"banana-for-scale-C_iNmlCT.mjs","names":[],"sources":["../../packages/configurator-core/public/geometry/banana.glb?no-inline?url","../../packages/configurator-core/src/webgl/banana-for-scale.ts"],"sourcesContent":["export default \"__VITE_ASSET__SH3JcDOvWNcn2WIvxBnLpg__\"","import inject from '../../../common-core/src/di/inject';\nimport type StaticItemLoader from '../../../common-core/src/webgl/static-item-loader';\nimport { ScenePluginDefaultImplementation } from './plugin-system';\nimport { BANANA_FILE_NAME } from '../static-files/geometries';\nimport type { Box3, Object3D, Scene } from 'three';\nimport { Vector3 } from 'three';\n\nexport default class BananaForScale extends ScenePluginDefaultImplementation {\n private _scene: Scene;\n private _bounds: Box3;\n private _banana: Object3D;\n\n @inject\n private _staticItemLoader: StaticItemLoader;\n\n public setScene(scene: Scene) {\n this._scene = scene;\n\n this._staticItemLoader.loadGLB(BANANA_FILE_NAME).then((glb) => {\n this._banana = glb.scene;\n this.updateBounds(null);\n });\n\n console.log(\n '%c' + 'Banana 3D model by https://sketchfab.com/daniel132',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Banana source: https://sketchfab.com/3d-models/banana-mark-2-a7fef734bf4544cb8a780a858fa6af97',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Licensed under Creative Commons 4.0: https://creativecommons.org/licenses/by/4.0/',\n 'color: #ffe135',\n );\n }\n\n public updateBounds(bounds: Box3) {\n if (bounds) {\n this._bounds = bounds;\n }\n if (!this._bounds) {\n return;\n }\n if (this._banana) {\n const size = this._bounds.getSize(new Vector3());\n const center = this._bounds.getCenter(new Vector3());\n const position = center.clone();\n position.x -= size.x / 2 + 0.18;\n position.z += size.z / 2 + 0.05;\n position.y = 0;\n let scale = 0.1;\n this._banana.scale.copy(new Vector3(scale, scale, scale));\n this._banana.rotation.y = 0.6;\n this._banana.position.copy(position);\n }\n if (!this._scene.children.includes(this._banana)) {\n this.addToScene();\n }\n }\n\n public clearScene(scene: Scene, uiScene: Scene): void {\n super.clearScene(scene, uiScene);\n\n this.removeFromScene();\n }\n\n public addToScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.add(this._banana);\n }\n\n public removeFromScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.remove(this._banana);\n }\n}\n"],"mappings":";;;;AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,cAAA,OAAA,KAAA,IAAA,CAAA,MCOM,IAArB,cAA4C,EAAiC;CAQ3E,SAAgB,GAAc;AAiB5B,EAhBA,KAAK,SAAS,GAEd,KAAK,kBAAkB,QAAQ,EAAiB,CAAC,MAAM,MAAQ;AAE7D,GADA,KAAK,UAAU,EAAI,OACnB,KAAK,aAAa,KAAK;IACvB,EAEF,QAAQ,IACN,wDACA,iBACD,EACD,QAAQ,IACN,mGAEA,iBACD,EACD,QAAQ,IACN,uFAEA,iBACD;;CAGH,aAAoB,GAAc;AAChC,MAAI,MACF,KAAK,UAAU,IAEZ,KAAK,SAGV;OAAI,KAAK,SAAS;IAChB,IAAM,IAAO,KAAK,QAAQ,QAAQ,IAAI,GAAS,CAAC,EAE1C,IADS,KAAK,QAAQ,UAAU,IAAI,GAAS,CAAC,CAC5B,OAAO;AAG/B,IAFA,EAAS,KAAK,EAAK,IAAI,IAAI,KAC3B,EAAS,KAAK,EAAK,IAAI,IAAI,KAC3B,EAAS,IAAI;IACb,IAAI,IAAQ;AAGZ,IAFA,KAAK,QAAQ,MAAM,KAAK,IAAI,EAAQ,GAAO,GAAO,EAAM,CAAC,EACzD,KAAK,QAAQ,SAAS,IAAI,IAC1B,KAAK,QAAQ,SAAS,KAAK,EAAS;;AAEtC,GAAK,KAAK,OAAO,SAAS,SAAS,KAAK,QAAQ,IAC9C,KAAK,YAAY;;;CAIrB,WAAkB,GAAc,GAAsB;AAGpD,EAFA,MAAM,WAAW,GAAO,EAAQ,EAEhC,KAAK,iBAAiB;;CAGxB,aAA0B;AACpB,GAAC,KAAK,UAAU,CAAC,KAAK,WAG1B,KAAK,OAAO,IAAI,KAAK,QAAQ;;CAG/B,kBAA+B;AACzB,GAAC,KAAK,UAAU,CAAC,KAAK,WAG1B,KAAK,OAAO,OAAO,KAAK,QAAQ;;;GApEjC,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,qBAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"banana-for-scale-C_iNmlCT.mjs","names":[],"sources":["../../packages/configurator-core/public/geometry/banana.glb?no-inline?url","../../packages/configurator-core/src/webgl/banana-for-scale.ts"],"sourcesContent":["export default \"__VITE_ASSET__gOpBNSELCNdnM_yZlyA5OQ__\"","import inject from '../../../common-core/src/di/inject';\nimport type StaticItemLoader from '../../../common-core/src/webgl/static-item-loader';\nimport { ScenePluginDefaultImplementation } from './plugin-system';\nimport { BANANA_FILE_NAME } from '../static-files/geometries';\nimport type { Box3, Object3D, Scene } from 'three';\nimport { Vector3 } from 'three';\n\nexport default class BananaForScale extends ScenePluginDefaultImplementation {\n private _scene: Scene;\n private _bounds: Box3;\n private _banana: Object3D;\n\n @inject\n private _staticItemLoader: StaticItemLoader;\n\n public setScene(scene: Scene) {\n this._scene = scene;\n\n this._staticItemLoader.loadGLB(BANANA_FILE_NAME).then((glb) => {\n this._banana = glb.scene;\n this.updateBounds(null);\n });\n\n console.log(\n '%c' + 'Banana 3D model by https://sketchfab.com/daniel132',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Banana source: https://sketchfab.com/3d-models/banana-mark-2-a7fef734bf4544cb8a780a858fa6af97',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Licensed under Creative Commons 4.0: https://creativecommons.org/licenses/by/4.0/',\n 'color: #ffe135',\n );\n }\n\n public updateBounds(bounds: Box3) {\n if (bounds) {\n this._bounds = bounds;\n }\n if (!this._bounds) {\n return;\n }\n if (this._banana) {\n const size = this._bounds.getSize(new Vector3());\n const center = this._bounds.getCenter(new Vector3());\n const position = center.clone();\n position.x -= size.x / 2 + 0.18;\n position.z += size.z / 2 + 0.05;\n position.y = 0;\n let scale = 0.1;\n this._banana.scale.copy(new Vector3(scale, scale, scale));\n this._banana.rotation.y = 0.6;\n this._banana.position.copy(position);\n }\n if (!this._scene.children.includes(this._banana)) {\n this.addToScene();\n }\n }\n\n public clearScene(scene: Scene, uiScene: Scene): void {\n super.clearScene(scene, uiScene);\n\n this.removeFromScene();\n }\n\n public addToScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.add(this._banana);\n }\n\n public removeFromScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.remove(this._banana);\n }\n}\n"],"mappings":";;;;AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,cAAA,OAAA,KAAA,IAAA,CAAA,MCOM,IAArB,cAA4C,EAAiC;CAQ3E,SAAgB,GAAc;AAiB5B,EAhBA,KAAK,SAAS,GAEd,KAAK,kBAAkB,QAAQ,EAAiB,CAAC,MAAM,MAAQ;AAE7D,GADA,KAAK,UAAU,EAAI,OACnB,KAAK,aAAa,KAAK;IACvB,EAEF,QAAQ,IACN,wDACA,iBACD,EACD,QAAQ,IACN,mGAEA,iBACD,EACD,QAAQ,IACN,uFAEA,iBACD;;CAGH,aAAoB,GAAc;AAChC,MAAI,MACF,KAAK,UAAU,IAEZ,KAAK,SAGV;OAAI,KAAK,SAAS;IAChB,IAAM,IAAO,KAAK,QAAQ,QAAQ,IAAI,GAAS,CAAC,EAE1C,IADS,KAAK,QAAQ,UAAU,IAAI,GAAS,CAAC,CAC5B,OAAO;AAG/B,IAFA,EAAS,KAAK,EAAK,IAAI,IAAI,KAC3B,EAAS,KAAK,EAAK,IAAI,IAAI,KAC3B,EAAS,IAAI;IACb,IAAI,IAAQ;AAGZ,IAFA,KAAK,QAAQ,MAAM,KAAK,IAAI,EAAQ,GAAO,GAAO,EAAM,CAAC,EACzD,KAAK,QAAQ,SAAS,IAAI,IAC1B,KAAK,QAAQ,SAAS,KAAK,EAAS;;AAEtC,GAAK,KAAK,OAAO,SAAS,SAAS,KAAK,QAAQ,IAC9C,KAAK,YAAY;;;CAIrB,WAAkB,GAAc,GAAsB;AAGpD,EAFA,MAAM,WAAW,GAAO,EAAQ,EAEhC,KAAK,iBAAiB;;CAGxB,aAA0B;AACpB,GAAC,KAAK,UAAU,CAAC,KAAK,WAG1B,KAAK,OAAO,IAAI,KAAK,QAAQ;;CAG/B,kBAA+B;AACzB,GAAC,KAAK,UAAU,CAAC,KAAK,WAG1B,KAAK,OAAO,OAAO,KAAK,QAAQ;;;GApEjC,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,qBAAA,KAAA,EAAA"}