@shopware-ag/dive 1.15.2 → 1.15.3
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 +16 -1
- package/build/dive.cjs.map +1 -1
- package/build/dive.js +16 -1
- package/build/dive.js.map +1 -1
- package/package.json +1 -1
- package/src/group/Group.ts +13 -0
- package/src/scene/root/Root.ts +11 -2
package/build/dive.cjs
CHANGED
|
@@ -1540,6 +1540,9 @@ var DIVEGroup = class extends DIVENode {
|
|
|
1540
1540
|
*/
|
|
1541
1541
|
updateBB() {
|
|
1542
1542
|
this._boundingBox.makeEmpty();
|
|
1543
|
+
if (this.children.length === 1) {
|
|
1544
|
+
return this.position.clone();
|
|
1545
|
+
}
|
|
1543
1546
|
this.children.forEach((child) => {
|
|
1544
1547
|
if (child.uuid === this._boxMesh.uuid) return;
|
|
1545
1548
|
this._boundingBox.expandByObject(child);
|
|
@@ -1547,9 +1550,14 @@ var DIVEGroup = class extends DIVENode {
|
|
|
1547
1550
|
return this._boundingBox.getCenter(new import_three10.Vector3());
|
|
1548
1551
|
}
|
|
1549
1552
|
updateBoxMesh() {
|
|
1553
|
+
if (this.children.length === 1) {
|
|
1554
|
+
this._boxMesh.visible = false;
|
|
1555
|
+
return;
|
|
1556
|
+
}
|
|
1550
1557
|
this._boxMesh.quaternion.copy(this.quaternion.clone().invert());
|
|
1551
1558
|
this._boxMesh.scale.set(1 / this.scale.x, 1 / this.scale.y, 1 / this.scale.z);
|
|
1552
1559
|
this._boxMesh.geometry = new import_three10.BoxGeometry(this._boundingBox.max.x - this._boundingBox.min.x, this._boundingBox.max.y - this._boundingBox.min.y, this._boundingBox.max.z - this._boundingBox.min.z);
|
|
1560
|
+
this._boxMesh.visible = true;
|
|
1553
1561
|
}
|
|
1554
1562
|
onMove() {
|
|
1555
1563
|
super.onMove();
|
|
@@ -1576,7 +1584,14 @@ var DIVERoot = class extends import_three11.Object3D {
|
|
|
1576
1584
|
return bb;
|
|
1577
1585
|
}
|
|
1578
1586
|
GetSceneObject(object) {
|
|
1579
|
-
|
|
1587
|
+
let foundObject;
|
|
1588
|
+
this.traverse((object3D) => {
|
|
1589
|
+
if (foundObject) return;
|
|
1590
|
+
if (object3D.userData.id === object.id) {
|
|
1591
|
+
foundObject = object3D;
|
|
1592
|
+
}
|
|
1593
|
+
});
|
|
1594
|
+
return foundObject;
|
|
1580
1595
|
}
|
|
1581
1596
|
AddSceneObject(object) {
|
|
1582
1597
|
switch (object.entityType) {
|