@shopware-ag/dive 1.15.5 → 1.16.1

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.
Files changed (143) hide show
  1. package/README.md +77 -40
  2. package/build/dive.cjs +665 -153
  3. package/build/dive.cjs.map +1 -1
  4. package/build/dive.d.cts +68 -52
  5. package/build/dive.d.ts +68 -52
  6. package/build/dive.js +706 -160
  7. package/build/dive.js.map +1 -1
  8. package/package.json +64 -60
  9. package/src/__test__/DIVE.test.ts +35 -31
  10. package/src/animation/AnimationSystem.ts +4 -4
  11. package/src/animation/__test__/AnimationSystem.test.ts +3 -3
  12. package/src/axiscamera/AxisCamera.ts +31 -11
  13. package/src/axiscamera/__test__/AxisCamera.test.ts +18 -10
  14. package/src/camera/PerspectiveCamera.ts +28 -13
  15. package/src/camera/__test__/PerspectiveCamera.test.ts +2 -2
  16. package/src/com/Communication.ts +297 -95
  17. package/src/com/__test__/Communication.test.ts +227 -140
  18. package/src/com/actions/camera/computeencompassingview.ts +7 -7
  19. package/src/com/actions/camera/getcameratransform.ts +7 -7
  20. package/src/com/actions/camera/movecamera.ts +15 -13
  21. package/src/com/actions/camera/resetcamera.ts +3 -3
  22. package/src/com/actions/camera/setcameralayer.ts +3 -3
  23. package/src/com/actions/camera/setcameratransform.ts +7 -7
  24. package/src/com/actions/camera/zoomcamera.ts +3 -3
  25. package/src/com/actions/index.ts +52 -50
  26. package/src/com/actions/media/generatemedia.ts +16 -13
  27. package/src/com/actions/object/addobject.ts +4 -4
  28. package/src/com/actions/object/deleteobject.ts +4 -4
  29. package/src/com/actions/object/deselectobject.ts +4 -4
  30. package/src/com/actions/object/getallobjects.ts +4 -4
  31. package/src/com/actions/object/getobjects.ts +4 -4
  32. package/src/com/actions/object/model/dropit.ts +3 -3
  33. package/src/com/actions/object/model/modelloaded.ts +3 -3
  34. package/src/com/actions/object/model/placeonfloor.ts +3 -3
  35. package/src/com/actions/object/selectobject.ts +4 -4
  36. package/src/com/actions/object/setparent.ts +7 -7
  37. package/src/com/actions/object/updateobject.ts +4 -4
  38. package/src/com/actions/scene/exportscene.ts +6 -0
  39. package/src/com/actions/scene/getallscenedata.ts +23 -18
  40. package/src/com/actions/scene/setbackground.ts +3 -3
  41. package/src/com/actions/scene/updatescene.ts +9 -9
  42. package/src/com/actions/toolbox/select/setgizmomode.ts +3 -3
  43. package/src/com/actions/toolbox/transform/setgizmovisible.ts +3 -3
  44. package/src/com/actions/toolbox/usetool.ts +4 -4
  45. package/src/com/types/COMBaseEntity.ts +2 -2
  46. package/src/com/types/COMEntity.ts +6 -6
  47. package/src/com/types/COMEntityType.ts +1 -1
  48. package/src/com/types/COMGeometry.ts +2 -2
  49. package/src/com/types/COMGroup.ts +3 -3
  50. package/src/com/types/COMLight.ts +3 -3
  51. package/src/com/types/COMMaterial.ts +2 -2
  52. package/src/com/types/COMModel.ts +4 -4
  53. package/src/com/types/COMPov.ts +3 -3
  54. package/src/com/types/COMPrimitive.ts +5 -5
  55. package/src/com/types/index.ts +10 -10
  56. package/src/constant/AxisHelperColors.ts +1 -1
  57. package/src/constant/GridColors.ts +1 -1
  58. package/src/controls/OrbitControls.ts +62 -29
  59. package/src/controls/__test__/OrbitControls.test.ts +133 -39
  60. package/src/dive.ts +82 -36
  61. package/src/gizmo/Gizmo.ts +21 -13
  62. package/src/gizmo/handles/AxisHandle.ts +40 -17
  63. package/src/gizmo/handles/RadialHandle.ts +39 -15
  64. package/src/gizmo/handles/ScaleHandle.ts +62 -25
  65. package/src/gizmo/plane/GizmoPlane.ts +5 -6
  66. package/src/gizmo/rotate/RotateGizmo.ts +58 -16
  67. package/src/gizmo/scale/ScaleGizmo.ts +37 -15
  68. package/src/gizmo/translate/TranslateGizmo.ts +34 -14
  69. package/src/grid/Grid.ts +13 -5
  70. package/src/grid/__test__/Grid.test.ts +5 -3
  71. package/src/group/Group.ts +9 -7
  72. package/src/group/__test__/Group.test.ts +8 -6
  73. package/src/helper/applyMixins/__test__/applyMixins.test.ts +9 -6
  74. package/src/helper/applyMixins/applyMixins.ts +6 -3
  75. package/src/helper/findInterface/__test__/findInterface.test.ts +28 -18
  76. package/src/helper/findInterface/findInterface.ts +7 -4
  77. package/src/helper/findSceneRecursive/__test__/findSceneRecursive.test.ts +1 -1
  78. package/src/helper/findSceneRecursive/findSceneRecursive.ts +1 -1
  79. package/src/helper/getObjectDelta/__test__/getObjectDelta.test.ts +43 -7
  80. package/src/helper/getObjectDelta/getObjectDelta.ts +13 -9
  81. package/src/helper/isInterface/__test__/implementsInterface.test.ts +1 -1
  82. package/src/helper/isInterface/implementsInterface.ts +6 -3
  83. package/src/info/Info.ts +20 -16
  84. package/src/info/__test__/Info.test.ts +67 -36
  85. package/src/interface/Draggable.ts +2 -2
  86. package/src/interface/Hoverable.ts +2 -2
  87. package/src/interface/Movable.ts +1 -1
  88. package/src/interface/Rotatable.ts +1 -1
  89. package/src/interface/Scalable.ts +1 -1
  90. package/src/io/IO.ts +85 -0
  91. package/src/io/__test__/IO.test.ts +99 -0
  92. package/src/io/gltf/GLTFIO.ts +56 -0
  93. package/src/io/gltf/__test__/GLTFIO.test.ts +185 -0
  94. package/src/light/PointLight.ts +42 -9
  95. package/src/light/SceneLight.ts +5 -5
  96. package/src/light/__test__/AmbientLight.test.ts +5 -4
  97. package/src/light/__test__/PointLight.test.ts +14 -10
  98. package/src/light/__test__/SceneLight.test.ts +19 -13
  99. package/src/loadingmanager/LoadingManager.ts +11 -6
  100. package/src/loadingmanager/__test__/LoadingManager.test.ts +14 -9
  101. package/src/math/__test__/DIVEMath.test.ts +1 -1
  102. package/src/math/ceil/__test__/ceilExp.test.ts +1 -1
  103. package/src/math/ceil/ceilExp.ts +2 -2
  104. package/src/math/floor/__test__/floorExp.test.ts +1 -1
  105. package/src/math/floor/floorExp.ts +2 -2
  106. package/src/math/helper/__test__/shift.test.ts +1 -1
  107. package/src/math/helper/shift.ts +1 -1
  108. package/src/math/index.ts +7 -7
  109. package/src/math/round/__test__/roundExp.test.ts +1 -1
  110. package/src/math/round/roundExp.ts +6 -3
  111. package/src/math/signedAngleTo/__test__/signedAngleTo.test.ts +10 -4
  112. package/src/math/signedAngleTo/signedAngleTo.ts +11 -4
  113. package/src/math/toFixed/__test__/toFixedExp.test.ts +9 -9
  114. package/src/math/toFixed/toFixedExp.ts +6 -3
  115. package/src/math/truncate/__test__/truncateExp.test.ts +1 -1
  116. package/src/math/truncate/truncateExp.ts +6 -3
  117. package/src/mediacreator/MediaCreator.ts +20 -10
  118. package/src/mediacreator/__test__/MediaCreator.test.ts +27 -12
  119. package/src/model/Model.ts +35 -7
  120. package/src/model/__test__/Model.test.ts +71 -44
  121. package/src/node/Node.ts +34 -12
  122. package/src/node/__test__/Node.test.ts +17 -13
  123. package/src/primitive/Primitive.ts +78 -13
  124. package/src/primitive/__test__/Primitive.test.ts +49 -38
  125. package/src/primitive/floor/Floor.ts +14 -3
  126. package/src/primitive/floor/__test__/Floor.test.ts +10 -4
  127. package/src/renderer/Renderer.ts +46 -15
  128. package/src/renderer/__test__/Renderer.test.ts +74 -24
  129. package/src/scene/Scene.ts +9 -3
  130. package/src/scene/__test__/Scene.test.ts +2 -2
  131. package/src/scene/root/Root.ts +142 -75
  132. package/src/scene/root/__test__/Root.test.ts +439 -111
  133. package/src/toolbox/BaseTool.ts +69 -33
  134. package/src/toolbox/Toolbox.ts +37 -17
  135. package/src/toolbox/__test__/BaseTool.test.ts +324 -160
  136. package/src/toolbox/__test__/Toolbox.test.ts +31 -14
  137. package/src/toolbox/select/SelectTool.ts +24 -19
  138. package/src/toolbox/select/__test__/SelectTool.test.ts +95 -59
  139. package/src/toolbox/transform/TransformTool.ts +40 -17
  140. package/src/toolbox/transform/__test__/TransformTool.test.ts +22 -15
  141. package/src/types/SceneObjects.ts +8 -8
  142. package/src/types/SceneType.ts +14 -0
  143. package/src/types/index.ts +3 -4
package/build/dive.cjs CHANGED
@@ -158,12 +158,18 @@ var init_BaseTool = __esm({
158
158
  break;
159
159
  }
160
160
  this._lastPointerDown.copy(this._pointer);
161
- this._draggable = findInterface((_a = this._intersects[0]) == null ? void 0 : _a.object, "isDraggable") || null;
161
+ this._draggable = findInterface(
162
+ (_a = this._intersects[0]) == null ? void 0 : _a.object,
163
+ "isDraggable"
164
+ ) || null;
162
165
  }
163
166
  onDragStart(e) {
164
167
  if (!this._draggable) return;
165
168
  if (this._dragRaycastOnObjects !== null) {
166
- this._intersects = this._raycaster.intersectObjects(this._dragRaycastOnObjects, true);
169
+ this._intersects = this._raycaster.intersectObjects(
170
+ this._dragRaycastOnObjects,
171
+ true
172
+ );
167
173
  }
168
174
  if (this._intersects.length === 0) return;
169
175
  this._dragStart.copy(this._intersects[0].point.clone());
@@ -187,24 +193,32 @@ var init_BaseTool = __esm({
187
193
  this._pointer.y = -(e.offsetY / this._canvas.clientHeight) * 2 + 1;
188
194
  this._raycaster.setFromCamera(this._pointer, this._controller.object);
189
195
  this._intersects = this.raycast(this._scene.children);
190
- const hoverable = findInterface((_a = this._intersects[0]) == null ? void 0 : _a.object, "isHoverable");
196
+ const hoverable = findInterface(
197
+ (_a = this._intersects[0]) == null ? void 0 : _a.object,
198
+ "isHoverable"
199
+ );
191
200
  if (this._intersects[0] && hoverable) {
192
201
  if (!this._hovered) {
193
- if (hoverable.onPointerEnter) hoverable.onPointerEnter(this._intersects[0]);
202
+ if (hoverable.onPointerEnter)
203
+ hoverable.onPointerEnter(this._intersects[0]);
194
204
  this._hovered = hoverable;
195
205
  return;
196
206
  }
197
207
  if (this._hovered.uuid !== hoverable.uuid) {
198
- if (this._hovered.onPointerLeave) this._hovered.onPointerLeave();
199
- if (hoverable.onPointerEnter) hoverable.onPointerEnter(this._intersects[0]);
208
+ if (this._hovered.onPointerLeave)
209
+ this._hovered.onPointerLeave();
210
+ if (hoverable.onPointerEnter)
211
+ hoverable.onPointerEnter(this._intersects[0]);
200
212
  this._hovered = hoverable;
201
213
  return;
202
214
  }
203
- if (hoverable.onPointerOver) hoverable.onPointerOver(this._intersects[0]);
215
+ if (hoverable.onPointerOver)
216
+ hoverable.onPointerOver(this._intersects[0]);
204
217
  this._hovered = hoverable;
205
218
  } else {
206
219
  if (this._hovered) {
207
- if (this._hovered.onPointerLeave) this._hovered.onPointerLeave();
220
+ if (this._hovered.onPointerLeave)
221
+ this._hovered.onPointerLeave();
208
222
  }
209
223
  this._hovered = null;
210
224
  }
@@ -217,13 +231,19 @@ var init_BaseTool = __esm({
217
231
  }
218
232
  onDrag(e) {
219
233
  if (this._dragRaycastOnObjects !== null) {
220
- this._intersects = this._raycaster.intersectObjects(this._dragRaycastOnObjects, true);
234
+ this._intersects = this._raycaster.intersectObjects(
235
+ this._dragRaycastOnObjects,
236
+ true
237
+ );
221
238
  }
222
239
  const intersect = this._intersects[0];
223
240
  if (!intersect) return;
224
241
  this._dragCurrent.copy(intersect.point.clone());
225
242
  this._dragEnd.copy(intersect.point.clone());
226
- this._dragDelta.subVectors(this._dragCurrent.clone(), this._dragStart.clone());
243
+ this._dragDelta.subVectors(
244
+ this._dragCurrent.clone(),
245
+ this._dragStart.clone()
246
+ );
227
247
  if (this._draggable && this._draggable.onDrag) {
228
248
  this._draggable.onDrag({
229
249
  dragStart: this._dragStart,
@@ -261,7 +281,10 @@ var init_BaseTool = __esm({
261
281
  if (intersect) {
262
282
  this._dragEnd.copy(intersect.point.clone());
263
283
  this._dragCurrent.copy(intersect.point.clone());
264
- this._dragDelta.subVectors(this._dragCurrent.clone(), this._dragStart.clone());
284
+ this._dragDelta.subVectors(
285
+ this._dragCurrent.clone(),
286
+ this._dragStart.clone()
287
+ );
265
288
  }
266
289
  if (this._draggable && this._draggable.onDragEnd) {
267
290
  this._draggable.onDragEnd({
@@ -282,7 +305,8 @@ var init_BaseTool = __esm({
282
305
  onWheel(e) {
283
306
  }
284
307
  raycast(objects) {
285
- if (objects !== void 0) return this._raycaster.intersectObjects(objects, true).filter((i) => i.object.visible);
308
+ if (objects !== void 0)
309
+ return this._raycaster.intersectObjects(objects, true).filter((i) => i.object.visible);
286
310
  return this._raycaster.intersectObjects(this._scene.children, true).filter((i) => i.object.visible);
287
311
  }
288
312
  pointerWasDragged() {
@@ -305,22 +329,37 @@ var init_TransformTool = __esm({
305
329
  super(scene, controller);
306
330
  this.isTransformTool = true;
307
331
  this.name = "DIVETransformTool";
308
- this._gizmo = new import_Addons.TransformControls(this._controller.object, this._controller.domElement);
332
+ this._gizmo = new import_Addons.TransformControls(
333
+ this._controller.object,
334
+ this._controller.domElement
335
+ );
309
336
  this._gizmo.mode = "translate";
310
337
  this._gizmo.addEventListener("mouseDown", () => {
311
338
  controller.enabled = false;
312
- if (!implementsInterface(this._gizmo.object, "isMovable")) return;
339
+ if (!implementsInterface(
340
+ this._gizmo.object,
341
+ "isMovable"
342
+ ))
343
+ return;
313
344
  if (!this._gizmo.object.onMoveStart) return;
314
345
  this._gizmo.object.onMoveStart();
315
346
  });
316
347
  this._gizmo.addEventListener("objectChange", () => {
317
- if (!implementsInterface(this._gizmo.object, "isMovable")) return;
348
+ if (!implementsInterface(
349
+ this._gizmo.object,
350
+ "isMovable"
351
+ ))
352
+ return;
318
353
  if (!this._gizmo.object.onMove) return;
319
354
  this._gizmo.object.onMove();
320
355
  });
321
356
  this._gizmo.addEventListener("mouseUp", () => {
322
357
  controller.enabled = true;
323
- if (!implementsInterface(this._gizmo.object, "isMovable")) return;
358
+ if (!implementsInterface(
359
+ this._gizmo.object,
360
+ "isMovable"
361
+ ))
362
+ return;
324
363
  if (!this._gizmo.object.onMoveEnd) return;
325
364
  this._gizmo.object.onMoveEnd();
326
365
  });
@@ -396,7 +435,10 @@ var init_SelectTool = __esm({
396
435
  onClick(e) {
397
436
  super.onClick(e);
398
437
  const first = this._raycaster.intersectObjects(this._scene.Root.children, true).filter((intersect) => intersect.object.visible)[0];
399
- const selectable = findInterface(first == null ? void 0 : first.object, "isSelectable");
438
+ const selectable = findInterface(
439
+ first == null ? void 0 : first.object,
440
+ "isSelectable"
441
+ );
400
442
  if (!first || !selectable) {
401
443
  if (this._gizmo.object) {
402
444
  this.Deselect(this._gizmo.object);
@@ -499,6 +541,101 @@ var init_MediaCreator = __esm({
499
541
  }
500
542
  });
501
543
 
544
+ // src/io/gltf/GLTFIO.ts
545
+ var import_GLTFLoader, import_GLTFExporter, DIVEGLTFIO;
546
+ var init_GLTFIO = __esm({
547
+ "src/io/gltf/GLTFIO.ts"() {
548
+ "use strict";
549
+ import_GLTFLoader = require("three/examples/jsm/loaders/GLTFLoader");
550
+ import_GLTFExporter = require("three/examples/jsm/exporters/GLTFExporter");
551
+ DIVEGLTFIO = class {
552
+ constructor() {
553
+ this._importer = new import_GLTFLoader.GLTFLoader();
554
+ this._exporter = new import_GLTFExporter.GLTFExporter();
555
+ }
556
+ Import(url, onProgress) {
557
+ return this._importer.loadAsync(url, (progress) => {
558
+ if (!onProgress) return;
559
+ onProgress(progress.loaded / progress.total);
560
+ });
561
+ }
562
+ Export(object, binary, onlyVisible) {
563
+ if (binary) {
564
+ return this._exporter.parseAsync(object, {
565
+ binary,
566
+ onlyVisible
567
+ });
568
+ } else {
569
+ return this._exporter.parseAsync(object, {
570
+ binary,
571
+ onlyVisible
572
+ });
573
+ }
574
+ }
575
+ };
576
+ }
577
+ });
578
+
579
+ // src/io/IO.ts
580
+ var IO_exports = {};
581
+ __export(IO_exports, {
582
+ DIVEIO: () => DIVEIO
583
+ });
584
+ var DIVEIO;
585
+ var init_IO = __esm({
586
+ "src/io/IO.ts"() {
587
+ "use strict";
588
+ init_GLTFIO();
589
+ DIVEIO = class {
590
+ constructor(scene) {
591
+ this._scene = scene;
592
+ this._gltfIO = new DIVEGLTFIO();
593
+ }
594
+ Import(type, url) {
595
+ return this._importFromURL(type, url).catch((error) => {
596
+ console.error(error);
597
+ return null;
598
+ });
599
+ }
600
+ Export(type) {
601
+ return this._exportToURL(type).catch((error) => {
602
+ console.error(error);
603
+ return null;
604
+ });
605
+ }
606
+ _importFromURL(type, url) {
607
+ switch (type) {
608
+ case "glb": {
609
+ return this._gltfIO.Import(url);
610
+ }
611
+ default: {
612
+ return Promise.reject("Unsupported file type: " + type);
613
+ }
614
+ }
615
+ }
616
+ _exportToURL(type) {
617
+ switch (type) {
618
+ case "glb": {
619
+ return new Promise((resolve, reject) => {
620
+ this._gltfIO.Export(this._scene, true, true).then((data) => {
621
+ resolve(this._createBlobURL(data));
622
+ }).catch((error) => {
623
+ reject(error);
624
+ });
625
+ });
626
+ }
627
+ default: {
628
+ return Promise.reject("Unsupported file type: " + type);
629
+ }
630
+ }
631
+ }
632
+ _createBlobURL(data) {
633
+ return URL.createObjectURL(new Blob([data]));
634
+ }
635
+ };
636
+ }
637
+ });
638
+
502
639
  // src/dive.ts
503
640
  var dive_exports = {};
504
641
  __export(dive_exports, {
@@ -685,12 +822,19 @@ var _DIVECommunication = class _DIVECommunication {
685
822
  this.controller = controls;
686
823
  this.toolbox = toolbox;
687
824
  this._mediaGenerator = null;
825
+ this._io = null;
688
826
  _DIVECommunication.__instances.push(this);
689
827
  }
690
828
  static get(id) {
691
- const fromComID = this.__instances.find((instance) => instance.id === id);
829
+ const fromComID = this.__instances.find(
830
+ (instance) => instance.id === id
831
+ );
692
832
  if (fromComID) return fromComID;
693
- return this.__instances.find((instance) => Array.from(instance.registered.values()).find((object) => object.id === id));
833
+ return this.__instances.find(
834
+ (instance) => Array.from(instance.registered.values()).find(
835
+ (object) => object.id === id
836
+ )
837
+ );
694
838
  }
695
839
  get id() {
696
840
  return this._id;
@@ -698,12 +842,25 @@ var _DIVECommunication = class _DIVECommunication {
698
842
  get mediaGenerator() {
699
843
  if (!this._mediaGenerator) {
700
844
  const DIVEMediaCreator2 = (init_MediaCreator(), __toCommonJS(MediaCreator_exports)).DIVEMediaCreator;
701
- this._mediaGenerator = new DIVEMediaCreator2(this.renderer, this.scene, this.controller);
845
+ this._mediaGenerator = new DIVEMediaCreator2(
846
+ this.renderer,
847
+ this.scene,
848
+ this.controller
849
+ );
702
850
  }
703
851
  return this._mediaGenerator;
704
852
  }
853
+ get io() {
854
+ if (!this._io) {
855
+ const DIVEIO2 = (init_IO(), __toCommonJS(IO_exports)).DIVEIO;
856
+ this._io = new DIVEIO2(this.scene);
857
+ }
858
+ return this._io;
859
+ }
705
860
  DestroyInstance() {
706
- const existingIndex = _DIVECommunication.__instances.findIndex((entry) => entry.id === this.id);
861
+ const existingIndex = _DIVECommunication.__instances.findIndex(
862
+ (entry) => entry.id === this.id
863
+ );
707
864
  if (existingIndex === -1) return false;
708
865
  _DIVECommunication.__instances.splice(existingIndex, 1);
709
866
  return true;
@@ -712,103 +869,159 @@ var _DIVECommunication = class _DIVECommunication {
712
869
  let returnValue = false;
713
870
  switch (action) {
714
871
  case "GET_ALL_SCENE_DATA": {
715
- returnValue = this.getAllSceneData(payload);
872
+ returnValue = this.getAllSceneData(
873
+ payload
874
+ );
716
875
  break;
717
876
  }
718
877
  case "GET_ALL_OBJECTS": {
719
- returnValue = this.getAllObjects(payload);
878
+ returnValue = this.getAllObjects(
879
+ payload
880
+ );
720
881
  break;
721
882
  }
722
883
  case "GET_OBJECTS": {
723
- returnValue = this.getObjects(payload);
884
+ returnValue = this.getObjects(
885
+ payload
886
+ );
724
887
  break;
725
888
  }
726
889
  case "ADD_OBJECT": {
727
- returnValue = this.addObject(payload);
890
+ returnValue = this.addObject(
891
+ payload
892
+ );
728
893
  break;
729
894
  }
730
895
  case "UPDATE_OBJECT": {
731
- returnValue = this.updateObject(payload);
896
+ returnValue = this.updateObject(
897
+ payload
898
+ );
732
899
  break;
733
900
  }
734
901
  case "DELETE_OBJECT": {
735
- returnValue = this.deleteObject(payload);
902
+ returnValue = this.deleteObject(
903
+ payload
904
+ );
736
905
  break;
737
906
  }
738
907
  case "SELECT_OBJECT": {
739
- returnValue = this.selectObject(payload);
908
+ returnValue = this.selectObject(
909
+ payload
910
+ );
740
911
  break;
741
912
  }
742
913
  case "DESELECT_OBJECT": {
743
- returnValue = this.deselectObject(payload);
914
+ returnValue = this.deselectObject(
915
+ payload
916
+ );
744
917
  break;
745
918
  }
746
919
  case "SET_BACKGROUND": {
747
- returnValue = this.setBackground(payload);
920
+ returnValue = this.setBackground(
921
+ payload
922
+ );
748
923
  break;
749
924
  }
750
925
  case "DROP_IT": {
751
- returnValue = this.dropIt(payload);
926
+ returnValue = this.dropIt(
927
+ payload
928
+ );
752
929
  break;
753
930
  }
754
931
  case "PLACE_ON_FLOOR": {
755
- returnValue = this.placeOnFloor(payload);
932
+ returnValue = this.placeOnFloor(
933
+ payload
934
+ );
756
935
  break;
757
936
  }
758
937
  case "SET_CAMERA_TRANSFORM": {
759
- returnValue = this.setCameraTransform(payload);
938
+ returnValue = this.setCameraTransform(
939
+ payload
940
+ );
760
941
  break;
761
942
  }
762
943
  case "GET_CAMERA_TRANSFORM": {
763
- returnValue = this.getCameraTransform(payload);
944
+ returnValue = this.getCameraTransform(
945
+ payload
946
+ );
764
947
  break;
765
948
  }
766
949
  case "MOVE_CAMERA": {
767
- returnValue = this.moveCamera(payload);
950
+ returnValue = this.moveCamera(
951
+ payload
952
+ );
768
953
  break;
769
954
  }
770
955
  case "RESET_CAMERA": {
771
- returnValue = this.resetCamera(payload);
956
+ returnValue = this.resetCamera(
957
+ payload
958
+ );
772
959
  break;
773
960
  }
774
961
  case "COMPUTE_ENCOMPASSING_VIEW": {
775
- returnValue = this.computeEncompassingView(payload);
962
+ returnValue = this.computeEncompassingView(
963
+ payload
964
+ );
776
965
  break;
777
966
  }
778
967
  case "SET_CAMERA_LAYER": {
779
- returnValue = this.setCameraLayer(payload);
968
+ returnValue = this.setCameraLayer(
969
+ payload
970
+ );
780
971
  break;
781
972
  }
782
973
  case "ZOOM_CAMERA": {
783
- returnValue = this.zoomCamera(payload);
974
+ returnValue = this.zoomCamera(
975
+ payload
976
+ );
784
977
  break;
785
978
  }
786
979
  case "SET_GIZMO_MODE": {
787
- returnValue = this.setGizmoMode(payload);
980
+ returnValue = this.setGizmoMode(
981
+ payload
982
+ );
788
983
  break;
789
984
  }
790
985
  case "SET_GIZMO_VISIBILITY": {
791
- returnValue = this.setGizmoVisibility(payload);
986
+ returnValue = this.setGizmoVisibility(
987
+ payload
988
+ );
792
989
  break;
793
990
  }
794
991
  case "USE_TOOL": {
795
- returnValue = this.useTool(payload);
992
+ returnValue = this.useTool(
993
+ payload
994
+ );
796
995
  break;
797
996
  }
798
997
  case "MODEL_LOADED": {
799
- returnValue = this.modelLoaded(payload);
998
+ returnValue = this.modelLoaded(
999
+ payload
1000
+ );
800
1001
  break;
801
1002
  }
802
1003
  case "UPDATE_SCENE": {
803
- returnValue = this.updateScene(payload);
1004
+ returnValue = this.updateScene(
1005
+ payload
1006
+ );
804
1007
  break;
805
1008
  }
806
1009
  case "GENERATE_MEDIA": {
807
- returnValue = this.generateMedia(payload);
1010
+ returnValue = this.generateMedia(
1011
+ payload
1012
+ );
808
1013
  break;
809
1014
  }
810
1015
  case "SET_PARENT": {
811
- returnValue = this.setParent(payload);
1016
+ returnValue = this.setParent(
1017
+ payload
1018
+ );
1019
+ break;
1020
+ }
1021
+ case "EXPORT_SCENE": {
1022
+ returnValue = this.exportScene(
1023
+ payload
1024
+ );
812
1025
  break;
813
1026
  }
814
1027
  }
@@ -821,7 +1034,9 @@ var _DIVECommunication = class _DIVECommunication {
821
1034
  return () => {
822
1035
  const listenerArray = this.listeners.get(type);
823
1036
  if (!listenerArray) return false;
824
- const existingIndex = listenerArray.findIndex((entry) => entry === listener);
1037
+ const existingIndex = listenerArray.findIndex(
1038
+ (entry) => entry === listener
1039
+ );
825
1040
  if (existingIndex === -1) return false;
826
1041
  listenerArray.splice(existingIndex, 1);
827
1042
  return true;
@@ -844,11 +1059,21 @@ var _DIVECommunication = class _DIVECommunication {
844
1059
  target: this.controller.target.clone()
845
1060
  },
846
1061
  spotmarks: [],
847
- lights: Array.from(this.registered.values()).filter((object) => object.entityType === "light"),
848
- objects: Array.from(this.registered.values()).filter((object) => object.entityType === "model"),
849
- cameras: Array.from(this.registered.values()).filter((object) => object.entityType === "pov"),
850
- primitives: Array.from(this.registered.values()).filter((object) => object.entityType === "primitive"),
851
- groups: Array.from(this.registered.values()).filter((object) => object.entityType === "group")
1062
+ lights: Array.from(this.registered.values()).filter(
1063
+ (object) => object.entityType === "light"
1064
+ ),
1065
+ objects: Array.from(this.registered.values()).filter(
1066
+ (object) => object.entityType === "model"
1067
+ ),
1068
+ cameras: Array.from(this.registered.values()).filter(
1069
+ (object) => object.entityType === "pov"
1070
+ ),
1071
+ primitives: Array.from(this.registered.values()).filter(
1072
+ (object) => object.entityType === "primitive"
1073
+ ),
1074
+ groups: Array.from(this.registered.values()).filter(
1075
+ (object) => object.entityType === "group"
1076
+ )
852
1077
  };
853
1078
  Object.assign(payload, sceneData);
854
1079
  return sceneData;
@@ -878,7 +1103,10 @@ var _DIVECommunication = class _DIVECommunication {
878
1103
  if (!objectToUpdate) return false;
879
1104
  this.registered.set(payload.id, (0, import_lodash.merge)(objectToUpdate, payload));
880
1105
  const updatedObject = this.registered.get(payload.id);
881
- this.scene.UpdateSceneObject(__spreadProps(__spreadValues({}, payload), { id: updatedObject.id, entityType: updatedObject.entityType }));
1106
+ this.scene.UpdateSceneObject(__spreadProps(__spreadValues({}, payload), {
1107
+ id: updatedObject.id,
1108
+ entityType: updatedObject.entityType
1109
+ }));
882
1110
  Object.assign(payload, updatedObject);
883
1111
  return true;
884
1112
  }
@@ -956,7 +1184,12 @@ var _DIVECommunication = class _DIVECommunication {
956
1184
  position = payload.position;
957
1185
  target = payload.target;
958
1186
  }
959
- this.controller.MoveTo(position, target, payload.duration, payload.locked);
1187
+ this.controller.MoveTo(
1188
+ position,
1189
+ target,
1190
+ payload.duration,
1191
+ payload.locked
1192
+ );
960
1193
  return true;
961
1194
  }
962
1195
  setCameraLayer(payload) {
@@ -996,10 +1229,14 @@ var _DIVECommunication = class _DIVECommunication {
996
1229
  }
997
1230
  updateScene(payload) {
998
1231
  if (payload.name !== void 0) this.scene.name = payload.name;
999
- if (payload.backgroundColor !== void 0) this.scene.SetBackground(payload.backgroundColor);
1000
- if (payload.gridEnabled !== void 0) this.scene.Grid.SetVisibility(payload.gridEnabled);
1001
- if (payload.floorEnabled !== void 0) this.scene.Floor.SetVisibility(payload.floorEnabled);
1002
- if (payload.floorColor !== void 0) this.scene.Floor.SetColor(payload.floorColor);
1232
+ if (payload.backgroundColor !== void 0)
1233
+ this.scene.SetBackground(payload.backgroundColor);
1234
+ if (payload.gridEnabled !== void 0)
1235
+ this.scene.Grid.SetVisibility(payload.gridEnabled);
1236
+ if (payload.floorEnabled !== void 0)
1237
+ this.scene.Floor.SetVisibility(payload.floorEnabled);
1238
+ if (payload.floorColor !== void 0)
1239
+ this.scene.Floor.SetColor(payload.floorColor);
1003
1240
  payload.name = this.scene.name;
1004
1241
  payload.backgroundColor = "#" + this.scene.background.getHexString();
1005
1242
  payload.gridEnabled = this.scene.Grid.visible;
@@ -1017,7 +1254,12 @@ var _DIVECommunication = class _DIVECommunication {
1017
1254
  position = payload.position;
1018
1255
  target = payload.target;
1019
1256
  }
1020
- payload.dataUri = this.mediaGenerator.GenerateMedia(position, target, payload.width, payload.height);
1257
+ payload.dataUri = this.mediaGenerator.GenerateMedia(
1258
+ position,
1259
+ target,
1260
+ payload.width,
1261
+ payload.height
1262
+ );
1021
1263
  return true;
1022
1264
  }
1023
1265
  setParent(payload) {
@@ -1045,6 +1287,9 @@ var _DIVECommunication = class _DIVECommunication {
1045
1287
  parentObject.attach(sceneObject);
1046
1288
  return true;
1047
1289
  }
1290
+ exportScene(payload) {
1291
+ return this.io.Export(payload.type);
1292
+ }
1048
1293
  };
1049
1294
  _DIVECommunication.__instances = [];
1050
1295
  var DIVECommunication = _DIVECommunication;
@@ -1067,8 +1312,17 @@ var DIVEPointLight = class extends import_three5.Object3D {
1067
1312
  this.light.shadow.mapSize.height = 512;
1068
1313
  this.add(this.light);
1069
1314
  const geoSize = 0.1;
1070
- const geometry = new import_three5.SphereGeometry(geoSize, geoSize * 320, geoSize * 320);
1071
- const material = new import_three5.MeshBasicMaterial({ color: this.light.color, transparent: true, opacity: 0.8, side: import_three5.FrontSide });
1315
+ const geometry = new import_three5.SphereGeometry(
1316
+ geoSize,
1317
+ geoSize * 320,
1318
+ geoSize * 320
1319
+ );
1320
+ const material = new import_three5.MeshBasicMaterial({
1321
+ color: this.light.color,
1322
+ transparent: true,
1323
+ opacity: 0.8,
1324
+ side: import_three5.FrontSide
1325
+ });
1072
1326
  this.mesh = new import_three5.Mesh(geometry, material);
1073
1327
  this.mesh.layers.mask = UI_LAYER_MASK;
1074
1328
  this.add(this.mesh);
@@ -1086,15 +1340,24 @@ var DIVEPointLight = class extends import_three5.Object3D {
1086
1340
  }
1087
1341
  onMove() {
1088
1342
  var _a;
1089
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position });
1343
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1344
+ "UPDATE_OBJECT",
1345
+ { id: this.userData.id, position: this.position }
1346
+ );
1090
1347
  }
1091
1348
  onSelect() {
1092
1349
  var _a;
1093
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("SELECT_OBJECT", { id: this.userData.id });
1350
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1351
+ "SELECT_OBJECT",
1352
+ { id: this.userData.id }
1353
+ );
1094
1354
  }
1095
1355
  onDeselect() {
1096
1356
  var _a;
1097
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("DESELECT_OBJECT", { id: this.userData.id });
1357
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1358
+ "DESELECT_OBJECT",
1359
+ { id: this.userData.id }
1360
+ );
1098
1361
  }
1099
1362
  };
1100
1363
 
@@ -1180,22 +1443,44 @@ var DIVENode = class extends import_three7.Object3D {
1180
1443
  SetToWorldOrigin() {
1181
1444
  var _a;
1182
1445
  this.position.set(0, 0, 0);
1183
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position, rotation: this.rotation, scale: this.scale });
1446
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1447
+ "UPDATE_OBJECT",
1448
+ {
1449
+ id: this.userData.id,
1450
+ position: this.position,
1451
+ rotation: this.rotation,
1452
+ scale: this.scale
1453
+ }
1454
+ );
1184
1455
  }
1185
1456
  onMove() {
1186
1457
  var _a;
1187
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position, rotation: this.rotation, scale: this.scale });
1458
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1459
+ "UPDATE_OBJECT",
1460
+ {
1461
+ id: this.userData.id,
1462
+ position: this.position,
1463
+ rotation: this.rotation,
1464
+ scale: this.scale
1465
+ }
1466
+ );
1188
1467
  if (this.parent && "isDIVEGroup" in this.parent) {
1189
1468
  this.parent.UpdateLineTo(this);
1190
1469
  }
1191
1470
  }
1192
1471
  onSelect() {
1193
1472
  var _a;
1194
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("SELECT_OBJECT", { id: this.userData.id });
1473
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1474
+ "SELECT_OBJECT",
1475
+ { id: this.userData.id }
1476
+ );
1195
1477
  }
1196
1478
  onDeselect() {
1197
1479
  var _a;
1198
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("DESELECT_OBJECT", { id: this.userData.id });
1480
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1481
+ "DESELECT_OBJECT",
1482
+ { id: this.userData.id }
1483
+ );
1199
1484
  }
1200
1485
  };
1201
1486
 
@@ -1266,20 +1551,36 @@ var DIVEModel = class extends DIVENode {
1266
1551
  PlaceOnFloor() {
1267
1552
  var _a;
1268
1553
  this.position.y = -this._boundingBox.min.y * this.scale.y;
1269
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position, rotation: this.rotation, scale: this.scale });
1554
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1555
+ "UPDATE_OBJECT",
1556
+ {
1557
+ id: this.userData.id,
1558
+ position: this.position,
1559
+ rotation: this.rotation,
1560
+ scale: this.scale
1561
+ }
1562
+ );
1270
1563
  }
1271
1564
  DropIt() {
1272
1565
  var _a;
1273
1566
  if (!this.parent) {
1274
- console.warn("DIVEModel: DropIt() called on a model that is not in the scene.", this);
1567
+ console.warn(
1568
+ "DIVEModel: DropIt() called on a model that is not in the scene.",
1569
+ this
1570
+ );
1275
1571
  return;
1276
1572
  }
1277
1573
  const bottomY = this._boundingBox.min.y * this.scale.y;
1278
- const bbBottomCenter = this.localToWorld(this._boundingBox.getCenter(new import_three8.Vector3()).multiply(this.scale));
1574
+ const bbBottomCenter = this.localToWorld(
1575
+ this._boundingBox.getCenter(new import_three8.Vector3()).multiply(this.scale)
1576
+ );
1279
1577
  bbBottomCenter.y = bottomY + this.position.y;
1280
1578
  const raycaster = new import_three8.Raycaster(bbBottomCenter, new import_three8.Vector3(0, -1, 0));
1281
1579
  raycaster.layers.mask = PRODUCT_LAYER_MASK;
1282
- const intersections = raycaster.intersectObjects(findSceneRecursive(this).Root.children, true);
1580
+ const intersections = raycaster.intersectObjects(
1581
+ findSceneRecursive(this).Root.children,
1582
+ true
1583
+ );
1283
1584
  if (intersections.length > 0) {
1284
1585
  const mesh = intersections[0].object;
1285
1586
  mesh.geometry.computeBoundingBox();
@@ -1289,7 +1590,15 @@ var DIVEModel = class extends DIVENode {
1289
1590
  const newPos = this.position.clone().setY(worldPos.y).sub(new import_three8.Vector3(0, bottomY, 0));
1290
1591
  this.position.copy(newPos);
1291
1592
  if (this.position.y === oldPos.y) return;
1292
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position, rotation: this.rotation, scale: this.scale });
1593
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1594
+ "UPDATE_OBJECT",
1595
+ {
1596
+ id: this.userData.id,
1597
+ position: this.position,
1598
+ rotation: this.rotation,
1599
+ scale: this.scale
1600
+ }
1601
+ );
1293
1602
  }
1294
1603
  }
1295
1604
  };
@@ -1302,7 +1611,9 @@ var DIVELoadingManager = class {
1302
1611
  this.progress = /* @__PURE__ */ new Map();
1303
1612
  this.gltfloader = new import_Addons2.GLTFLoader();
1304
1613
  this.dracoloader = new import_Addons2.DRACOLoader();
1305
- this.dracoloader.setDecoderPath("https://www.gstatic.com/draco/v1/decoders/");
1614
+ this.dracoloader.setDecoderPath(
1615
+ "https://www.gstatic.com/draco/v1/decoders/"
1616
+ );
1306
1617
  this.gltfloader.setDRACOLoader(this.dracoloader);
1307
1618
  }
1308
1619
  LoadGLTF(uri) {
@@ -1381,20 +1692,36 @@ var DIVEPrimitive = class extends DIVENode {
1381
1692
  PlaceOnFloor() {
1382
1693
  var _a;
1383
1694
  this.position.y = -this._boundingBox.min.y * this.scale.y;
1384
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position, rotation: this.rotation, scale: this.scale });
1695
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1696
+ "UPDATE_OBJECT",
1697
+ {
1698
+ id: this.userData.id,
1699
+ position: this.position,
1700
+ rotation: this.rotation,
1701
+ scale: this.scale
1702
+ }
1703
+ );
1385
1704
  }
1386
1705
  DropIt() {
1387
1706
  var _a;
1388
1707
  if (!this.parent) {
1389
- console.warn("DIVEPrimitive: DropIt() called on a model that is not in the scene.", this);
1708
+ console.warn(
1709
+ "DIVEPrimitive: DropIt() called on a model that is not in the scene.",
1710
+ this
1711
+ );
1390
1712
  return;
1391
1713
  }
1392
1714
  const bottomY = this._boundingBox.min.y * this.scale.y;
1393
- const bbBottomCenter = this.localToWorld(this._boundingBox.getCenter(new import_three9.Vector3()).multiply(this.scale));
1715
+ const bbBottomCenter = this.localToWorld(
1716
+ this._boundingBox.getCenter(new import_three9.Vector3()).multiply(this.scale)
1717
+ );
1394
1718
  bbBottomCenter.y = bottomY + this.position.y;
1395
1719
  const raycaster = new import_three9.Raycaster(bbBottomCenter, new import_three9.Vector3(0, -1, 0));
1396
1720
  raycaster.layers.mask = PRODUCT_LAYER_MASK;
1397
- const intersections = raycaster.intersectObjects(findSceneRecursive(this).Root.children, true);
1721
+ const intersections = raycaster.intersectObjects(
1722
+ findSceneRecursive(this).Root.children,
1723
+ true
1724
+ );
1398
1725
  if (intersections.length > 0) {
1399
1726
  const mesh = intersections[0].object;
1400
1727
  mesh.geometry.computeBoundingBox();
@@ -1404,7 +1731,15 @@ var DIVEPrimitive = class extends DIVENode {
1404
1731
  const newPos = this.position.clone().setY(worldPos.y).sub(new import_three9.Vector3(0, bottomY, 0));
1405
1732
  this.position.copy(newPos);
1406
1733
  if (this.position.y === oldPos.y) return;
1407
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position, rotation: this.rotation, scale: this.scale });
1734
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1735
+ "UPDATE_OBJECT",
1736
+ {
1737
+ id: this.userData.id,
1738
+ position: this.position,
1739
+ rotation: this.rotation,
1740
+ scale: this.scale
1741
+ }
1742
+ );
1408
1743
  }
1409
1744
  }
1410
1745
  assembleGeometry(geometry) {
@@ -1424,13 +1759,21 @@ var DIVEPrimitive = class extends DIVENode {
1424
1759
  case "plane":
1425
1760
  return this.createPlaneGeometry(geometry);
1426
1761
  default: {
1427
- console.warn("DIVEPrimitive: Invalid geometry type:", geometry.name.toLowerCase());
1762
+ console.warn(
1763
+ "DIVEPrimitive: Invalid geometry type:",
1764
+ geometry.name.toLowerCase()
1765
+ );
1428
1766
  return new import_three9.BufferGeometry();
1429
1767
  }
1430
1768
  }
1431
1769
  }
1432
1770
  createCylinderGeometry(geometry) {
1433
- const geo = new import_three9.CylinderGeometry(geometry.width / 2, geometry.width / 2, geometry.height, 64);
1771
+ const geo = new import_three9.CylinderGeometry(
1772
+ geometry.width / 2,
1773
+ geometry.width / 2,
1774
+ geometry.height,
1775
+ 64
1776
+ );
1434
1777
  geo.translate(0, geometry.height / 2, 0);
1435
1778
  return geo;
1436
1779
  }
@@ -1439,13 +1782,23 @@ var DIVEPrimitive = class extends DIVENode {
1439
1782
  return geo;
1440
1783
  }
1441
1784
  createPyramidGeometry(geometry) {
1442
- const geo = new import_three9.ConeGeometry(geometry.width / 2, geometry.height, 4, 1, true);
1785
+ const geo = new import_three9.ConeGeometry(
1786
+ geometry.width / 2,
1787
+ geometry.height,
1788
+ 4,
1789
+ 1,
1790
+ true
1791
+ );
1443
1792
  geo.rotateY(Math.PI / 4);
1444
1793
  geo.translate(0, geometry.height / 2, 0);
1445
1794
  return geo;
1446
1795
  }
1447
1796
  createBoxGeometry(geometry) {
1448
- const geo = new import_three9.BoxGeometry(geometry.width, geometry.height, geometry.depth);
1797
+ const geo = new import_three9.BoxGeometry(
1798
+ geometry.width,
1799
+ geometry.height,
1800
+ geometry.depth
1801
+ );
1449
1802
  geo.translate(0, geometry.height / 2, 0);
1450
1803
  return geo;
1451
1804
  }
@@ -1455,12 +1808,21 @@ var DIVEPrimitive = class extends DIVENode {
1455
1808
  return geo;
1456
1809
  }
1457
1810
  createWallGeometry(geometry) {
1458
- const geo = new import_three9.BoxGeometry(geometry.width, geometry.height, geometry.depth || 0.05, 16);
1811
+ const geo = new import_three9.BoxGeometry(
1812
+ geometry.width,
1813
+ geometry.height,
1814
+ geometry.depth || 0.05,
1815
+ 16
1816
+ );
1459
1817
  geo.translate(0, geometry.height / 2, 0);
1460
1818
  return geo;
1461
1819
  }
1462
1820
  createPlaneGeometry(geometry) {
1463
- const geo = new import_three9.BoxGeometry(geometry.width, geometry.height, geometry.depth);
1821
+ const geo = new import_three9.BoxGeometry(
1822
+ geometry.width,
1823
+ geometry.height,
1824
+ geometry.depth
1825
+ );
1464
1826
  geo.translate(0, geometry.height / 2, 0);
1465
1827
  return geo;
1466
1828
  }
@@ -1531,7 +1893,10 @@ var DIVEGroup = class extends DIVENode {
1531
1893
  * Updates a line to the object.
1532
1894
  */
1533
1895
  updateLineTo(line, object) {
1534
- line.geometry.setFromPoints([new import_three10.Vector3(0, 0, 0), object.position.clone()]);
1896
+ line.geometry.setFromPoints([
1897
+ new import_three10.Vector3(0, 0, 0),
1898
+ object.position.clone()
1899
+ ]);
1535
1900
  line.computeLineDistances();
1536
1901
  }
1537
1902
  // public SetBoundingBoxVisibility(visible: boolean): void {
@@ -1709,20 +2074,39 @@ var DIVERoot = class extends import_three11.Object3D {
1709
2074
  break;
1710
2075
  }
1711
2076
  default: {
1712
- console.warn(`DIVERoot.updateLight: Unknown light type: ${light.type}`);
2077
+ console.warn(
2078
+ `DIVERoot.updateLight: Unknown light type: ${light.type}`
2079
+ );
1713
2080
  return;
1714
2081
  }
1715
2082
  }
1716
2083
  sceneObject.userData.id = light.id;
1717
2084
  this.add(sceneObject);
1718
2085
  }
1719
- if (light.name !== void 0 && light.name !== null) sceneObject.name = light.name;
1720
- if (light.position !== void 0 && light.position !== null) sceneObject.position.set(light.position.x, light.position.y, light.position.z);
1721
- if (light.intensity !== void 0 && light.intensity !== null) sceneObject.SetIntensity(light.intensity);
1722
- if (light.enabled !== void 0 && light.enabled !== null) sceneObject.SetEnabled(light.enabled);
1723
- if (light.color !== void 0 && light.color !== null) sceneObject.SetColor(new import_three11.Color(light.color));
1724
- if (light.visible !== void 0 && light.visible !== null) sceneObject.visible = light.visible;
1725
- if (light.parentId !== void 0) this.setParent(__spreadProps(__spreadValues({}, light), { parentId: light.parentId }));
2086
+ if (light.name !== void 0 && light.name !== null)
2087
+ sceneObject.name = light.name;
2088
+ if (light.position !== void 0 && light.position !== null)
2089
+ sceneObject.position.set(
2090
+ light.position.x,
2091
+ light.position.y,
2092
+ light.position.z
2093
+ );
2094
+ if (light.intensity !== void 0 && light.intensity !== null)
2095
+ sceneObject.SetIntensity(
2096
+ light.intensity
2097
+ );
2098
+ if (light.enabled !== void 0 && light.enabled !== null)
2099
+ sceneObject.SetEnabled(
2100
+ light.enabled
2101
+ );
2102
+ if (light.color !== void 0 && light.color !== null)
2103
+ sceneObject.SetColor(
2104
+ new import_three11.Color(light.color)
2105
+ );
2106
+ if (light.visible !== void 0 && light.visible !== null)
2107
+ sceneObject.visible = light.visible;
2108
+ if (light.parentId !== void 0)
2109
+ this.setParent(__spreadProps(__spreadValues({}, light), { parentId: light.parentId }));
1726
2110
  }
1727
2111
  updateModel(model) {
1728
2112
  let sceneObject = this.GetSceneObject(model);
@@ -1736,16 +2120,25 @@ var DIVERoot = class extends import_three11.Object3D {
1736
2120
  this.loadingManager.LoadGLTF(model.uri).then((gltf) => {
1737
2121
  var _a;
1738
2122
  sceneObject.SetModel(gltf);
1739
- (_a = DIVECommunication.get(model.id)) == null ? void 0 : _a.PerformAction("MODEL_LOADED", { id: model.id });
2123
+ (_a = DIVECommunication.get(model.id)) == null ? void 0 : _a.PerformAction(
2124
+ "MODEL_LOADED",
2125
+ { id: model.id }
2126
+ );
1740
2127
  });
1741
2128
  }
1742
2129
  if (model.name !== void 0) sceneObject.name = model.name;
1743
- if (model.position !== void 0) sceneObject.SetPosition(model.position);
1744
- if (model.rotation !== void 0) sceneObject.SetRotation(model.rotation);
1745
- if (model.scale !== void 0) sceneObject.SetScale(model.scale);
1746
- if (model.visible !== void 0) sceneObject.SetVisibility(model.visible);
1747
- if (model.material !== void 0) sceneObject.SetMaterial(model.material);
1748
- if (model.parentId !== void 0) this.setParent(__spreadProps(__spreadValues({}, model), { parentId: model.parentId }));
2130
+ if (model.position !== void 0)
2131
+ sceneObject.SetPosition(model.position);
2132
+ if (model.rotation !== void 0)
2133
+ sceneObject.SetRotation(model.rotation);
2134
+ if (model.scale !== void 0)
2135
+ sceneObject.SetScale(model.scale);
2136
+ if (model.visible !== void 0)
2137
+ sceneObject.SetVisibility(model.visible);
2138
+ if (model.material !== void 0)
2139
+ sceneObject.SetMaterial(model.material);
2140
+ if (model.parentId !== void 0)
2141
+ this.setParent(__spreadProps(__spreadValues({}, model), { parentId: model.parentId }));
1749
2142
  }
1750
2143
  updatePrimitive(primitive) {
1751
2144
  let sceneObject = this.GetSceneObject(primitive);
@@ -1756,13 +2149,20 @@ var DIVERoot = class extends import_three11.Object3D {
1756
2149
  this.add(sceneObject);
1757
2150
  }
1758
2151
  if (primitive.name !== void 0) sceneObject.name = primitive.name;
1759
- if (primitive.geometry !== void 0) sceneObject.SetGeometry(primitive.geometry);
1760
- if (primitive.position !== void 0) sceneObject.SetPosition(primitive.position);
1761
- if (primitive.rotation !== void 0) sceneObject.SetRotation(primitive.rotation);
1762
- if (primitive.scale !== void 0) sceneObject.SetScale(primitive.scale);
1763
- if (primitive.visible !== void 0) sceneObject.SetVisibility(primitive.visible);
1764
- if (primitive.material !== void 0) sceneObject.SetMaterial(primitive.material);
1765
- if (primitive.parentId !== void 0) this.setParent(__spreadProps(__spreadValues({}, primitive), { parentId: primitive.parentId }));
2152
+ if (primitive.geometry !== void 0)
2153
+ sceneObject.SetGeometry(primitive.geometry);
2154
+ if (primitive.position !== void 0)
2155
+ sceneObject.SetPosition(primitive.position);
2156
+ if (primitive.rotation !== void 0)
2157
+ sceneObject.SetRotation(primitive.rotation);
2158
+ if (primitive.scale !== void 0)
2159
+ sceneObject.SetScale(primitive.scale);
2160
+ if (primitive.visible !== void 0)
2161
+ sceneObject.SetVisibility(primitive.visible);
2162
+ if (primitive.material !== void 0)
2163
+ sceneObject.SetMaterial(primitive.material);
2164
+ if (primitive.parentId !== void 0)
2165
+ this.setParent(__spreadProps(__spreadValues({}, primitive), { parentId: primitive.parentId }));
1766
2166
  }
1767
2167
  updateGroup(group) {
1768
2168
  let sceneObject = this.GetSceneObject(group);
@@ -1773,17 +2173,25 @@ var DIVERoot = class extends import_three11.Object3D {
1773
2173
  this.add(sceneObject);
1774
2174
  }
1775
2175
  if (group.name !== void 0) sceneObject.name = group.name;
1776
- if (group.position !== void 0) sceneObject.SetPosition(group.position);
1777
- if (group.rotation !== void 0) sceneObject.SetRotation(group.rotation);
1778
- if (group.scale !== void 0) sceneObject.SetScale(group.scale);
1779
- if (group.visible !== void 0) sceneObject.SetVisibility(group.visible);
1780
- if (group.bbVisible !== void 0) sceneObject.SetLinesVisibility(group.bbVisible);
1781
- if (group.parentId !== void 0) this.setParent(__spreadProps(__spreadValues({}, group), { parentId: group.parentId }));
2176
+ if (group.position !== void 0)
2177
+ sceneObject.SetPosition(group.position);
2178
+ if (group.rotation !== void 0)
2179
+ sceneObject.SetRotation(group.rotation);
2180
+ if (group.scale !== void 0)
2181
+ sceneObject.SetScale(group.scale);
2182
+ if (group.visible !== void 0)
2183
+ sceneObject.SetVisibility(group.visible);
2184
+ if (group.bbVisible !== void 0)
2185
+ sceneObject.SetLinesVisibility(group.bbVisible);
2186
+ if (group.parentId !== void 0)
2187
+ this.setParent(__spreadProps(__spreadValues({}, group), { parentId: group.parentId }));
1782
2188
  }
1783
2189
  deleteLight(light) {
1784
2190
  const sceneObject = this.GetSceneObject(light);
1785
2191
  if (!sceneObject) {
1786
- console.warn(`DIVERoot.deleteLight: Light with id ${light.id} not found`);
2192
+ console.warn(
2193
+ `DIVERoot.deleteLight: Light with id ${light.id} not found`
2194
+ );
1787
2195
  return;
1788
2196
  }
1789
2197
  this.detachTransformControls(sceneObject);
@@ -1792,7 +2200,9 @@ var DIVERoot = class extends import_three11.Object3D {
1792
2200
  deleteModel(model) {
1793
2201
  const sceneObject = this.GetSceneObject(model);
1794
2202
  if (!sceneObject) {
1795
- console.warn(`DIVERoot.deleteModel: Model with id ${model.id} not found`);
2203
+ console.warn(
2204
+ `DIVERoot.deleteModel: Model with id ${model.id} not found`
2205
+ );
1796
2206
  return;
1797
2207
  }
1798
2208
  this.detachTransformControls(sceneObject);
@@ -1801,7 +2211,9 @@ var DIVERoot = class extends import_three11.Object3D {
1801
2211
  deletePrimitive(primitive) {
1802
2212
  const sceneObject = this.GetSceneObject(primitive);
1803
2213
  if (!sceneObject) {
1804
- console.warn(`DIVERoot.deletePrimitive: Primitive with id ${primitive.id} not found`);
2214
+ console.warn(
2215
+ `DIVERoot.deletePrimitive: Primitive with id ${primitive.id} not found`
2216
+ );
1805
2217
  return;
1806
2218
  }
1807
2219
  this.detachTransformControls(sceneObject);
@@ -1810,7 +2222,9 @@ var DIVERoot = class extends import_three11.Object3D {
1810
2222
  deleteGroup(group) {
1811
2223
  const sceneObject = this.GetSceneObject(group);
1812
2224
  if (!sceneObject) {
1813
- console.warn(`DIVERoot.deleteGroup: Group with id ${group.id} not found`);
2225
+ console.warn(
2226
+ `DIVERoot.deleteGroup: Group with id ${group.id} not found`
2227
+ );
1814
2228
  return;
1815
2229
  }
1816
2230
  this.detachTransformControls(sceneObject);
@@ -1828,7 +2242,9 @@ var DIVERoot = class extends import_three11.Object3D {
1828
2242
  const sceneObject = this.GetSceneObject(object);
1829
2243
  if (!sceneObject) return;
1830
2244
  if (object.parentId !== null) {
1831
- const parent = this.GetSceneObject({ id: object.parentId });
2245
+ const parent = this.GetSceneObject({
2246
+ id: object.parentId
2247
+ });
1832
2248
  if (!parent) return;
1833
2249
  parent.attach(sceneObject);
1834
2250
  } else {
@@ -1846,7 +2262,6 @@ var DIVERoot = class extends import_three11.Object3D {
1846
2262
  if (object.parent !== null) {
1847
2263
  return this.findScene(object.parent);
1848
2264
  }
1849
- ;
1850
2265
  return object;
1851
2266
  }
1852
2267
  };
@@ -1862,7 +2277,12 @@ var DIVEGrid = class extends import_three12.Object3D {
1862
2277
  constructor() {
1863
2278
  super();
1864
2279
  this.name = "Grid";
1865
- const grid = new import_three12.GridHelper(100, 100, GRID_CENTER_LINE_COLOR, GRID_SIDE_LINE_COLOR);
2280
+ const grid = new import_three12.GridHelper(
2281
+ 100,
2282
+ 100,
2283
+ GRID_CENTER_LINE_COLOR,
2284
+ GRID_SIDE_LINE_COLOR
2285
+ );
1866
2286
  grid.material.depthTest = false;
1867
2287
  grid.layers.mask = HELPER_LAYER_MASK;
1868
2288
  this.add(grid);
@@ -1877,7 +2297,12 @@ var import_three13 = require("three");
1877
2297
  init_VisibilityLayerMask();
1878
2298
  var DIVEFloor = class extends import_three13.Mesh {
1879
2299
  constructor() {
1880
- super(new import_three13.PlaneGeometry(1e4, 1e4), new import_three13.MeshStandardMaterial({ color: new import_three13.Color(150 / 255, 150 / 255, 150 / 255) }));
2300
+ super(
2301
+ new import_three13.PlaneGeometry(1e4, 1e4),
2302
+ new import_three13.MeshStandardMaterial({
2303
+ color: new import_three13.Color(150 / 255, 150 / 255, 150 / 255)
2304
+ })
2305
+ );
1881
2306
  this.isFloor = true;
1882
2307
  this.name = "Floor";
1883
2308
  this.layers.mask = PRODUCT_LAYER_MASK;
@@ -1995,7 +2420,11 @@ var _DIVEOrbitControls = class _DIVEOrbitControls extends import_OrbitControls.O
1995
2420
  ZoomIn(by) {
1996
2421
  const zoomBy = by || _DIVEOrbitControls.DEFAULT_ZOOM_FACTOR;
1997
2422
  const { minDistance, maxDistance } = this;
1998
- this.minDistance = this.maxDistance = import_three15.MathUtils.clamp(this.getDistance() - zoomBy, minDistance + zoomBy, maxDistance - zoomBy);
2423
+ this.minDistance = this.maxDistance = import_three15.MathUtils.clamp(
2424
+ this.getDistance() - zoomBy,
2425
+ minDistance + zoomBy,
2426
+ maxDistance - zoomBy
2427
+ );
1999
2428
  this.update();
2000
2429
  this.minDistance = minDistance;
2001
2430
  this.maxDistance = maxDistance;
@@ -2003,7 +2432,11 @@ var _DIVEOrbitControls = class _DIVEOrbitControls extends import_OrbitControls.O
2003
2432
  ZoomOut(by) {
2004
2433
  const zoomBy = by || _DIVEOrbitControls.DEFAULT_ZOOM_FACTOR;
2005
2434
  const { minDistance, maxDistance } = this;
2006
- this.minDistance = this.maxDistance = import_three15.MathUtils.clamp(this.getDistance() + zoomBy, minDistance + zoomBy, maxDistance - zoomBy);
2435
+ this.minDistance = this.maxDistance = import_three15.MathUtils.clamp(
2436
+ this.getDistance() + zoomBy,
2437
+ minDistance + zoomBy,
2438
+ maxDistance - zoomBy
2439
+ );
2007
2440
  this.update();
2008
2441
  this.minDistance = minDistance;
2009
2442
  this.maxDistance = maxDistance;
@@ -2013,7 +2446,11 @@ var _DIVEOrbitControls = class _DIVEOrbitControls extends import_OrbitControls.O
2013
2446
  const toPosition = pos || this.object.position.clone();
2014
2447
  const toTarget = target || this.target.clone();
2015
2448
  this.stopRevertLast();
2016
- if (!this.locked) this.last = { pos: this.object.position.clone(), target: this.target.clone() };
2449
+ if (!this.locked)
2450
+ this.last = {
2451
+ pos: this.object.position.clone(),
2452
+ target: this.target.clone()
2453
+ };
2017
2454
  this.animating = duration > 0;
2018
2455
  this.locked = lock;
2019
2456
  this.enabled = false;
@@ -2057,7 +2494,10 @@ var DIVEToolbox = class {
2057
2494
  get selectTool() {
2058
2495
  if (!this._selectTool) {
2059
2496
  const DIVESelectTool2 = (init_SelectTool(), __toCommonJS(SelectTool_exports)).DIVESelectTool;
2060
- this._selectTool = new DIVESelectTool2(this._scene, this._controller);
2497
+ this._selectTool = new DIVESelectTool2(
2498
+ this._scene,
2499
+ this._controller
2500
+ );
2061
2501
  }
2062
2502
  return this._selectTool;
2063
2503
  }
@@ -2116,16 +2556,40 @@ var DIVEToolbox = class {
2116
2556
  (_a = this._activeTool) == null ? void 0 : _a.onWheel(e);
2117
2557
  }
2118
2558
  addEventListeners() {
2119
- this._controller.domElement.addEventListener("pointermove", (e) => this.onPointerMove(e));
2120
- this._controller.domElement.addEventListener("pointerdown", (e) => this.onPointerDown(e));
2121
- this._controller.domElement.addEventListener("pointerup", (e) => this.onPointerUp(e));
2122
- this._controller.domElement.addEventListener("wheel", (e) => this.onWheel(e));
2559
+ this._controller.domElement.addEventListener(
2560
+ "pointermove",
2561
+ (e) => this.onPointerMove(e)
2562
+ );
2563
+ this._controller.domElement.addEventListener(
2564
+ "pointerdown",
2565
+ (e) => this.onPointerDown(e)
2566
+ );
2567
+ this._controller.domElement.addEventListener(
2568
+ "pointerup",
2569
+ (e) => this.onPointerUp(e)
2570
+ );
2571
+ this._controller.domElement.addEventListener(
2572
+ "wheel",
2573
+ (e) => this.onWheel(e)
2574
+ );
2123
2575
  }
2124
2576
  removeEventListeners() {
2125
- this._controller.domElement.removeEventListener("pointermove", (e) => this.onPointerMove(e));
2126
- this._controller.domElement.removeEventListener("pointerdown", (e) => this.onPointerDown(e));
2127
- this._controller.domElement.removeEventListener("pointerup", (e) => this.onPointerUp(e));
2128
- this._controller.domElement.removeEventListener("wheel", (e) => this.onWheel(e));
2577
+ this._controller.domElement.removeEventListener(
2578
+ "pointermove",
2579
+ (e) => this.onPointerMove(e)
2580
+ );
2581
+ this._controller.domElement.removeEventListener(
2582
+ "pointerdown",
2583
+ (e) => this.onPointerDown(e)
2584
+ );
2585
+ this._controller.domElement.removeEventListener(
2586
+ "pointerup",
2587
+ (e) => this.onPointerUp(e)
2588
+ );
2589
+ this._controller.domElement.removeEventListener(
2590
+ "wheel",
2591
+ (e) => this.onWheel(e)
2592
+ );
2129
2593
  }
2130
2594
  };
2131
2595
  DIVEToolbox.DefaultTool = "select";
@@ -2212,7 +2676,9 @@ var DIVEAxisCamera = class extends import_three16.OrthographicCamera {
2212
2676
  this._scene.remove(this);
2213
2677
  }
2214
2678
  SetFromCameraMatrix(matrix) {
2215
- this.axesHelper.rotation.setFromRotationMatrix(new import_three16.Matrix4().extractRotation(matrix).invert());
2679
+ this.axesHelper.rotation.setFromRotationMatrix(
2680
+ new import_three16.Matrix4().extractRotation(matrix).invert()
2681
+ );
2216
2682
  }
2217
2683
  };
2218
2684
 
@@ -2247,7 +2713,10 @@ var getObjectDelta = (a, b) => {
2247
2713
  }
2248
2714
  const arrayDeltas = [];
2249
2715
  bArray.forEach((entry, index) => {
2250
- const inArrayDelta = getObjectDelta(aArray[index], bArray[index]);
2716
+ const inArrayDelta = getObjectDelta(
2717
+ aArray[index],
2718
+ bArray[index]
2719
+ );
2251
2720
  if (Object.keys(inArrayDelta).length) {
2252
2721
  arrayDeltas.push(bArray[index]);
2253
2722
  }
@@ -2263,7 +2732,10 @@ var getObjectDelta = (a, b) => {
2263
2732
  delta = __spreadProps(__spreadValues({}, delta), { [key]: b[key] });
2264
2733
  return;
2265
2734
  }
2266
- const objectDelta = getObjectDelta(a[key], b[key]);
2735
+ const objectDelta = getObjectDelta(
2736
+ a[key],
2737
+ b[key]
2738
+ );
2267
2739
  if (Object.keys(objectDelta).length) {
2268
2740
  delta = __spreadProps(__spreadValues({}, delta), { [key]: objectDelta });
2269
2741
  return;
@@ -2379,7 +2851,7 @@ DIVEInfo._supportsWebXR = null;
2379
2851
  // package.json
2380
2852
  var package_default = {
2381
2853
  name: "@shopware-ag/dive",
2382
- version: "1.15.5",
2854
+ version: "1.16.1",
2383
2855
  description: "Shopware Spatial Framework",
2384
2856
  type: "module",
2385
2857
  main: "./build/dive.cjs",
@@ -2424,6 +2896,8 @@ var package_default = {
2424
2896
  jest: "^29.7.0",
2425
2897
  "jest-environment-jsdom": "^29.7.0",
2426
2898
  jsdom: "^24.0.0",
2899
+ prettier: "^3.3.3",
2900
+ "prettier-plugin-multiline-arrays": "^3.0.6",
2427
2901
  "ts-jest": "^29.1.2",
2428
2902
  "ts-node": "^10.9.2",
2429
2903
  tsup: "^8.0.2",
@@ -2434,6 +2908,8 @@ var package_default = {
2434
2908
  build: "tsup && yarn genmd",
2435
2909
  watch: "tsup --watch",
2436
2910
  lint: "eslint",
2911
+ "prettier-check": "prettier --check .",
2912
+ "prettier-fix": "prettier --write .",
2437
2913
  unit: "jest",
2438
2914
  coverage: "jest --coverage",
2439
2915
  genmd: "node ./scripts/genmd.js"
@@ -2467,7 +2943,10 @@ function roundExponential(number, decimals = 0) {
2467
2943
 
2468
2944
  // src/math/signedAngleTo/signedAngleTo.ts
2469
2945
  function signedAngleTo(vecA, vecB, planeNormal) {
2470
- return Math.atan2(vecA.clone().cross(vecB).dot(planeNormal), vecB.clone().dot(vecA));
2946
+ return Math.atan2(
2947
+ vecA.clone().cross(vecB).dot(planeNormal),
2948
+ vecB.clone().dot(vecA)
2949
+ );
2471
2950
  }
2472
2951
 
2473
2952
  // src/math/toFixed/toFixedExp.ts
@@ -2525,7 +3004,10 @@ var DIVE = class _DIVE {
2525
3004
  dive.Communication.PerformAction("PLACE_ON_FLOOR", {
2526
3005
  id: modelid
2527
3006
  });
2528
- const transform = dive.Communication.PerformAction("COMPUTE_ENCOMPASSING_VIEW", {});
3007
+ const transform = dive.Communication.PerformAction(
3008
+ "COMPUTE_ENCOMPASSING_VIEW",
3009
+ {}
3010
+ );
2529
3011
  dive.Communication.PerformAction("SET_CAMERA_TRANSFORM", {
2530
3012
  position: transform.position,
2531
3013
  target: transform.target
@@ -2563,16 +3045,25 @@ var DIVE = class _DIVE {
2563
3045
  set Settings(settings) {
2564
3046
  var _a;
2565
3047
  const settingsDelta = getObjectDelta(this._settings, settings);
2566
- if (settingsDelta.renderer) this.renderer = new DIVERenderer(this._settings.renderer);
3048
+ if (settingsDelta.renderer)
3049
+ this.renderer = new DIVERenderer(this._settings.renderer);
2567
3050
  if (settingsDelta.perspectiveCamera) {
2568
- if (settingsDelta.perspectiveCamera.fov !== void 0) this.perspectiveCamera.fov = settingsDelta.perspectiveCamera.fov;
2569
- if (settingsDelta.perspectiveCamera.near !== void 0) this.perspectiveCamera.near = settingsDelta.perspectiveCamera.near;
2570
- if (settingsDelta.perspectiveCamera.far !== void 0) this.perspectiveCamera.far = settingsDelta.perspectiveCamera.far;
2571
- this.perspectiveCamera.OnResize(this.renderer.domElement.width, this.renderer.domElement.height);
3051
+ if (settingsDelta.perspectiveCamera.fov !== void 0)
3052
+ this.perspectiveCamera.fov = settingsDelta.perspectiveCamera.fov;
3053
+ if (settingsDelta.perspectiveCamera.near !== void 0)
3054
+ this.perspectiveCamera.near = settingsDelta.perspectiveCamera.near;
3055
+ if (settingsDelta.perspectiveCamera.far !== void 0)
3056
+ this.perspectiveCamera.far = settingsDelta.perspectiveCamera.far;
3057
+ this.perspectiveCamera.OnResize(
3058
+ this.renderer.domElement.width,
3059
+ this.renderer.domElement.height
3060
+ );
2572
3061
  }
2573
3062
  if (settingsDelta.orbitControls) {
2574
- if (settingsDelta.orbitControls.enableDamping !== void 0) this.orbitControls.enableDamping = settingsDelta.orbitControls.enableDamping;
2575
- if (settingsDelta.orbitControls.dampingFactor !== void 0) this.orbitControls.dampingFactor = settingsDelta.orbitControls.dampingFactor;
3063
+ if (settingsDelta.orbitControls.enableDamping !== void 0)
3064
+ this.orbitControls.enableDamping = settingsDelta.orbitControls.enableDamping;
3065
+ if (settingsDelta.orbitControls.dampingFactor !== void 0)
3066
+ this.orbitControls.dampingFactor = settingsDelta.orbitControls.dampingFactor;
2576
3067
  }
2577
3068
  if (settingsDelta.autoResize !== this._settings.autoResize) {
2578
3069
  if (settingsDelta.autoResize) {
@@ -2582,7 +3073,11 @@ var DIVE = class _DIVE {
2582
3073
  }
2583
3074
  }
2584
3075
  if (settingsDelta.displayAxes) {
2585
- this.axisCamera = new DIVEAxisCamera(this.renderer, this.scene, this.orbitControls);
3076
+ this.axisCamera = new DIVEAxisCamera(
3077
+ this.renderer,
3078
+ this.scene,
3079
+ this.orbitControls
3080
+ );
2586
3081
  } else {
2587
3082
  (_a = this.axisCamera) == null ? void 0 : _a.Dispose();
2588
3083
  this.axisCamera = null;
@@ -2596,13 +3091,29 @@ var DIVE = class _DIVE {
2596
3091
  this._height = 0;
2597
3092
  this.renderer = new DIVERenderer(this._settings.renderer);
2598
3093
  this.scene = new DIVEScene();
2599
- this.perspectiveCamera = new DIVEPerspectiveCamera(this._settings.perspectiveCamera);
3094
+ this.perspectiveCamera = new DIVEPerspectiveCamera(
3095
+ this._settings.perspectiveCamera
3096
+ );
2600
3097
  this.animationSystem = new DIVEAnimationSystem(this.renderer);
2601
- this.orbitControls = new DIVEOrbitControls(this.perspectiveCamera, this.renderer, this.animationSystem, this._settings.orbitControls);
3098
+ this.orbitControls = new DIVEOrbitControls(
3099
+ this.perspectiveCamera,
3100
+ this.renderer,
3101
+ this.animationSystem,
3102
+ this._settings.orbitControls
3103
+ );
2602
3104
  this.toolbox = new DIVEToolbox(this.scene, this.orbitControls);
2603
- this.communication = new DIVECommunication(this.renderer, this.scene, this.orbitControls, this.toolbox);
3105
+ this.communication = new DIVECommunication(
3106
+ this.renderer,
3107
+ this.scene,
3108
+ this.orbitControls,
3109
+ this.toolbox
3110
+ );
2604
3111
  if (this._settings.displayAxes) {
2605
- this.axisCamera = new DIVEAxisCamera(this.renderer, this.scene, this.orbitControls);
3112
+ this.axisCamera = new DIVEAxisCamera(
3113
+ this.renderer,
3114
+ this.scene,
3115
+ this.orbitControls
3116
+ );
2606
3117
  } else {
2607
3118
  this.axisCamera = null;
2608
3119
  }
@@ -2637,7 +3148,8 @@ var DIVE = class _DIVE {
2637
3148
  const canvasWrapper = this.renderer.domElement.parentElement;
2638
3149
  if (!canvasWrapper) return;
2639
3150
  const { clientWidth, clientHeight } = canvasWrapper;
2640
- if (clientWidth === this._width && clientHeight === this._height) return;
3151
+ if (clientWidth === this._width && clientHeight === this._height)
3152
+ return;
2641
3153
  this.OnResize(clientWidth, clientHeight);
2642
3154
  this._width = clientWidth;
2643
3155
  this._height = clientHeight;