@shopware-ag/dive 1.15.1 → 1.15.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.
- package/build/dive.cjs +2 -1
- package/build/dive.cjs.map +1 -1
- package/build/dive.js +2 -1
- package/build/dive.js.map +1 -1
- package/package.json +1 -1
- package/src/com/Communication.ts +2 -1
- package/src/com/__test__/Communication.test.ts +16 -1
package/package.json
CHANGED
package/src/com/Communication.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { isSelectTool } from "../toolbox/select/SelectTool.ts";
|
|
|
4
4
|
|
|
5
5
|
// type imports
|
|
6
6
|
import { type Color, type MeshStandardMaterial } from "three";
|
|
7
|
-
import { type COMLight, type COMModel, type COMEntity, type COMPov, type COMPrimitive } from "./types";
|
|
7
|
+
import { type COMLight, type COMModel, type COMEntity, type COMPov, type COMPrimitive, type COMGroup } from "./types";
|
|
8
8
|
import { type DIVEScene } from "../scene/Scene.ts";
|
|
9
9
|
import type DIVEToolbox from "../toolbox/Toolbox.ts";
|
|
10
10
|
import type DIVEOrbitControls from "../controls/OrbitControls.ts";
|
|
@@ -240,6 +240,7 @@ export class DIVECommunication {
|
|
|
240
240
|
objects: Array.from(this.registered.values()).filter((object) => object.entityType === 'model') as COMModel[],
|
|
241
241
|
cameras: Array.from(this.registered.values()).filter((object) => object.entityType === 'pov') as COMPov[],
|
|
242
242
|
primitives: Array.from(this.registered.values()).filter((object) => object.entityType === 'primitive') as COMPrimitive[],
|
|
243
|
+
groups: Array.from(this.registered.values()).filter((object) => object.entityType === 'group') as COMGroup[],
|
|
243
244
|
};
|
|
244
245
|
Object.assign(payload, sceneData);
|
|
245
246
|
return sceneData;
|
|
@@ -25,7 +25,7 @@ import type { DIVEScene } from '../../scene/Scene';
|
|
|
25
25
|
import type DIVEToolbox from '../../toolbox/Toolbox';
|
|
26
26
|
import type DIVEOrbitControls from '../../controls/OrbitControls';
|
|
27
27
|
import { type DIVERenderer } from '../../renderer/Renderer';
|
|
28
|
-
import { type COMEntity, type COMEntityType, type COMLight, type COMModel, type COMPov, type COMPrimitive } from '../types';
|
|
28
|
+
import { type COMGroup, type COMEntity, type COMEntityType, type COMLight, type COMModel, type COMPov, type COMPrimitive } from '../types';
|
|
29
29
|
import { type DIVESceneObject } from '../../types';
|
|
30
30
|
|
|
31
31
|
jest.mock('three/src/math/MathUtils', () => {
|
|
@@ -516,6 +516,14 @@ describe('dive/communication/DIVECommunication', () => {
|
|
|
516
516
|
color: 'white',
|
|
517
517
|
} as COMLight);
|
|
518
518
|
|
|
519
|
+
testCom.PerformAction('ADD_OBJECT', {
|
|
520
|
+
entityType: "group",
|
|
521
|
+
id: "group1",
|
|
522
|
+
position: { x: 0, y: 0, z: 0 },
|
|
523
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
524
|
+
parent: null,
|
|
525
|
+
} as COMGroup);
|
|
526
|
+
|
|
519
527
|
const success = testCom.PerformAction('GET_ALL_SCENE_DATA', {});
|
|
520
528
|
expect(success).toStrictEqual({
|
|
521
529
|
backgroundColor: "#ffffff",
|
|
@@ -553,6 +561,13 @@ describe('dive/communication/DIVECommunication', () => {
|
|
|
553
561
|
position: { x: 1, y: 2, z: 3 },
|
|
554
562
|
target: { x: 4, y: 5, z: 6 },
|
|
555
563
|
},
|
|
564
|
+
groups: [{
|
|
565
|
+
entityType: "group",
|
|
566
|
+
id: "group1",
|
|
567
|
+
position: { x: 0, y: 0, z: 0 },
|
|
568
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
569
|
+
parent: null,
|
|
570
|
+
}],
|
|
556
571
|
});
|
|
557
572
|
});
|
|
558
573
|
|