@roomle/web-sdk 2.70.0-alpha.8 → 2.70.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/component-raycast-helper-00644d78.js +2 -0
- package/lib/component-raycast-helper-00644d78.js.map +1 -0
- package/lib/component-raycast-helper-7096ac85.nomodule.js +2 -0
- package/lib/component-raycast-helper-7096ac85.nomodule.js.map +1 -0
- package/lib/{configurator-b9f1a342.nomodule.js → configurator-042540f4.nomodule.js} +2 -2
- package/lib/configurator-042540f4.nomodule.js.map +1 -0
- package/lib/{configurator-d18eebaf.js → configurator-ddc6e7ee.js} +2 -2
- package/lib/configurator-ddc6e7ee.js.map +1 -0
- package/lib/{configurator-main-c1770888.js → configurator-main-a2447b4e.js} +2 -2
- package/lib/configurator-main-a2447b4e.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/definitions/common-core/src/cameracontrol/camera-behaviour-3d.d.ts +5 -0
- package/lib/definitions/configurator-core/src/utils/component-raycast-helper.d.ts +4 -3
- package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +6 -2
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +1 -1
- package/lib/legacy/component-raycast-helper-bc6969aa.legacy.js +2 -0
- package/lib/legacy/component-raycast-helper-bc6969aa.legacy.js.map +1 -0
- package/lib/legacy/{configurator-a319db55.legacy.js → configurator-0fc2671b.legacy.js} +2 -2
- package/lib/legacy/configurator-0fc2671b.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{planner-b8a0e3fc.legacy.js → planner-21d8fa6f.legacy.js} +2 -2
- package/lib/legacy/{planner-b8a0e3fc.legacy.js.map → planner-21d8fa6f.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/roomle-configurator-16ba6944.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-16ba6944.legacy.js.map +1 -0
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/{planner-9c9e9ebf.nomodule.js → planner-08187203.nomodule.js} +2 -2
- package/lib/{planner-9c9e9ebf.nomodule.js.map → planner-08187203.nomodule.js.map} +1 -1
- package/lib/{planner-3fcfe328.js → planner-d90d3c90.js} +2 -2
- package/lib/{planner-3fcfe328.js.map → planner-d90d3c90.js.map} +1 -1
- package/lib/{planner-main-4bb772b8.js → planner-main-e8e0e4c7.js} +2 -2
- package/lib/planner-main-e8e0e4c7.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{roomle-configurator-41a3faa0.js → roomle-configurator-1ce108eb.js} +2 -2
- package/lib/roomle-configurator-1ce108eb.js.map +1 -0
- package/lib/roomle-configurator-32fee736.nomodule.js +2 -0
- package/lib/roomle-configurator-32fee736.nomodule.js.map +1 -0
- package/lib/{roomle-sdk-d74e16ec.js → roomle-sdk-37a4c9cd.js} +2 -2
- package/lib/roomle-sdk-37a4c9cd.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/package.json +2 -2
- package/lib/component-raycast-helper-98c7ea75.js +0 -2
- package/lib/component-raycast-helper-98c7ea75.js.map +0 -1
- package/lib/component-raycast-helper-db211262.nomodule.js +0 -2
- package/lib/component-raycast-helper-db211262.nomodule.js.map +0 -1
- package/lib/configurator-b9f1a342.nomodule.js.map +0 -1
- package/lib/configurator-d18eebaf.js.map +0 -1
- package/lib/configurator-main-c1770888.js.map +0 -1
- package/lib/legacy/component-raycast-helper-b58fb547.legacy.js +0 -2
- package/lib/legacy/component-raycast-helper-b58fb547.legacy.js.map +0 -1
- package/lib/legacy/configurator-a319db55.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-9aaf9f85.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-9aaf9f85.legacy.js.map +0 -1
- package/lib/planner-main-4bb772b8.js.map +0 -1
- package/lib/roomle-configurator-41a3faa0.js.map +0 -1
- package/lib/roomle-configurator-5517851a.nomodule.js +0 -2
- package/lib/roomle-configurator-5517851a.nomodule.js.map +0 -1
- package/lib/roomle-sdk-d74e16ec.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{bx as Raycaster,bN as throttle,z as Mesh,v as MeshStandardMaterial,ad as Box3,a as Vector3,bO as Frustum,k as Matrix4}from"./main-thread-to-worker-2003c1d9.js";import{$ as transitionTransparencyOfMaterial}from"./roomle-dependency-injection-9001109d.js";class ComponentRaycastHelper{constructor(){this._nonTransparentComponent=null,this._raycaster=new Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3),this._raycaster.layers.enable(4),this._raycaster.layers.enable(5),this._raycaster.layers.enable(6)}init(e,t){this._object=e,this._camera=t,this.checkComponentVisibility=throttle(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=throttle(this.checkPreviewVisibility,100).bind(this)}setCamera(e){this._camera=e}setObject(e){this._object=e}changeMaterialsOnSelect(e,t,a=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,a))}_changeMaterialsOnSelect(e,t,a=!1){if(e.children.length>0&&e.children.forEach(i=>{const s=t&&e.id===t.id||a,r=!(i instanceof Mesh);this._changeMaterialsOnSelect(i,t,(!s||!r)&&s)}),t)e instanceof Mesh&&e.material instanceof MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),a||transitionTransparencyOfMaterial(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof Mesh&&e.material instanceof MeshStandardMaterial){const{opacity:t,transparent:a}=e.userData.oldMaterial;transitionTransparencyOfMaterial(e,{opacity:t,transparent:a}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const a=(new Box3).setFromObject(e).getCenter(new Vector3),i=(new Vector3).subVectors(a,this._camera.position).normalize();this._raycaster.set(this._camera.position,i),this._raycaster.far=this._camera.position.distanceTo(a);const s=[];return this._raycaster.intersectObjects(this._object.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._object,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const a=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(a.length>1)return;const i=a[0];this.isComponentVisible(i)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,i)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new Frustum,a=(new Matrix4).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),i=new Box3;return t.setFromProjectionMatrix(a),e.map(e=>(e=>{const a=i.setFromObject(e).getCenter(new Vector3);return t.containsPoint(a)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,{id:-1}))}}export{ComponentRaycastHelper as default};
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-00644d78.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-00644d78.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./main-thread-to-worker-4d246b8d.nomodule.js","./roomle-dependency-injection-9ceffa50.nomodule.js"],(function(e){var t,i,n,s,a,r,c,o,l;return{setters:[function(e){t=e.bx,i=e.bN,n=e.z,s=e.v,a=e.ad,r=e.a,c=e.bO,o=e.k},function(e){l=e.$}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new t,this._raycaster.near=.1,this._raycaster.layers.enable(3),this._raycaster.layers.enable(4),this._raycaster.layers.enable(5),this._raycaster.layers.enable(6)}init(e,t){this._object=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}setCamera(e){this._camera=e}setObject(e){this._object=e}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,t,i=!1){if(e.children.length>0&&e.children.forEach(s=>{const a=t&&e.id===t.id||i,r=!(s instanceof n);this._changeMaterialsOnSelect(s,t,(!a||!r)&&a)}),t)e instanceof n&&e.material instanceof s&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||l(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof n&&e.material instanceof s){const{opacity:t,transparent:i}=e.userData.oldMaterial;l(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new a).setFromObject(e).getCenter(new r),n=(new r).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,n),this._raycaster.far=this._camera.position.distanceTo(i);const s=[];return this._raycaster.intersectObjects(this._object.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._object,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const n=i[0];this.isComponentVisible(n)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,n)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new c,i=(new o).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new a;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new r);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,{id:-1}))}})}}}));
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-7096ac85.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-7096ac85.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./script-loader-4c75ff92.nomodule.js","./roomle-dependency-injection-9ceffa50.nomodule.js","./camera-behaviour-510b2914.nomodule.js","./component-raycast-helper-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
System.register(["./script-loader-4c75ff92.nomodule.js","./roomle-dependency-injection-9ceffa50.nomodule.js","./camera-behaviour-510b2914.nomodule.js","./component-raycast-helper-7096ac85.nomodule.js","./roomle-configurator-32fee736.nomodule.js","./query-params-helper-bf0b71cd.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js","./default-light-setting-998bc8a2.nomodule.js"],(function(e){var o,n,t,r,c,i,a,s,l,u,p,d,f,h;return{setters:[function(e){o=e.S,n=e.M},function(e){t=e.D,r=e.L,c=e.R,i=e.a,a=e.C,s=e.b,l=e.A},function(e){u=e.C,p=e.a},function(e){d=e.default},function(e){f=e.C,h=e.R},function(){},function(){},function(){}],execute:function(){const m=[new t("logger",r),new t("rapi-access",c),new t("script-loader",o),new t("camera-control-3d",u),new t("camera-control",p),new t("data-syncer",i),new t("configurator-scene-manager",f,1),new t("configurator-view-model",a,1),new t("component-raycast-helper",d,0)];e("Configurator",class extends n{setupDependencies(){s.setup(m),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),o=this.lookup("rapi-access");this.lookup("dom-helper");const n=this.lookup("configurator-scene-manager");e&&e.cleanUp(),o&&o.cleanUp(),n&&n.cleanUp()}setupGlobals(e){const{kernelInstance:o,kernelContainer:n,planObjectId:t}=e||{};l.init({kernelInstance:o,kernelContainer:n,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new h(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
+
//# sourceMappingURL=configurator-042540f4.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-042540f4.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-8a74aea8.js";import{D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a as DataSyncer,C as ConfiguratorViewModel,b as RoomleDependencyInjection,A as AppContext}from"./roomle-dependency-injection-9001109d.js";import{C as CameraControl3D,a as CameraControl}from"./camera-behaviour-152f3965.js";import ComponentRaycastHelper from"./component-raycast-helper-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-8a74aea8.js";import{D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a as DataSyncer,C as ConfiguratorViewModel,b as RoomleDependencyInjection,A as AppContext}from"./roomle-dependency-injection-9001109d.js";import{C as CameraControl3D,a as CameraControl}from"./camera-behaviour-152f3965.js";import ComponentRaycastHelper from"./component-raycast-helper-00644d78.js";import{C as ConfiguratorSceneManager,R as RoomleConfigurator}from"./roomle-configurator-1ce108eb.js";import"./query-params-helper-8d88a29e.js";import"./main-thread-to-worker-2003c1d9.js";import"./default-light-setting-701866d7.js";const INJECTABLES=[new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess),new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("camera-control-3d",CameraControl3D),new DependencyInjectionAssignment("camera-control",CameraControl),new DependencyInjectionAssignment("data-syncer",DataSyncer),new DependencyInjectionAssignment("configurator-scene-manager",ConfiguratorSceneManager,1),new DependencyInjectionAssignment("configurator-view-model",ConfiguratorViewModel,1),new DependencyInjectionAssignment("component-raycast-helper",ComponentRaycastHelper,0)];class Configurator extends Main{setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access");this.lookup("dom-helper");const o=this.lookup("configurator-scene-manager");e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};AppContext.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new RoomleConfigurator(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}export{Configurator};
|
|
2
|
+
//# sourceMappingURL=configurator-ddc6e7ee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-ddc6e7ee.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Configurator}from"./configurator-
|
|
2
|
-
//# sourceMappingURL=configurator-main-
|
|
1
|
+
import{Configurator}from"./configurator-ddc6e7ee.js";import"./script-loader-8a74aea8.js";import"./query-params-helper-8d88a29e.js";import"./main-thread-to-worker-2003c1d9.js";import"./roomle-dependency-injection-9001109d.js";import"./camera-behaviour-152f3965.js";import"./component-raycast-helper-00644d78.js";import"./roomle-configurator-1ce108eb.js";import"./default-light-setting-701866d7.js";(new Configurator).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let o=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-o))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)});
|
|
2
|
+
//# sourceMappingURL=configurator-main-a2447b4e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-main-a2447b4e.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./configurator-
|
|
1
|
+
System.register(["./configurator-042540f4.nomodule.js","./script-loader-4c75ff92.nomodule.js","./query-params-helper-bf0b71cd.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js","./roomle-dependency-injection-9ceffa50.nomodule.js","./camera-behaviour-510b2914.nomodule.js","./component-raycast-helper-7096ac85.nomodule.js","./roomle-configurator-32fee736.nomodule.js","./default-light-setting-998bc8a2.nomodule.js"],(function(){var e;return{setters:[function(o){e=o.Configurator},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let o=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-o))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})}}}));
|
|
2
2
|
//# sourceMappingURL=configurator-main.nomodule.js.map
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import type { RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';
|
|
2
2
|
import type ConfiguratorSceneEventHandler from '../webgl/configurator-scene-event-handler';
|
|
3
3
|
import type ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';
|
|
4
|
-
import type { Object3D, PerspectiveCamera
|
|
4
|
+
import type { Object3D, PerspectiveCamera } from 'three';
|
|
5
5
|
export default class ComponentRaycastHelper {
|
|
6
|
-
private
|
|
6
|
+
private _object;
|
|
7
7
|
private _camera;
|
|
8
8
|
private _raycaster;
|
|
9
9
|
private _nonTransparentComponent;
|
|
10
10
|
constructor();
|
|
11
|
-
init(
|
|
11
|
+
init(object: Object3D, camera: PerspectiveCamera): void;
|
|
12
12
|
setCamera(camera: PerspectiveCamera): void;
|
|
13
|
+
setObject(object: Object3D): void;
|
|
13
14
|
changeMaterialsOnSelect(object: Object3D, component: RoomleComponent, selected?: boolean): void;
|
|
14
15
|
private _changeMaterialsOnSelect;
|
|
15
16
|
isComponentVisible(component: RoomleComponent): boolean;
|
|
@@ -6,8 +6,9 @@ import type { KernelComponent, PlanObject, UiPossibleChild } from '../../../typi
|
|
|
6
6
|
import type { SceneSettings } from '../../../common-core/src/scene-settings-loader';
|
|
7
7
|
import type { RapiMaterial } from '../../../typings/rapi-types';
|
|
8
8
|
import type ConfiguratorContext from '../../../common-core/src/webgl/configurator-context';
|
|
9
|
-
import type { ConfiguratorViewModelCallbackI } from '../../../common-core/src/view-model/configurator-view-model';
|
|
10
9
|
import type ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';
|
|
10
|
+
import { type ConfiguratorViewModelCallbackI } from '../../../common-core/src/view-model/configurator-view-model';
|
|
11
|
+
import type ComponentRaycastHelper from '../utils/component-raycast-helper';
|
|
11
12
|
import type { CameraParameter } from '../../../common-core/src/cameracontrol/camera-control';
|
|
12
13
|
import SceneManager from '../../../common-core/src/webgl/scene-manager';
|
|
13
14
|
import { type CAMERA_TYPE } from '../../../common-core/src/cameracontrol/camera-type';
|
|
@@ -17,6 +18,7 @@ import { Box3, Vector3 } from 'three';
|
|
|
17
18
|
import type { CameraTarget, PrepareImageOptions, RenderOptions } from '../../../common-core/src/webgl/image-renderer';
|
|
18
19
|
import ConfiguratorCameraBehaviour from '../../../common-core/src/cameracontrol/configurator-camera-behaviour';
|
|
19
20
|
import type CameraBehaviour from '../../../common-core/src/cameracontrol/camera-behaviour';
|
|
21
|
+
import type CameraBehaviour3d from '../../../common-core/src/cameracontrol/camera-behaviour-3d';
|
|
20
22
|
export default class ConfiguratorSceneManager extends SceneManager implements ConfiguratorViewModelCallbackI {
|
|
21
23
|
_creator_: string;
|
|
22
24
|
private _configuratorInputManager;
|
|
@@ -30,7 +32,7 @@ export default class ConfiguratorSceneManager extends SceneManager implements Co
|
|
|
30
32
|
protected _plannerKernelAccess: PlannerKernelAccess;
|
|
31
33
|
protected _viewModel: ConfiguratorViewModel;
|
|
32
34
|
private _componentFactory;
|
|
33
|
-
|
|
35
|
+
protected _componentRaycastHelper: ComponentRaycastHelper;
|
|
34
36
|
private _dimensionHelper;
|
|
35
37
|
private _uiIntersectionHelper;
|
|
36
38
|
private _sceneEventHandler;
|
|
@@ -133,8 +135,10 @@ export default class ConfiguratorSceneManager extends SceneManager implements Co
|
|
|
133
135
|
getGeometryBounds(): Box3;
|
|
134
136
|
sceneChanged(): void;
|
|
135
137
|
protected get configuratorCameraBehaviour(): ConfiguratorCameraBehaviour;
|
|
138
|
+
protected get cameraBehaviour3d(): CameraBehaviour3d;
|
|
136
139
|
protected _onCameraIdle(): boolean;
|
|
137
140
|
protected _onCameraMove(): boolean;
|
|
138
141
|
getComponent(componentRuntimeId: number): KernelComponent;
|
|
139
142
|
cameraBehaviourChanged(): void;
|
|
143
|
+
protected _setCameraControlListeners(): void;
|
|
140
144
|
}
|
|
@@ -88,7 +88,7 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
88
88
|
switchTo3D(): void;
|
|
89
89
|
switchToFirstPerson(): void;
|
|
90
90
|
protected onCameraChanged(): void;
|
|
91
|
-
|
|
91
|
+
protected _setCameraControlListeners(): void;
|
|
92
92
|
private _onCameraZoomChange;
|
|
93
93
|
private _setKernelZoomFactor;
|
|
94
94
|
private _setCeiling;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./main-thread-to-worker-b6add17c.legacy.js","./roomle-dependency-injection-4023fe40.legacy.js"],(function(e){var t,i,n,s,a,r,c,o,l;return{setters:[function(e){t=e.bH,i=e.bX,n=e.J,s=e.z,a=e.ak,r=e.a,c=e.bY,o=e.o},function(e){l=e.$}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new t,this._raycaster.near=.1,this._raycaster.layers.enable(3),this._raycaster.layers.enable(4),this._raycaster.layers.enable(5),this._raycaster.layers.enable(6)}init(e,t){this._object=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}setCamera(e){this._camera=e}setObject(e){this._object=e}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,t,i=!1){if(e.children.length>0&&e.children.forEach(s=>{const a=t&&e.id===t.id||i,r=!(s instanceof n);this._changeMaterialsOnSelect(s,t,(!a||!r)&&a)}),t)e instanceof n&&e.material instanceof s&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||l(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof n&&e.material instanceof s){const{opacity:t,transparent:i}=e.userData.oldMaterial;l(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new a).setFromObject(e).getCenter(new r),n=(new r).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,n),this._raycaster.far=this._camera.position.distanceTo(i);const s=[];return this._raycaster.intersectObjects(this._object.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._object,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const n=i[0];this.isComponentVisible(n)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,n)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new c,i=(new o).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new a;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new r);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,{id:-1}))}})}}}));
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-bc6969aa.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-bc6969aa.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./script-loader-f80cbdd3.legacy.js","./roomle-dependency-injection-4023fe40.legacy.js","./camera-behaviour-12bf66b1.legacy.js","./component-raycast-helper-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
System.register(["./script-loader-f80cbdd3.legacy.js","./roomle-dependency-injection-4023fe40.legacy.js","./camera-behaviour-12bf66b1.legacy.js","./component-raycast-helper-bc6969aa.legacy.js","./roomle-configurator-16ba6944.legacy.js","./query-params-helper-a1e13324.legacy.js","./main-thread-to-worker-b6add17c.legacy.js","./default-light-setting-894d1404.legacy.js"],(function(e){var n,o,t,a,r,c,i,s,l,u,p,g,d,f;return{setters:[function(e){n=e.S,o=e.M},function(e){t=e.D,a=e.L,r=e.R,c=e.a,i=e.C,s=e.b,l=e.A},function(e){u=e.C,p=e.a},function(e){g=e.default},function(e){d=e.C,f=e.R},function(){},function(){},function(){}],execute:function(){const h=[new t("logger",a),new t("rapi-access",r),new t("script-loader",n),new t("camera-control-3d",u),new t("camera-control",p),new t("data-syncer",c),new t("configurator-scene-manager",d,1),new t("configurator-view-model",i,1),new t("component-raycast-helper",g,0)];e("Configurator",class extends o{setupDependencies(){s.setup(h),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access");this.lookup("dom-helper");const o=this.lookup("configurator-scene-manager");e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};l.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new f(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
+
//# sourceMappingURL=configurator-0fc2671b.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-0fc2671b.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./configurator-
|
|
1
|
+
System.register(["./configurator-0fc2671b.legacy.js","./script-loader-f80cbdd3.legacy.js","./query-params-helper-a1e13324.legacy.js","./main-thread-to-worker-b6add17c.legacy.js","./roomle-dependency-injection-4023fe40.legacy.js","./camera-behaviour-12bf66b1.legacy.js","./component-raycast-helper-bc6969aa.legacy.js","./roomle-configurator-16ba6944.legacy.js","./default-light-setting-894d1404.legacy.js"],(function(){var e;return{setters:[function(n){e=n.Configurator},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let n=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-n))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})}}}));
|
|
2
2
|
//# sourceMappingURL=configurator-main.legacy.js.map
|