@roomle/web-sdk 5.1.0-alpha.4 → 5.1.0-alpha.6
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.
- package/lib/{BufferGeometry-Bl5whHAB.mjs → BufferGeometry-CxlpBjLq.mjs} +192 -195
- package/lib/BufferGeometry-CxlpBjLq.mjs.map +1 -0
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-yQ7mMauu.mjs → GLTFExporter-DeNw0qAI.mjs} +86 -80
- package/lib/GLTFExporter-DeNw0qAI.mjs.map +1 -0
- package/lib/GaussianBlurNode-BR1cKBsX.mjs +65 -0
- package/lib/GaussianBlurNode-BR1cKBsX.mjs.map +1 -0
- package/lib/{Object3D-BHdngbxB.mjs → Object3D-CALIQdg1.mjs} +142 -59
- package/lib/Object3D-CALIQdg1.mjs.map +1 -0
- package/lib/{Pass-DLiMLT5k.mjs → Pass-DCljS3Z-.mjs} +4 -4
- package/lib/{Pass-DLiMLT5k.mjs.map → Pass-DCljS3Z-.mjs.map} +1 -1
- package/lib/{PointLightHelper-CuPSBuDU.mjs → PointLightHelper-C_0CYp7R.mjs} +35 -32
- package/lib/PointLightHelper-C_0CYp7R.mjs.map +1 -0
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-m-Rh8vGU.mjs → SpotLightHelper-UUIHn43T.mjs} +22 -19
- package/lib/SpotLightHelper-UUIHn43T.mjs.map +1 -0
- package/lib/{USDZExporter-MdkuT226.mjs → USDZExporter-BBNw7Hey.mjs} +6 -3
- package/lib/USDZExporter-BBNw7Hey.mjs.map +1 -0
- package/lib/{Vector4-C7TlIAyy.mjs → Vector4-BOcWTZJI.mjs} +2 -2
- package/lib/Vector4-BOcWTZJI.mjs.map +1 -0
- package/lib/{api-Bznmr-xZ.mjs → api-ClfVJAUd.mjs} +2 -2
- package/lib/{api-Bznmr-xZ.mjs.map → api-ClfVJAUd.mjs.map} +1 -1
- package/lib/asset-loader.worker-CzI1oyTY.mjs.map +1 -1
- package/lib/{banana-for-scale-DpKXNBt_.mjs → banana-for-scale-Cf41yXTl.mjs} +3 -3
- package/lib/{banana-for-scale-DpKXNBt_.mjs.map → banana-for-scale-Cf41yXTl.mjs.map} +1 -1
- package/lib/budgeteer.sw-D80jTmYa.mjs.map +1 -1
- package/lib/{common-utils-DbL4tku0.mjs → common-utils-OTJQGohe.mjs} +3 -3
- package/lib/common-utils-OTJQGohe.mjs.map +1 -0
- package/lib/{component-dimensioning-BaUqwqYJ.mjs → component-dimensioning-yPK46Y5o.mjs} +26 -26
- package/lib/{component-dimensioning-BaUqwqYJ.mjs.map → component-dimensioning-yPK46Y5o.mjs.map} +1 -1
- package/lib/{component-raycast-helper-4i8b4E5B.mjs → component-raycast-helper-CnpnRaFg.mjs} +15 -15
- package/lib/{component-raycast-helper-4i8b4E5B.mjs.map → component-raycast-helper-CnpnRaFg.mjs.map} +1 -1
- package/lib/{configurator-CDw_c6tB.mjs → configurator-BM31Kt-5.mjs} +4 -4
- package/lib/{configurator-CDw_c6tB.mjs.map → configurator-BM31Kt-5.mjs.map} +1 -1
- package/lib/configurator-CRQg04Bp.mjs +2 -0
- package/lib/{continuous-drawing-helper-DqHIR_qF.mjs → continuous-drawing-helper-CTfGRTfH.mjs} +3 -3
- package/lib/{continuous-drawing-helper-DqHIR_qF.mjs.map → continuous-drawing-helper-CTfGRTfH.mjs.map} +1 -1
- package/lib/dimensioning-helper-CQlesi-m.mjs +2 -0
- package/lib/{dimensioning-helper-CGPjS2hW.mjs → dimensioning-helper-DSlkLDmx.mjs} +42 -36
- package/lib/dimensioning-helper-DSlkLDmx.mjs.map +1 -0
- package/lib/{glb-viewer-B-Zr743e.mjs → glb-viewer-B2si39v2.mjs} +33 -33
- package/lib/{glb-viewer-B-Zr743e.mjs.map → glb-viewer-B2si39v2.mjs.map} +1 -1
- package/lib/glb-viewer-DWybhP87.mjs +2 -0
- package/lib/{highlight-coordinator-4gkjde82.mjs → highlight-coordinator-DU6oFunq.mjs} +6 -6
- package/lib/{highlight-coordinator-4gkjde82.mjs.map → highlight-coordinator-DU6oFunq.mjs.map} +1 -1
- package/lib/{homag-intelligence-D7S7r-Gc.mjs → homag-intelligence-CSBo-iks.mjs} +3 -3
- package/lib/{homag-intelligence-D7S7r-Gc.mjs.map → homag-intelligence-CSBo-iks.mjs.map} +1 -1
- package/lib/{hosek-wilkie-sky-iMar2iw-.mjs → hosek-wilkie-sky-DmTvnxMA.mjs} +33 -33
- package/lib/{hosek-wilkie-sky-iMar2iw-.mjs.map → hosek-wilkie-sky-DmTvnxMA.mjs.map} +1 -1
- package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs → imos-ix-poc-export-helper-BGN97m8W.mjs} +3 -3
- package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs.map → imos-ix-poc-export-helper-BGN97m8W.mjs.map} +1 -1
- package/lib/kernel-BWfRHWkW.mjs.map +1 -1
- package/lib/{kernel-utils-BvatnA7U.mjs → kernel-utils-BYKmP0mf.mjs} +13 -13
- package/lib/{kernel-utils-BvatnA7U.mjs.map → kernel-utils-BYKmP0mf.mjs.map} +1 -1
- package/lib/{material-viewer-CTsSfTfL.mjs → material-viewer-C2Pj4-II.mjs} +18 -18
- package/lib/{material-viewer-CTsSfTfL.mjs.map → material-viewer-C2Pj4-II.mjs.map} +1 -1
- package/lib/{packages-BXAZEcKa.mjs → packages-C0xavGqP.mjs} +5 -5
- package/lib/{packages-BXAZEcKa.mjs.map → packages-C0xavGqP.mjs.map} +1 -1
- package/lib/{planner-jvLAnYww.mjs → planner-C1KkZRGk.mjs} +3 -3
- package/lib/{planner-jvLAnYww.mjs.map → planner-C1KkZRGk.mjs.map} +1 -1
- package/lib/planner-DJE5aZXG.mjs +2 -0
- package/lib/{plugin-system-CRaC04G5.mjs → plugin-system-CPf99Zkf.mjs} +2 -2
- package/lib/{plugin-system-CRaC04G5.mjs.map → plugin-system-CPf99Zkf.mjs.map} +1 -1
- package/lib/{render-cache-DCPIQbO1.mjs → render-cache-CPppt7Rd.mjs} +5 -5
- package/lib/{render-cache-DCPIQbO1.mjs.map → render-cache-CPppt7Rd.mjs.map} +1 -1
- package/lib/{render-order-BPF2wDMw.mjs → render-order-a0QAbB7Q.mjs} +2 -2
- package/lib/{render-order-BPF2wDMw.mjs.map → render-order-a0QAbB7Q.mjs.map} +1 -1
- package/lib/roomle-headless.d.ts +13 -11
- package/lib/roomle-headless.js +14 -14
- package/lib/{roomle-renderer-Ato6RMrd.mjs → roomle-renderer-UJINLYxS.mjs} +2 -2
- package/lib/{roomle-renderer-Ato6RMrd.mjs.map → roomle-renderer-UJINLYxS.mjs.map} +1 -1
- package/lib/{roomle-sdk-CBwhwX_e.mjs → roomle-sdk-BhHLCbgP.mjs} +1747 -1729
- package/lib/roomle-sdk-BhHLCbgP.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +13 -11
- package/lib/roomle-sdk.js +7 -7
- package/lib/{roomle-webgpu-renderer-BfZKcXSz.mjs → roomle-webgpu-renderer-BSvxbopA.mjs} +900 -707
- package/lib/roomle-webgpu-renderer-BSvxbopA.mjs.map +1 -0
- package/lib/{scene-renderer-BHYZac3H.mjs → scene-renderer--DzrpIl_.mjs} +309 -309
- package/lib/{scene-renderer-BHYZac3H.mjs.map → scene-renderer--DzrpIl_.mjs.map} +1 -1
- package/lib/{script-loader-CvnG6LgL.mjs → script-loader-BHniYj5b.mjs} +2 -2
- package/lib/{script-loader-CvnG6LgL.mjs.map → script-loader-BHniYj5b.mjs.map} +1 -1
- package/lib/{shading-settings-BBhR7KcS.mjs → shading-settings-6v-7O_Sz.mjs} +49 -49
- package/lib/{shading-settings-BBhR7KcS.mjs.map → shading-settings-6v-7O_Sz.mjs.map} +1 -1
- package/lib/src-6KtBPZXp.mjs +2 -0
- package/lib/{src-HhklrVDg.mjs → src-Dg0wYIom.mjs} +150 -150
- package/lib/{src-HhklrVDg.mjs.map → src-Dg0wYIom.mjs.map} +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +4 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +5 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-PndcZCzL.mjs → stats-helper-DYjPPDnz.mjs} +2 -2
- package/lib/{stats-helper-PndcZCzL.mjs.map → stats-helper-DYjPPDnz.mjs.map} +1 -1
- package/lib/{three.core-0KaTx8dm.mjs → three.core-BTUCraWz.mjs} +976 -884
- package/lib/three.core-BTUCraWz.mjs.map +1 -0
- package/lib/{three.module-dym6j3lO.mjs → three.module-DUSFrLM6.mjs} +1789 -1739
- package/lib/three.module-DUSFrLM6.mjs.map +1 -0
- package/lib/three.tsl-De6A-G56.mjs +158 -0
- package/lib/three.tsl-De6A-G56.mjs.map +1 -0
- package/lib/three.tsl-DtfvggFX.mjs +2 -0
- package/lib/three.webgpu-B1OhMci_.mjs +3 -0
- package/lib/{three.webgpu-D3nSEIjD.mjs → three.webgpu-wPiwbpFM.mjs} +5806 -4926
- package/lib/three.webgpu-wPiwbpFM.mjs.map +1 -0
- package/lib/{threejs-utils-v1uOvccg.mjs → threejs-utils-lVSsgAiQ.mjs} +68 -68
- package/lib/{threejs-utils-v1uOvccg.mjs.map → threejs-utils-lVSsgAiQ.mjs.map} +1 -1
- package/lib/{tools-core-B29U-88K.mjs → tools-core-QUdVgS4n.mjs} +3 -3
- package/lib/{tools-core-B29U-88K.mjs.map → tools-core-QUdVgS4n.mjs.map} +1 -1
- package/lib/{webgpu-BHAP6BLI.mjs → webgpu-BxYJfBjz.mjs} +555 -555
- package/lib/{webgpu-BHAP6BLI.mjs.map → webgpu-BxYJfBjz.mjs.map} +1 -1
- package/package.json +5 -5
- package/lib/BufferGeometry-Bl5whHAB.mjs.map +0 -1
- package/lib/GLTFExporter-yQ7mMauu.mjs.map +0 -1
- package/lib/GaussianBlurNode-DNBEf5-n.mjs +0 -59
- package/lib/GaussianBlurNode-DNBEf5-n.mjs.map +0 -1
- package/lib/Object3D-BHdngbxB.mjs.map +0 -1
- package/lib/PointLightHelper-CuPSBuDU.mjs.map +0 -1
- package/lib/SpotLightHelper-m-Rh8vGU.mjs.map +0 -1
- package/lib/USDZExporter-MdkuT226.mjs.map +0 -1
- package/lib/Vector4-C7TlIAyy.mjs.map +0 -1
- package/lib/common-utils-DbL4tku0.mjs.map +0 -1
- package/lib/configurator-BYQdWEvf.mjs +0 -2
- package/lib/dimensioning-helper-CGPjS2hW.mjs.map +0 -1
- package/lib/dimensioning-helper-VndKlIXS.mjs +0 -2
- package/lib/glb-viewer-Bd5Xn6Oq.mjs +0 -2
- package/lib/planner-DMk3T4ts.mjs +0 -2
- package/lib/roomle-sdk-CBwhwX_e.mjs.map +0 -1
- package/lib/roomle-webgpu-renderer-BfZKcXSz.mjs.map +0 -1
- package/lib/src-Bbq3Hqzn.mjs +0 -2
- package/lib/three.core-0KaTx8dm.mjs.map +0 -1
- package/lib/three.module-dym6j3lO.mjs.map +0 -1
- package/lib/three.tsl-BTc4fg8T.mjs +0 -2
- package/lib/three.tsl-Cf0-sCqB.mjs +0 -152
- package/lib/three.tsl-Cf0-sCqB.mjs.map +0 -1
- package/lib/three.webgpu-ClICiWlK.mjs +0 -3
- package/lib/three.webgpu-D3nSEIjD.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _n as e,
|
|
1
|
+
import { _n as e, ln as t, vn as n } from "./three.core-BTUCraWz.mjs";
|
|
2
2
|
//#region packages/common-core/src/webgl/renderer/render-cache.ts
|
|
3
|
-
var r = /* @__PURE__ */ new WeakMap(), i = (e, t) => Array.isArray(e) ? e.some((e) => i(e, t)) : e.transparent && e.opacity < t || e.alphaTest > 0, a = (
|
|
3
|
+
var r = /* @__PURE__ */ new WeakMap(), i = (e, t) => Array.isArray(e) ? e.some((e) => i(e, t)) : e.transparent && e.opacity < t || e.alphaTest > 0, a = (t) => Array.isArray(t) ? t.some((e) => a(e)) : t instanceof e && t.transmission > 0, o = class {
|
|
4
4
|
constructor(e) {
|
|
5
5
|
this.needsUpdate = !0, this._cache = null, this._cache = e;
|
|
6
6
|
}
|
|
@@ -100,8 +100,8 @@ var r = /* @__PURE__ */ new WeakMap(), i = (e, t) => Array.isArray(e) ? e.some((
|
|
|
100
100
|
}
|
|
101
101
|
addLineOrPoint(e) {}
|
|
102
102
|
addObject(e) {}
|
|
103
|
-
addMesh(
|
|
104
|
-
this._doNotWriteDepth && this._doNotWriteDepth(
|
|
103
|
+
addMesh(e) {
|
|
104
|
+
this._doNotWriteDepth && this._doNotWriteDepth(e) && e.material instanceof n && e.material.depthWrite && this._depthWriteCache.add(e.material);
|
|
105
105
|
}
|
|
106
106
|
onBeforeRender() {
|
|
107
107
|
this._depthWriteCache.forEach((e) => {
|
|
@@ -147,4 +147,4 @@ var r = /* @__PURE__ */ new WeakMap(), i = (e, t) => Array.isArray(e) ? e.some((
|
|
|
147
147
|
//#endregion
|
|
148
148
|
export { a, c as i, u as n, i as o, s as r, r as s, l as t };
|
|
149
149
|
|
|
150
|
-
//# sourceMappingURL=render-cache-
|
|
150
|
+
//# sourceMappingURL=render-cache-CPppt7Rd.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-cache-DCPIQbO1.mjs","names":[],"sources":["../../packages/common-core/src/webgl/renderer/render-cache.ts"],"sourcesContent":["import type { Material, Object3D } from 'three';\nimport { Mesh, MeshPhysicalMaterial } from 'three';\nimport { MeshStandardMaterial } from 'three';\n\nexport const originalHighlightMaterials = new WeakMap<Material, Material>();\n\nexport const isTransparentMaterial = (\n material: Material | Material[],\n threshold: number,\n): boolean => {\n if (Array.isArray(material)) {\n return material.some((m) => isTransparentMaterial(m, threshold));\n }\n return (\n (material.transparent && material.opacity < threshold) ||\n material.alphaTest > 0\n );\n};\n\nexport const isTransmissiveMaterial = (\n material: Material | Material[],\n): boolean => {\n if (Array.isArray(material)) {\n return material.some((m) => isTransmissiveMaterial(m));\n }\n return material instanceof MeshPhysicalMaterial && material.transmission > 0;\n};\n\nexport interface RenderCache {\n dispose(): void;\n clear(): void;\n addLineOrPoint(object3d: Object3D): void;\n addMesh(mesh: Mesh): void;\n addObject(object3d: Object3D): void;\n onBeforeRender(): void;\n onAfterRender(): void;\n}\n\nexport interface ThreeObject3d {\n isLine?: boolean;\n isPoints?: boolean;\n isMesh?: boolean;\n}\n\nclass RenderCacheMapItem {\n public needsUpdate: boolean = true;\n private _cache: RenderCache | null = null;\n\n constructor(cache: RenderCache) {\n this._cache = cache;\n }\n\n public dispose() {\n this._cache?.dispose();\n }\n\n public clear() {\n this._cache?.clear();\n this.needsUpdate = true;\n }\n\n public update(object3d: Object3D) {\n if (!this.needsUpdate || !this._cache) {\n return;\n }\n object3d.traverse((object: Object3D | ThreeObject3d) => {\n if (\n (object as ThreeObject3d).isLine ||\n (object as ThreeObject3d).isPoints\n ) {\n this._cache?.addLineOrPoint(object as Object3D);\n } else if ((object as ThreeObject3d).isMesh) {\n this._cache?.addMesh(object as Mesh);\n } else {\n this._cache?.addObject(object as Object3D);\n }\n });\n this.needsUpdate = false;\n }\n\n public onBeforeRender(): void {\n this._cache?.onBeforeRender();\n }\n\n public onAfterRender(): void {\n this._cache?.onAfterRender();\n }\n}\n\nexport type CacheKey = any;\n\nexport class RenderCacheManager {\n private _cacheMap: Map<CacheKey, RenderCacheMapItem> = new Map();\n\n public dispose() {\n this._cacheMap.forEach((cache) => {\n cache.dispose();\n });\n }\n\n public registerCache(key: CacheKey, cache: RenderCache) {\n this._cacheMap.set(key, new RenderCacheMapItem(cache));\n }\n\n public clearCache() {\n this._cacheMap.forEach((cache) => {\n cache.clear();\n });\n }\n\n public clearObjectCache(key: CacheKey) {\n const cache = this._cacheMap.get(key);\n if (cache) {\n cache.clear();\n }\n }\n\n public onBeforeRender(key: CacheKey, object3d: Object3D): void {\n const cache = this._cacheMap.get(key);\n if (cache) {\n cache.update(object3d);\n cache.onBeforeRender();\n }\n }\n\n public onAfterRender(key: CacheKey): void {\n const cache = this._cacheMap.get(key);\n if (cache) {\n cache.onAfterRender();\n }\n }\n\n public render(key: CacheKey, object3d: Object3D, renderMethod: () => void) {\n const cache = this._cacheMap.get(key);\n if (cache) {\n cache.update(object3d);\n cache.onBeforeRender();\n }\n try {\n renderMethod();\n } finally {\n if (cache) {\n cache.onAfterRender();\n }\n }\n }\n}\n\nexport class VisibilityRenderCache implements RenderCache {\n // the key set is the objects to hide, the value is only meaningful between\n // onBeforeRender and onAfterRender and is refreshed in place every pass\n private _visibilityToRestore: Map<Object3D, boolean> = new Map();\n private _isObjectInvisible?: (object: any) => boolean;\n\n constructor(isObjectInvisible?: (object: any) => boolean) {\n this._isObjectInvisible = isObjectInvisible;\n }\n\n public dispose(): void {\n this.clear();\n }\n\n public clear(): void {\n this._visibilityToRestore.clear();\n }\n\n public addLineOrPoint(object3d: Object3D): void {\n this._visibilityToRestore.set(object3d, object3d.visible);\n }\n\n public addMesh(mesh: Mesh): void {\n if (this._isObjectInvisible && this._isObjectInvisible(mesh)) {\n this._visibilityToRestore.set(mesh, mesh.visible);\n }\n }\n\n public addObject(object3d: Object3D): void {\n if (this._isObjectInvisible && this._isObjectInvisible(object3d)) {\n this._visibilityToRestore.set(object3d, object3d.visible);\n }\n }\n\n public onBeforeRender(): void {\n this._visibilityToRestore.forEach((_visible: boolean, object: Object3D) => {\n this._visibilityToRestore.set(object, object.visible);\n object.visible = false;\n });\n }\n\n public onAfterRender(): void {\n this._visibilityToRestore.forEach((visible: boolean, object: Object3D) => {\n object.visible = visible;\n });\n }\n}\n\nexport class DepthWriteRenderCache {\n private _depthWriteCache = new Set<MeshStandardMaterial>();\n private _doNotWriteDepth?: (mesh: Mesh) => boolean;\n\n constructor(doNotWriteDepth?: (object: any) => boolean) {\n this._doNotWriteDepth = doNotWriteDepth;\n }\n\n public dispose(): void {\n this._depthWriteCache.clear();\n }\n\n public clear(): void {\n this._depthWriteCache.clear();\n }\n\n public addLineOrPoint(_: Object3D): void {\n // do nothing\n }\n public addObject(_: Object3D): void {\n // do nothing\n }\n\n public addMesh(mesh: Mesh): void {\n if (\n this._doNotWriteDepth &&\n this._doNotWriteDepth(mesh) &&\n mesh.material instanceof MeshStandardMaterial &&\n mesh.material.depthWrite\n ) {\n this._depthWriteCache.add(mesh.material);\n }\n }\n\n public onBeforeRender(): void {\n this._depthWriteCache.forEach((material: MeshStandardMaterial) => {\n material.depthWrite = false;\n });\n }\n\n public onAfterRender(): void {\n this._depthWriteCache.forEach((material: MeshStandardMaterial) => {\n material.depthWrite = true;\n });\n }\n}\n\nexport interface ObjectCacheData {\n visible?: boolean;\n castShadow?: boolean;\n receiveShadow?: boolean;\n material?: Material | Material[];\n}\n\ninterface ObjectCacheEntry {\n originalObjectData: ObjectCacheData;\n updateObjectData: ObjectCacheData;\n}\n\nexport abstract class ObjectRenderCache implements RenderCache {\n private _objectCache = new Map<Object3D, ObjectCacheEntry>();\n\n public abstract dispose(): void;\n public abstract addLineOrPoint(object3d: Object3D): void;\n public abstract addMesh(mesh: Mesh): void;\n public abstract addObject(object3d: Object3D): void;\n\n public clear(): void {\n this._objectCache.clear();\n }\n\n public onBeforeRender(): void {\n this._objectCache.forEach((data: ObjectCacheEntry, object: Object3D) => {\n ObjectRenderCache._writeObjectDataInto(object, data.originalObjectData);\n this._updateObject(object, data.updateObjectData);\n });\n }\n\n public onAfterRender(): void {\n this._objectCache.forEach((data: ObjectCacheEntry, object: Object3D) => {\n this._updateObject(object, data.originalObjectData);\n });\n }\n\n public addToCache(\n object: Object3D | Mesh,\n updateObjectData: ObjectCacheData,\n ): void {\n const originalObjectData: ObjectCacheData = {};\n ObjectRenderCache._writeObjectDataInto(object, originalObjectData);\n this._objectCache.set(object, { originalObjectData, updateObjectData });\n }\n\n private static _writeObjectDataInto(\n object: Object3D | Mesh,\n target: ObjectCacheData,\n ): void {\n target.visible = object.visible;\n target.castShadow = object.castShadow;\n target.receiveShadow =\n object instanceof Mesh ? object.receiveShadow : undefined;\n target.material = object instanceof Mesh ? object.material : undefined;\n }\n\n private _updateObject(object: Object3D, objectData: ObjectCacheData) {\n if (objectData.visible !== undefined) {\n object.visible = objectData.visible;\n }\n if (objectData.castShadow !== undefined) {\n object.castShadow = objectData.castShadow;\n }\n if (object instanceof Mesh && objectData.receiveShadow !== undefined) {\n (object as Mesh).receiveShadow = objectData.receiveShadow;\n }\n if (object instanceof Mesh && objectData.material !== undefined) {\n (object as Mesh).material = objectData.material as Material;\n }\n }\n}\n"],"mappings":";;AAIA,IAAa,oBAA6B,IAAI,SAA6B,EAE9D,KACX,GACA,MAEI,MAAM,QAAQ,EAAS,GAClB,EAAS,MAAM,MAAM,EAAsB,GAAG,EAAU,CAAC,GAG/D,EAAS,eAAe,EAAS,UAAU,KAC5C,EAAS,YAAY,GAIZ,KACX,MAEI,MAAM,QAAQ,EAAS,GAClB,EAAS,MAAM,MAAM,EAAuB,EAAE,CAAC,GAEjD,aAAoB,KAAwB,EAAS,eAAe,GAmBvE,IAAN,MAAyB;CAIvB,YAAY,GAAoB;AAC9B,qBAJ4B,kBACO,MAGnC,KAAK,SAAS;;CAGhB,UAAiB;AACf,OAAK,QAAQ,SAAS;;CAGxB,QAAe;AAEb,EADA,KAAK,QAAQ,OAAO,EACpB,KAAK,cAAc;;CAGrB,OAAc,GAAoB;AAC5B,GAAC,KAAK,eAAe,CAAC,KAAK,WAG/B,EAAS,UAAU,MAAqC;AACtD,GACG,EAAyB,UACzB,EAAyB,WAE1B,KAAK,QAAQ,eAAe,EAAmB,GACrC,EAAyB,SAC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Ac,GAAQ,EAAK,mBAAmB;IACnD;;CAGJ,WACE,GACA,GACM;EACN,IAAM,IAAsC,EAAE;AAE9C,EADA,EAAkB,qBAAqB,GAAQ,EAAmB,EAClE,KAAK,aAAa,IAAI,GAAQ;GAAE;GAAoB;GAAkB,CAAC;;CAGzE,OAAe,qBACb,GACA,GACM;AAKN,EAJA,EAAO,UAAU,EAAO,SACxB,EAAO,aAAa,EAAO,YAC3B,EAAO,gBACL,aAAkB,IAAO,EAAO,gBAAgB,KAAA,GAClD,EAAO,WAAW,aAAkB,IAAO,EAAO,WAAW,KAAA;;CAG/D,cAAsB,GAAkB,GAA6B;AAUnE,EATI,EAAW,YAAY,KAAA,MACzB,EAAO,UAAU,EAAW,UAE1B,EAAW,eAAe,KAAA,MAC5B,EAAO,aAAa,EAAW,aAE7B,aAAkB,KAAQ,EAAW,kBAAkB,KAAA,MACxD,EAAgB,gBAAgB,EAAW,gBAE1C,aAAkB,KAAQ,EAAW,aAAa,KAAA,MACnD,EAAgB,WAAW,EAAW"}
|
|
1
|
+
{"version":3,"file":"render-cache-CPppt7Rd.mjs","names":[],"sources":["../../packages/common-core/src/webgl/renderer/render-cache.ts"],"sourcesContent":["import type { Material, Object3D } from 'three';\nimport { Mesh, MeshPhysicalMaterial } from 'three';\nimport { MeshStandardMaterial } from 'three';\n\nexport const originalHighlightMaterials = new WeakMap<Material, Material>();\n\nexport const isTransparentMaterial = (\n material: Material | Material[],\n threshold: number,\n): boolean => {\n if (Array.isArray(material)) {\n return material.some((m) => isTransparentMaterial(m, threshold));\n }\n return (\n (material.transparent && material.opacity < threshold) ||\n material.alphaTest > 0\n );\n};\n\nexport const isTransmissiveMaterial = (\n material: Material | Material[],\n): boolean => {\n if (Array.isArray(material)) {\n return material.some((m) => isTransmissiveMaterial(m));\n }\n return material instanceof MeshPhysicalMaterial && material.transmission > 0;\n};\n\nexport interface RenderCache {\n dispose(): void;\n clear(): void;\n addLineOrPoint(object3d: Object3D): void;\n addMesh(mesh: Mesh): void;\n addObject(object3d: Object3D): void;\n onBeforeRender(): void;\n onAfterRender(): void;\n}\n\nexport interface ThreeObject3d {\n isLine?: boolean;\n isPoints?: boolean;\n isMesh?: boolean;\n}\n\nclass RenderCacheMapItem {\n public needsUpdate: boolean = true;\n private _cache: RenderCache | null = null;\n\n constructor(cache: RenderCache) {\n this._cache = cache;\n }\n\n public dispose() {\n this._cache?.dispose();\n }\n\n public clear() {\n this._cache?.clear();\n this.needsUpdate = true;\n }\n\n public update(object3d: Object3D) {\n if (!this.needsUpdate || !this._cache) {\n return;\n }\n object3d.traverse((object: Object3D | ThreeObject3d) => {\n if (\n (object as ThreeObject3d).isLine ||\n (object as ThreeObject3d).isPoints\n ) {\n this._cache?.addLineOrPoint(object as Object3D);\n } else if ((object as ThreeObject3d).isMesh) {\n this._cache?.addMesh(object as Mesh);\n } else {\n this._cache?.addObject(object as Object3D);\n }\n });\n this.needsUpdate = false;\n }\n\n public onBeforeRender(): void {\n this._cache?.onBeforeRender();\n }\n\n public onAfterRender(): void {\n this._cache?.onAfterRender();\n }\n}\n\nexport type CacheKey = any;\n\nexport class RenderCacheManager {\n private _cacheMap: Map<CacheKey, RenderCacheMapItem> = new Map();\n\n public dispose() {\n this._cacheMap.forEach((cache) => {\n cache.dispose();\n });\n }\n\n public registerCache(key: CacheKey, cache: RenderCache) {\n this._cacheMap.set(key, new RenderCacheMapItem(cache));\n }\n\n public clearCache() {\n this._cacheMap.forEach((cache) => {\n cache.clear();\n });\n }\n\n public clearObjectCache(key: CacheKey) {\n const cache = this._cacheMap.get(key);\n if (cache) {\n cache.clear();\n }\n }\n\n public onBeforeRender(key: CacheKey, object3d: Object3D): void {\n const cache = this._cacheMap.get(key);\n if (cache) {\n cache.update(object3d);\n cache.onBeforeRender();\n }\n }\n\n public onAfterRender(key: CacheKey): void {\n const cache = this._cacheMap.get(key);\n if (cache) {\n cache.onAfterRender();\n }\n }\n\n public render(key: CacheKey, object3d: Object3D, renderMethod: () => void) {\n const cache = this._cacheMap.get(key);\n if (cache) {\n cache.update(object3d);\n cache.onBeforeRender();\n }\n try {\n renderMethod();\n } finally {\n if (cache) {\n cache.onAfterRender();\n }\n }\n }\n}\n\nexport class VisibilityRenderCache implements RenderCache {\n // the key set is the objects to hide, the value is only meaningful between\n // onBeforeRender and onAfterRender and is refreshed in place every pass\n private _visibilityToRestore: Map<Object3D, boolean> = new Map();\n private _isObjectInvisible?: (object: any) => boolean;\n\n constructor(isObjectInvisible?: (object: any) => boolean) {\n this._isObjectInvisible = isObjectInvisible;\n }\n\n public dispose(): void {\n this.clear();\n }\n\n public clear(): void {\n this._visibilityToRestore.clear();\n }\n\n public addLineOrPoint(object3d: Object3D): void {\n this._visibilityToRestore.set(object3d, object3d.visible);\n }\n\n public addMesh(mesh: Mesh): void {\n if (this._isObjectInvisible && this._isObjectInvisible(mesh)) {\n this._visibilityToRestore.set(mesh, mesh.visible);\n }\n }\n\n public addObject(object3d: Object3D): void {\n if (this._isObjectInvisible && this._isObjectInvisible(object3d)) {\n this._visibilityToRestore.set(object3d, object3d.visible);\n }\n }\n\n public onBeforeRender(): void {\n this._visibilityToRestore.forEach((_visible: boolean, object: Object3D) => {\n this._visibilityToRestore.set(object, object.visible);\n object.visible = false;\n });\n }\n\n public onAfterRender(): void {\n this._visibilityToRestore.forEach((visible: boolean, object: Object3D) => {\n object.visible = visible;\n });\n }\n}\n\nexport class DepthWriteRenderCache {\n private _depthWriteCache = new Set<MeshStandardMaterial>();\n private _doNotWriteDepth?: (mesh: Mesh) => boolean;\n\n constructor(doNotWriteDepth?: (object: any) => boolean) {\n this._doNotWriteDepth = doNotWriteDepth;\n }\n\n public dispose(): void {\n this._depthWriteCache.clear();\n }\n\n public clear(): void {\n this._depthWriteCache.clear();\n }\n\n public addLineOrPoint(_: Object3D): void {\n // do nothing\n }\n public addObject(_: Object3D): void {\n // do nothing\n }\n\n public addMesh(mesh: Mesh): void {\n if (\n this._doNotWriteDepth &&\n this._doNotWriteDepth(mesh) &&\n mesh.material instanceof MeshStandardMaterial &&\n mesh.material.depthWrite\n ) {\n this._depthWriteCache.add(mesh.material);\n }\n }\n\n public onBeforeRender(): void {\n this._depthWriteCache.forEach((material: MeshStandardMaterial) => {\n material.depthWrite = false;\n });\n }\n\n public onAfterRender(): void {\n this._depthWriteCache.forEach((material: MeshStandardMaterial) => {\n material.depthWrite = true;\n });\n }\n}\n\nexport interface ObjectCacheData {\n visible?: boolean;\n castShadow?: boolean;\n receiveShadow?: boolean;\n material?: Material | Material[];\n}\n\ninterface ObjectCacheEntry {\n originalObjectData: ObjectCacheData;\n updateObjectData: ObjectCacheData;\n}\n\nexport abstract class ObjectRenderCache implements RenderCache {\n private _objectCache = new Map<Object3D, ObjectCacheEntry>();\n\n public abstract dispose(): void;\n public abstract addLineOrPoint(object3d: Object3D): void;\n public abstract addMesh(mesh: Mesh): void;\n public abstract addObject(object3d: Object3D): void;\n\n public clear(): void {\n this._objectCache.clear();\n }\n\n public onBeforeRender(): void {\n this._objectCache.forEach((data: ObjectCacheEntry, object: Object3D) => {\n ObjectRenderCache._writeObjectDataInto(object, data.originalObjectData);\n this._updateObject(object, data.updateObjectData);\n });\n }\n\n public onAfterRender(): void {\n this._objectCache.forEach((data: ObjectCacheEntry, object: Object3D) => {\n this._updateObject(object, data.originalObjectData);\n });\n }\n\n public addToCache(\n object: Object3D | Mesh,\n updateObjectData: ObjectCacheData,\n ): void {\n const originalObjectData: ObjectCacheData = {};\n ObjectRenderCache._writeObjectDataInto(object, originalObjectData);\n this._objectCache.set(object, { originalObjectData, updateObjectData });\n }\n\n private static _writeObjectDataInto(\n object: Object3D | Mesh,\n target: ObjectCacheData,\n ): void {\n target.visible = object.visible;\n target.castShadow = object.castShadow;\n target.receiveShadow =\n object instanceof Mesh ? object.receiveShadow : undefined;\n target.material = object instanceof Mesh ? object.material : undefined;\n }\n\n private _updateObject(object: Object3D, objectData: ObjectCacheData) {\n if (objectData.visible !== undefined) {\n object.visible = objectData.visible;\n }\n if (objectData.castShadow !== undefined) {\n object.castShadow = objectData.castShadow;\n }\n if (object instanceof Mesh && objectData.receiveShadow !== undefined) {\n (object as Mesh).receiveShadow = objectData.receiveShadow;\n }\n if (object instanceof Mesh && objectData.material !== undefined) {\n (object as Mesh).material = objectData.material as Material;\n }\n }\n}\n"],"mappings":";;AAIA,IAAa,oBAA6B,IAAI,SAA6B,EAE9D,KACX,GACA,MAEI,MAAM,QAAQ,EAAS,GAClB,EAAS,MAAM,MAAM,EAAsB,GAAG,EAAU,CAAC,GAG/D,EAAS,eAAe,EAAS,UAAU,KAC5C,EAAS,YAAY,GAIZ,KACX,MAEI,MAAM,QAAQ,EAAS,GAClB,EAAS,MAAM,MAAM,EAAuB,EAAE,CAAC,GAEjD,aAAoB,KAAwB,EAAS,eAAe,GAmBvE,IAAN,MAAyB;CAIvB,YAAY,GAAoB;AAC9B,qBAJ4B,kBACO,MAGnC,KAAK,SAAS;;CAGhB,UAAiB;AACf,OAAK,QAAQ,SAAS;;CAGxB,QAAe;AAEb,EADA,KAAK,QAAQ,OAAO,EACpB,KAAK,cAAc;;CAGrB,OAAc,GAAoB;AAC5B,GAAC,KAAK,eAAe,CAAC,KAAK,WAG/B,EAAS,UAAU,MAAqC;AACtD,GACG,EAAyB,UACzB,EAAyB,WAE1B,KAAK,QAAQ,eAAe,EAAmB,GACrC,EAAyB,SACnC,KAAK,QAAQ,QAAQ,EAAe,GAEpC,KAAK,QAAQ,UAAU,EAAmB;IAE5C,EACF,KAAK,cAAc;;CAGrB,iBAA8B;AAC5B,OAAK,QAAQ,gBAAgB;;CAG/B,gBAA6B;AAC3B,OAAK,QAAQ,eAAe;;GAMnB,IAAb,MAAgC;;mCACyB,IAAI,KAAK;;CAEhE,UAAiB;AACf,OAAK,UAAU,SAAS,MAAU;AAChC,KAAM,SAAS;IACf;;CAGJ,cAAqB,GAAe,GAAoB;AACtD,OAAK,UAAU,IAAI,GAAK,IAAI,EAAmB,EAAM,CAAC;;CAGxD,aAAoB;AAClB,OAAK,UA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,EATI,EAAW,YAAY,KAAA,MACzB,EAAO,UAAU,EAAW,UAE1B,EAAW,eAAe,KAAA,MAC5B,EAAO,aAAa,EAAW,aAE7B,aAAkB,KAAQ,EAAW,kBAAkB,KAAA,MACxD,EAAgB,gBAAgB,EAAW,gBAE1C,aAAkB,KAAQ,EAAW,aAAa,KAAA,MACnD,EAAgB,WAAW,EAAW"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _n as e } from "./three.core-BTUCraWz.mjs";
|
|
2
2
|
//#region packages/common-core/src/webgl/render-order.ts
|
|
3
3
|
var t = {
|
|
4
4
|
DIMENSION_LINE: 0,
|
|
@@ -23,4 +23,4 @@ var t = {
|
|
|
23
23
|
//#endregion
|
|
24
24
|
export { n, t };
|
|
25
25
|
|
|
26
|
-
//# sourceMappingURL=render-order-
|
|
26
|
+
//# sourceMappingURL=render-order-a0QAbB7Q.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-order-
|
|
1
|
+
{"version":3,"file":"render-order-a0QAbB7Q.mjs","names":[],"sources":["../../packages/common-core/src/webgl/render-order.ts"],"sourcesContent":["// mostly relevant for transparent/translucent objects\n// lower renderOrder is drawn before render order (if no depth test is used)\n// (please keep this sorted)\nimport type { Mesh } from 'three';\nimport { MeshPhysicalMaterial } from 'three';\n\nexport const MESH_RENDER_ORDER = {\n DIMENSION_LINE: 0,\n DIMENSION_LABEL: 1,\n SHADOW_GROUND_PLANE: 1,\n DOCKING_PREVIEW_MESH: 1,\n DOCKING_PREVIEW_LINE: 1,\n COMPONENT_MESH: 2, // default roomle component mesh\n TRANSMISSIVE_MATERIAL: 3,\n LOADING_MESH: 4,\n BOUNDING_BOX_MESH: 4,\n DOCKLINE_MESH: 4,\n DOCKLINE_BOUNDING_LINE: 4,\n WALL: 5,\n PLANNER_DIMENSION_LINE: 10,\n PLANNER_DIMENSION_LABEL: 11,\n CAMERA_FACING_HIGHLIGHT: 27,\n CONSTRUCTION_INDICATOR_THICKNESS: 28,\n CONSTRUCTION_INDICATOR_GROUND: 29,\n CONSTRUCTION_INDICATOR_LINE: 30,\n} as const;\n\nexport const decideMeshRenderOrder = (mesh: Mesh): number => {\n const hasTransmissiveMaterial =\n mesh.material instanceof MeshPhysicalMaterial &&\n mesh.material.transmission > 0;\n\n return hasTransmissiveMaterial\n ? MESH_RENDER_ORDER.TRANSMISSIVE_MATERIAL\n : MESH_RENDER_ORDER.COMPONENT_MESH;\n};\n"],"mappings":";;AAMA,IAAa,IAAoB;CAC/B,gBAAgB;CAChB,iBAAiB;CACjB,qBAAqB;CACrB,sBAAsB;CACtB,sBAAsB;CACtB,gBAAgB;CAChB,uBAAuB;CACvB,cAAc;CACd,mBAAmB;CACnB,eAAe;CACf,wBAAwB;CACxB,MAAM;CACN,wBAAwB;CACxB,yBAAyB;CACzB,yBAAyB;CACzB,kCAAkC;CAClC,+BAA+B;CAC/B,6BAA6B;CAC9B,EAEY,KAAyB,MAElC,EAAK,oBAAoB,KACzB,EAAK,SAAS,eAAe,IAG3B,EAAkB,wBAClB,EAAkB"}
|
package/lib/roomle-headless.d.ts
CHANGED
|
@@ -1068,7 +1068,6 @@ export declare class ConfiguratorContext {
|
|
|
1068
1068
|
configurationRuntimeId: number;
|
|
1069
1069
|
planElementId: number;
|
|
1070
1070
|
rootComponentId: number;
|
|
1071
|
-
dockingRootComponentId: number | null;
|
|
1072
1071
|
baseContext: BASE_CONTEXT | null;
|
|
1073
1072
|
lastPossibleChild: UiPossibleChild;
|
|
1074
1073
|
rootComponentParametersAsGlobal: boolean;
|
|
@@ -1385,8 +1384,6 @@ export declare interface ConfiguratorKernelClass {
|
|
|
1385
1384
|
clearAll(): void;
|
|
1386
1385
|
loadConfiguration(kernelConversationId: number, configurationObject: ConfigurationString, position: KernelVector3): void;
|
|
1387
1386
|
updateConfiguration(kernelConversationId: number, objectOrComponentId: number, serializedConfiguration: string): void;
|
|
1388
|
-
loadPlainComponent(conversationId: number, componentId: RapiId, configuration: ConfigurationString): void;
|
|
1389
|
-
loadFreeFlyingConfiguration(conversationId: number, configuration: ConfigurationString): void;
|
|
1390
1387
|
requestComponentDockPreview(targetObjectId: number, componentId: string, serializedComponent: string, dragIn: boolean, allowInsertInBetween: boolean): void;
|
|
1391
1388
|
requestItemDockPreview(targetObjectId: number, serializedConfiguration: string, dragIn: boolean, allowInsertInBetween: boolean): void;
|
|
1392
1389
|
requestExternalObjectDockPreview(targetObjectId: number, articleId: string, dragIn: boolean, allowInsertInBetween: boolean): void;
|
|
@@ -1680,7 +1677,7 @@ export declare class ConfiguratorSceneManager extends SceneManager implements Co
|
|
|
1680
1677
|
componentUpdated(component: RoomleComponent, kernelComponent: KernelComponent): void;
|
|
1681
1678
|
planObjectUpdated(planObject: PlanObjectKernel, geometryChanged: boolean, pendingDocking: boolean, automaticCalculationUpdate: boolean): void;
|
|
1682
1679
|
componentDeleted(component: RoomleComponent): void;
|
|
1683
|
-
previewConstructionDone(
|
|
1680
|
+
previewConstructionDone(component: RoomleComponent, hasPreviews: boolean): void;
|
|
1684
1681
|
planObjectDependencyUpdated(planObjectId: number): void;
|
|
1685
1682
|
configurationLoaded(component: RoomleComponent, isFreeFlying: boolean): void;
|
|
1686
1683
|
addComponentHandlers(component: RoomleComponent): void;
|
|
@@ -2057,7 +2054,7 @@ export declare class ConfiguratorViewModel implements ConfiguratorKernelCallback
|
|
|
2057
2054
|
private _mergeNextComponent;
|
|
2058
2055
|
private _mergeComponent;
|
|
2059
2056
|
protected _addComponent(component: RoomleComponent): void;
|
|
2060
|
-
|
|
2057
|
+
cancelPreviewDocking(): void;
|
|
2061
2058
|
protected dockComponent(componentDocking: KernelComponentDocking): void;
|
|
2062
2059
|
dockComponentWithPosition(previewComponent: PreviewLineComponent, component?: RoomleComponent): void;
|
|
2063
2060
|
removePreviews(): void;
|
|
@@ -2083,7 +2080,7 @@ export declare class ConfiguratorViewModel implements ConfiguratorKernelCallback
|
|
|
2083
2080
|
componentMetaUpdated(kernelComponent: KernelComponent): void;
|
|
2084
2081
|
componentConfigurationUpdated(runtimeComponentId: number, geometryChanged: boolean): void;
|
|
2085
2082
|
private _getRuntimeComponent;
|
|
2086
|
-
configurationLoaded(
|
|
2083
|
+
configurationLoaded(_conversationId: number, objectId: number, componentId: number, _hash: string, _errors: any, isFreeFlying: boolean): void;
|
|
2087
2084
|
finishParameterChange(resolve: () => void, _reject: () => void): void;
|
|
2088
2085
|
planObjectDependencyUpdated(planObjectId: number): void;
|
|
2089
2086
|
planObjectConfigurationUpdated(planObjectId: number, _configuration: ConfigurationString, _hash: string, pendingDocking: boolean): void;
|
|
@@ -4646,10 +4643,9 @@ export declare interface KernelConfiguration {
|
|
|
4646
4643
|
children: KernelConfiguration[];
|
|
4647
4644
|
}
|
|
4648
4645
|
|
|
4649
|
-
export declare interface KernelConfigurationPlanView {
|
|
4646
|
+
export declare interface KernelConfigurationPlanView extends KernelPlanViewStyle {
|
|
4650
4647
|
viewType: PlanViewType;
|
|
4651
4648
|
lineOfSight: KernelVector3f;
|
|
4652
|
-
enabled: boolean;
|
|
4653
4649
|
label: string | null;
|
|
4654
4650
|
}
|
|
4655
4651
|
|
|
@@ -4943,6 +4939,13 @@ export declare interface KernelPlanObjectComponent extends KernelPlanObjectBase
|
|
|
4943
4939
|
export declare class KernelPlanObjectList extends EmsList<KernelPlanObject> {
|
|
4944
4940
|
}
|
|
4945
4941
|
|
|
4942
|
+
export declare interface KernelPlanViewStyle {
|
|
4943
|
+
lineColor: string | null;
|
|
4944
|
+
lineWidth: number | null;
|
|
4945
|
+
dimensioningColor: string | null;
|
|
4946
|
+
dimensioningLineWidth: number | null;
|
|
4947
|
+
}
|
|
4948
|
+
|
|
4946
4949
|
export declare interface KernelPossibleChild {
|
|
4947
4950
|
componentId?: RapiId;
|
|
4948
4951
|
itemId?: RapiId;
|
|
@@ -6329,7 +6332,6 @@ export declare class PlannerSceneEventHandler extends SceneEventHandler<SceneEve
|
|
|
6329
6332
|
private _isMeasurementLineDrawActive;
|
|
6330
6333
|
private _state;
|
|
6331
6334
|
private _drawingGroup;
|
|
6332
|
-
private _isBusyLoading;
|
|
6333
6335
|
private _continuousDrawingHelper;
|
|
6334
6336
|
private _kernelZoomFactor;
|
|
6335
6337
|
private _currentPlanMeasure;
|
|
@@ -6377,7 +6379,6 @@ export declare class PlannerSceneEventHandler extends SceneEventHandler<SceneEve
|
|
|
6377
6379
|
private _hoverMove;
|
|
6378
6380
|
private _isHiddenConstructionElement;
|
|
6379
6381
|
private _isHoveredObjectNonDraggable;
|
|
6380
|
-
setLoadingCursor(isLoading: boolean): void;
|
|
6381
6382
|
private _setCursor;
|
|
6382
6383
|
setCamera(camera: Camera): void;
|
|
6383
6384
|
setObject(object: Object3D, secondaryObject?: Object3D): void;
|
|
@@ -6900,10 +6901,11 @@ export declare abstract class PlanText extends PlanElement {
|
|
|
6900
6901
|
getText(): string;
|
|
6901
6902
|
}
|
|
6902
6903
|
|
|
6903
|
-
export declare interface PlanView {
|
|
6904
|
+
export declare interface PlanView extends KernelPlanViewStyle {
|
|
6904
6905
|
id: number;
|
|
6905
6906
|
viewType: PlanViewType;
|
|
6906
6907
|
lineOfSight: KernelVector3f;
|
|
6908
|
+
label: string | null;
|
|
6907
6909
|
objects: PlanObject[];
|
|
6908
6910
|
profile: ElevationProfile;
|
|
6909
6911
|
floorPlanEdges: FloorPlanEdges;
|
package/lib/roomle-headless.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./packages-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./packages-C0xavGqP.mjs";
|
|
2
2
|
import { i as a, t as o } from "./kernel-BWfRHWkW.mjs";
|
|
3
|
-
import { ht as s, yt as c } from "./threejs-utils-
|
|
4
|
-
import {
|
|
3
|
+
import { ht as s, yt as c } from "./threejs-utils-lVSsgAiQ.mjs";
|
|
4
|
+
import { Ti as l, m as u, nt as d } from "./three.core-BTUCraWz.mjs";
|
|
5
5
|
import { i as f } from "./decorate-Bl-JF_YY.mjs";
|
|
6
|
-
import { V as p } from "./common-utils-
|
|
7
|
-
import { A as m, F as h, G as ee, J as te, K as ne, M as re, N as ie, P as ae, S as oe, V as se, W as ce, a as g, at as le, b as ue, ct as de, dt as fe, i as pe, j as me, k as he, l as ge, lt as _e, m as ve, mt as ye, o as _, ot as v, q as y, r as b, s as x, st as S, t as C, u as w, ut as T, x as E, y as D, z as O } from "./roomle-sdk-
|
|
8
|
-
import { n as k } from "./roomle-renderer-
|
|
9
|
-
import { n as A } from "./script-loader-
|
|
10
|
-
import { t as j } from "./configurator-
|
|
11
|
-
import { t as M } from "./planner-
|
|
12
|
-
import { n as N, t as P } from "./glb-viewer-
|
|
13
|
-
import { t as be } from "./api-
|
|
6
|
+
import { V as p } from "./common-utils-OTJQGohe.mjs";
|
|
7
|
+
import { A as m, F as h, G as ee, J as te, K as ne, M as re, N as ie, P as ae, S as oe, V as se, W as ce, a as g, at as le, b as ue, ct as de, dt as fe, i as pe, j as me, k as he, l as ge, lt as _e, m as ve, mt as ye, o as _, ot as v, q as y, r as b, s as x, st as S, t as C, u as w, ut as T, x as E, y as D, z as O } from "./roomle-sdk-BhHLCbgP.mjs";
|
|
8
|
+
import { n as k } from "./roomle-renderer-UJINLYxS.mjs";
|
|
9
|
+
import { n as A } from "./script-loader-BHniYj5b.mjs";
|
|
10
|
+
import { t as j } from "./configurator-BM31Kt-5.mjs";
|
|
11
|
+
import { t as M } from "./planner-C1KkZRGk.mjs";
|
|
12
|
+
import { n as N, t as P } from "./glb-viewer-B2si39v2.mjs";
|
|
13
|
+
import { t as be } from "./api-ClfVJAUd.mjs";
|
|
14
14
|
import { t as xe } from "./roomle-headless-setup-ps3I0vOP.mjs";
|
|
15
15
|
import { createRequire as Se } from "module";
|
|
16
16
|
//#region packages/headless-core/src/headless-tween-stub.ts
|
|
@@ -353,7 +353,7 @@ var Pe = (e) => {
|
|
|
353
353
|
async _getPathTracer(e) {
|
|
354
354
|
if (this._pathTracer && this._renderer === e) return this._pathTracer;
|
|
355
355
|
this._pathTracer?.dispose();
|
|
356
|
-
let { WebGPUPathTracer: t } = await import("./webgpu-
|
|
356
|
+
let { WebGPUPathTracer: t } = await import("./webgpu-BxYJfBjz.mjs"), n = new t(e);
|
|
357
357
|
return n.useMegakernel(!0), n.dynamicLowRes = !1, n.renderDelay = 0, n.fadeDuration = 0, n.minSamples = 1, this._pathTracer = n, this._renderer = e, n;
|
|
358
358
|
}
|
|
359
359
|
}, Le = class e extends ve {
|
|
@@ -362,7 +362,7 @@ var Pe = (e) => {
|
|
|
362
362
|
}
|
|
363
363
|
async _createThreejsImageRenderer() {
|
|
364
364
|
if (!this._initData.webGpu) return super._createThreejsImageRenderer();
|
|
365
|
-
let { WebGPURenderer: e } = await import("./three.webgpu-
|
|
365
|
+
let { WebGPURenderer: e } = await import("./three.webgpu-B1OhMci_.mjs"), t = new e({
|
|
366
366
|
antialias: !1,
|
|
367
367
|
alpha: !0
|
|
368
368
|
});
|
|
@@ -370,7 +370,7 @@ var Pe = (e) => {
|
|
|
370
370
|
}
|
|
371
371
|
async _createRoomleRenderer(e) {
|
|
372
372
|
if (!e.isWebGPURenderer) return super._createRoomleRenderer(e);
|
|
373
|
-
let { RoomleWebGPURenderer: t } = await import("./roomle-webgpu-renderer-
|
|
373
|
+
let { RoomleWebGPURenderer: t } = await import("./roomle-webgpu-renderer-BSvxbopA.mjs");
|
|
374
374
|
return new t(this._creator_, e, !0, void 0, !1);
|
|
375
375
|
}
|
|
376
376
|
static hasExplicitCameraPlacement(e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as e } from "./three.core-
|
|
1
|
+
import { f as e } from "./three.core-BTUCraWz.mjs";
|
|
2
2
|
//#region packages/common-core/src/utils/shims.ts
|
|
3
3
|
var t = /* @__PURE__ */ function(e) {
|
|
4
4
|
return e.RESIZE = "resize", e.KEY_DOWN = "keydown", e.KEY_UP = "keyup", e.VISIBILITY_CHANGE = "visibilitychange", e;
|
|
@@ -77,4 +77,4 @@ var t = /* @__PURE__ */ function(e) {
|
|
|
77
77
|
//#endregion
|
|
78
78
|
export { r as a, n as i, c as n, t as o, o as r, s as t };
|
|
79
79
|
|
|
80
|
-
//# sourceMappingURL=roomle-renderer-
|
|
80
|
+
//# sourceMappingURL=roomle-renderer-UJINLYxS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roomle-renderer-Ato6RMrd.mjs","names":[],"sources":["../../packages/common-core/src/utils/shims.ts","../../packages/common-core/src/utils/fps-counter.ts","../../packages/common-core/src/roomle-renderer.ts"],"sourcesContent":["import type { ROOMLE_COLORS } from './common-utils';\nimport type {\n HexColorNumber,\n HexColorString,\n RapiId,\n RapiServerUrlType,\n} from '../../../typings/rapi-types';\nimport type { CAMERA_TYPE } from '../cameracontrol/camera-type';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { ROOMLE_HIGHLIGHTNG } from './common-utils';\nimport type { DefaultEnvironmentSceneType } from '../webgl/renderer/environment-scene';\nimport type {\n CustomShadingParameters,\n SceneShadingType,\n} from '../webgl/renderer/shading-settings';\nimport type { Color } from 'three';\nimport type { HomagIntelligenceInitData } from '../../../homag-intelligence/src/hi-api-types';\n\nexport const enum WINDOW_EVENT {\n RESIZE = 'resize',\n KEY_DOWN = 'keydown',\n KEY_UP = 'keyup',\n VISIBILITY_CHANGE = 'visibilitychange',\n}\n\nexport const DRAW_PREVIEW_MODES = {\n DEFAULT: 'default',\n VECTOR: 'vector',\n} as const;\n\nexport const WEBGPU_TONE_MAPPINGS = {\n NONE: 'none',\n LINEAR: 'linear',\n REINHARD: 'reinhard',\n CINEON: 'cineon',\n ACES_FILMIC: 'acesFilmic',\n AGX: 'agx',\n NEUTRAL: 'neutral',\n} as const;\n\nexport type WebGpuToneMapping = Enumify<typeof WEBGPU_TONE_MAPPINGS>;\n\n/**\n * Init data parameters which are not context specific\n */\nexport interface GlobalInitDataDefinition {\n /**\n * @description locale to use for the\n * embedding instance\n */\n locale?: string;\n\n /**\n * @internal\n * @deprecated\n * @description Can be used for content testing\n */\n overrideTenant?: number;\n\n /**\n * @description Set country to use for the Roomle price service. If not used the customer IP address will be used to determine the location. usage: overrideCountry=de\n */\n overrideCountry?: string | null;\n\n /**\n * @internal\n * @description Set which RAPI (Roomle API) backend should be used options: live, test\n */\n overrideRapi?: RapiServerUrlType;\n\n /**\n * @description The id which should be used for this embedding instance. When this id is set all InitData parameter can be set and changed in Rubens Admin. This is the way we recommend to set init data params. Ask your Roomle contact for your configuratorId.\n */\n configuratorId?: string;\n\n /**\n * @description Set which RAPI (Roomle API) backend should be used usage: customApiUrl=https://www.roomle.com/api/v2\n */\n customApiUrl?: string;\n\n /**\n * @internal\n * @description Can be set to true if started as an end-to-end test. This will disable post-processing\n */\n e2e?: boolean;\n\n /**\n * @internal\n * @description If set to true, the Roomle Renderer is used for perspective and top images this should help the E2E tests of Joe to migrate from comparing Roomle Renderer images to Three.js Renderer images\n */\n e2eRoomleRendererForImages?: boolean;\n\n /**\n * @internal\n * @description When loading a plan, the external objects from the plan XML are discarded\n */\n discardExternalObjectsWhenLoadingPlan?: boolean;\n\n /**\n * @description If set to true, the plan will be locked and no changes can be made to walls, floors or construction elements.\n * @default false\n */\n lockPlan?: boolean;\n\n /**\n * @description If set to true, the plan is in read-only mode. Hides all editing UI and prevents interaction with plan elements.\n * Automatically sets edit=false and lockPlan=true and saveToIdb=false\n * @default false\n */\n readonly?: boolean;\n}\n\nexport interface WebGpuTopLightConfigDefinition {\n /**\n * @description Intensity (brightness) of the WebGPU top light.\n * @default 1\n */\n intensity?: number;\n\n /**\n * @description Intensity of the shadow cast by the top light.\n * 0 means no shadow, 1 means a fully opaque shadow.\n * @default 1\n */\n shadowIntensity?: number;\n\n /**\n * @description Softness (blur radius) of the top light's shadow edges.\n * Higher values produce softer shadows.\n * @default 1.1\n */\n shadowRadius?: number;\n}\n\nexport interface WebGpuGroundReflectionConfigDefinition {\n /**\n * @description Enables or disables the ground reflection entirely.\n * When disabled the floor still receives shadows but does not render a reflection,\n * which also avoids the extra reflection render pass.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * @description Strength of the ground reflection.\n * 0 means no reflection, 1 means a full mirror-like reflection.\n * @default 0.1\n */\n intensity?: number;\n\n /**\n * @description Depth at which the reflection starts to fade out.\n * @default 0.05\n */\n startFadeout?: number;\n\n /**\n * @description Depth at which the reflection is fully faded out.\n * @default 0.15\n */\n endFadeout?: number;\n\n /**\n * @description How much the resolution of the scene is scaled by for the reflection resolution\n * If transmissive objects are not in use, this can be set to a lower value like 0.5 to improve performance.\n * @default 1\n */\n reflectionScale?: number;\n}\n\nexport interface WebGpuFogConfigDefinition {\n /**\n * @description If true, a fog is added to the scene in webGPU mode.\n * This is mainly so you cant see the outer edge of the\n * floor (which makes it blends smoothly into the background).\n * This fog exists in a cylindrical shape around the origin and the\n * farBlend and nearBlend parameters indirectly control the radius\n * at which the fog starts and ends.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * @description Radial distance from the start of the fog to the end of the fog.\n * This creates a smooth transition from full fog to no fog.\n * Larger values produce a softer, more gradual fog transition.\n * @default 7\n */\n nearBlend?: number;\n\n /**\n * @description Distance from the far end of the camera view/floor boundaries\n * at which the fully opaque fog should start to appear.\n * Larger values move the fully opaque(/end of the) fog\n * closer to the center of the scene.\n * @default 10\n */\n farBlend?: number;\n}\n\nexport interface WebGpuSkyConfigDefinition {\n /**\n * @description If true, adds a physically based (Hosek-Wilkie) sky and a matching\n * sun providing light to the scene.\n * @default false\n */\n enabled?: boolean;\n\n /**\n * @description Value determining the amount of aerosol particles in the sky. This\n * very much impacts the sky's color and clearness.\n * From the original paper: T = 2 yields a very clear, Arctic-like sky,\n * T = 3 a clear sky in a temperate climate,\n * T = 6 a sky on a warm, moist day,\n * T = 10 a slightly hazy sky\n * Valid range: `[1,10]`\n * @default 2.5\n */\n turbidity?: number;\n\n /**\n * @description Represents how much light the ground bounces back into the atmosphere,\n * which brightens the sky near the horizon if this value is high.\n * Valid range: `[0,1]`\n * @default 0.9\n */\n albedo?: number;\n\n /**\n * @description Horizontal orientation of the sun in radians.\n * Changing this value rotates the sun clockwise around\n * the scene without changing its height.\n * Valid range: `[-pi, pi]`\n * @default 0\n */\n azimuthAngle?: number;\n\n /**\n * @description Height of the sun measured as the angle\n * from straight up (the zenith), in radians. Smaller values raise the sun toward\n * noon; larger values lower it toward the horizon.\n * Valid range: `[0,pi/2≈1.57]`.\n * @default 1\n */\n polarAngle?: number;\n\n /**\n * @description Intensity of the sun that lights the scene and casts shadows.\n * This does not influence how the sun disc looks in the sky.\n * @default 10\n */\n sunLightIntensity?: number;\n\n /**\n * @description Radius of the visible sun disc in the sky.\n * @default 0.03\n */\n sunRadius?: number;\n\n /**\n * @description Blurryness of the edge of the visible sun disc in the sky.\n * @default 0.002\n */\n sunSoftness?: number;\n\n /**\n * @description Exposure multiplier applied during the sky-specific tone mapping.\n * Higher values make the sky brighter.\n * @default 0.5\n */\n tonemapExposure?: number;\n\n /**\n * @description The HDR brightness value which the sky-specific tone mapping considers as white.\n * Lower values clip bright areas (like the sun) to white sooner, increasing contrast.\n * Higher values preserve more detail in the brightest regions.\n * @default 14\n */\n tonemapWhite?: number;\n\n /**\n * @description Fraction of the sky covered by clouds.\n * At `0` no clouds are rendered. at `1` the sky is fully covered by clouds.\n * @default 0.25\n */\n cloudCoverage?: number;\n\n /**\n * @description Opacity of the clouds when they are blended over the sky. At `0` clouds\n * are invisible even if coverage is high; at `1` they fully replace the sky color\n * beneath them.\n * @default 0.3\n */\n cloudDensity?: number;\n\n /**\n * @description Height of the virtual cloud plane. A value of `0` places the plane\n * very high (clouds appear small and distant); `1` pulls it down towards the horizon\n * so clouds appear lower and larger.\n * @default 0.7\n */\n cloudElevation?: number;\n\n /**\n * @description Intensity of the environment map lighting while the sky is\n * enabled. Because the sky already contributes its own image-based lighting,\n * the environment map is dimmed to this value to keep the overall scene brightness balanced.\n * @default 0.5\n */\n overrideEnvironmentMapIntensity?: number;\n}\n\nexport interface WebGpuSSGIConfigDefinition {\n /**\n * @description Radius of the denoising filter applied to the indirect lighting.\n * Higher values produce a stronger denoising effect, which can help reduce noise\n * in the indirect lighting but may also blur fine details.\n * @default 20\n */\n giDenoiseRadius?: number;\n\n /**\n * @description Radius of the denoising filter applied to the ambient occlusion (AO) pass.\n * Higher values produce a stronger denoising effect, which can help reduce noise\n * in the AO but may also blur fine details.\n * @default 10\n */\n aoDenoiseRadius?: number;\n}\n\nexport interface WebGpuConfigDefinition {\n /**\n * @description If true, the initial webgpu quality level is autodetected based on\n * a benchmark of the graphics hardware. If false, the default quality level is used.\n * @default true\n */\n autoDetectQualityLevel?: boolean;\n\n /**\n * @description This can be used to configure the lower bound of webgpu auto quality\n * meaning the fps bound which, when hit, will set the quality setting lower\n * To disable: set to 0\n * @default 24\n */\n autoQualityMinFps?: number;\n\n /**\n * @description This can be used to configure the upper bound of webgpu auto quality\n * meaning the fps bound which, when hit, will set the quality setting higher\n * This should be sufficiently larger than the minFps to not cause the quality to go up and down all the time\n * To disable: set to something very high\n * @default 59\n */\n autoQualityMaxFps?: number;\n\n /**\n * @description Visual configuration for the WebGPU top light and its shadow.\n */\n topLight?: WebGpuTopLightConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU ground reflection.\n */\n groundReflection?: WebGpuGroundReflectionConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU fog.\n */\n fog?: WebGpuFogConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU sky and sun.\n */\n sky?: WebGpuSkyConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU screen space global illumination (SSGI) effect.\n */\n ssgi?: WebGpuSSGIConfigDefinition;\n\n /**\n * @description Tone mapping operator applied by the WebGPU renderer.\n * @default 'none'\n */\n toneMapping?: WebGpuToneMapping;\n\n /**\n * @description Exposure (intensity) of the tone mapping applied by the\n * WebGPU renderer. Higher values produce a brighter image.\n * @default 1\n */\n toneMappingExposure?: number;\n}\n\nexport interface FeatureFlags {\n pulsePreview?: boolean;\n reDock?: boolean;\n\n /**\n * @description Sets whether the snapping behavior of objects in the planner is initially enabled.\n */\n enableSnapping?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced docking behavior is enabled (for test purposes only)\n */\n advancedDocking?: boolean;\n\n /**\n * @internal\n * @description If true, when inserting new objects in the planner, we will try to merge them into existing groups if possible.\n * This is for test purposes only and should not be enabled in production yet, as it can lead to unexpected behavior.\n */\n mergeOnInsert?: boolean;\n\n /**\n * @internal\n * @description If “vector”, the vector preview is activated when drawing walls (for test purposes only).\n * By default, the walls are immediately drawn with their actual thickness,\n * but this leads to problems when displaying the dimensions of the walls,\n * as it is not possible to guess which side of the wall of the room currently being entered is the inside of the wall.\n */\n drawPreviewMode?: Enumify<typeof DRAW_PREVIEW_MODES>;\n /**\n * @internal\n * @description TO BE REMOVED ONCE RML-13218 IS RESOLVED.\n * Forces new thumbnails to be generated on configuration save\n */\n forceSaveThumbnails?: boolean;\n\n /**\n * @internal\n * @description Enables dynamically placed interior lights in the room planner.\n */\n interiorLights?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced dimensioning is enabled (for test purposes only)\n */\n advancedDimensioning?: boolean;\n\n /**\n * @internal\n * @deprecated Use the top-level `webGpu` init data property instead.\n * @description If true, the scene will be rendered with WebGPU instead of WebGL\n */\n webGpu?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced highlighting behavior is enabled (for test purposes only)\n */\n advancedHighlighting?: boolean;\n\n /**\n * @internal\n * @description If true, enables the POC for planning fences (e.g. garden fences) in the room planner.\n */\n fence?: boolean;\n\n /**\n * @internal\n * @description If true, `onRequestPlan` waits until every pending configuration\n * save in the plan has been persisted to the Roomle backend before firing.\n * See RML-17394\n */\n awaitConfigurationSavesBeforeRequestPlan?: boolean;\n}\n\nexport type RoomleColors = keyof typeof ROOMLE_COLORS;\n\nexport type ColorsIn3dScene = Record<\n RoomleColors,\n HexColorString | HexColorNumber\n>;\n\nexport type ThreeJsColorsIn3dScene = Record<keyof typeof ROOMLE_COLORS, Color>;\n\n/**\n * Init data parameter which can be used in configurator AND planner\n */\nexport interface CommonInitData {\n /**\n * @description If set to true the configurator will make sure every device has great user experience with fluid frame rate.\n * If set to false the configurator will always show the highest quality possible.\n * That could lead to stutter and other problems on low-end devices. We advise you to only turn off \"autoQuality\" if you really know what you are doing.\n * usage: autoQuality=false\n * @groups scene-settings\n */\n autoQuality?: boolean;\n\n /**\n * @description Can be used to personalize colors used in the 3D scene\n * @groups scene-settings\n */\n colors?: ColorsIn3dScene;\n\n /**\n * @description The item id or configuration id of the item which should be loaded.\n * Examples:\n * Configuration id: usm:frame:2449773A7F54278EBB61A67A10EF6A10E8BB6F38BE775B028AC050B438414507\n * Item id: usm:frame\n */\n id?: RapiId;\n\n /**\n * @internal\n * @deprecated\n * @description Use prices which are hardcoded in the configuration script.\n * Only used for trade show demos.\n */\n useRoomlePrice?: boolean;\n\n /**\n * @description Set how many positions after the decimal point should be shown.\n * For example:\n * 8' 1.68\" -> precisionCm=2 -> 8' 1.68\"\n * 8' 1.68\" -> precisionCm=1 -> 8' 1.7\"\n * 8' 1.68\" -> precisionCm=0 -> 8' 2\"\n */\n precisionInch?: number;\n\n /**\n * @description Set how many positions after the decimal point should be shown.\n * For example:\n * 123,45 -> precisionCm=2 -> 123,45\n * 123,45 -> precisionCm=1 -> 123,5\n * 123,45 -> precisionCm=0 -> 124\n */\n precisionCm?: number;\n\n /**\n * @description Defines which unit should be used for measurements/dimensions\n * Options: 'cm', 'mm', 'inchfeet'\n */\n unit?: string;\n\n /**\n * @description How the current unit should be formatted\n * Options:\n * - 'none': No unit string added, for example '200'\n * - 'long': Long unit string, for example '200 meters'\n * - 'short': Short unit string, for example '200 m'\n */\n unitStringType?: string;\n\n /**\n * @description When mesh selection is enabled, the meshes of the object are used directly for highlighting.\n * Setting it to false could be useful for square/rectangular (shelf) items.\n */\n meshSelection?: boolean;\n\n /**\n * @description if set to true it shows a little overlay with performance stats\n */\n stats?: boolean;\n\n /**\n * @description This flag enables:\n * - Scripter debug logs (e.g. which parameter is not assigned to a parameter group)\n * - Free camera movement (no restrictions, camera stays after reload, panning using Shift key)\n */\n debug?: boolean;\n\n /**\n * @description This flag enables:\n * - External object docking vector debug geometry\n */\n debugGeometry?: boolean;\n\n /**\n * @description If true this flag shows component bounding boxes\n */\n debugBoundingBox?: boolean;\n\n /**\n * @description This flag enables:\n * - Help line geometry in the planner\n * @internal\n */\n debugLines?: boolean;\n\n /**\n * @description If set to true, prices are calculated using the Roomle price service.\n * For more information ask your Roomle contact.\n */\n usePriceService?: boolean;\n\n /**\n * @description Url to an exr or hdr env map\n * @groups scene-settings\n */\n envMapUrl?: string;\n\n /**\n * @description Set the intensity of the environment map\n * @groups scene-settings\n */\n envMapIntensity?: number;\n\n /**\n * @description Set the rotation of the environment map in radians, between 0 and 2 * PI, rotates counter-clockwise\n * @groups scene-settings\n */\n envMapRotation?: number;\n\n /**\n * @description Set the maximum number of light sources extracted from the environment map\n * @groups scene-settings\n */\n maxLightSources?: number;\n\n /**\n * @description Use old light setting instead of env maps. Ignored when using the WebGPU renderer\n * @groups scene-settings\n */\n legacyLight?: boolean;\n\n /**\n * @description Generate environment map from a scene instead of env maps\n * use all_around for an surrounding light\n * use front for a mainly frontal light\n * @groups scene-settings\n */\n sceneLight?: DefaultEnvironmentSceneType;\n\n /**\n * @description General shading properties for the overall appearance\n * default: for planner and a configurator with colorful, metallic or wooden materials\n * bright: for a configurator with white and bright materials\n * @groups scene-settings\n */\n shading?: SceneShadingType;\n\n /**\n * @description Customized shading properties for the overall appearance\n * @groups scene-settings\n */\n customShading?: CustomShadingParameters;\n\n /**\n * @description Activates the linear AO filter mode to reduce AO anti-aliasing artifacts\n * @groups scene-settings\n */\n linearAoFilter?: boolean;\n\n /**\n * @description Customized shading properties for the overall appearance in MOC\n * @groups scene-settings\n */\n customShadingMoc?: CustomShadingParameters;\n\n /**\n * @description restrictionLevel defines visibility of parameters and possible children\n */\n restrictionLevel?: number;\n\n /**\n * @description Settings for Homag Intelligence\n * @internal\n */\n hi?: HomagIntelligenceInitData;\n\n /**\n * @description disable injection of default styles for measurements and component dimension labels\n * to enable easier customization of these styles (via the assigned classes)\n */\n disableDefaultLabelStyles?: boolean;\n}\n\nexport interface ConfiguratorInitData {\n /**\n * @description Sets the behavior of the highlighting of a hovered component.\n * usage: highlighting=smart\n */\n highlighting?: Enumify<typeof ROOMLE_HIGHLIGHTNG>;\n\n /**\n * @description Set the floor material which is used when loading the configurator\n * For different options see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}\n */\n initialFloorMaterial?: string;\n\n /**\n * @internal\n * @description Load a light setting using an URL.\n * Check lights in {@link @roomle/web-sdk/configurator-core/src/scene-settings-loader#SceneSettings} for an example.\n * value is a dynamic light setting url\n */\n dls?: string;\n\n /**\n * @description Load a predefined light setting, eg: ls=sofa\n * @groups scene-settings\n */\n ls?: string;\n\n /**\n * @description Set the distance to which the user can zoom (in centimeters).\n * default: object size divided by 10 or 10 cm\n * usage: zoomDistance=3\n * @groups scene-settings\n */\n zoomDistance?: number;\n\n /**\n * @description When set this param restricts the camera rotation to the given angle (e.g. 45 degree), this overrides minHorizontalCameraAngle and maxHorizontalCameraAngle\n * default: not set -> no camera restriction\n * usage: cameraRestriction=45\n * @groups scene-settings\n */\n cameraRestriction?: number;\n\n /**\n * @description Sets the default/initial vertical camera angle (pitch)\n * default: 10\n * usage: verticalCameraAngle=45\n * @groups scene-settings\n */\n verticalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the down/vertical camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: minVerticalCameraAngle=45\n * @groups scene-settings\n */\n minVerticalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the up/vertical camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: maxVerticalCameraAngle=45\n * @groups scene-settings\n */\n maxVerticalCameraAngle?: number;\n\n /**\n * @description Sets the default/initial horizontal camera angle (yaw)\n * default: -30\n * usage: horizontalCameraAngle=45\n * @groups scene-settings\n */\n horizontalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the left/horizontal camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: minHorizontalCameraAngle=45\n * @groups scene-settings\n */\n minHorizontalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the right/horizontal camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: maxHorizontalCameraAngle=45\n * @groups scene-settings\n */\n maxHorizontalCameraAngle?: number;\n\n /**\n * @description If set to false the camera will just jump to a new position\n * default: true\n * usage: animateCamera=false\n * @groups scene-settings\n */\n animateCamera?: boolean;\n\n /**\n * @internal\n * @description Easter Egg\n * */\n bananaForScale?: boolean;\n\n /**\n * @description If set to true, components which are between the camera and the selected component/preview will be rendered transparent\n * usage: transparentHighlighting=true\n * @groups scene-settings\n */\n transparentHighlighting?: boolean;\n\n /**\n * @description If set to true, the background is transparent and allows elements behind the configurator to be visible through the scene.\n * Not compatible with the WebGPU sky feature\n * usage: transparentBackground=true\n * @groups scene-settings\n */\n transparentBackground?: boolean;\n\n /**\n * @description If set to true it will try to apply all current global parameters to the loaded object\n */\n applyCurrentGlobalParameters?: boolean;\n\n /**\n * @description If set to true, component dimension labels stay visible even when the distance-based proximity check would normally hide them.\n * @default false\n */\n disableMeasurementCollisionDetection?: boolean;\n\n /**\n * @description Adds the given spacing (in centimeters) to the loaded object. This is then used to calculate the initial camera distance\n * default: 0\n * usage:\n * cameraSpacing=100, zoom out further by increasing camera spacing by 100 centimeters\n * cameraSpacing=-30, zoom in further by decreasing camera spacing by 30 centimeters\n * @groups scene-settings\n */\n cameraSpacing?: number;\n\n /**\n * @internal\n * @description If set to true, screen space reflections are enabled\n */\n ssr?: boolean;\n\n /**\n * @internal\n * @description features that can be enabled/disabled\n */\n featureFlags?: FeatureFlags;\n\n /**\n * @internal\n * @description If true, the scene will be rendered with WebGPU instead of WebGL\n * @default false\n * usage: webGpu=true\n */\n webGpu?: boolean;\n\n /**\n * @internal\n * @description Configuration for the WebGPU renderer (e.g. auto quality fps bounds).\n */\n webGpuConfig?: WebGpuConfigDefinition;\n\n /**\n * @description if true, the meshes of the component will be used, in addition to the bounding box, for raycasting (selecting)\n * Warning: this will decrease performance when hovering over components with complex meshes\n * @default false\n * usage: meshRaycasting=true\n */\n meshRaycasting?: boolean;\n}\n\nexport interface PlannerInitData {\n /**\n * @description Sets the default floor material when creating a new plan or drawing.\n * Can be a number (RGB color) or a string (material ID).\n */\n defaultFloorMaterial?: number | string;\n\n /**\n * @description Select with which camera mode to start initially.\n * usage: mode=2D\n * options: 2D, 3D, FP\n */\n mode?: Enumify<typeof CAMERA_TYPE>;\n\n /**\n * @internal\n * @description If set to true the plan can be edited.\n */\n edit?: boolean;\n\n /**\n * @description If set to true it will treat the planner as a multi object configurator (moc).\n * This means:\n * - do not merge geometries\n * - set configurator environment & lights in planner\n * - reduce initial spacing of camera (higher zoom)\n */\n moc?: boolean;\n\n /**\n * @description If set to true we will not hide other items while configuring in the planner\n */\n configureInRoom?: boolean;\n\n /**\n * @description If set to true docking of configurable objects in the planner is enabled.\n * The default value is true.\n */\n dockInRoom?: boolean;\n\n /**\n * @description If set to true the 3D planner camera zooms in as close to objects as the configurator does,\n * instead of stopping at the bounds of the plan. Objects which would be cut by the camera near plane are\n * hidden while they are cut.\n * @default false\n * usage: configuratorZoom=false\n */\n configuratorZoom?: boolean;\n}\n\nexport interface InitDataDefinition\n extends CommonInitData,\n ConfiguratorInitData,\n PlannerInitData {}\n","const FPS_LIST_SIZE = 10;\nconst FPS_MEASUREMENT_INTERVAL_MS = 20;\n\nexport default class FpsCounter {\n private _index: number = 0;\n private _fpsList: number[];\n private _prevTime: number = 0;\n private _frames: number = 0;\n private _fps: number = -1;\n\n constructor() {\n this._fpsList = Array(FPS_LIST_SIZE).fill(0);\n this._prevTime = (performance || Date).now();\n this.reset();\n }\n\n public update() {\n this._frames++;\n const time = (performance || Date).now();\n\n if (time >= this._prevTime + FPS_MEASUREMENT_INTERVAL_MS) {\n this._fpsList[this._index % FPS_LIST_SIZE] =\n (this._frames * 1000) / (time - this._prevTime);\n\n if (this._index >= FPS_LIST_SIZE) {\n this._fps =\n this._fpsList.reduce((pv, cv) => pv + cv) / this._fpsList.length;\n }\n\n this._prevTime = time;\n this._frames = 0;\n this._index++;\n }\n }\n\n public start() {\n this._prevTime = (performance || Date).now();\n this._frames = 0;\n }\n\n public reset() {\n this._fps = -1;\n this._fpsList = Array(FPS_LIST_SIZE).fill(0);\n this._index = 0;\n }\n\n public getFps() {\n return this._fps;\n }\n}\n","import type { Camera, Object3D, Scene, Vector2, WebGLRenderer } from 'three';\nimport { Box3 } from 'three';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { CAMERA_TYPE } from './cameracontrol/camera-type';\nimport type { WebGPURenderer } from 'three/webgpu';\nimport type { SceneShadingType } from './webgl/renderer/shading-settings';\nimport type { OutlineCustomParameters } from './webgl/renderer/scene-renderer';\n\nexport type GenericRoomleRenderer = RoomleRenderer<\n WebGLRenderer | WebGPURenderer\n>;\n\nexport enum PlannerRenderMode {\n Mode3D,\n Mode2D,\n}\n\nexport abstract class RoomleRenderer<\n RendererType extends WebGLRenderer | WebGPURenderer,\n> {\n public _creator_: string;\n public renderer: RendererType;\n protected isConfiguratorMode: boolean = true;\n protected isCameraMoving: boolean = false;\n protected cameraType: Enumify<typeof CAMERA_TYPE>;\n protected shadowNeedsUpdate: boolean = false;\n protected boundingBox: Box3 = new Box3();\n protected boundingBoxNeedsUpdate: boolean = false;\n\n protected constructor(creator: string, renderer: RendererType) {\n this._creator_ = creator;\n this.renderer = renderer;\n }\n\n public get isConfiguring(): boolean {\n return this.isConfiguratorMode;\n }\n\n public dispose(): void {\n this.renderer.dispose();\n }\n\n public setSize(width: number, height: number): void {\n this.renderer.setSize(width, height);\n }\n\n public getSize(target: Vector2): Vector2 {\n return this.renderer.getSize(target);\n }\n\n public setCameraType(cameraType: Enumify<typeof CAMERA_TYPE>) {\n this.cameraType = cameraType;\n }\n\n public movingCameraStarts(): void {\n this.isCameraMoving = true;\n }\n\n public movingCameraStops(): void {\n this.isCameraMoving = false;\n }\n\n public forceShadowUpdates(_updateBakedGroundShadow: boolean): void {\n this.shadowNeedsUpdate = true;\n }\n\n public clear() {\n this.renderer.clear();\n }\n\n public updateBounds(geometryBounds: Box3) {\n this.boundingBox.copy(geometryBounds);\n this.boundingBoxNeedsUpdate = true;\n }\n\n public switchToConfigurator(): void {\n this.isConfiguratorMode = true;\n }\n\n public switchToPlanner(_renderMode: PlannerRenderMode) {\n this.isConfiguratorMode = false;\n }\n\n public abstract setShadingType(shadingType: SceneShadingType): void;\n\n public abstract setCustomOutlineParameters(\n outlineCustomParameters: OutlineCustomParameters,\n ): void;\n\n public abstract render(scene: Scene, camera: Camera): void;\n\n public abstract showGUI(updateCallback: () => void): void;\n\n public abstract clearCache(): void;\n\n public abstract highlightObjects(selectedMeshes: Object3D[]): void;\n\n public abstract setGroundShadow(enabled: boolean, scene: Scene): void;\n\n public abstract enableUiInteractionMode(): void;\n\n public abstract disableUiInteractionMode(): void;\n}\n"],"mappings":";;AAkBA,IAAkB,IAAX,yBAAA,GAAA;QACL,EAAA,SAAA,UACA,EAAA,WAAA,WACA,EAAA,SAAA,SACA,EAAA,oBAAA;KACD,EAEY,IAAqB;CAChC,SAAS;CACT,QAAQ;CACT,EAEY,IAAuB;CAClC,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,aAAa;CACb,KAAK;CACL,SAAS;CACV,ECtCK,IAAgB,IAChB,IAA8B,IAEf,IAArB,MAAgC;CAO9B,cAAc;AAGZ,gBATuB,oBAEG,kBACF,eACH,IAGrB,KAAK,WAAW,MAAM,EAAc,CAAC,KAAK,EAAE,EAC5C,KAAK,aAAa,eAAe,MAAM,KAAK,EAC5C,KAAK,OAAO;;CAGd,SAAgB;AACd,OAAK;EACL,IAAM,KAA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B,gBAAuB,GAAgC;AACrD,OAAK,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"roomle-renderer-UJINLYxS.mjs","names":[],"sources":["../../packages/common-core/src/utils/shims.ts","../../packages/common-core/src/utils/fps-counter.ts","../../packages/common-core/src/roomle-renderer.ts"],"sourcesContent":["import type { ROOMLE_COLORS } from './common-utils';\nimport type {\n HexColorNumber,\n HexColorString,\n RapiId,\n RapiServerUrlType,\n} from '../../../typings/rapi-types';\nimport type { CAMERA_TYPE } from '../cameracontrol/camera-type';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { ROOMLE_HIGHLIGHTNG } from './common-utils';\nimport type { DefaultEnvironmentSceneType } from '../webgl/renderer/environment-scene';\nimport type {\n CustomShadingParameters,\n SceneShadingType,\n} from '../webgl/renderer/shading-settings';\nimport type { Color } from 'three';\nimport type { HomagIntelligenceInitData } from '../../../homag-intelligence/src/hi-api-types';\n\nexport const enum WINDOW_EVENT {\n RESIZE = 'resize',\n KEY_DOWN = 'keydown',\n KEY_UP = 'keyup',\n VISIBILITY_CHANGE = 'visibilitychange',\n}\n\nexport const DRAW_PREVIEW_MODES = {\n DEFAULT: 'default',\n VECTOR: 'vector',\n} as const;\n\nexport const WEBGPU_TONE_MAPPINGS = {\n NONE: 'none',\n LINEAR: 'linear',\n REINHARD: 'reinhard',\n CINEON: 'cineon',\n ACES_FILMIC: 'acesFilmic',\n AGX: 'agx',\n NEUTRAL: 'neutral',\n} as const;\n\nexport type WebGpuToneMapping = Enumify<typeof WEBGPU_TONE_MAPPINGS>;\n\n/**\n * Init data parameters which are not context specific\n */\nexport interface GlobalInitDataDefinition {\n /**\n * @description locale to use for the\n * embedding instance\n */\n locale?: string;\n\n /**\n * @internal\n * @deprecated\n * @description Can be used for content testing\n */\n overrideTenant?: number;\n\n /**\n * @description Set country to use for the Roomle price service. If not used the customer IP address will be used to determine the location. usage: overrideCountry=de\n */\n overrideCountry?: string | null;\n\n /**\n * @internal\n * @description Set which RAPI (Roomle API) backend should be used options: live, test\n */\n overrideRapi?: RapiServerUrlType;\n\n /**\n * @description The id which should be used for this embedding instance. When this id is set all InitData parameter can be set and changed in Rubens Admin. This is the way we recommend to set init data params. Ask your Roomle contact for your configuratorId.\n */\n configuratorId?: string;\n\n /**\n * @description Set which RAPI (Roomle API) backend should be used usage: customApiUrl=https://www.roomle.com/api/v2\n */\n customApiUrl?: string;\n\n /**\n * @internal\n * @description Can be set to true if started as an end-to-end test. This will disable post-processing\n */\n e2e?: boolean;\n\n /**\n * @internal\n * @description If set to true, the Roomle Renderer is used for perspective and top images this should help the E2E tests of Joe to migrate from comparing Roomle Renderer images to Three.js Renderer images\n */\n e2eRoomleRendererForImages?: boolean;\n\n /**\n * @internal\n * @description When loading a plan, the external objects from the plan XML are discarded\n */\n discardExternalObjectsWhenLoadingPlan?: boolean;\n\n /**\n * @description If set to true, the plan will be locked and no changes can be made to walls, floors or construction elements.\n * @default false\n */\n lockPlan?: boolean;\n\n /**\n * @description If set to true, the plan is in read-only mode. Hides all editing UI and prevents interaction with plan elements.\n * Automatically sets edit=false and lockPlan=true and saveToIdb=false\n * @default false\n */\n readonly?: boolean;\n}\n\nexport interface WebGpuTopLightConfigDefinition {\n /**\n * @description Intensity (brightness) of the WebGPU top light.\n * @default 1\n */\n intensity?: number;\n\n /**\n * @description Intensity of the shadow cast by the top light.\n * 0 means no shadow, 1 means a fully opaque shadow.\n * @default 1\n */\n shadowIntensity?: number;\n\n /**\n * @description Softness (blur radius) of the top light's shadow edges.\n * Higher values produce softer shadows.\n * @default 1.1\n */\n shadowRadius?: number;\n}\n\nexport interface WebGpuGroundReflectionConfigDefinition {\n /**\n * @description Enables or disables the ground reflection entirely.\n * When disabled the floor still receives shadows but does not render a reflection,\n * which also avoids the extra reflection render pass.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * @description Strength of the ground reflection.\n * 0 means no reflection, 1 means a full mirror-like reflection.\n * @default 0.1\n */\n intensity?: number;\n\n /**\n * @description Depth at which the reflection starts to fade out.\n * @default 0.05\n */\n startFadeout?: number;\n\n /**\n * @description Depth at which the reflection is fully faded out.\n * @default 0.15\n */\n endFadeout?: number;\n\n /**\n * @description How much the resolution of the scene is scaled by for the reflection resolution\n * If transmissive objects are not in use, this can be set to a lower value like 0.5 to improve performance.\n * @default 1\n */\n reflectionScale?: number;\n}\n\nexport interface WebGpuFogConfigDefinition {\n /**\n * @description If true, a fog is added to the scene in webGPU mode.\n * This is mainly so you cant see the outer edge of the\n * floor (which makes it blends smoothly into the background).\n * This fog exists in a cylindrical shape around the origin and the\n * farBlend and nearBlend parameters indirectly control the radius\n * at which the fog starts and ends.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * @description Radial distance from the start of the fog to the end of the fog.\n * This creates a smooth transition from full fog to no fog.\n * Larger values produce a softer, more gradual fog transition.\n * @default 7\n */\n nearBlend?: number;\n\n /**\n * @description Distance from the far end of the camera view/floor boundaries\n * at which the fully opaque fog should start to appear.\n * Larger values move the fully opaque(/end of the) fog\n * closer to the center of the scene.\n * @default 10\n */\n farBlend?: number;\n}\n\nexport interface WebGpuSkyConfigDefinition {\n /**\n * @description If true, adds a physically based (Hosek-Wilkie) sky and a matching\n * sun providing light to the scene.\n * @default false\n */\n enabled?: boolean;\n\n /**\n * @description Value determining the amount of aerosol particles in the sky. This\n * very much impacts the sky's color and clearness.\n * From the original paper: T = 2 yields a very clear, Arctic-like sky,\n * T = 3 a clear sky in a temperate climate,\n * T = 6 a sky on a warm, moist day,\n * T = 10 a slightly hazy sky\n * Valid range: `[1,10]`\n * @default 2.5\n */\n turbidity?: number;\n\n /**\n * @description Represents how much light the ground bounces back into the atmosphere,\n * which brightens the sky near the horizon if this value is high.\n * Valid range: `[0,1]`\n * @default 0.9\n */\n albedo?: number;\n\n /**\n * @description Horizontal orientation of the sun in radians.\n * Changing this value rotates the sun clockwise around\n * the scene without changing its height.\n * Valid range: `[-pi, pi]`\n * @default 0\n */\n azimuthAngle?: number;\n\n /**\n * @description Height of the sun measured as the angle\n * from straight up (the zenith), in radians. Smaller values raise the sun toward\n * noon; larger values lower it toward the horizon.\n * Valid range: `[0,pi/2≈1.57]`.\n * @default 1\n */\n polarAngle?: number;\n\n /**\n * @description Intensity of the sun that lights the scene and casts shadows.\n * This does not influence how the sun disc looks in the sky.\n * @default 10\n */\n sunLightIntensity?: number;\n\n /**\n * @description Radius of the visible sun disc in the sky.\n * @default 0.03\n */\n sunRadius?: number;\n\n /**\n * @description Blurryness of the edge of the visible sun disc in the sky.\n * @default 0.002\n */\n sunSoftness?: number;\n\n /**\n * @description Exposure multiplier applied during the sky-specific tone mapping.\n * Higher values make the sky brighter.\n * @default 0.5\n */\n tonemapExposure?: number;\n\n /**\n * @description The HDR brightness value which the sky-specific tone mapping considers as white.\n * Lower values clip bright areas (like the sun) to white sooner, increasing contrast.\n * Higher values preserve more detail in the brightest regions.\n * @default 14\n */\n tonemapWhite?: number;\n\n /**\n * @description Fraction of the sky covered by clouds.\n * At `0` no clouds are rendered. at `1` the sky is fully covered by clouds.\n * @default 0.25\n */\n cloudCoverage?: number;\n\n /**\n * @description Opacity of the clouds when they are blended over the sky. At `0` clouds\n * are invisible even if coverage is high; at `1` they fully replace the sky color\n * beneath them.\n * @default 0.3\n */\n cloudDensity?: number;\n\n /**\n * @description Height of the virtual cloud plane. A value of `0` places the plane\n * very high (clouds appear small and distant); `1` pulls it down towards the horizon\n * so clouds appear lower and larger.\n * @default 0.7\n */\n cloudElevation?: number;\n\n /**\n * @description Intensity of the environment map lighting while the sky is\n * enabled. Because the sky already contributes its own image-based lighting,\n * the environment map is dimmed to this value to keep the overall scene brightness balanced.\n * @default 0.5\n */\n overrideEnvironmentMapIntensity?: number;\n}\n\nexport interface WebGpuSSGIConfigDefinition {\n /**\n * @description Radius of the denoising filter applied to the indirect lighting.\n * Higher values produce a stronger denoising effect, which can help reduce noise\n * in the indirect lighting but may also blur fine details.\n * @default 20\n */\n giDenoiseRadius?: number;\n\n /**\n * @description Radius of the denoising filter applied to the ambient occlusion (AO) pass.\n * Higher values produce a stronger denoising effect, which can help reduce noise\n * in the AO but may also blur fine details.\n * @default 10\n */\n aoDenoiseRadius?: number;\n}\n\nexport interface WebGpuConfigDefinition {\n /**\n * @description If true, the initial webgpu quality level is autodetected based on\n * a benchmark of the graphics hardware. If false, the default quality level is used.\n * @default true\n */\n autoDetectQualityLevel?: boolean;\n\n /**\n * @description This can be used to configure the lower bound of webgpu auto quality\n * meaning the fps bound which, when hit, will set the quality setting lower\n * To disable: set to 0\n * @default 24\n */\n autoQualityMinFps?: number;\n\n /**\n * @description This can be used to configure the upper bound of webgpu auto quality\n * meaning the fps bound which, when hit, will set the quality setting higher\n * This should be sufficiently larger than the minFps to not cause the quality to go up and down all the time\n * To disable: set to something very high\n * @default 59\n */\n autoQualityMaxFps?: number;\n\n /**\n * @description Visual configuration for the WebGPU top light and its shadow.\n */\n topLight?: WebGpuTopLightConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU ground reflection.\n */\n groundReflection?: WebGpuGroundReflectionConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU fog.\n */\n fog?: WebGpuFogConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU sky and sun.\n */\n sky?: WebGpuSkyConfigDefinition;\n\n /**\n * @description Visual configuration for the WebGPU screen space global illumination (SSGI) effect.\n */\n ssgi?: WebGpuSSGIConfigDefinition;\n\n /**\n * @description Tone mapping operator applied by the WebGPU renderer.\n * @default 'none'\n */\n toneMapping?: WebGpuToneMapping;\n\n /**\n * @description Exposure (intensity) of the tone mapping applied by the\n * WebGPU renderer. Higher values produce a brighter image.\n * @default 1\n */\n toneMappingExposure?: number;\n}\n\nexport interface FeatureFlags {\n pulsePreview?: boolean;\n reDock?: boolean;\n\n /**\n * @description Sets whether the snapping behavior of objects in the planner is initially enabled.\n */\n enableSnapping?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced docking behavior is enabled (for test purposes only)\n */\n advancedDocking?: boolean;\n\n /**\n * @internal\n * @description If true, when inserting new objects in the planner, we will try to merge them into existing groups if possible.\n * This is for test purposes only and should not be enabled in production yet, as it can lead to unexpected behavior.\n */\n mergeOnInsert?: boolean;\n\n /**\n * @internal\n * @description If “vector”, the vector preview is activated when drawing walls (for test purposes only).\n * By default, the walls are immediately drawn with their actual thickness,\n * but this leads to problems when displaying the dimensions of the walls,\n * as it is not possible to guess which side of the wall of the room currently being entered is the inside of the wall.\n */\n drawPreviewMode?: Enumify<typeof DRAW_PREVIEW_MODES>;\n /**\n * @internal\n * @description TO BE REMOVED ONCE RML-13218 IS RESOLVED.\n * Forces new thumbnails to be generated on configuration save\n */\n forceSaveThumbnails?: boolean;\n\n /**\n * @internal\n * @description Enables dynamically placed interior lights in the room planner.\n */\n interiorLights?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced dimensioning is enabled (for test purposes only)\n */\n advancedDimensioning?: boolean;\n\n /**\n * @internal\n * @deprecated Use the top-level `webGpu` init data property instead.\n * @description If true, the scene will be rendered with WebGPU instead of WebGL\n */\n webGpu?: boolean;\n\n /**\n * @internal\n * @description If true, the advanced highlighting behavior is enabled (for test purposes only)\n */\n advancedHighlighting?: boolean;\n\n /**\n * @internal\n * @description If true, enables the POC for planning fences (e.g. garden fences) in the room planner.\n */\n fence?: boolean;\n\n /**\n * @internal\n * @description If true, `onRequestPlan` waits until every pending configuration\n * save in the plan has been persisted to the Roomle backend before firing.\n * See RML-17394\n */\n awaitConfigurationSavesBeforeRequestPlan?: boolean;\n}\n\nexport type RoomleColors = keyof typeof ROOMLE_COLORS;\n\nexport type ColorsIn3dScene = Record<\n RoomleColors,\n HexColorString | HexColorNumber\n>;\n\nexport type ThreeJsColorsIn3dScene = Record<keyof typeof ROOMLE_COLORS, Color>;\n\n/**\n * Init data parameter which can be used in configurator AND planner\n */\nexport interface CommonInitData {\n /**\n * @description If set to true the configurator will make sure every device has great user experience with fluid frame rate.\n * If set to false the configurator will always show the highest quality possible.\n * That could lead to stutter and other problems on low-end devices. We advise you to only turn off \"autoQuality\" if you really know what you are doing.\n * usage: autoQuality=false\n * @groups scene-settings\n */\n autoQuality?: boolean;\n\n /**\n * @description Can be used to personalize colors used in the 3D scene\n * @groups scene-settings\n */\n colors?: ColorsIn3dScene;\n\n /**\n * @description The item id or configuration id of the item which should be loaded.\n * Examples:\n * Configuration id: usm:frame:2449773A7F54278EBB61A67A10EF6A10E8BB6F38BE775B028AC050B438414507\n * Item id: usm:frame\n */\n id?: RapiId;\n\n /**\n * @internal\n * @deprecated\n * @description Use prices which are hardcoded in the configuration script.\n * Only used for trade show demos.\n */\n useRoomlePrice?: boolean;\n\n /**\n * @description Set how many positions after the decimal point should be shown.\n * For example:\n * 8' 1.68\" -> precisionCm=2 -> 8' 1.68\"\n * 8' 1.68\" -> precisionCm=1 -> 8' 1.7\"\n * 8' 1.68\" -> precisionCm=0 -> 8' 2\"\n */\n precisionInch?: number;\n\n /**\n * @description Set how many positions after the decimal point should be shown.\n * For example:\n * 123,45 -> precisionCm=2 -> 123,45\n * 123,45 -> precisionCm=1 -> 123,5\n * 123,45 -> precisionCm=0 -> 124\n */\n precisionCm?: number;\n\n /**\n * @description Defines which unit should be used for measurements/dimensions\n * Options: 'cm', 'mm', 'inchfeet'\n */\n unit?: string;\n\n /**\n * @description How the current unit should be formatted\n * Options:\n * - 'none': No unit string added, for example '200'\n * - 'long': Long unit string, for example '200 meters'\n * - 'short': Short unit string, for example '200 m'\n */\n unitStringType?: string;\n\n /**\n * @description When mesh selection is enabled, the meshes of the object are used directly for highlighting.\n * Setting it to false could be useful for square/rectangular (shelf) items.\n */\n meshSelection?: boolean;\n\n /**\n * @description if set to true it shows a little overlay with performance stats\n */\n stats?: boolean;\n\n /**\n * @description This flag enables:\n * - Scripter debug logs (e.g. which parameter is not assigned to a parameter group)\n * - Free camera movement (no restrictions, camera stays after reload, panning using Shift key)\n */\n debug?: boolean;\n\n /**\n * @description This flag enables:\n * - External object docking vector debug geometry\n */\n debugGeometry?: boolean;\n\n /**\n * @description If true this flag shows component bounding boxes\n */\n debugBoundingBox?: boolean;\n\n /**\n * @description This flag enables:\n * - Help line geometry in the planner\n * @internal\n */\n debugLines?: boolean;\n\n /**\n * @description If set to true, prices are calculated using the Roomle price service.\n * For more information ask your Roomle contact.\n */\n usePriceService?: boolean;\n\n /**\n * @description Url to an exr or hdr env map\n * @groups scene-settings\n */\n envMapUrl?: string;\n\n /**\n * @description Set the intensity of the environment map\n * @groups scene-settings\n */\n envMapIntensity?: number;\n\n /**\n * @description Set the rotation of the environment map in radians, between 0 and 2 * PI, rotates counter-clockwise\n * @groups scene-settings\n */\n envMapRotation?: number;\n\n /**\n * @description Set the maximum number of light sources extracted from the environment map\n * @groups scene-settings\n */\n maxLightSources?: number;\n\n /**\n * @description Use old light setting instead of env maps. Ignored when using the WebGPU renderer\n * @groups scene-settings\n */\n legacyLight?: boolean;\n\n /**\n * @description Generate environment map from a scene instead of env maps\n * use all_around for an surrounding light\n * use front for a mainly frontal light\n * @groups scene-settings\n */\n sceneLight?: DefaultEnvironmentSceneType;\n\n /**\n * @description General shading properties for the overall appearance\n * default: for planner and a configurator with colorful, metallic or wooden materials\n * bright: for a configurator with white and bright materials\n * @groups scene-settings\n */\n shading?: SceneShadingType;\n\n /**\n * @description Customized shading properties for the overall appearance\n * @groups scene-settings\n */\n customShading?: CustomShadingParameters;\n\n /**\n * @description Activates the linear AO filter mode to reduce AO anti-aliasing artifacts\n * @groups scene-settings\n */\n linearAoFilter?: boolean;\n\n /**\n * @description Customized shading properties for the overall appearance in MOC\n * @groups scene-settings\n */\n customShadingMoc?: CustomShadingParameters;\n\n /**\n * @description restrictionLevel defines visibility of parameters and possible children\n */\n restrictionLevel?: number;\n\n /**\n * @description Settings for Homag Intelligence\n * @internal\n */\n hi?: HomagIntelligenceInitData;\n\n /**\n * @description disable injection of default styles for measurements and component dimension labels\n * to enable easier customization of these styles (via the assigned classes)\n */\n disableDefaultLabelStyles?: boolean;\n}\n\nexport interface ConfiguratorInitData {\n /**\n * @description Sets the behavior of the highlighting of a hovered component.\n * usage: highlighting=smart\n */\n highlighting?: Enumify<typeof ROOMLE_HIGHLIGHTNG>;\n\n /**\n * @description Set the floor material which is used when loading the configurator\n * For different options see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting}\n */\n initialFloorMaterial?: string;\n\n /**\n * @internal\n * @description Load a light setting using an URL.\n * Check lights in {@link @roomle/web-sdk/configurator-core/src/scene-settings-loader#SceneSettings} for an example.\n * value is a dynamic light setting url\n */\n dls?: string;\n\n /**\n * @description Load a predefined light setting, eg: ls=sofa\n * @groups scene-settings\n */\n ls?: string;\n\n /**\n * @description Set the distance to which the user can zoom (in centimeters).\n * default: object size divided by 10 or 10 cm\n * usage: zoomDistance=3\n * @groups scene-settings\n */\n zoomDistance?: number;\n\n /**\n * @description When set this param restricts the camera rotation to the given angle (e.g. 45 degree), this overrides minHorizontalCameraAngle and maxHorizontalCameraAngle\n * default: not set -> no camera restriction\n * usage: cameraRestriction=45\n * @groups scene-settings\n */\n cameraRestriction?: number;\n\n /**\n * @description Sets the default/initial vertical camera angle (pitch)\n * default: 10\n * usage: verticalCameraAngle=45\n * @groups scene-settings\n */\n verticalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the down/vertical camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: minVerticalCameraAngle=45\n * @groups scene-settings\n */\n minVerticalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the up/vertical camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: maxVerticalCameraAngle=45\n * @groups scene-settings\n */\n maxVerticalCameraAngle?: number;\n\n /**\n * @description Sets the default/initial horizontal camera angle (yaw)\n * default: -30\n * usage: horizontalCameraAngle=45\n * @groups scene-settings\n */\n horizontalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the left/horizontal camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: minHorizontalCameraAngle=45\n * @groups scene-settings\n */\n minHorizontalCameraAngle?: number;\n\n /**\n * @description When set this param restricts the right/horizontal camera rotation to the given angle (e.g. 45 degree)\n * default: not set -> no camera angle restriction\n * usage: maxHorizontalCameraAngle=45\n * @groups scene-settings\n */\n maxHorizontalCameraAngle?: number;\n\n /**\n * @description If set to false the camera will just jump to a new position\n * default: true\n * usage: animateCamera=false\n * @groups scene-settings\n */\n animateCamera?: boolean;\n\n /**\n * @internal\n * @description Easter Egg\n * */\n bananaForScale?: boolean;\n\n /**\n * @description If set to true, components which are between the camera and the selected component/preview will be rendered transparent\n * usage: transparentHighlighting=true\n * @groups scene-settings\n */\n transparentHighlighting?: boolean;\n\n /**\n * @description If set to true, the background is transparent and allows elements behind the configurator to be visible through the scene.\n * Not compatible with the WebGPU sky feature\n * usage: transparentBackground=true\n * @groups scene-settings\n */\n transparentBackground?: boolean;\n\n /**\n * @description If set to true it will try to apply all current global parameters to the loaded object\n */\n applyCurrentGlobalParameters?: boolean;\n\n /**\n * @description If set to true, component dimension labels stay visible even when the distance-based proximity check would normally hide them.\n * @default false\n */\n disableMeasurementCollisionDetection?: boolean;\n\n /**\n * @description Adds the given spacing (in centimeters) to the loaded object. This is then used to calculate the initial camera distance\n * default: 0\n * usage:\n * cameraSpacing=100, zoom out further by increasing camera spacing by 100 centimeters\n * cameraSpacing=-30, zoom in further by decreasing camera spacing by 30 centimeters\n * @groups scene-settings\n */\n cameraSpacing?: number;\n\n /**\n * @internal\n * @description If set to true, screen space reflections are enabled\n */\n ssr?: boolean;\n\n /**\n * @internal\n * @description features that can be enabled/disabled\n */\n featureFlags?: FeatureFlags;\n\n /**\n * @internal\n * @description If true, the scene will be rendered with WebGPU instead of WebGL\n * @default false\n * usage: webGpu=true\n */\n webGpu?: boolean;\n\n /**\n * @internal\n * @description Configuration for the WebGPU renderer (e.g. auto quality fps bounds).\n */\n webGpuConfig?: WebGpuConfigDefinition;\n\n /**\n * @description if true, the meshes of the component will be used, in addition to the bounding box, for raycasting (selecting)\n * Warning: this will decrease performance when hovering over components with complex meshes\n * @default false\n * usage: meshRaycasting=true\n */\n meshRaycasting?: boolean;\n}\n\nexport interface PlannerInitData {\n /**\n * @description Sets the default floor material when creating a new plan or drawing.\n * Can be a number (RGB color) or a string (material ID).\n */\n defaultFloorMaterial?: number | string;\n\n /**\n * @description Select with which camera mode to start initially.\n * usage: mode=2D\n * options: 2D, 3D, FP\n */\n mode?: Enumify<typeof CAMERA_TYPE>;\n\n /**\n * @internal\n * @description If set to true the plan can be edited.\n */\n edit?: boolean;\n\n /**\n * @description If set to true it will treat the planner as a multi object configurator (moc).\n * This means:\n * - do not merge geometries\n * - set configurator environment & lights in planner\n * - reduce initial spacing of camera (higher zoom)\n */\n moc?: boolean;\n\n /**\n * @description If set to true we will not hide other items while configuring in the planner\n */\n configureInRoom?: boolean;\n\n /**\n * @description If set to true docking of configurable objects in the planner is enabled.\n * The default value is true.\n */\n dockInRoom?: boolean;\n\n /**\n * @description If set to true the 3D planner camera zooms in as close to objects as the configurator does,\n * instead of stopping at the bounds of the plan. Objects which would be cut by the camera near plane are\n * hidden while they are cut.\n * @default false\n * usage: configuratorZoom=false\n */\n configuratorZoom?: boolean;\n}\n\nexport interface InitDataDefinition\n extends CommonInitData,\n ConfiguratorInitData,\n PlannerInitData {}\n","const FPS_LIST_SIZE = 10;\nconst FPS_MEASUREMENT_INTERVAL_MS = 20;\n\nexport default class FpsCounter {\n private _index: number = 0;\n private _fpsList: number[];\n private _prevTime: number = 0;\n private _frames: number = 0;\n private _fps: number = -1;\n\n constructor() {\n this._fpsList = Array(FPS_LIST_SIZE).fill(0);\n this._prevTime = (performance || Date).now();\n this.reset();\n }\n\n public update() {\n this._frames++;\n const time = (performance || Date).now();\n\n if (time >= this._prevTime + FPS_MEASUREMENT_INTERVAL_MS) {\n this._fpsList[this._index % FPS_LIST_SIZE] =\n (this._frames * 1000) / (time - this._prevTime);\n\n if (this._index >= FPS_LIST_SIZE) {\n this._fps =\n this._fpsList.reduce((pv, cv) => pv + cv) / this._fpsList.length;\n }\n\n this._prevTime = time;\n this._frames = 0;\n this._index++;\n }\n }\n\n public start() {\n this._prevTime = (performance || Date).now();\n this._frames = 0;\n }\n\n public reset() {\n this._fps = -1;\n this._fpsList = Array(FPS_LIST_SIZE).fill(0);\n this._index = 0;\n }\n\n public getFps() {\n return this._fps;\n }\n}\n","import type { Camera, Object3D, Scene, Vector2, WebGLRenderer } from 'three';\nimport { Box3 } from 'three';\nimport type { Enumify } from '#/common/src/utils/types';\nimport type { CAMERA_TYPE } from './cameracontrol/camera-type';\nimport type { WebGPURenderer } from 'three/webgpu';\nimport type { SceneShadingType } from './webgl/renderer/shading-settings';\nimport type { OutlineCustomParameters } from './webgl/renderer/scene-renderer';\n\nexport type GenericRoomleRenderer = RoomleRenderer<\n WebGLRenderer | WebGPURenderer\n>;\n\nexport enum PlannerRenderMode {\n Mode3D,\n Mode2D,\n}\n\nexport abstract class RoomleRenderer<\n RendererType extends WebGLRenderer | WebGPURenderer,\n> {\n public _creator_: string;\n public renderer: RendererType;\n protected isConfiguratorMode: boolean = true;\n protected isCameraMoving: boolean = false;\n protected cameraType: Enumify<typeof CAMERA_TYPE>;\n protected shadowNeedsUpdate: boolean = false;\n protected boundingBox: Box3 = new Box3();\n protected boundingBoxNeedsUpdate: boolean = false;\n\n protected constructor(creator: string, renderer: RendererType) {\n this._creator_ = creator;\n this.renderer = renderer;\n }\n\n public get isConfiguring(): boolean {\n return this.isConfiguratorMode;\n }\n\n public dispose(): void {\n this.renderer.dispose();\n }\n\n public setSize(width: number, height: number): void {\n this.renderer.setSize(width, height);\n }\n\n public getSize(target: Vector2): Vector2 {\n return this.renderer.getSize(target);\n }\n\n public setCameraType(cameraType: Enumify<typeof CAMERA_TYPE>) {\n this.cameraType = cameraType;\n }\n\n public movingCameraStarts(): void {\n this.isCameraMoving = true;\n }\n\n public movingCameraStops(): void {\n this.isCameraMoving = false;\n }\n\n public forceShadowUpdates(_updateBakedGroundShadow: boolean): void {\n this.shadowNeedsUpdate = true;\n }\n\n public clear() {\n this.renderer.clear();\n }\n\n public updateBounds(geometryBounds: Box3) {\n this.boundingBox.copy(geometryBounds);\n this.boundingBoxNeedsUpdate = true;\n }\n\n public switchToConfigurator(): void {\n this.isConfiguratorMode = true;\n }\n\n public switchToPlanner(_renderMode: PlannerRenderMode) {\n this.isConfiguratorMode = false;\n }\n\n public abstract setShadingType(shadingType: SceneShadingType): void;\n\n public abstract setCustomOutlineParameters(\n outlineCustomParameters: OutlineCustomParameters,\n ): void;\n\n public abstract render(scene: Scene, camera: Camera): void;\n\n public abstract showGUI(updateCallback: () => void): void;\n\n public abstract clearCache(): void;\n\n public abstract highlightObjects(selectedMeshes: Object3D[]): void;\n\n public abstract setGroundShadow(enabled: boolean, scene: Scene): void;\n\n public abstract enableUiInteractionMode(): void;\n\n public abstract disableUiInteractionMode(): void;\n}\n"],"mappings":";;AAkBA,IAAkB,IAAX,yBAAA,GAAA;QACL,EAAA,SAAA,UACA,EAAA,WAAA,WACA,EAAA,SAAA,SACA,EAAA,oBAAA;KACD,EAEY,IAAqB;CAChC,SAAS;CACT,QAAQ;CACT,EAEY,IAAuB;CAClC,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,aAAa;CACb,KAAK;CACL,SAAS;CACV,ECtCK,IAAgB,IAChB,IAA8B,IAEf,IAArB,MAAgC;CAO9B,cAAc;AAGZ,gBATuB,oBAEG,kBACF,eACH,IAGrB,KAAK,WAAW,MAAM,EAAc,CAAC,KAAK,EAAE,EAC5C,KAAK,aAAa,eAAe,MAAM,KAAK,EAC5C,KAAK,OAAO;;CAGd,SAAgB;AACd,OAAK;EACL,IAAM,KAAQ,eAAe,MAAM,KAAK;AAExC,EAAI,KAAQ,KAAK,YAAY,MAC3B,KAAK,SAAS,KAAK,SAAS,KACzB,KAAK,UAAU,OAAS,IAAO,KAAK,YAEnC,KAAK,UAAU,MACjB,KAAK,OACH,KAAK,SAAS,QAAQ,GAAI,MAAO,IAAK,EAA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