@shopware-ag/dive 1.13.0 → 1.14.0
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 +14 -0
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.cts +3 -0
- package/build/dive.d.ts +3 -0
- package/build/dive.js +14 -0
- package/build/dive.js.map +1 -1
- package/package.json +1 -1
- package/src/group/Group.ts +15 -0
- package/src/group/__test__/Group.test.ts +33 -0
package/build/dive.d.cts
CHANGED
package/build/dive.d.ts
CHANGED
package/build/dive.js
CHANGED
|
@@ -1546,6 +1546,7 @@ var DIVEGroup = class extends Object3D7 {
|
|
|
1546
1546
|
* Children's world positions are kept.
|
|
1547
1547
|
*/
|
|
1548
1548
|
recalculatePosition() {
|
|
1549
|
+
var _a;
|
|
1549
1550
|
const childrensWorldPositions = this.children.map((child) => child.getWorldPosition(new Vector34()));
|
|
1550
1551
|
const bbcenter = this.updateBB();
|
|
1551
1552
|
this.position.copy(bbcenter);
|
|
@@ -1553,6 +1554,7 @@ var DIVEGroup = class extends Object3D7 {
|
|
|
1553
1554
|
if (child.uuid === this._boxMesh.uuid) return;
|
|
1554
1555
|
child.position.copy(this.worldToLocal(childrensWorldPositions[i]));
|
|
1555
1556
|
});
|
|
1557
|
+
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position });
|
|
1556
1558
|
}
|
|
1557
1559
|
/**
|
|
1558
1560
|
* Updates the bounding box of the group.
|
|
@@ -1569,6 +1571,18 @@ var DIVEGroup = class extends Object3D7 {
|
|
|
1569
1571
|
updateBoxMesh() {
|
|
1570
1572
|
this._boxMesh.geometry = new BoxGeometry2(this._bb.max.x - this._bb.min.x, this._bb.max.y - this._bb.min.y, this._bb.max.z - this._bb.min.z);
|
|
1571
1573
|
}
|
|
1574
|
+
onMove() {
|
|
1575
|
+
var _a;
|
|
1576
|
+
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position, rotation: this.rotation, scale: this.scale });
|
|
1577
|
+
}
|
|
1578
|
+
onSelect() {
|
|
1579
|
+
var _a;
|
|
1580
|
+
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("SELECT_OBJECT", { id: this.userData.id });
|
|
1581
|
+
}
|
|
1582
|
+
onDeselect() {
|
|
1583
|
+
var _a;
|
|
1584
|
+
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("DESELECT_OBJECT", { id: this.userData.id });
|
|
1585
|
+
}
|
|
1572
1586
|
};
|
|
1573
1587
|
|
|
1574
1588
|
// src/scene/root/Root.ts
|