@shopware-ag/dive 1.16.5 → 1.16.7

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 CHANGED
@@ -423,12 +423,12 @@ var init_SelectTool = __esm({
423
423
  Activate() {
424
424
  }
425
425
  Select(selectable) {
426
- if (selectable.onSelect) selectable.onSelect();
427
426
  this.AttachGizmo(selectable);
427
+ if (selectable.onSelect) selectable.onSelect();
428
428
  }
429
429
  Deselect(selectable) {
430
- if (selectable.onDeselect) selectable.onDeselect();
431
430
  this.DetachGizmo();
431
+ if (selectable.onDeselect) selectable.onDeselect();
432
432
  }
433
433
  AttachGizmo(selectable) {
434
434
  if ("isMovable" in selectable) {
@@ -1161,8 +1161,9 @@ var _DIVECommunication = class _DIVECommunication {
1161
1161
  return true;
1162
1162
  }
1163
1163
  placeOnFloor(payload) {
1164
- if (!this.registered.get(payload.id)) return false;
1165
- this.scene.PlaceOnFloor(payload);
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
- var _a;
1558
+ const oldPos = this.position.clone();
1558
1559
  this.position.y = -this._boundingBox.min.y * this.scale.y;
1559
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1560
- "UPDATE_OBJECT",
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
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
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
- var _a;
1685
+ const oldPos = this.position.clone();
1701
1686
  this.position.y = -this._boundingBox.min.y * this.scale.y;
1702
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1703
- "UPDATE_OBJECT",
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
- (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
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.5",
2851
+ version: "1.16.7",
2883
2852
  description: "Shopware Spatial Framework",
2884
2853
  type: "module",
2885
2854
  main: "./build/dive.cjs",