@roomle/web-sdk 2.91.0-alpha.7 → 2.91.0-alpha.9
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/{TextGeometry-35ad7588.js → TextGeometry-ab643210.js} +2 -2
- package/lib/{TextGeometry-35ad7588.js.map → TextGeometry-ab643210.js.map} +1 -1
- package/lib/{TextGeometry-e9f8b213.nomodule.js → TextGeometry-cd81779b.nomodule.js} +2 -2
- package/lib/{TextGeometry-e9f8b213.nomodule.js.map → TextGeometry-cd81779b.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-b82d4f43.js → banana-for-scale-718d2841.js} +2 -2
- package/lib/{banana-for-scale-b82d4f43.js.map → banana-for-scale-718d2841.js.map} +1 -1
- package/lib/{banana-for-scale-e957c721.nomodule.js → banana-for-scale-867690ed.nomodule.js} +2 -2
- package/lib/{banana-for-scale-e957c721.nomodule.js.map → banana-for-scale-867690ed.nomodule.js.map} +1 -1
- package/lib/{budgeteer-measure-4ec5f193.js → budgeteer-measure-f6505461.js} +2 -2
- package/lib/{budgeteer-measure-4ec5f193.js.map → budgeteer-measure-f6505461.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/camera-behaviour-0c0e95a7.nomodule.js +2 -0
- package/lib/{camera-behaviour-f0dfef84.nomodule.js.map → camera-behaviour-0c0e95a7.nomodule.js.map} +1 -1
- package/lib/camera-behaviour-742d2a9f.js +2 -0
- package/lib/{camera-behaviour-c31a8283.js.map → camera-behaviour-742d2a9f.js.map} +1 -1
- package/lib/{component-dimensioning-e6b57409.nomodule.js → component-dimensioning-14a9e284.nomodule.js} +2 -2
- package/lib/component-dimensioning-14a9e284.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-8b53fb80.js → component-dimensioning-54705806.js} +2 -2
- package/lib/component-dimensioning-54705806.js.map +1 -0
- package/lib/{component-raycast-helper-8add956e.nomodule.js → component-raycast-helper-10ee9741.nomodule.js} +2 -2
- package/lib/component-raycast-helper-10ee9741.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-c7c83ee8.js → component-raycast-helper-f66b2225.js} +2 -2
- package/lib/component-raycast-helper-f66b2225.js.map +1 -0
- package/lib/{configurator-09203eb4.js → configurator-7f20e16b.js} +2 -2
- package/lib/configurator-7f20e16b.js.map +1 -0
- package/lib/configurator-a5cfa17a.nomodule.js +2 -0
- package/lib/configurator-a5cfa17a.nomodule.js.map +1 -0
- package/lib/configurator-main-c2ff8b77.js +2 -0
- package/lib/configurator-main-c2ff8b77.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-4ab59041.nomodule.js → continuous-drawing-helper-9715562b.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-9715562b.nomodule.js.map +1 -0
- package/lib/{continuous-drawing-helper-5994f32f.js → continuous-drawing-helper-e981e121.js} +2 -2
- package/lib/continuous-drawing-helper-e981e121.js.map +1 -0
- package/lib/{default-light-setting-7b1aaba9.js → default-light-setting-a107f5f2.js} +2 -2
- package/lib/default-light-setting-a107f5f2.js.map +1 -0
- package/lib/{default-light-setting-26c6a0ae.nomodule.js → default-light-setting-e0eeabc6.nomodule.js} +2 -2
- package/lib/default-light-setting-e0eeabc6.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-control-2d.d.ts +3 -3
- package/lib/definitions/common-core/src/cameracontrol/camera-control-3d.d.ts +4 -3
- package/lib/definitions/common-core/src/cameracontrol/camera-control.d.ts +4 -4
- package/lib/definitions/common-core/src/cameracontrol/configurator-camera-behaviour.d.ts +1 -1
- package/lib/definitions/common-core/src/cameracontrol/glb-viewer-camera-behaviour.d.ts +1 -1
- package/lib/definitions/common-core/src/cameracontrol/planner-2d-camera-behaviour.d.ts +2 -1
- package/lib/definitions/common-core/src/cameracontrol/planner-3d-camera-behaviour.d.ts +1 -1
- package/lib/definitions/common-core/src/cameracontrol/planner-camera-behaviour.d.ts +3 -2
- package/lib/definitions/common-core/src/cameracontrol/planner-fp-camera-behaviour.d.ts +3 -1
- package/lib/definitions/common-core/src/utils/common-utils.d.ts +1 -0
- package/lib/definitions/common-core/src/webgl/scene-manager.d.ts +10 -0
- package/lib/definitions/packages/common-core/src/cameracontrol/camera-control-2d.d.ts +3 -3
- package/lib/definitions/packages/common-core/src/cameracontrol/camera-control-3d.d.ts +4 -3
- package/lib/definitions/packages/common-core/src/cameracontrol/camera-control.d.ts +4 -4
- package/lib/definitions/packages/common-core/src/cameracontrol/configurator-camera-behaviour.d.ts +1 -1
- package/lib/definitions/packages/common-core/src/cameracontrol/glb-viewer-camera-behaviour.d.ts +1 -1
- package/lib/definitions/packages/common-core/src/cameracontrol/planner-2d-camera-behaviour.d.ts +2 -1
- package/lib/definitions/packages/common-core/src/cameracontrol/planner-3d-camera-behaviour.d.ts +1 -1
- package/lib/definitions/packages/common-core/src/cameracontrol/planner-camera-behaviour.d.ts +3 -2
- package/lib/definitions/packages/common-core/src/cameracontrol/planner-fp-camera-behaviour.d.ts +3 -1
- package/lib/definitions/packages/common-core/src/utils/common-utils.d.ts +1 -0
- package/lib/definitions/packages/common-core/src/webgl/scene-manager.d.ts +10 -0
- package/lib/definitions/packages/planner-core/src/camera-control/camera-control-first-person.d.ts +2 -2
- package/lib/definitions/packages/planner-core/src/roomle-planner.d.ts +9 -0
- package/lib/definitions/packages/planner-core/src/services/planner-kernel-access.d.ts +1 -0
- package/lib/definitions/packages/planner-core/src/webgl/planner-scene-manager.d.ts +3 -0
- package/lib/definitions/planner-core/src/camera-control/camera-control-first-person.d.ts +2 -2
- package/lib/definitions/planner-core/src/roomle-planner.d.ts +9 -0
- package/lib/definitions/planner-core/src/services/planner-kernel-access.d.ts +1 -0
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +4 -1
- package/lib/{dimensioning-helper-c685421a.js → dimensioning-helper-7c58d2df.js} +2 -2
- package/lib/{dimensioning-helper-c685421a.js.map → dimensioning-helper-7c58d2df.js.map} +1 -1
- package/lib/{dimensioning-helper-c3d3d1ae.nomodule.js → dimensioning-helper-9d940fd0.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-c3d3d1ae.nomodule.js.map → dimensioning-helper-9d940fd0.nomodule.js.map} +1 -1
- package/lib/glb-viewer-a51c1679.js +2 -0
- package/lib/{glb-viewer-f314ac2b.js.map → glb-viewer-a51c1679.js.map} +1 -1
- package/lib/glb-viewer-camera-behaviour-364def6b.js +2 -0
- package/lib/glb-viewer-camera-behaviour-364def6b.js.map +1 -0
- package/lib/glb-viewer-camera-behaviour-99f825f9.nomodule.js +2 -0
- package/lib/glb-viewer-camera-behaviour-99f825f9.nomodule.js.map +1 -0
- package/lib/glb-viewer-f0e484c9.nomodule.js +2 -0
- package/lib/{glb-viewer-4c4b8630.nomodule.js.map → glb-viewer-f0e484c9.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-5bd28680.js +2 -0
- package/lib/glb-viewer-main-5bd28680.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{TextGeometry-2234cb5c.legacy.js → TextGeometry-f4299b59.legacy.js} +2 -2
- package/lib/legacy/{TextGeometry-2234cb5c.legacy.js.map → TextGeometry-f4299b59.legacy.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-0879dc36.legacy.js → banana-for-scale-9d668a53.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-0879dc36.legacy.js.map → banana-for-scale-9d668a53.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/camera-behaviour-552ac6a9.legacy.js +2 -0
- package/lib/legacy/{camera-behaviour-3fb6e5cd.legacy.js.map → camera-behaviour-552ac6a9.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-f0627f1c.legacy.js → component-dimensioning-e94834f6.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-e94834f6.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-89b75300.legacy.js → component-raycast-helper-558d0d4a.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-558d0d4a.legacy.js.map +1 -0
- package/lib/legacy/configurator-8d43871c.legacy.js +2 -0
- package/lib/legacy/configurator-8d43871c.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-464da526.legacy.js → continuous-drawing-helper-00de8243.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-00de8243.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-9e031793.legacy.js → default-light-setting-ad18912f.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-ad18912f.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-d8842060.legacy.js → dimensioning-helper-56cd38c2.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-d8842060.legacy.js.map → dimensioning-helper-56cd38c2.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-camera-behaviour-58df039b.legacy.js +2 -0
- package/lib/legacy/glb-viewer-camera-behaviour-58df039b.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-f9a844c3.legacy.js +2 -0
- package/lib/legacy/{glb-viewer-63dedb85.legacy.js.map → glb-viewer-f9a844c3.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{main-thread-to-worker-d88983c7.legacy.js → main-thread-to-worker-7c2b8bc9.legacy.js} +3 -3
- package/lib/legacy/{main-thread-to-worker-d88983c7.legacy.js.map → main-thread-to-worker-7c2b8bc9.legacy.js.map} +1 -1
- package/lib/legacy/material-viewer-f138a99c.legacy.js +2 -0
- package/lib/legacy/material-viewer-f138a99c.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-194e78d2.legacy.js +2 -0
- package/lib/legacy/{planner-dd57a9c7.legacy.js.map → planner-194e78d2.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{query-params-helper-4c2a68e8.legacy.js → query-params-helper-aca6a1b1.legacy.js} +2 -2
- package/lib/legacy/query-params-helper-aca6a1b1.legacy.js.map +1 -0
- package/lib/legacy/roomle-configurator-b0dccd61.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-b0dccd61.legacy.js.map +1 -0
- package/lib/legacy/{roomle-dependency-injection-fc938017.legacy.js → roomle-dependency-injection-b3e57924.legacy.js} +2 -2
- package/lib/legacy/{roomle-dependency-injection-fc938017.legacy.js.map → roomle-dependency-injection-b3e57924.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-8eff33b2.legacy.js → script-loader-1385572c.legacy.js} +2 -2
- package/lib/legacy/script-loader-1385572c.legacy.js.map +1 -0
- package/lib/legacy/{stats-helper-58331042.legacy.js → stats-helper-d065f57e.legacy.js} +2 -2
- package/lib/legacy/stats-helper-d065f57e.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-08a1cf68.legacy.js → tools-core-b8c7f017.legacy.js} +2 -2
- package/lib/legacy/tools-core-b8c7f017.legacy.js.map +1 -0
- package/lib/{main-thread-to-worker-45d16085.nomodule.js → main-thread-to-worker-2529fa31.nomodule.js} +2 -2
- package/lib/{main-thread-to-worker-45d16085.nomodule.js.map → main-thread-to-worker-2529fa31.nomodule.js.map} +1 -1
- package/lib/main-thread-to-worker-ee3036b3.js +2 -0
- package/lib/{main-thread-to-worker-67108fb3.js.map → main-thread-to-worker-ee3036b3.js.map} +1 -1
- package/lib/material-viewer-cf65815f.nomodule.js +2 -0
- package/lib/material-viewer-cf65815f.nomodule.js.map +1 -0
- package/lib/material-viewer-e4b0d6d2.js +2 -0
- package/lib/material-viewer-e4b0d6d2.js.map +1 -0
- package/lib/material-viewer-main-8c0763f0.js +2 -0
- package/lib/material-viewer-main-8c0763f0.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-a65c9826.js +2 -0
- package/lib/{planner-923d7c8d.js.map → planner-a65c9826.js.map} +1 -1
- package/lib/planner-ddfe014f.nomodule.js +2 -0
- package/lib/{planner-343db579.nomodule.js.map → planner-ddfe014f.nomodule.js.map} +1 -1
- package/lib/planner-main-1117391e.js +2 -0
- package/lib/planner-main-1117391e.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{query-params-helper-728f722d.nomodule.js → query-params-helper-51a53f8c.nomodule.js} +2 -2
- package/lib/query-params-helper-51a53f8c.nomodule.js.map +1 -0
- package/lib/{query-params-helper-47365ce8.js → query-params-helper-c9492f35.js} +2 -2
- package/lib/query-params-helper-c9492f35.js.map +1 -0
- package/lib/roomle-configurator-936c272c.nomodule.js +2 -0
- package/lib/roomle-configurator-936c272c.nomodule.js.map +1 -0
- package/lib/roomle-configurator-b3bbf02e.js +2 -0
- package/lib/roomle-configurator-b3bbf02e.js.map +1 -0
- package/lib/{roomle-dependency-injection-50955724.js → roomle-dependency-injection-7e094172.js} +2 -2
- package/lib/{roomle-dependency-injection-50955724.js.map → roomle-dependency-injection-7e094172.js.map} +1 -1
- package/lib/{roomle-dependency-injection-a0f275a0.nomodule.js → roomle-dependency-injection-c9ed110e.nomodule.js} +2 -2
- package/lib/{roomle-dependency-injection-a0f275a0.nomodule.js.map → roomle-dependency-injection-c9ed110e.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-d01534cc.js → roomle-sdk-04599db2.js} +2 -2
- package/lib/roomle-sdk-04599db2.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-3ad4c569.nomodule.js → script-loader-5d01175d.nomodule.js} +2 -2
- package/lib/script-loader-5d01175d.nomodule.js.map +1 -0
- package/lib/{script-loader-8223bcca.js → script-loader-af2758f6.js} +2 -2
- package/lib/script-loader-af2758f6.js.map +1 -0
- package/lib/{stats-helper-4b650566.js → stats-helper-6aeaa364.js} +2 -2
- package/lib/stats-helper-6aeaa364.js.map +1 -0
- package/lib/{stats-helper-4d6aaeed.nomodule.js → stats-helper-90a0586d.nomodule.js} +2 -2
- package/lib/stats-helper-90a0586d.nomodule.js.map +1 -0
- package/lib/{tools-core-a9210765.nomodule.js → tools-core-4e9b8dfe.nomodule.js} +2 -2
- package/lib/tools-core-4e9b8dfe.nomodule.js.map +1 -0
- package/lib/{tools-core-b378e72d.js → tools-core-f27db442.js} +2 -2
- package/lib/tools-core-f27db442.js.map +1 -0
- package/package.json +2 -2
- package/lib/camera-behaviour-c31a8283.js +0 -2
- package/lib/camera-behaviour-f0dfef84.nomodule.js +0 -2
- package/lib/component-dimensioning-8b53fb80.js.map +0 -1
- package/lib/component-dimensioning-e6b57409.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-8add956e.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-c7c83ee8.js.map +0 -1
- package/lib/configurator-09203eb4.js.map +0 -1
- package/lib/configurator-dbf610e1.nomodule.js +0 -2
- package/lib/configurator-dbf610e1.nomodule.js.map +0 -1
- package/lib/configurator-main-1be46d9a.js +0 -2
- package/lib/configurator-main-1be46d9a.js.map +0 -1
- package/lib/continuous-drawing-helper-4ab59041.nomodule.js.map +0 -1
- package/lib/continuous-drawing-helper-5994f32f.js.map +0 -1
- package/lib/default-light-setting-26c6a0ae.nomodule.js.map +0 -1
- package/lib/default-light-setting-7b1aaba9.js.map +0 -1
- package/lib/glb-viewer-4c4b8630.nomodule.js +0 -2
- package/lib/glb-viewer-camera-behaviour-3db98513.nomodule.js +0 -2
- package/lib/glb-viewer-camera-behaviour-3db98513.nomodule.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-f57a5588.js +0 -2
- package/lib/glb-viewer-camera-behaviour-f57a5588.js.map +0 -1
- package/lib/glb-viewer-f314ac2b.js +0 -2
- package/lib/glb-viewer-main-f3093735.js +0 -2
- package/lib/glb-viewer-main-f3093735.js.map +0 -1
- package/lib/legacy/camera-behaviour-3fb6e5cd.legacy.js +0 -2
- package/lib/legacy/component-dimensioning-f0627f1c.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-89b75300.legacy.js.map +0 -1
- package/lib/legacy/configurator-1c2b7409.legacy.js +0 -2
- package/lib/legacy/configurator-1c2b7409.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-464da526.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-9e031793.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-63dedb85.legacy.js +0 -2
- package/lib/legacy/glb-viewer-camera-behaviour-1664d2c4.legacy.js +0 -2
- package/lib/legacy/glb-viewer-camera-behaviour-1664d2c4.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-4c111125.legacy.js +0 -2
- package/lib/legacy/material-viewer-4c111125.legacy.js.map +0 -1
- package/lib/legacy/planner-dd57a9c7.legacy.js +0 -2
- package/lib/legacy/query-params-helper-4c2a68e8.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-30ad4441.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-30ad4441.legacy.js.map +0 -1
- package/lib/legacy/script-loader-8eff33b2.legacy.js.map +0 -1
- package/lib/legacy/stats-helper-58331042.legacy.js.map +0 -1
- package/lib/legacy/tools-core-08a1cf68.legacy.js.map +0 -1
- package/lib/main-thread-to-worker-67108fb3.js +0 -2
- package/lib/material-viewer-477c1896.js +0 -2
- package/lib/material-viewer-477c1896.js.map +0 -1
- package/lib/material-viewer-8bf2c1b3.nomodule.js +0 -2
- package/lib/material-viewer-8bf2c1b3.nomodule.js.map +0 -1
- package/lib/material-viewer-main-eec2416c.js +0 -2
- package/lib/material-viewer-main-eec2416c.js.map +0 -1
- package/lib/planner-343db579.nomodule.js +0 -2
- package/lib/planner-923d7c8d.js +0 -2
- package/lib/planner-main-a9111f93.js +0 -2
- package/lib/planner-main-a9111f93.js.map +0 -1
- package/lib/query-params-helper-47365ce8.js.map +0 -1
- package/lib/query-params-helper-728f722d.nomodule.js.map +0 -1
- package/lib/roomle-configurator-48264a3f.js +0 -2
- package/lib/roomle-configurator-48264a3f.js.map +0 -1
- package/lib/roomle-configurator-fbc22856.nomodule.js +0 -2
- package/lib/roomle-configurator-fbc22856.nomodule.js.map +0 -1
- package/lib/roomle-sdk-d01534cc.js.map +0 -1
- package/lib/script-loader-3ad4c569.nomodule.js.map +0 -1
- package/lib/script-loader-8223bcca.js.map +0 -1
- package/lib/stats-helper-4b650566.js.map +0 -1
- package/lib/stats-helper-4d6aaeed.nomodule.js.map +0 -1
- package/lib/tools-core-a9210765.nomodule.js.map +0 -1
- package/lib/tools-core-b378e72d.js.map +0 -1
package/lib/definitions/packages/common-core/src/cameracontrol/planner-2d-camera-behaviour.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type CameraControl2D from './camera-control-2d';
|
|
2
2
|
import PlannerCameraBehaviour from './planner-camera-behaviour';
|
|
3
3
|
import { type Box3 } from 'three';
|
|
4
|
+
import type { CameraParameter } from './camera-control';
|
|
4
5
|
export default class Planner2dCameraBehaviour extends PlannerCameraBehaviour {
|
|
5
6
|
get cameraControl(): CameraControl2D;
|
|
6
7
|
resetCameraOnPlanCompletelyLoaded(bounds: Box3): void;
|
|
@@ -11,6 +12,6 @@ export default class Planner2dCameraBehaviour extends PlannerCameraBehaviour {
|
|
|
11
12
|
updateCameraOnPlanElementInsertedInsideCurrentCameraView(_bounds: Box3): void;
|
|
12
13
|
updateCameraOnPlanElementDraggedOutsidePlanBounds(bounds: Box3): void;
|
|
13
14
|
updateCameraOnPlanElementRemoved(_bounds: Box3): void;
|
|
14
|
-
updateCameraOnBackToPlanner(bounds: Box3): void;
|
|
15
|
+
updateCameraOnBackToPlanner(bounds: Box3, _startCameraParams: CameraParameter, _endCameraParams: CameraParameter): void;
|
|
15
16
|
resetCameraOnEnableWallDrawing(bounds: Box3): void;
|
|
16
17
|
}
|
package/lib/definitions/packages/common-core/src/cameracontrol/planner-3d-camera-behaviour.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export default class Planner3dCameraBehaviour extends PlannerCameraBehaviour {
|
|
|
14
14
|
updateCameraOnPlanElementDraggedOutsidePlanBounds(bounds: Box3): void;
|
|
15
15
|
updateCameraOnPlanElementInsertedInsideCurrentCameraView(bounds: Box3): void;
|
|
16
16
|
updateCameraOnPlanElementRemoved(bounds: Box3): void;
|
|
17
|
-
updateCameraOnBackToPlanner(
|
|
17
|
+
updateCameraOnBackToPlanner(_bounds: Box3, startCameraParams: CameraParameter, endCameraParams: CameraParameter): Promise<void>;
|
|
18
18
|
resetCameraOnEnableWallDrawing(bounds: Box3): void;
|
|
19
19
|
externalApiMoveCamera(cameraParameter: CameraParameter): Promise<void>;
|
|
20
20
|
}
|
package/lib/definitions/packages/common-core/src/cameracontrol/planner-camera-behaviour.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type CameraControl from './camera-control';
|
|
2
1
|
import { type Box3 } from 'three';
|
|
3
2
|
import CameraBehaviour from './camera-behaviour';
|
|
3
|
+
import type CameraControl from './camera-control';
|
|
4
|
+
import type { CameraParameter } from './camera-control';
|
|
4
5
|
export default abstract class PlannerCameraBehaviour extends CameraBehaviour {
|
|
5
6
|
get cameraControl(): CameraControl;
|
|
6
7
|
abstract resetCameraOnPlanCompletelyLoaded(bounds: Box3): void;
|
|
@@ -10,6 +11,6 @@ export default abstract class PlannerCameraBehaviour extends CameraBehaviour {
|
|
|
10
11
|
abstract updateCameraOnPlanElementInsertedInsideCurrentCameraView(bounds: Box3): void;
|
|
11
12
|
abstract updateCameraOnPlanElementDraggedOutsidePlanBounds(bounds: Box3): void;
|
|
12
13
|
abstract updateCameraOnPlanElementRemoved(bounds: Box3): void;
|
|
13
|
-
abstract updateCameraOnBackToPlanner(bounds: Box3): void;
|
|
14
|
+
abstract updateCameraOnBackToPlanner(bounds: Box3, startCameraParams: CameraParameter, endCameraParams: CameraParameter): void;
|
|
14
15
|
abstract resetCameraOnEnableWallDrawing(bounds: Box3): void;
|
|
15
16
|
}
|
package/lib/definitions/packages/common-core/src/cameracontrol/planner-fp-camera-behaviour.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type CameraControlFirstPerson from '../../../planner-core/src/camera-control/camera-control-first-person';
|
|
2
2
|
import PlannerCameraBehaviour from './planner-camera-behaviour';
|
|
3
3
|
import { type Box3 } from 'three';
|
|
4
|
+
import type { CameraParameter } from './camera-control';
|
|
4
5
|
export default class PlannerFpCameraBehaviour extends PlannerCameraBehaviour {
|
|
5
6
|
get cameraControl(): CameraControlFirstPerson;
|
|
6
7
|
resetCameraOnPlanCompletelyLoaded(_bounds: Box3): void;
|
|
@@ -10,6 +11,7 @@ export default class PlannerFpCameraBehaviour extends PlannerCameraBehaviour {
|
|
|
10
11
|
updateCameraOnPlanElementInsertedInsideCurrentCameraView(_bounds: Box3): void;
|
|
11
12
|
updateCameraOnPlanElementDraggedOutsidePlanBounds(_bounds: Box3): void;
|
|
12
13
|
updateCameraOnPlanElementRemoved(_bounds: Box3): void;
|
|
13
|
-
updateCameraOnBackToPlanner(_bounds: Box3): void;
|
|
14
|
+
updateCameraOnBackToPlanner(_bounds: Box3, _startCameraParams: CameraParameter, _endCameraParams: CameraParameter): void;
|
|
14
15
|
resetCameraOnEnableWallDrawing(_bounds: Box3): void;
|
|
16
|
+
resetCameraOnSwitchToFirstPerson(): void;
|
|
15
17
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { CanvasOffset } from '../common-interfaces';
|
|
2
2
|
import type DomHelper from '../utils/dom-helper';
|
|
3
|
+
import CameraControl3D from '../cameracontrol/camera-control-3d';
|
|
3
4
|
import type InputManager from '../input/input-manager';
|
|
4
5
|
import type { GUI } from 'dat.gui';
|
|
5
6
|
import type ScriptLoader from '../script-loader';
|
|
7
|
+
import { type CameraParameter } from '../cameracontrol/camera-control';
|
|
6
8
|
import type LightSetting from '../lightsetting/light-setting';
|
|
7
9
|
import { type CAMERA_TYPE } from '../cameracontrol/camera-type';
|
|
8
10
|
import type { Context } from '../di/context';
|
|
11
|
+
import CameraControlFirstPerson from '../../../planner-core/src/camera-control/camera-control-first-person';
|
|
9
12
|
import type { SceneSettings } from '../scene-settings-loader';
|
|
10
13
|
import type Environment from '../environment/environment';
|
|
11
14
|
import type { DynamicLightSettingSource } from '../lightsetting/dynamic-light-setting-loader';
|
|
@@ -25,6 +28,7 @@ import type CameraBehaviour from '../cameracontrol/camera-behaviour';
|
|
|
25
28
|
import type { Nullable } from '../../../typings/helper';
|
|
26
29
|
import type GlobalInitData from '../utils/global-init-data';
|
|
27
30
|
import type { GlobalCallback } from '../services/global-callback';
|
|
31
|
+
import CameraControl2D from '../cameracontrol/camera-control-2d';
|
|
28
32
|
export default abstract class SceneManager implements Context, LifeCycleCallbacks, EventListenerObject {
|
|
29
33
|
_creator_: string;
|
|
30
34
|
protected _domHelper: DomHelper;
|
|
@@ -39,6 +43,9 @@ export default abstract class SceneManager implements Context, LifeCycleCallback
|
|
|
39
43
|
protected _pluginSystem: PluginSystem;
|
|
40
44
|
protected _imageRenderer: ImageRenderer;
|
|
41
45
|
protected _cameraBehaviourState: CameraBehaviourState;
|
|
46
|
+
private _cameraControl3D;
|
|
47
|
+
private _cameraControl2D;
|
|
48
|
+
private _cameraControlFirstPerson;
|
|
42
49
|
protected _scene: Scene;
|
|
43
50
|
protected _uiScene: Scene;
|
|
44
51
|
private _depthWriteMaterial;
|
|
@@ -137,4 +144,7 @@ export default abstract class SceneManager implements Context, LifeCycleCallback
|
|
|
137
144
|
lockCamera(): void;
|
|
138
145
|
unlockCamera(): void;
|
|
139
146
|
setEnvironmentMap(url?: string, intensity?: number, rotation?: number, maxLightSources?: number): void;
|
|
147
|
+
protected _getCameraControl3D(cameraParameters?: CameraParameter): CameraControl3D;
|
|
148
|
+
protected _getCameraControl2D(): CameraControl2D;
|
|
149
|
+
protected _getCameraControlFirstPerson(): CameraControlFirstPerson;
|
|
140
150
|
}
|
package/lib/definitions/packages/planner-core/src/camera-control/camera-control-first-person.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CameraControl from '../../../common-core/src/cameracontrol/camera-control';
|
|
1
|
+
import CameraControl, { type CameraParameter } from '../../../common-core/src/cameracontrol/camera-control';
|
|
2
2
|
import type InputManager from '../../../common-core/src/input/input-manager';
|
|
3
3
|
import { PerspectiveCamera, Vector3 } from 'three';
|
|
4
4
|
export default class CameraControlFirstPerson extends CameraControl {
|
|
@@ -13,7 +13,7 @@ export default class CameraControlFirstPerson extends CameraControl {
|
|
|
13
13
|
private _listenerLoopAnimationFrame;
|
|
14
14
|
minPolarAngle: number;
|
|
15
15
|
maxPolarAngle: number;
|
|
16
|
-
constructor(creator: string, inputManager: InputManager,
|
|
16
|
+
constructor(creator: string, inputManager: InputManager, initialCameraParameters?: CameraParameter, camera?: PerspectiveCamera);
|
|
17
17
|
private _gamepadConnected;
|
|
18
18
|
private _gamepadDisconnected;
|
|
19
19
|
private startButtonPressListener;
|
|
@@ -101,6 +101,15 @@ export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlann
|
|
|
101
101
|
rotateSelection(rotateBy: number): void;
|
|
102
102
|
cancelSelection(reason?: CancelSelectionReasons): void;
|
|
103
103
|
init(element: HTMLElement, preloadPlanId?: string, options?: InitDataDefinition & GlobalInitDataDefinition): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* creates and loads a plan from a given object
|
|
106
|
+
* @param id
|
|
107
|
+
* @param position
|
|
108
|
+
* @param rotation
|
|
109
|
+
*
|
|
110
|
+
* return the object runtime id
|
|
111
|
+
*/
|
|
112
|
+
createPlanFromObject(id: RapiId, position?: Position3, rotation?: number): Promise<number>;
|
|
104
113
|
loadPlanXml(xml: string, options?: InitDataDefinition & GlobalInitDataDefinition): Promise<void>;
|
|
105
114
|
loadPlan(id: string, options?: InitDataDefinition & GlobalInitDataDefinition): Promise<RapiPlan | RapiPlanSnapshotGetData>;
|
|
106
115
|
/**
|
|
@@ -83,6 +83,7 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
83
83
|
beginPlanConstruction(plan: Plan): void;
|
|
84
84
|
addPlanMesh(plan: Plan, material: any, vertices: Float32Array, indices: Int32Array, uvCoords: Float32Array, normals: Float32Array, type: KernelEnum): void;
|
|
85
85
|
endPlanConstruction(plan: Plan): void;
|
|
86
|
+
createPlanFromObject(rapiElement: RapiItem | RapiConfiguration, position?: Position3, rotation?: number): Plan;
|
|
86
87
|
addPlanObjectFromItem(rapiElement: RapiItem | RapiConfiguration, position?: Position3, rotation?: number): Promise<RuntimeId>;
|
|
87
88
|
coupleReferences(jsObject: any, coreReference: KernelObject): void;
|
|
88
89
|
private _decoupleReferences;
|
|
@@ -51,6 +51,7 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
51
51
|
private _dragStartBounds;
|
|
52
52
|
currentSelection: SelectionPayload;
|
|
53
53
|
private _paperBackground;
|
|
54
|
+
private _cameraState;
|
|
54
55
|
private _debugSpheres;
|
|
55
56
|
constructor(creator: string, offset: CanvasOffset, plannerCallback: RoomlePlannerCallback, mode: Enumify<typeof CAMERA_TYPE>);
|
|
56
57
|
get configuratorContext(): import("../../../common-core/src/webgl/configurator-context").default;
|
|
@@ -70,6 +71,8 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
70
71
|
protected createCameraControl(mode: Enumify<typeof CAMERA_TYPE>, _offset: CanvasOffset): void;
|
|
71
72
|
startViewing(): void;
|
|
72
73
|
startConfiguring(): void;
|
|
74
|
+
private _setCameraPosition;
|
|
75
|
+
private _resetCameraPosition;
|
|
73
76
|
selectPlanObject(runtimeId: number): Promise<void>;
|
|
74
77
|
backToPlanner(): void;
|
|
75
78
|
private _getYRotationOfObject;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import CameraControl from '../../../common-core/src/cameracontrol/camera-control';
|
|
1
|
+
import CameraControl, { type CameraParameter } from '../../../common-core/src/cameracontrol/camera-control';
|
|
2
2
|
import type InputManager from '../../../common-core/src/input/input-manager';
|
|
3
3
|
import { PerspectiveCamera, Vector3 } from 'three';
|
|
4
4
|
export default class CameraControlFirstPerson extends CameraControl {
|
|
@@ -13,7 +13,7 @@ export default class CameraControlFirstPerson extends CameraControl {
|
|
|
13
13
|
private _listenerLoopAnimationFrame;
|
|
14
14
|
minPolarAngle: number;
|
|
15
15
|
maxPolarAngle: number;
|
|
16
|
-
constructor(creator: string, inputManager: InputManager,
|
|
16
|
+
constructor(creator: string, inputManager: InputManager, initialCameraParameters?: CameraParameter, camera?: PerspectiveCamera);
|
|
17
17
|
private _gamepadConnected;
|
|
18
18
|
private _gamepadDisconnected;
|
|
19
19
|
private startButtonPressListener;
|
|
@@ -101,6 +101,15 @@ export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlann
|
|
|
101
101
|
rotateSelection(rotateBy: number): void;
|
|
102
102
|
cancelSelection(reason?: CancelSelectionReasons): void;
|
|
103
103
|
init(element: HTMLElement, preloadPlanId?: string, options?: InitDataDefinition & GlobalInitDataDefinition): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* creates and loads a plan from a given object
|
|
106
|
+
* @param id
|
|
107
|
+
* @param position
|
|
108
|
+
* @param rotation
|
|
109
|
+
*
|
|
110
|
+
* return the object runtime id
|
|
111
|
+
*/
|
|
112
|
+
createPlanFromObject(id: RapiId, position?: Position3, rotation?: number): Promise<number>;
|
|
104
113
|
loadPlanXml(xml: string, options?: InitDataDefinition & GlobalInitDataDefinition): Promise<void>;
|
|
105
114
|
loadPlan(id: string, options?: InitDataDefinition & GlobalInitDataDefinition): Promise<RapiPlan | RapiPlanSnapshotGetData>;
|
|
106
115
|
/**
|
|
@@ -83,6 +83,7 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
83
83
|
beginPlanConstruction(plan: Plan): void;
|
|
84
84
|
addPlanMesh(plan: Plan, material: any, vertices: Float32Array, indices: Int32Array, uvCoords: Float32Array, normals: Float32Array, type: KernelEnum): void;
|
|
85
85
|
endPlanConstruction(plan: Plan): void;
|
|
86
|
+
createPlanFromObject(rapiElement: RapiItem | RapiConfiguration, position?: Position3, rotation?: number): Plan;
|
|
86
87
|
addPlanObjectFromItem(rapiElement: RapiItem | RapiConfiguration, position?: Position3, rotation?: number): Promise<RuntimeId>;
|
|
87
88
|
coupleReferences(jsObject: any, coreReference: KernelObject): void;
|
|
88
89
|
private _decoupleReferences;
|
|
@@ -51,6 +51,7 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
51
51
|
private _dragStartBounds;
|
|
52
52
|
currentSelection: SelectionPayload;
|
|
53
53
|
private _paperBackground;
|
|
54
|
+
private _cameraState;
|
|
54
55
|
private _debugSpheres;
|
|
55
56
|
constructor(creator: string, offset: CanvasOffset, plannerCallback: RoomlePlannerCallback, mode: Enumify<typeof CAMERA_TYPE>);
|
|
56
57
|
get configuratorContext(): import("../../../common-core/src/webgl/configurator-context").default;
|
|
@@ -70,6 +71,8 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
70
71
|
protected createCameraControl(mode: Enumify<typeof CAMERA_TYPE>, _offset: CanvasOffset): void;
|
|
71
72
|
startViewing(): void;
|
|
72
73
|
startConfiguring(): void;
|
|
74
|
+
private _setCameraPosition;
|
|
75
|
+
private _resetCameraPosition;
|
|
73
76
|
selectPlanObject(runtimeId: number): Promise<void>;
|
|
74
77
|
backToPlanner(): void;
|
|
75
78
|
private _getYRotationOfObject;
|
|
@@ -187,7 +190,7 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
187
190
|
getWallAngleDegrees(wall: WallPlanElementViewModel): number;
|
|
188
191
|
moveElementPosition(selectedElement: PlanElementViewModel, position: KernelVector3): void;
|
|
189
192
|
moveElementsPosition(selectedElements: PlanElementViewModel[], position: KernelVector3): void;
|
|
190
|
-
protected get plannerCameraBehaviour():
|
|
193
|
+
protected get plannerCameraBehaviour(): Planner2dCameraBehaviour | Planner3dCameraBehaviour | PlannerFpCameraBehaviour;
|
|
191
194
|
enableMeasurementLineDrawing(): void;
|
|
192
195
|
disableMeasurementLineDrawing(): void;
|
|
193
196
|
setCompletelyLoaded(completelyLoaded: boolean): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aW as normalizeRotation,H as dispose,_ as __decorate,i as inject,j as AsyncGuard,aX as AsyncDependencyLoader,ac as convertToTHREE}from"./roomle-dependency-injection-50955724.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,bo as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,b9 as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,bH as Line3,ad as Box3}from"./main-thread-to-worker-67108fb3.js";import{T as TextGeometry}from"./TextGeometry-35ad7588.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i){this._position.copy(e),this._cameraPosition=i,this._label=t;const s=this.getWorldPosition(new Vector3),n=this._cameraPosition.distanceTo(s),o=Math.max(.01,n/150),h=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=h,this._parameters.bevelSize=h,this._parameters.size=o,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new Quaternion;e.setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new Vector3)}else if(this._updateText(this._textGeometry,new Quaternion,new Vector3),this._cameraPosition){const e=this.getWorldPosition(new Vector3),t=normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this.parent.rotation.y);this._text.rotation.y=t,this._plane.rotation.y=t}}_updateText(e,t,i){let s=new Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new Vector3);e.center(),this._text.position.copy(s),t&&this._text.quaternion.copy(t);let o=new PlaneGeometry(n.x+.02,n.y+.02,32);o.center(),this._plane.geometry=o,this._plane.position.copy(s),t&&this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._objectRotation=0,this._cameraPosition=new Vector3,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new Group,this._dimensionTextGroup=new Object3D,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/lato_regular_sub-d4b30187185acc59.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToObject(this._object),this.addToUiScene(this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._dimensions||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new BufferGeometry,t=this._getWidthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let s=t.getCenter(new Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._widthText)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,n,this._cameraPosition)}_updateHeight(){let e=new BufferGeometry,t=this._getHeightEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let s=t.getCenter(new Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._heightText)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,n,this._cameraPosition)}_updateDepth(){let e=new BufferGeometry,t=this._getDepthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let s=t.getCenter(new Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._depthText)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(-1e3*this._dimensions.z);this._depthText.update(s,n,this._cameraPosition)}updateSize(e){this._origin=convertToTHREE(e.origin),this._dimensionLineGroup.position.x=this._origin.x-this._object.position.x,this._dimensionLineGroup.position.y=this._origin.y-this._object.position.y,this._dimensionLineGroup.position.z=this._origin.z-this._object.position.z,this._dimensions=convertToTHREE(e.size);const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToObject(e){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&e.add(this._dimensionLineGroup)}removeFromObject(e){e.remove(this._dimensionLineGroup),this.update()}addToUiScene(e){if(!(this._widthText&&this._heightText&&this._depthText&&this._object))return;const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this._dimensionTextGroup.rotation.y=this._objectRotation,e.add(this._dimensionTextGroup),this.update()}removeFromUiScene(e){e.remove(this._dimensionTextGroup),this.update()}_getWidthEdge(){const e=this._getRotation();return e>Math.PI/2||e<-Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(this._dimensions.x+.05,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(this._dimensions.x+.05,0,.05))}_getDepthEdge(){return this._getRotation()>0?new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,0,this._dimensions.z-.05))}_getHeightEdge(){const e=this._getRotation();return e>0&&e<Math.PI/2?new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,this._dimensions.y+.05,.05)):e>Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(-.05,this._dimensions.y+.05,this._dimensions.z-.05)):e<-Math.PI/2?new Line3(new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,this._dimensions.z-.05)):new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,.05))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this._topDimensions=!0,this.enableDimensions(),this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToObject(this._object),this.addToUiScene(this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromUiScene(this._uiScene),this.removeFromObject(this._object)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=e,this._dimensionTextGroup.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setObject(e,t=0){this._object=e,this._objectRotation=t}setUiScene(e){this._uiScene=e}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}_getRotation(){const e=this._object.getWorldPosition(new Vector3);return normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this._objectRotation)}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
import{aW as normalizeRotation,H as dispose,_ as __decorate,i as inject,j as AsyncGuard,aX as AsyncDependencyLoader,ac as convertToTHREE}from"./roomle-dependency-injection-7e094172.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,bo as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,b9 as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,bI as Line3,ad as Box3}from"./main-thread-to-worker-ee3036b3.js";import{T as TextGeometry}from"./TextGeometry-ab643210.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i){this._position.copy(e),this._cameraPosition=i,this._label=t;const s=this.getWorldPosition(new Vector3),n=this._cameraPosition.distanceTo(s),o=Math.max(.01,n/150),h=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=h,this._parameters.bevelSize=h,this._parameters.size=o,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new Quaternion;e.setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new Vector3)}else if(this._updateText(this._textGeometry,new Quaternion,new Vector3),this._cameraPosition){const e=this.getWorldPosition(new Vector3),t=normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this.parent.rotation.y);this._text.rotation.y=t,this._plane.rotation.y=t}}_updateText(e,t,i){let s=new Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new Vector3);e.center(),this._text.position.copy(s),t&&this._text.quaternion.copy(t);let o=new PlaneGeometry(n.x+.02,n.y+.02,32);o.center(),this._plane.geometry=o,this._plane.position.copy(s),t&&this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._objectRotation=0,this._cameraPosition=new Vector3,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new Group,this._dimensionTextGroup=new Object3D,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/lato_regular_sub-d4b30187185acc59.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToObject(this._object),this.addToUiScene(this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._dimensions||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new BufferGeometry,t=this._getWidthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let s=t.getCenter(new Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._widthText)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,n,this._cameraPosition)}_updateHeight(){let e=new BufferGeometry,t=this._getHeightEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let s=t.getCenter(new Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._heightText)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,n,this._cameraPosition)}_updateDepth(){let e=new BufferGeometry,t=this._getDepthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let s=t.getCenter(new Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._depthText)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(-1e3*this._dimensions.z);this._depthText.update(s,n,this._cameraPosition)}updateSize(e){this._origin=convertToTHREE(e.origin),this._dimensionLineGroup.position.x=this._origin.x-this._object.position.x,this._dimensionLineGroup.position.y=this._origin.y-this._object.position.y,this._dimensionLineGroup.position.z=this._origin.z-this._object.position.z,this._dimensions=convertToTHREE(e.size);const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToObject(e){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&e.add(this._dimensionLineGroup)}removeFromObject(e){e.remove(this._dimensionLineGroup),this.update()}addToUiScene(e){if(!(this._widthText&&this._heightText&&this._depthText&&this._object))return;const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this._dimensionTextGroup.rotation.y=this._objectRotation,e.add(this._dimensionTextGroup),this.update()}removeFromUiScene(e){e.remove(this._dimensionTextGroup),this.update()}_getWidthEdge(){const e=this._getRotation();return e>Math.PI/2||e<-Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(this._dimensions.x+.05,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(this._dimensions.x+.05,0,.05))}_getDepthEdge(){return this._getRotation()>0?new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,0,this._dimensions.z-.05))}_getHeightEdge(){const e=this._getRotation();return e>0&&e<Math.PI/2?new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,this._dimensions.y+.05,.05)):e>Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(-.05,this._dimensions.y+.05,this._dimensions.z-.05)):e<-Math.PI/2?new Line3(new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,this._dimensions.z-.05)):new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,.05))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this._topDimensions=!0,this.enableDimensions(),this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToObject(this._object),this.addToUiScene(this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromUiScene(this._uiScene),this.removeFromObject(this._object)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=e,this._dimensionTextGroup.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setObject(e,t=0){this._object=e,this._objectRotation=t}setUiScene(e){this._uiScene=e}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}_getRotation(){const e=this._object.getWorldPosition(new Vector3);return normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this._objectRotation)}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-7c58d2df.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-7c58d2df.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-d4b30187185acc59.json\""],"names":[],"mappings":"w7IAAe"}
|
package/lib/{dimensioning-helper-c3d3d1ae.nomodule.js → dimensioning-helper-9d940fd0.nomodule.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-c9ed110e.nomodule.js","./main-thread-to-worker-2529fa31.nomodule.js","./TextGeometry-cd81779b.nomodule.js"],(function(t){var i,e,s,n,h,o,a,_,d,r,p,m,l,c,x,u,g,w,b,y,T,L,z;return{setters:[function(t){i=t.aW,e=t.H,s=t._,n=t.i,h=t.j,o=t.aX,a=t.ac},function(t){_=t.O,d=t.a,r=t.h,p=t.w,m=t.bo,l=t.B,c=t.z,x=t.Q,u=t.b9,g=t.K,w=t.u,b=t.G,y=t.b,T=t.bI,L=t.ad},function(t){z=t.T}],execute:function(){const G="component_dimensioning_plane_material",M="component_dimensioning_text_material";class j extends _{constructor(t){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=t,this._position=new d,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(G)?this._planeMaterial=this._cacheHolder.materialCache.get(G):(this._planeMaterial=new r({color:16777215,side:p,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(G,this._planeMaterial)),this._cacheHolder.materialCache.has(M)?this._textMaterial=this._cacheHolder.materialCache.get(M):(this._textMaterial=new m({color:3618615}),this._cacheHolder.materialCache.set(M,this._textMaterial))}_init(){let t=new l;this._text=new c(t,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new c(t,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new z(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(t,i,e){this._position.copy(t),this._cameraPosition=e,this._label=i;const s=this.getWorldPosition(new d),n=this._cameraPosition.distanceTo(s),h=Math.max(.01,n/150),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new z(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let t=new x;t.setFromAxisAngle(new d(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,t,new d)}else if(this._updateText(this._textGeometry,new x,new d),this._cameraPosition){const t=this.getWorldPosition(new d),e=i(Math.atan2(this._cameraPosition.x-t.x,this._cameraPosition.z-t.z)-this.parent.rotation.y);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(t,i,e){let s=new d;s.copy(this._position),e.x*=this._getXSign(),s.add(e);let n=t.boundingBox.getSize(new d);t.center(),this._text.position.copy(s),i&&this._text.quaternion.copy(i);let h=new u(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),i&&this._plane.quaternion.copy(i)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){e(this)}}s([n],j.prototype,"_cacheHolder",void 0);class D{constructor(t){this._objectRotation=0,this._cameraPosition=new d,this._topDimensions=!1,this._initialized=new h,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new g,this._dimensionTextGroup=new _,this._creator_=t,this._lineMaterial=new w({color:3618615,linewidth:2});let i=new l;this._widthLine=new b(i,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new b(i,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new b(i,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new r({color:16777215,side:p,opacity:.8,transparent:!0}),o.loadFont("static/lato_regular_sub-d4b30187185acc59.json").then(t=>{this._font=t,this._loaded()})}_loaded(){this.update(!1),this.addToObject(this._object),this.addToUiScene(this._uiScene),this._initialized.resolve()}_performUpdate(t){this._enabled&&(this._dimensions||t)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let t=new l,i=this._getWidthEdge(),e=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];t.setAttribute("position",new y(new Float32Array(e),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=t;let s=i.getCenter(new d);this._widthText||(this._widthText=new j(this._font),this._dimensionTextGroup.add(this._widthText)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,n,this._cameraPosition)}_updateHeight(){let t=new l,i=this._getHeightEdge(),e=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];t.setAttribute("position",new y(new Float32Array(e),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=t;let s=i.getCenter(new d);this._heightText||(this._heightText=new j(this._font),this._dimensionTextGroup.add(this._heightText)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,n,this._cameraPosition)}_updateDepth(){let t=new l,i=this._getDepthEdge(),e=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];t.setAttribute("position",new y(new Float32Array(e),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=t;let s=i.getCenter(new d);this._depthText||(this._depthText=new j(this._font),this._dimensionTextGroup.add(this._depthText)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(-1e3*this._dimensions.z);this._depthText.update(s,n,this._cameraPosition)}updateSize(t){this._origin=a(t.origin),this._dimensionLineGroup.position.x=this._origin.x-this._object.position.x,this._dimensionLineGroup.position.y=this._origin.y-this._object.position.y,this._dimensionLineGroup.position.z=this._origin.z-this._object.position.z,this._dimensions=a(t.size);const i=this._dimensionLineGroup.localToWorld(new d);this._dimensionTextGroup.position.copy(i),this.update()}update(t=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(t)}addToObject(t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&t.add(this._dimensionLineGroup)}removeFromObject(t){t.remove(this._dimensionLineGroup),this.update()}addToUiScene(t){if(!(this._widthText&&this._heightText&&this._depthText&&this._object))return;const i=this._dimensionLineGroup.localToWorld(new d);this._dimensionTextGroup.position.copy(i),this._dimensionTextGroup.rotation.y=this._objectRotation,t.add(this._dimensionTextGroup),this.update()}removeFromUiScene(t){t.remove(this._dimensionTextGroup),this.update()}_getWidthEdge(){const t=this._getRotation();return t>Math.PI/2||t<-Math.PI/2?new T(new d(-.05,0,this._dimensions.z-.05),new d(this._dimensions.x+.05,0,this._dimensions.z-.05)):new T(new d(-.05,0,.05),new d(this._dimensions.x+.05,0,.05))}_getDepthEdge(){return this._getRotation()>0?new T(new d(.05+this._dimensions.x,0,.05),new d(.05+this._dimensions.x,0,this._dimensions.z-.05)):new T(new d(-.05,0,.05),new d(-.05,0,this._dimensions.z-.05))}_getHeightEdge(){const t=this._getRotation();return t>0&&t<Math.PI/2?new T(new d(-.05,0,.05),new d(-.05,this._dimensions.y+.05,.05)):t>Math.PI/2?new T(new d(-.05,0,this._dimensions.z-.05),new d(-.05,this._dimensions.y+.05,this._dimensions.z-.05)):t<-Math.PI/2?new T(new d(.05+this._dimensions.x,0,this._dimensions.z-.05),new d(.05+this._dimensions.x,this._dimensions.y+.05,this._dimensions.z-.05)):new T(new d(.05+this._dimensions.x,0,.05),new d(.05+this._dimensions.x,this._dimensions.y+.05,.05))}onDimensionsVisibilityChanged(t){this._onChange=t}enableTopDimensions(){this._topDimensions=!0,this.enableDimensions(),this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToObject(this._object),this.addToUiScene(this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromUiScene(this._uiScene),this.removeFromObject(this._object)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const t=new L;return t.expandByObject(this._widthLine),t.expandByObject(this._widthText),t.expandByObject(this._heightLine),t.expandByObject(this._heightText),t.expandByObject(this._depthLine),t.expandByObject(this._depthText),t}setVisibility(t){this._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=t,this._dimensionTextGroup.visible=t)}moveCameraStart(t){this.setVisibility(!1),this._cameraPosition=t,this.update()}moveCameraEnd(t){this.setVisibility(!0),this._cameraPosition=t,this.update()}clearScene(t){this._clear()}setObject(t,i=0){this._object=t,this._objectRotation=i}setUiScene(t){this._uiScene=t}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}_getRotation(){const t=this._object.getWorldPosition(new d);return i(Math.atan2(this._cameraPosition.x-t.x,this._cameraPosition.z-t.z)-this._objectRotation)}}t("default",D),s([n],D.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-9d940fd0.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-9d940fd0.nomodule.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-d4b30187185acc59.json\""],"names":[],"mappings":"w4HAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-af2758f6.js";import{aM as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,ag as getGUI,_ as __decorate,i as inject,u as CANVAS_ID,x as DynamicLightSettingLoader,y as PREDEFINED_LIGHTSETTING,H as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-7e094172.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-742d2a9f.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aR as getGlbUrl,bw as WebGLRenderer,i as SRGBColorSpace,bk as BasicShadowMap,N as PerspectiveCamera,bP as download}from"./main-thread-to-worker-ee3036b3.js";import{D as DefaultLightSetting}from"./default-light-setting-a107f5f2.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-364def6b.js";import"./query-params-helper-c9492f35.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,a,i){let n=new Vector3(-e.x/2,0,-e.z/2),s=new Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(n,s);let o=new Euler(-Math.PI/2+a,r,0,"ZYX"),c=(new Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new GlbViewerCameraBehaviour(new AdjustableCameraControl3D(this._creator_,this._getInputManager(),null),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const a=getGlbUrl(r);return a?this.loadGLB(a,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new Vector3(1,1,1),a){return this.clearScene(),new Promise((i,n)=>{this._loadGLB(e,new Vector3(0,0,0),0,void 0,r,void 0,void 0,a).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new Box3).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),this._readyForRender(),i()},n)})}preparePerspectiveImage(e,t,r){return new Promise(a=>{var i,n;t||(t=1e3),r||(r=1e3),e||((e=new WebGLRenderer({antialias:!0})).setSize(t,r),e.outputColorSpace=SRGBColorSpace,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=BasicShadowMap);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof PerspectiveCamera&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(i=this._lightSetting)||void 0===i||i.removeFromScene();let o=new DefaultLightSetting(this._scene);e.render(this._scene,s);let c=e.domElement.toDataURL();e.domElement.toBlob(e=>{a({image:c,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,a){if(this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D){let i=(new Box3).setFromObject(this._scene).getSize(new Vector3);this.cameraBehaviour.cameraControl.adjust(i,e,t,r,a),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new Box3).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}async moveCamera(e){return this.glbViewerCameraBehaviour.externalApiMoveCamera(e)}_readyForRender(){this._globalCallback.onReadyForRender()}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let a=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(a.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{download("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:a,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(t,r,a,i)}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}async moveCamera(e){return this._sceneManager.moveCamera(e)}get globalCallbacks(){return this._globalCallback}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalCallback",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-a51c1679.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-a51c1679.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"mzRAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as CameraBehaviour}from"./camera-behaviour-742d2a9f.js";class GlbViewerCameraBehaviour extends CameraBehaviour{get cameraControl(){return this._cameraControl}async updateCameraOnItemLoaded(a){await this.cameraControl.updateAndReset(a,!0)}async externalApiMoveCamera(a){await this.cameraControl.moveCamera(a),this._onCameraChanged()}}export{GlbViewerCameraBehaviour as G};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-364def6b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-364def6b.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./camera-behaviour-0c0e95a7.nomodule.js"],(function(e){var a;return{setters:[function(e){a=e.b}],execute:function(){e("G",class extends a{get cameraControl(){return this._cameraControl}async updateCameraOnItemLoaded(e){await this.cameraControl.updateAndReset(e,!0)}async externalApiMoveCamera(e){await this.cameraControl.moveCamera(e),this._onCameraChanged()}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-99f825f9.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-99f825f9.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./script-loader-5d01175d.nomodule.js","./roomle-dependency-injection-c9ed110e.nomodule.js","./camera-behaviour-0c0e95a7.nomodule.js","./main-thread-to-worker-2529fa31.nomodule.js","./default-light-setting-e0eeabc6.nomodule.js","./glb-viewer-camera-behaviour-99f825f9.nomodule.js","./query-params-helper-51a53f8c.nomodule.js"],(function(e){var t,r,i,a,n,s,o,h,c,l,d,u,m,_,g,p,v,w,b,C,f,S,L,M,B,y,I,x,G,E,j,F,O;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.aM,a=e.D,n=e.L,s=e.R,o=e.ag,h=e._,c=e.i,l=e.u,d=e.x,u=e.y,m=e.H,_=e.b},function(e){g=e.C,p=e.L,v=e.S,w=e.T},function(e){b=e.a,C=e.ad,f=e.ag,S=e.Q,L=e.A,M=e.C,B=e.aE,y=e.aR,I=e.bw,x=e.i,G=e.bk,E=e.N,j=e.bP},function(e){F=e.D},function(e){O=e.G},function(){}],execute:function(){const P=[new a("script-loader",t),new a("glb-input-manager",class extends i{},1),new a("logger",n),new a("rapi-access",s)];class D extends g{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,a){let n=new b(-e.x/2,0,-e.z/2),s=new b(e.x/2,e.y,e.z/2);this._boundingBox=new C(n,s);let o=new f(-Math.PI/2+i,r,0,"ZYX"),h=(new S).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class k extends p{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new L(new M(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=o();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new M(e)})}}}class R extends v{constructor(e,t){super(e,t,l.GLB,B.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(d.createDynamicLightSettingSource(null,u.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new k(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new O(new D(this._creator_,this._getInputManager(),null),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=y(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new b(1,1,1),i){return this.clearScene(),new Promise((a,n)=>{this._loadGLB(e,new b(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new C).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),this._readyForRender(),a()},n)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{var a,n;t||(t=1e3),r||(r=1e3),e||((e=new I({antialias:!0})).setSize(t,r),e.outputColorSpace=x,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=G);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof E&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(a=this._lightSetting)||void 0===a||a.removeFromScene();let o=new F(this._scene);e.render(this._scene,s);let h=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:h,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,i){if(this.cameraBehaviour.cameraControl instanceof D){let a=(new C).setFromObject(this._scene).getSize(new b);this.cameraBehaviour.cameraControl.adjust(a,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),m(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new C).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}async moveCamera(e){return this.glbViewerCameraBehaviour.externalApiMoveCamera(e)}_readyForRender(){this._globalCallback.onReadyForRender()}}h([c],R.prototype,"_glbInputManager",void 0),h([c],R.prototype,"_rapiAccess",void 0);class z{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new I({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=x}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new b(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class A{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(w,{id:"tween-js"})]).then(()=>{this._sceneManager=new R(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new b(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new z(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{j("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:a}=e;this._sceneManager.setEnvironmentMap(t,r,i,a)}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}async moveCamera(e){return this._sceneManager.moveCamera(e)}get globalCallbacks(){return this._globalCallback}}h([c],A.prototype,"_rapiAccess",void 0),h([c],A.prototype,"_domHelper",void 0),h([c],A.prototype,"_scriptLoader",void 0),h([c],A.prototype,"_lifeCycleManager",void 0),h([c],A.prototype,"_initData",void 0),h([c],A.prototype,"_globalInitData",void 0),h([c],A.prototype,"_globalCallback",void 0),h([c],A.prototype,"_unitFormatter",void 0),h([c],A.prototype,"_idbManager",void 0),e("GlbViewer",class extends r{setupGlobals(){}setupDependencies(){_.setup(P),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new A(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-f0e484c9.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-f0e484c9.nomodule.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"m0PAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{GlbViewer}from"./glb-viewer-a51c1679.js";import"./script-loader-af2758f6.js";import"./query-params-helper-c9492f35.js";import"./main-thread-to-worker-ee3036b3.js";import"./roomle-dependency-injection-7e094172.js";import"./camera-behaviour-742d2a9f.js";import"./default-light-setting-a107f5f2.js";import"./glb-viewer-camera-behaviour-364def6b.js";(new GlbViewer).boot();
|
|
2
|
+
//# sourceMappingURL=glb-viewer-main-5bd28680.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-main-5bd28680.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./glb-viewer-
|
|
1
|
+
System.register(["./glb-viewer-f0e484c9.nomodule.js","./script-loader-5d01175d.nomodule.js","./query-params-helper-51a53f8c.nomodule.js","./main-thread-to-worker-2529fa31.nomodule.js","./roomle-dependency-injection-c9ed110e.nomodule.js","./camera-behaviour-0c0e95a7.nomodule.js","./default-light-setting-e0eeabc6.nomodule.js","./glb-viewer-camera-behaviour-99f825f9.nomodule.js"],(function(){var e;return{setters:[function(n){e=n.GlbViewer},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
|
|
2
2
|
//# sourceMappingURL=glb-viewer-main.nomodule.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-
|
|
2
|
-
//# sourceMappingURL=TextGeometry-
|
|
1
|
+
System.register(["./main-thread-to-worker-7c2b8bc9.legacy.js"],(function(e){var t,i,n,h,o,r;return{setters:[function(e){t=e._,i=e.e,n=e.f,h=e.c2,o=e.h,r=e.c3}],execute:function(){e("T",function(e){t(d,e);var r=i(d);function d(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,d);var o=i.font;if(void 0===o)t=r.call(this);else{var s=o.generateShapes(e,i.size);void 0===i.depth&&void 0!==i.height&&console.warn("THREE.TextGeometry: .height is now depreciated. Please use .depth instead"),i.depth=void 0!==i.depth?i.depth:void 0!==i.height?i.height:50,void 0===i.bevelThickness&&(i.bevelThickness=10),void 0===i.bevelSize&&(i.bevelSize=8),void 0===i.bevelEnabled&&(i.bevelEnabled=!1),t=r.call(this,s,i)}return t.type="TextGeometry",h(t)}return o(d)}(r))}}}));
|
|
2
|
+
//# sourceMappingURL=TextGeometry-f4299b59.legacy.js.map
|
package/lib/legacy/{TextGeometry-2234cb5c.legacy.js.map → TextGeometry-f4299b59.legacy.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextGeometry-
|
|
1
|
+
{"version":3,"file":"TextGeometry-f4299b59.legacy.js","sources":["../../../node_modules/three/examples/jsm/geometries/TextGeometry.js"],"sourcesContent":["/**\n * Text = 3D Text\n *\n * parameters = {\n * font: <THREE.Font>, // font\n *\n * size: <float>, // size of the text\n * depth: <float>, // thickness to extrude text\n * curveSegments: <int>, // number of points on the curves\n *\n * bevelEnabled: <bool>, // turn on bevel\n * bevelThickness: <float>, // how deep into text bevel goes\n * bevelSize: <float>, // how far from text outline (including bevelOffset) is bevel\n * bevelOffset: <float> // how far from text outline does bevel start\n * }\n */\n\nimport {\n\tExtrudeGeometry\n} from 'three';\n\nclass TextGeometry extends ExtrudeGeometry {\n\n\tconstructor( text, parameters = {} ) {\n\n\t\tconst font = parameters.font;\n\n\t\tif ( font === undefined ) {\n\n\t\t\tsuper(); // generate default extrude geometry\n\n\t\t} else {\n\n\t\t\tconst shapes = font.generateShapes( text, parameters.size );\n\n\t\t\t// translate parameters to ExtrudeGeometry API\n\n\t\t\tif ( parameters.depth === undefined && parameters.height !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.TextGeometry: .height is now depreciated. Please use .depth instead' ); // @deprecated, r163\n\n\t\t\t}\n\n\t\t\tparameters.depth = parameters.depth !== undefined ?\n\t\t\t\tparameters.depth : parameters.height !== undefined ?\n\t\t\t\t\tparameters.height : 50;\n\n\t\t\t// defaults\n\n\t\t\tif ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10;\n\t\t\tif ( parameters.bevelSize === undefined ) parameters.bevelSize = 8;\n\t\t\tif ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false;\n\n\t\t\tsuper( shapes, parameters );\n\n\t\t}\n\n\t\tthis.type = 'TextGeometry';\n\n\t}\n\n}\n\n\nexport { TextGeometry };\n"],"names":["exports","_ExtrudeGeometry","_inherits","TextGeometry","_super","_createSuper","text","_this","parameters","arguments","length","undefined","_classCallCheck","font","call","shapes","generateShapes","size","depth","height","console","warn","bevelThickness","bevelSize","bevelEnabled","type","_possibleConstructorReturn","_createClass","ExtrudeGeometry"],"mappings":"mLAqBkBA,EAAA,aAAAC,GAAAC,EAAAC,EAAAF,GAAA,IAAAG,EAAAC,EAAAF,GAEjB,SAAAA,EAAaG,GAAwB,IAAAC,EAAlBC,EAAUC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAAEG,OAAAT,GAEjC,IAAMU,EAAOL,EAAWK,KAExB,QAAcF,IAATE,EAEJN,EAAAH,EAAAU,eAEM,CAEN,IAAMC,EAASF,EAAKG,eAAgBV,EAAME,EAAWS,WAI3BN,IAArBH,EAAWU,YAA6CP,IAAtBH,EAAWW,QAEjDC,QAAQC,KAAM,6EAIfb,EAAWU,WAA6BP,IAArBH,EAAWU,MAC7BV,EAAWU,WAA8BP,IAAtBH,EAAWW,OAC7BX,EAAWW,OAAS,QAIaR,IAA9BH,EAAWc,iBAA+Bd,EAAWc,eAAiB,SAC7CX,IAAzBH,EAAWe,YAA0Bf,EAAWe,UAAY,QAChCZ,IAA5BH,EAAWgB,eAA6BhB,EAAWgB,cAAe,GAEvEjB,EAAAH,EAAAU,KAAOC,KAAAA,EAAQP,GAIW,OAA3BD,EAAKkB,KAAO,eAAeC,EAAAnB,GAE3B,OAAAoB,EAAAxB,IAtCyByB"}
|
package/lib/legacy/{banana-for-scale-0879dc36.legacy.js → banana-for-scale-9d668a53.legacy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=banana-for-scale-
|
|
1
|
+
System.register(["./roomle-dependency-injection-b3e57924.legacy.js","./main-thread-to-worker-7c2b8bc9.legacy.js"],(function(e){var n,t,a,s,i;return{setters:[function(e){n=e.aY,t=e._,a=e.i},function(e){s=e.g,i=e.a}],execute:function(){class c extends n{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(s()+"static/banana-bbcc0e46fc0ee694.glb").then(e=>{this._banana=e.scene,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new i),n=this._bounds.getCenter(new i).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.1;this._banana.scale.copy(new i(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}e("default",c),t([a],c.prototype,"_staticItemLoader",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=banana-for-scale-9d668a53.legacy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana-for-scale-
|
|
1
|
+
{"version":3,"file":"banana-for-scale-9d668a53.legacy.js","sources":["../../../packages/configurator-core/public/geometry/banana.glb"],"sourcesContent":["export default \"static/banana-bbcc0e46fc0ee694.glb\""],"names":[],"mappings":"yTAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-
|
|
1
|
+
System.register(["./main-thread-to-worker-7c2b8bc9.legacy.js","./query-params-helper-aca6a1b1.legacy.js"],(function(){var e,r,t;return{setters:[function(t){e=t.M,r=t.g},function(e){t=e.g}],execute:function(){new class{_addIframe(){const e="website-to-measure";if(document.getElementById(e))return void console.error("Iframe already added! Check how this can happen");const r=t();if(!r.checkUrl)return void console.error("CAN NOT MEASURE WITHOUT A URL, add checkUrl queryParam. To encode call BudgeteerMeasure.encodeUrl(url: string)");let o=this.decodeUrl(r.checkUrl);const i=window.location.origin;if(!o.startsWith(i))return void console.error("CAN ONLY MEASURE SAME ORIGIN PLEASE CHECK",{origin:i,src:o});const n=t(o),a=Object.keys(n).length?"&":"?";n._measureTraffic||(o+=a+"_measureTraffic=true");const c=document.createElement("iframe");c.id=e,c.src=o,document.body.appendChild(c)}_isAlreadyActive(){return navigator.serviceWorker.controller&&-1!==navigator.serviceWorker.controller.scriptURL.indexOf("budgeteer.sw")&&"activated"===navigator.serviceWorker.controller.state}_handleActiveSw(){this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller),this._addIframe(),this._alreadyAdded=!0}constructor(){this._inLimbo=!1,this._alreadyAdded=!1,window.addEventListener("beforeunload",()=>this._inLimbo=!0),this._mainThreadToWorker=new e(this,navigator.serviceWorker),this._isAlreadyActive()?this._handleActiveSw():navigator.serviceWorker.register(r()+"static/budgeteer.sw-a4a226d2fc19672e.js",{scope:"../../"}).then(e=>{this._isAlreadyActive()&&this._handleActiveSw()},e=>console.error("Budgeteer registration failed: ",e)),navigator.serviceWorker.addEventListener("controllerchange",()=>this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller)),window.BudgeteerMeasure={encodeUrl:this.encodeUrl}}encodeUrl(e){return encodeURIComponent(e)}decodeUrl(e){return decodeURIComponent(e)}onCommand(e){if(!this._inLimbo)switch(e){case 6:this._alreadyAdded||this._addIframe()}}}}}}));
|
|
2
2
|
//# sourceMappingURL=budgeteer-measure.legacy.js.map
|