@shopware-ag/dive 1.16.8 → 1.16.10

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
@@ -1468,6 +1468,9 @@ var DIVENode = class extends import_three7.Object3D {
1468
1468
  }
1469
1469
  );
1470
1470
  }
1471
+ /**
1472
+ * Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
1473
+ */
1471
1474
  onMove() {
1472
1475
  var _a;
1473
1476
  (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
@@ -1565,7 +1568,7 @@ var DIVEModel = class extends DIVENode {
1565
1568
  var _a;
1566
1569
  const worldPos = this.getWorldPosition(this._positionWorldBuffer);
1567
1570
  const oldWorldPos = worldPos.clone();
1568
- worldPos.y = -this._boundingBox.min.y * this.scale.y;
1571
+ worldPos.y = (this._boundingBox.max.y - this._boundingBox.min.y) / 2;
1569
1572
  if (worldPos.y === oldWorldPos.y) return;
1570
1573
  (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1571
1574
  "UPDATE_OBJECT",
@@ -1702,7 +1705,7 @@ var DIVEPrimitive = class extends DIVENode {
1702
1705
  var _a;
1703
1706
  const worldPos = this.getWorldPosition(this._positionWorldBuffer);
1704
1707
  const oldWorldPos = worldPos.clone();
1705
- worldPos.y = -this._boundingBox.min.y * this.scale.y;
1708
+ worldPos.y = (this._boundingBox.max.y - this._boundingBox.min.y) / 2;
1706
1709
  if (worldPos.y === oldWorldPos.y) return;
1707
1710
  (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
1708
1711
  "UPDATE_OBJECT",
@@ -1886,6 +1889,14 @@ var DIVEGroup = class extends DIVENode {
1886
1889
  this._members = [];
1887
1890
  this._lines = [];
1888
1891
  }
1892
+ SetPosition(position) {
1893
+ super.SetPosition(position);
1894
+ this._members.forEach((member) => {
1895
+ if ("isDIVENode" in member) {
1896
+ member.onMove();
1897
+ }
1898
+ });
1899
+ }
1889
1900
  SetLinesVisibility(visible, object) {
1890
1901
  if (!object) {
1891
1902
  this._lines.forEach((line) => {
@@ -2918,7 +2929,7 @@ DIVEInfo._supportsWebXR = null;
2918
2929
  // package.json
2919
2930
  var package_default = {
2920
2931
  name: "@shopware-ag/dive",
2921
- version: "1.16.8",
2932
+ version: "1.16.10",
2922
2933
  description: "Shopware Spatial Framework",
2923
2934
  type: "module",
2924
2935
  main: "./build/dive.cjs",
@@ -3036,6 +3047,18 @@ function truncateExp(number, decimals = 0) {
3036
3047
  return shift(Math.trunc(n), -decimals);
3037
3048
  }
3038
3049
 
3050
+ // src/math/radToDeg/radToDeg.ts
3051
+ var import_three17 = require("three");
3052
+ function radToDeg(radians) {
3053
+ return (import_three17.MathUtils.radToDeg(radians) + 360) % 360;
3054
+ }
3055
+
3056
+ // src/math/degToRad/degToRad.ts
3057
+ var import_three18 = require("three");
3058
+ function degToRad(degrees) {
3059
+ return import_three18.MathUtils.degToRad(degrees);
3060
+ }
3061
+
3039
3062
  // src/math/index.ts
3040
3063
  var DIVEMath = {
3041
3064
  ceilExp,
@@ -3043,7 +3066,9 @@ var DIVEMath = {
3043
3066
  roundExp: roundExponential,
3044
3067
  toFixedExp,
3045
3068
  truncateExp,
3046
- signedAngleTo
3069
+ signedAngleTo,
3070
+ radToDeg,
3071
+ degToRad
3047
3072
  };
3048
3073
 
3049
3074
  // src/dive.ts