@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.cjs
CHANGED
|
@@ -1161,8 +1161,9 @@ var _DIVECommunication = class _DIVECommunication {
|
|
|
1161
1161
|
return true;
|
|
1162
1162
|
}
|
|
1163
1163
|
placeOnFloor(payload) {
|
|
1164
|
-
|
|
1165
|
-
|
|
1164
|
+
const object = this.registered.get(payload.id);
|
|
1165
|
+
if (!object) return false;
|
|
1166
|
+
this.scene.PlaceOnFloor(object);
|
|
1166
1167
|
return true;
|
|
1167
1168
|
}
|
|
1168
1169
|
setCameraTransform(payload) {
|
|
@@ -1554,20 +1555,12 @@ var DIVEModel = class extends DIVENode {
|
|
|
1554
1555
|
}
|
|
1555
1556
|
}
|
|
1556
1557
|
PlaceOnFloor() {
|
|
1557
|
-
|
|
1558
|
+
const oldPos = this.position.clone();
|
|
1558
1559
|
this.position.y = -this._boundingBox.min.y * this.scale.y;
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
{
|
|
1562
|
-
id: this.userData.id,
|
|
1563
|
-
position: this.position,
|
|
1564
|
-
rotation: this.rotation,
|
|
1565
|
-
scale: this.scale
|
|
1566
|
-
}
|
|
1567
|
-
);
|
|
1560
|
+
if (this.position.y === oldPos.y) return;
|
|
1561
|
+
this.onMove();
|
|
1568
1562
|
}
|
|
1569
1563
|
DropIt() {
|
|
1570
|
-
var _a;
|
|
1571
1564
|
if (!this.parent) {
|
|
1572
1565
|
console.warn(
|
|
1573
1566
|
"DIVEModel: DropIt() called on a model that is not in the scene.",
|
|
@@ -1595,15 +1588,7 @@ var DIVEModel = class extends DIVENode {
|
|
|
1595
1588
|
const newPos = this.position.clone().setY(worldPos.y).sub(new import_three8.Vector3(0, bottomY, 0));
|
|
1596
1589
|
this.position.copy(newPos);
|
|
1597
1590
|
if (this.position.y === oldPos.y) return;
|
|
1598
|
-
|
|
1599
|
-
"UPDATE_OBJECT",
|
|
1600
|
-
{
|
|
1601
|
-
id: this.userData.id,
|
|
1602
|
-
position: this.position,
|
|
1603
|
-
rotation: this.rotation,
|
|
1604
|
-
scale: this.scale
|
|
1605
|
-
}
|
|
1606
|
-
);
|
|
1591
|
+
this.onMove();
|
|
1607
1592
|
}
|
|
1608
1593
|
}
|
|
1609
1594
|
};
|
|
@@ -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 import_three9.Vector3(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) {
|
|
@@ -2879,7 +2848,7 @@ DIVEInfo._supportsWebXR = null;
|
|
|
2879
2848
|
// package.json
|
|
2880
2849
|
var package_default = {
|
|
2881
2850
|
name: "@shopware-ag/dive",
|
|
2882
|
-
version: "1.16.
|
|
2851
|
+
version: "1.16.6",
|
|
2883
2852
|
description: "Shopware Spatial Framework",
|
|
2884
2853
|
type: "module",
|
|
2885
2854
|
main: "./build/dive.cjs",
|
|
@@ -3162,7 +3131,9 @@ var DIVE = class _DIVE {
|
|
|
3162
3131
|
console.log(this.scene);
|
|
3163
3132
|
}
|
|
3164
3133
|
};
|
|
3165
|
-
console.log(
|
|
3134
|
+
console.log(
|
|
3135
|
+
`DIVE ${package_default.version} initialized ${process.env.NODE_ENV === "development" ? "in development mode" : ""}`
|
|
3136
|
+
);
|
|
3166
3137
|
}
|
|
3167
3138
|
Dispose() {
|
|
3168
3139
|
var _a;
|