@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.cjs
CHANGED
|
@@ -1568,6 +1568,7 @@ var DIVEGroup = class extends import_three9.Object3D {
|
|
|
1568
1568
|
* Children's world positions are kept.
|
|
1569
1569
|
*/
|
|
1570
1570
|
recalculatePosition() {
|
|
1571
|
+
var _a;
|
|
1571
1572
|
const childrensWorldPositions = this.children.map((child) => child.getWorldPosition(new import_three9.Vector3()));
|
|
1572
1573
|
const bbcenter = this.updateBB();
|
|
1573
1574
|
this.position.copy(bbcenter);
|
|
@@ -1575,6 +1576,7 @@ var DIVEGroup = class extends import_three9.Object3D {
|
|
|
1575
1576
|
if (child.uuid === this._boxMesh.uuid) return;
|
|
1576
1577
|
child.position.copy(this.worldToLocal(childrensWorldPositions[i]));
|
|
1577
1578
|
});
|
|
1579
|
+
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position });
|
|
1578
1580
|
}
|
|
1579
1581
|
/**
|
|
1580
1582
|
* Updates the bounding box of the group.
|
|
@@ -1591,6 +1593,18 @@ var DIVEGroup = class extends import_three9.Object3D {
|
|
|
1591
1593
|
updateBoxMesh() {
|
|
1592
1594
|
this._boxMesh.geometry = new import_three9.BoxGeometry(this._bb.max.x - this._bb.min.x, this._bb.max.y - this._bb.min.y, this._bb.max.z - this._bb.min.z);
|
|
1593
1595
|
}
|
|
1596
|
+
onMove() {
|
|
1597
|
+
var _a;
|
|
1598
|
+
(_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 });
|
|
1599
|
+
}
|
|
1600
|
+
onSelect() {
|
|
1601
|
+
var _a;
|
|
1602
|
+
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("SELECT_OBJECT", { id: this.userData.id });
|
|
1603
|
+
}
|
|
1604
|
+
onDeselect() {
|
|
1605
|
+
var _a;
|
|
1606
|
+
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("DESELECT_OBJECT", { id: this.userData.id });
|
|
1607
|
+
}
|
|
1594
1608
|
};
|
|
1595
1609
|
|
|
1596
1610
|
// src/scene/root/Root.ts
|