@shopware-ag/dive 1.16.0 → 1.16.2

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 +271 -40
  2. package/build/dive.cjs +575 -159
  3. package/build/dive.cjs.map +1 -1
  4. package/build/dive.d.cts +83 -57
  5. package/build/dive.d.ts +83 -57
  6. package/build/dive.js +614 -164
  7. package/build/dive.js.map +1 -1
  8. package/package.json +72 -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 +282 -100
  17. package/src/com/__test__/Communication.test.ts +207 -141
  18. package/src/com/actions/camera/computeencompassingview.ts +8 -7
  19. package/src/com/actions/camera/getcameratransform.ts +8 -7
  20. package/src/com/actions/camera/movecamera.ts +16 -13
  21. package/src/com/actions/camera/resetcamera.ts +4 -3
  22. package/src/com/actions/camera/setcameralayer.ts +4 -3
  23. package/src/com/actions/camera/setcameratransform.ts +8 -7
  24. package/src/com/actions/camera/zoomcamera.ts +4 -3
  25. package/src/com/actions/index.ts +54 -54
  26. package/src/com/actions/media/generatemedia.ts +17 -13
  27. package/src/com/actions/object/addobject.ts +5 -4
  28. package/src/com/actions/object/deleteobject.ts +5 -4
  29. package/src/com/actions/object/deselectobject.ts +5 -4
  30. package/src/com/actions/object/getallobjects.ts +5 -4
  31. package/src/com/actions/object/getobjects.ts +5 -4
  32. package/src/com/actions/object/model/dropit.ts +4 -3
  33. package/src/com/actions/object/model/modelloaded.ts +4 -3
  34. package/src/com/actions/object/model/placeonfloor.ts +4 -3
  35. package/src/com/actions/object/selectobject.ts +5 -4
  36. package/src/com/actions/object/setparent.ts +8 -7
  37. package/src/com/actions/object/updateobject.ts +5 -4
  38. package/src/com/actions/scene/exportscene.ts +5 -4
  39. package/src/com/actions/scene/getallscenedata.ts +24 -18
  40. package/src/com/actions/scene/setbackground.ts +4 -3
  41. package/src/com/actions/scene/updatescene.ts +10 -9
  42. package/src/com/actions/toolbox/select/setgizmomode.ts +4 -3
  43. package/src/com/actions/toolbox/transform/setgizmovisible.ts +4 -3
  44. package/src/com/actions/toolbox/usetool.ts +5 -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 +21 -43
  91. package/src/io/__test__/IO.test.ts +16 -62
  92. package/src/io/gltf/GLTFIO.ts +34 -31
  93. package/src/io/gltf/__test__/GLTFIO.test.ts +88 -78
  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 +3 -3
  143. package/src/types/index.ts +3 -6
@@ -1,17 +1,23 @@
1
- import { Box3, Color, Object3D } from "three";
2
- import DIVEAmbientLight from "../../light/AmbientLight.ts";
3
- import DIVEPointLight from "../../light/PointLight.ts";
4
- import DIVESceneLight from "../../light/SceneLight.ts";
5
- import { DIVEModel } from "../../model/Model.ts";
6
- import { DIVELoadingManager } from "../../loadingmanager/LoadingManager.ts";
7
- import { DIVECommunication } from "../../com/Communication.ts";
8
- import { DIVEPrimitive } from "../../primitive/Primitive.ts";
9
-
10
- import { type DIVEScene } from "../Scene.ts";
11
- import { type TransformControls } from "three/examples/jsm/controls/TransformControls";
12
- import { type COMLight, type COMModel, type COMEntity, type COMPrimitive, type COMGroup } from "../../com/types";
13
- import { type DIVESceneObject } from "../../types";
14
- import { DIVEGroup } from "../../group/Group.ts";
1
+ import { Box3, Color, Object3D } from 'three';
2
+ import DIVEAmbientLight from '../../light/AmbientLight.ts';
3
+ import DIVEPointLight from '../../light/PointLight.ts';
4
+ import DIVESceneLight from '../../light/SceneLight.ts';
5
+ import { DIVEModel } from '../../model/Model.ts';
6
+ import { DIVELoadingManager } from '../../loadingmanager/LoadingManager.ts';
7
+ import { DIVECommunication } from '../../com/Communication.ts';
8
+ import { DIVEPrimitive } from '../../primitive/Primitive.ts';
9
+
10
+ import { type DIVEScene } from '../Scene.ts';
11
+ import { type TransformControls } from 'three/examples/jsm/controls/TransformControls';
12
+ import {
13
+ type COMLight,
14
+ type COMModel,
15
+ type COMEntity,
16
+ type COMPrimitive,
17
+ type COMGroup,
18
+ } from '../../com/types';
19
+ import { type DIVESceneObject } from '../../types';
20
+ import { DIVEGroup } from '../../group/Group.ts';
15
21
 
16
22
  /**
17
23
  * A basic scene node to hold grid, floor and all lower level roots.
@@ -26,7 +32,7 @@ export class DIVERoot extends Object3D {
26
32
 
27
33
  constructor() {
28
34
  super();
29
- this.name = "Root";
35
+ this.name = 'Root';
30
36
 
31
37
  this.loadingManager = new DIVELoadingManager();
32
38
  }
@@ -42,7 +48,7 @@ export class DIVERoot extends Object3D {
42
48
  }
43
49
 
44
50
  public GetSceneObject<T extends DIVESceneObject>(
45
- object: Partial<COMEntity> & { id: string }
51
+ object: Partial<COMEntity> & { id: string },
46
52
  ): T | undefined {
47
53
  let foundObject: T | undefined;
48
54
  this.traverse((object3D) => {
@@ -56,70 +62,74 @@ export class DIVERoot extends Object3D {
56
62
 
57
63
  public AddSceneObject(object: COMEntity): void {
58
64
  switch (object.entityType) {
59
- case "pov": {
65
+ case 'pov': {
60
66
  break;
61
67
  }
62
- case "light": {
68
+ case 'light': {
63
69
  this.updateLight(object);
64
70
  break;
65
71
  }
66
- case "model": {
72
+ case 'model': {
67
73
  this.updateModel(object);
68
74
  break;
69
75
  }
70
- case "primitive": {
76
+ case 'primitive': {
71
77
  this.updatePrimitive(object);
72
78
  break;
73
79
  }
74
- case "group": {
80
+ case 'group': {
75
81
  this.updateGroup(object);
76
82
  break;
77
83
  }
78
84
  }
79
85
  }
80
86
 
81
- public UpdateSceneObject(object: Partial<COMEntity> & { id: string }): void {
87
+ public UpdateSceneObject(
88
+ object: Partial<COMEntity> & { id: string },
89
+ ): void {
82
90
  switch (object.entityType) {
83
- case "pov": {
91
+ case 'pov': {
84
92
  break;
85
93
  }
86
- case "light": {
94
+ case 'light': {
87
95
  this.updateLight(object);
88
96
  break;
89
97
  }
90
- case "model": {
98
+ case 'model': {
91
99
  this.updateModel(object);
92
100
  break;
93
101
  }
94
- case "primitive": {
102
+ case 'primitive': {
95
103
  this.updatePrimitive(object);
96
104
  break;
97
105
  }
98
- case "group": {
106
+ case 'group': {
99
107
  this.updateGroup(object);
100
108
  break;
101
109
  }
102
110
  }
103
111
  }
104
112
 
105
- public DeleteSceneObject(object: Partial<COMEntity> & { id: string }): void {
113
+ public DeleteSceneObject(
114
+ object: Partial<COMEntity> & { id: string },
115
+ ): void {
106
116
  switch (object.entityType) {
107
- case "pov": {
117
+ case 'pov': {
108
118
  break;
109
119
  }
110
- case "light": {
120
+ case 'light': {
111
121
  this.deleteLight(object);
112
122
  break;
113
123
  }
114
- case "model": {
124
+ case 'model': {
115
125
  this.deleteModel(object);
116
126
  break;
117
127
  }
118
- case "primitive": {
128
+ case 'primitive': {
119
129
  this.deletePrimitive(object);
120
130
  break;
121
131
  }
122
- case "group": {
132
+ case 'group': {
123
133
  this.deleteGroup(object);
124
134
  break;
125
135
  }
@@ -128,12 +138,12 @@ export class DIVERoot extends Object3D {
128
138
 
129
139
  public PlaceOnFloor(object: Partial<COMEntity> & { id: string }): void {
130
140
  switch (object.entityType) {
131
- case "pov":
132
- case "light": {
141
+ case 'pov':
142
+ case 'light': {
133
143
  break;
134
144
  }
135
- case "model":
136
- case "primitive": {
145
+ case 'model':
146
+ case 'primitive': {
137
147
  this.placeOnFloor(object);
138
148
  break;
139
149
  }
@@ -157,7 +167,9 @@ export class DIVERoot extends Object3D {
157
167
  break;
158
168
  }
159
169
  default: {
160
- console.warn(`DIVERoot.updateLight: Unknown light type: ${light.type}`);
170
+ console.warn(
171
+ `DIVERoot.updateLight: Unknown light type: ${light.type}`,
172
+ );
161
173
  return;
162
174
  }
163
175
  }
@@ -165,13 +177,31 @@ export class DIVERoot extends Object3D {
165
177
  this.add(sceneObject);
166
178
  }
167
179
 
168
- if (light.name !== undefined && light.name !== null) sceneObject.name = light.name;
169
- if (light.position !== undefined && light.position !== null) sceneObject.position.set(light.position.x, light.position.y, light.position.z);
170
- if (light.intensity !== undefined && light.intensity !== null) (sceneObject as (DIVEAmbientLight | DIVEPointLight)).SetIntensity(light.intensity);
171
- if (light.enabled !== undefined && light.enabled !== null) (sceneObject as (DIVEAmbientLight | DIVEPointLight)).SetEnabled(light.enabled);
172
- if (light.color !== undefined && light.color !== null) (sceneObject as (DIVEAmbientLight | DIVEPointLight)).SetColor(new Color(light.color));
173
- if (light.visible !== undefined && light.visible !== null) (sceneObject as (DIVEAmbientLight | DIVEPointLight)).visible = light.visible;
174
- if (light.parentId !== undefined) this.setParent({ ...light, parentId: light.parentId });
180
+ if (light.name !== undefined && light.name !== null)
181
+ sceneObject.name = light.name;
182
+ if (light.position !== undefined && light.position !== null)
183
+ sceneObject.position.set(
184
+ light.position.x,
185
+ light.position.y,
186
+ light.position.z,
187
+ );
188
+ if (light.intensity !== undefined && light.intensity !== null)
189
+ (sceneObject as DIVEAmbientLight | DIVEPointLight).SetIntensity(
190
+ light.intensity,
191
+ );
192
+ if (light.enabled !== undefined && light.enabled !== null)
193
+ (sceneObject as DIVEAmbientLight | DIVEPointLight).SetEnabled(
194
+ light.enabled,
195
+ );
196
+ if (light.color !== undefined && light.color !== null)
197
+ (sceneObject as DIVEAmbientLight | DIVEPointLight).SetColor(
198
+ new Color(light.color),
199
+ );
200
+ if (light.visible !== undefined && light.visible !== null)
201
+ (sceneObject as DIVEAmbientLight | DIVEPointLight).visible =
202
+ light.visible;
203
+ if (light.parentId !== undefined)
204
+ this.setParent({ ...light, parentId: light.parentId });
175
205
  }
176
206
 
177
207
  private updateModel(model: Partial<COMModel> & { id: string }): void {
@@ -186,20 +216,31 @@ export class DIVERoot extends Object3D {
186
216
  if (model.uri !== undefined) {
187
217
  this.loadingManager.LoadGLTF(model.uri).then((gltf) => {
188
218
  (sceneObject as DIVEModel).SetModel(gltf);
189
- DIVECommunication.get(model.id!)?.PerformAction('MODEL_LOADED', { id: model.id! });
219
+ DIVECommunication.get(model.id!)?.PerformAction(
220
+ 'MODEL_LOADED',
221
+ { id: model.id! },
222
+ );
190
223
  });
191
224
  }
192
225
 
193
226
  if (model.name !== undefined) sceneObject.name = model.name;
194
- if (model.position !== undefined) (sceneObject as DIVEModel).SetPosition(model.position);
195
- if (model.rotation !== undefined) (sceneObject as DIVEModel).SetRotation(model.rotation);
196
- if (model.scale !== undefined) (sceneObject as DIVEModel).SetScale(model.scale);
197
- if (model.visible !== undefined) (sceneObject as DIVEModel).SetVisibility(model.visible);
198
- if (model.material !== undefined) (sceneObject as DIVEModel).SetMaterial(model.material);
199
- if (model.parentId !== undefined) this.setParent({ ...model, parentId: model.parentId });
227
+ if (model.position !== undefined)
228
+ (sceneObject as DIVEModel).SetPosition(model.position);
229
+ if (model.rotation !== undefined)
230
+ (sceneObject as DIVEModel).SetRotation(model.rotation);
231
+ if (model.scale !== undefined)
232
+ (sceneObject as DIVEModel).SetScale(model.scale);
233
+ if (model.visible !== undefined)
234
+ (sceneObject as DIVEModel).SetVisibility(model.visible);
235
+ if (model.material !== undefined)
236
+ (sceneObject as DIVEModel).SetMaterial(model.material);
237
+ if (model.parentId !== undefined)
238
+ this.setParent({ ...model, parentId: model.parentId });
200
239
  }
201
240
 
202
- private updatePrimitive(primitive: Partial<COMPrimitive> & { id: string }): void {
241
+ private updatePrimitive(
242
+ primitive: Partial<COMPrimitive> & { id: string },
243
+ ): void {
203
244
  let sceneObject = this.GetSceneObject<DIVESceneObject>(primitive);
204
245
  if (!sceneObject) {
205
246
  const created = new DIVEPrimitive();
@@ -209,13 +250,20 @@ export class DIVERoot extends Object3D {
209
250
  }
210
251
 
211
252
  if (primitive.name !== undefined) sceneObject.name = primitive.name;
212
- if (primitive.geometry !== undefined) (sceneObject as DIVEPrimitive).SetGeometry(primitive.geometry);
213
- if (primitive.position !== undefined) (sceneObject as DIVEPrimitive).SetPosition(primitive.position);
214
- if (primitive.rotation !== undefined) (sceneObject as DIVEPrimitive).SetRotation(primitive.rotation);
215
- if (primitive.scale !== undefined) (sceneObject as DIVEPrimitive).SetScale(primitive.scale);
216
- if (primitive.visible !== undefined) (sceneObject as DIVEPrimitive).SetVisibility(primitive.visible);
217
- if (primitive.material !== undefined) (sceneObject as DIVEPrimitive).SetMaterial(primitive.material);
218
- if (primitive.parentId !== undefined) this.setParent({ ...primitive, parentId: primitive.parentId });
253
+ if (primitive.geometry !== undefined)
254
+ (sceneObject as DIVEPrimitive).SetGeometry(primitive.geometry);
255
+ if (primitive.position !== undefined)
256
+ (sceneObject as DIVEPrimitive).SetPosition(primitive.position);
257
+ if (primitive.rotation !== undefined)
258
+ (sceneObject as DIVEPrimitive).SetRotation(primitive.rotation);
259
+ if (primitive.scale !== undefined)
260
+ (sceneObject as DIVEPrimitive).SetScale(primitive.scale);
261
+ if (primitive.visible !== undefined)
262
+ (sceneObject as DIVEPrimitive).SetVisibility(primitive.visible);
263
+ if (primitive.material !== undefined)
264
+ (sceneObject as DIVEPrimitive).SetMaterial(primitive.material);
265
+ if (primitive.parentId !== undefined)
266
+ this.setParent({ ...primitive, parentId: primitive.parentId });
219
267
  }
220
268
 
221
269
  private updateGroup(group: Partial<COMGroup> & { id: string }): void {
@@ -228,18 +276,26 @@ export class DIVERoot extends Object3D {
228
276
  }
229
277
 
230
278
  if (group.name !== undefined) sceneObject.name = group.name;
231
- if (group.position !== undefined) (sceneObject as DIVEPrimitive).SetPosition(group.position);
232
- if (group.rotation !== undefined) (sceneObject as DIVEPrimitive).SetRotation(group.rotation);
233
- if (group.scale !== undefined) (sceneObject as DIVEPrimitive).SetScale(group.scale);
234
- if (group.visible !== undefined) (sceneObject as DIVEPrimitive).SetVisibility(group.visible);
235
- if (group.bbVisible !== undefined) (sceneObject as DIVEGroup).SetLinesVisibility(group.bbVisible);
236
- if (group.parentId !== undefined) this.setParent({ ...group, parentId: group.parentId });
279
+ if (group.position !== undefined)
280
+ (sceneObject as DIVEPrimitive).SetPosition(group.position);
281
+ if (group.rotation !== undefined)
282
+ (sceneObject as DIVEPrimitive).SetRotation(group.rotation);
283
+ if (group.scale !== undefined)
284
+ (sceneObject as DIVEPrimitive).SetScale(group.scale);
285
+ if (group.visible !== undefined)
286
+ (sceneObject as DIVEPrimitive).SetVisibility(group.visible);
287
+ if (group.bbVisible !== undefined)
288
+ (sceneObject as DIVEGroup).SetLinesVisibility(group.bbVisible);
289
+ if (group.parentId !== undefined)
290
+ this.setParent({ ...group, parentId: group.parentId });
237
291
  }
238
292
 
239
293
  private deleteLight(light: Partial<COMLight> & { id: string }): void {
240
294
  const sceneObject = this.GetSceneObject(light);
241
295
  if (!sceneObject) {
242
- console.warn(`DIVERoot.deleteLight: Light with id ${light.id} not found`);
296
+ console.warn(
297
+ `DIVERoot.deleteLight: Light with id ${light.id} not found`,
298
+ );
243
299
  return;
244
300
  }
245
301
 
@@ -251,7 +307,9 @@ export class DIVERoot extends Object3D {
251
307
  private deleteModel(model: Partial<COMModel> & { id: string }): void {
252
308
  const sceneObject = this.GetSceneObject(model);
253
309
  if (!sceneObject) {
254
- console.warn(`DIVERoot.deleteModel: Model with id ${model.id} not found`);
310
+ console.warn(
311
+ `DIVERoot.deleteModel: Model with id ${model.id} not found`,
312
+ );
255
313
  return;
256
314
  }
257
315
 
@@ -260,10 +318,14 @@ export class DIVERoot extends Object3D {
260
318
  this.remove(sceneObject);
261
319
  }
262
320
 
263
- private deletePrimitive(primitive: Partial<COMPrimitive> & { id: string }): void {
321
+ private deletePrimitive(
322
+ primitive: Partial<COMPrimitive> & { id: string },
323
+ ): void {
264
324
  const sceneObject = this.GetSceneObject(primitive);
265
325
  if (!sceneObject) {
266
- console.warn(`DIVERoot.deletePrimitive: Primitive with id ${primitive.id} not found`);
326
+ console.warn(
327
+ `DIVERoot.deletePrimitive: Primitive with id ${primitive.id} not found`,
328
+ );
267
329
  return;
268
330
  }
269
331
 
@@ -275,7 +337,9 @@ export class DIVERoot extends Object3D {
275
337
  private deleteGroup(group: Partial<COMGroup> & { id: string }): void {
276
338
  const sceneObject = this.GetSceneObject(group);
277
339
  if (!sceneObject) {
278
- console.warn(`DIVERoot.deleteGroup: Group with id ${group.id} not found`);
340
+ console.warn(
341
+ `DIVERoot.deleteGroup: Group with id ${group.id} not found`,
342
+ );
279
343
  return;
280
344
  }
281
345
 
@@ -295,17 +359,20 @@ export class DIVERoot extends Object3D {
295
359
  (sceneObject as DIVEModel | DIVEPrimitive).PlaceOnFloor();
296
360
  }
297
361
 
298
- private setParent(object: Partial<COMEntity> & { id: string, parentId: string | null }): void {
362
+ private setParent(
363
+ object: Partial<COMEntity> & { id: string; parentId: string | null },
364
+ ): void {
299
365
  const sceneObject = this.GetSceneObject<DIVESceneObject>(object);
300
366
  if (!sceneObject) return;
301
367
 
302
368
  if (object.parentId !== null) {
303
- const parent = this.GetSceneObject<DIVESceneObject>({ id: object.parentId });
369
+ const parent = this.GetSceneObject<DIVESceneObject>({
370
+ id: object.parentId,
371
+ });
304
372
  if (!parent) return;
305
373
 
306
374
  // attach to new parent (if exists in scene)
307
375
  parent.attach(sceneObject);
308
-
309
376
  } else {
310
377
  // attach to root if no parent is found
311
378
  this.attach(sceneObject);
@@ -324,7 +391,7 @@ export class DIVERoot extends Object3D {
324
391
  private findScene(object: Object3D): DIVEScene {
325
392
  if (object.parent !== null) {
326
393
  return this.findScene(object.parent);
327
- };
394
+ }
328
395
  return object as DIVEScene;
329
396
  }
330
397
  }