@shopware-ag/dive 1.16.4 → 1.16.6
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 +15 -44
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.cts +6 -0
- package/build/dive.d.ts +6 -0
- package/build/dive.js +16 -45
- package/build/dive.js.map +1 -1
- package/package.json +1 -1
- package/src/__test__/DIVE.test.ts +8 -0
- package/src/com/Communication.ts +3 -2
- package/src/dive.ts +3 -1
- package/src/model/Model.ts +6 -19
- package/src/model/__test__/Model.test.ts +10 -4
- package/src/primitive/Primitive.ts +6 -19
- package/src/primitive/__test__/Primitive.test.ts +8 -4
- package/src/scene/Scene.ts +5 -3
- package/src/scene/root/Root.ts +14 -6
- package/src/scene/root/__test__/Root.test.ts +60 -6
package/build/dive.d.cts
CHANGED
|
@@ -612,12 +612,15 @@ declare class DIVERoot extends Object3D {
|
|
|
612
612
|
AddSceneObject(object: COMEntity): void;
|
|
613
613
|
UpdateSceneObject(object: Partial<COMEntity> & {
|
|
614
614
|
id: string;
|
|
615
|
+
entityType: string;
|
|
615
616
|
}): void;
|
|
616
617
|
DeleteSceneObject(object: Partial<COMEntity> & {
|
|
617
618
|
id: string;
|
|
619
|
+
entityType: string;
|
|
618
620
|
}): void;
|
|
619
621
|
PlaceOnFloor(object: Partial<COMEntity> & {
|
|
620
622
|
id: string;
|
|
623
|
+
entityType: string;
|
|
621
624
|
}): void;
|
|
622
625
|
private updateLight;
|
|
623
626
|
private updateModel;
|
|
@@ -680,12 +683,15 @@ declare class DIVEScene extends Scene {
|
|
|
680
683
|
AddSceneObject(object: COMEntity): void;
|
|
681
684
|
UpdateSceneObject(object: Partial<COMEntity> & {
|
|
682
685
|
id: string;
|
|
686
|
+
entityType: string;
|
|
683
687
|
}): void;
|
|
684
688
|
DeleteSceneObject(object: Partial<COMEntity> & {
|
|
685
689
|
id: string;
|
|
690
|
+
entityType: string;
|
|
686
691
|
}): void;
|
|
687
692
|
PlaceOnFloor(object: Partial<COMModel> & {
|
|
688
693
|
id: string;
|
|
694
|
+
entityType: string;
|
|
689
695
|
}): void;
|
|
690
696
|
}
|
|
691
697
|
|
package/build/dive.d.ts
CHANGED
|
@@ -612,12 +612,15 @@ declare class DIVERoot extends Object3D {
|
|
|
612
612
|
AddSceneObject(object: COMEntity): void;
|
|
613
613
|
UpdateSceneObject(object: Partial<COMEntity> & {
|
|
614
614
|
id: string;
|
|
615
|
+
entityType: string;
|
|
615
616
|
}): void;
|
|
616
617
|
DeleteSceneObject(object: Partial<COMEntity> & {
|
|
617
618
|
id: string;
|
|
619
|
+
entityType: string;
|
|
618
620
|
}): void;
|
|
619
621
|
PlaceOnFloor(object: Partial<COMEntity> & {
|
|
620
622
|
id: string;
|
|
623
|
+
entityType: string;
|
|
621
624
|
}): void;
|
|
622
625
|
private updateLight;
|
|
623
626
|
private updateModel;
|
|
@@ -680,12 +683,15 @@ declare class DIVEScene extends Scene {
|
|
|
680
683
|
AddSceneObject(object: COMEntity): void;
|
|
681
684
|
UpdateSceneObject(object: Partial<COMEntity> & {
|
|
682
685
|
id: string;
|
|
686
|
+
entityType: string;
|
|
683
687
|
}): void;
|
|
684
688
|
DeleteSceneObject(object: Partial<COMEntity> & {
|
|
685
689
|
id: string;
|
|
690
|
+
entityType: string;
|
|
686
691
|
}): void;
|
|
687
692
|
PlaceOnFloor(object: Partial<COMModel> & {
|
|
688
693
|
id: string;
|
|
694
|
+
entityType: string;
|
|
689
695
|
}): void;
|
|
690
696
|
}
|
|
691
697
|
|
package/build/dive.js
CHANGED
|
@@ -1151,8 +1151,9 @@ var _DIVECommunication = class _DIVECommunication {
|
|
|
1151
1151
|
return true;
|
|
1152
1152
|
}
|
|
1153
1153
|
placeOnFloor(payload) {
|
|
1154
|
-
|
|
1155
|
-
|
|
1154
|
+
const object = this.registered.get(payload.id);
|
|
1155
|
+
if (!object) return false;
|
|
1156
|
+
this.scene.PlaceOnFloor(object);
|
|
1156
1157
|
return true;
|
|
1157
1158
|
}
|
|
1158
1159
|
setCameraTransform(payload) {
|
|
@@ -1544,20 +1545,12 @@ var DIVEModel = class extends DIVENode {
|
|
|
1544
1545
|
}
|
|
1545
1546
|
}
|
|
1546
1547
|
PlaceOnFloor() {
|
|
1547
|
-
|
|
1548
|
+
const oldPos = this.position.clone();
|
|
1548
1549
|
this.position.y = -this._boundingBox.min.y * this.scale.y;
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
{
|
|
1552
|
-
id: this.userData.id,
|
|
1553
|
-
position: this.position,
|
|
1554
|
-
rotation: this.rotation,
|
|
1555
|
-
scale: this.scale
|
|
1556
|
-
}
|
|
1557
|
-
);
|
|
1550
|
+
if (this.position.y === oldPos.y) return;
|
|
1551
|
+
this.onMove();
|
|
1558
1552
|
}
|
|
1559
1553
|
DropIt() {
|
|
1560
|
-
var _a;
|
|
1561
1554
|
if (!this.parent) {
|
|
1562
1555
|
console.warn(
|
|
1563
1556
|
"DIVEModel: DropIt() called on a model that is not in the scene.",
|
|
@@ -1585,15 +1578,7 @@ var DIVEModel = class extends DIVENode {
|
|
|
1585
1578
|
const newPos = this.position.clone().setY(worldPos.y).sub(new Vector32(0, bottomY, 0));
|
|
1586
1579
|
this.position.copy(newPos);
|
|
1587
1580
|
if (this.position.y === oldPos.y) return;
|
|
1588
|
-
|
|
1589
|
-
"UPDATE_OBJECT",
|
|
1590
|
-
{
|
|
1591
|
-
id: this.userData.id,
|
|
1592
|
-
position: this.position,
|
|
1593
|
-
rotation: this.rotation,
|
|
1594
|
-
scale: this.scale
|
|
1595
|
-
}
|
|
1596
|
-
);
|
|
1581
|
+
this.onMove();
|
|
1597
1582
|
}
|
|
1598
1583
|
}
|
|
1599
1584
|
};
|
|
@@ -1633,6 +1618,7 @@ var DIVELoadingManager = class {
|
|
|
1633
1618
|
};
|
|
1634
1619
|
|
|
1635
1620
|
// src/primitive/Primitive.ts
|
|
1621
|
+
init_VisibilityLayerMask();
|
|
1636
1622
|
import {
|
|
1637
1623
|
BoxGeometry,
|
|
1638
1624
|
Color as Color4,
|
|
@@ -1644,7 +1630,6 @@ import {
|
|
|
1644
1630
|
SphereGeometry as SphereGeometry2,
|
|
1645
1631
|
Vector3 as Vector33
|
|
1646
1632
|
} from "three";
|
|
1647
|
-
init_VisibilityLayerMask();
|
|
1648
1633
|
var DIVEPrimitive = class extends DIVENode {
|
|
1649
1634
|
constructor() {
|
|
1650
1635
|
super();
|
|
@@ -1697,20 +1682,12 @@ var DIVEPrimitive = class extends DIVENode {
|
|
|
1697
1682
|
if (this._mesh) this._mesh.material = primitiveMaterial;
|
|
1698
1683
|
}
|
|
1699
1684
|
PlaceOnFloor() {
|
|
1700
|
-
|
|
1685
|
+
const oldPos = this.position.clone();
|
|
1701
1686
|
this.position.y = -this._boundingBox.min.y * this.scale.y;
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
{
|
|
1705
|
-
id: this.userData.id,
|
|
1706
|
-
position: this.position,
|
|
1707
|
-
rotation: this.rotation,
|
|
1708
|
-
scale: this.scale
|
|
1709
|
-
}
|
|
1710
|
-
);
|
|
1687
|
+
if (this.position.y === oldPos.y) return;
|
|
1688
|
+
this.onMove();
|
|
1711
1689
|
}
|
|
1712
1690
|
DropIt() {
|
|
1713
|
-
var _a;
|
|
1714
1691
|
if (!this.parent) {
|
|
1715
1692
|
console.warn(
|
|
1716
1693
|
"DIVEPrimitive: DropIt() called on a model that is not in the scene.",
|
|
@@ -1738,15 +1715,7 @@ var DIVEPrimitive = class extends DIVENode {
|
|
|
1738
1715
|
const newPos = this.position.clone().setY(worldPos.y).sub(new Vector33(0, bottomY, 0));
|
|
1739
1716
|
this.position.copy(newPos);
|
|
1740
1717
|
if (this.position.y === oldPos.y) return;
|
|
1741
|
-
|
|
1742
|
-
"UPDATE_OBJECT",
|
|
1743
|
-
{
|
|
1744
|
-
id: this.userData.id,
|
|
1745
|
-
position: this.position,
|
|
1746
|
-
rotation: this.rotation,
|
|
1747
|
-
scale: this.scale
|
|
1748
|
-
}
|
|
1749
|
-
);
|
|
1718
|
+
this.onMove();
|
|
1750
1719
|
}
|
|
1751
1720
|
}
|
|
1752
1721
|
assembleGeometry(geometry) {
|
|
@@ -2890,7 +2859,7 @@ DIVEInfo._supportsWebXR = null;
|
|
|
2890
2859
|
// package.json
|
|
2891
2860
|
var package_default = {
|
|
2892
2861
|
name: "@shopware-ag/dive",
|
|
2893
|
-
version: "1.16.
|
|
2862
|
+
version: "1.16.6",
|
|
2894
2863
|
description: "Shopware Spatial Framework",
|
|
2895
2864
|
type: "module",
|
|
2896
2865
|
main: "./build/dive.cjs",
|
|
@@ -3173,7 +3142,9 @@ var DIVE = class _DIVE {
|
|
|
3173
3142
|
console.log(this.scene);
|
|
3174
3143
|
}
|
|
3175
3144
|
};
|
|
3176
|
-
console.log(
|
|
3145
|
+
console.log(
|
|
3146
|
+
`DIVE ${package_default.version} initialized ${process.env.NODE_ENV === "development" ? "in development mode" : ""}`
|
|
3147
|
+
);
|
|
3177
3148
|
}
|
|
3178
3149
|
Dispose() {
|
|
3179
3150
|
var _a;
|