@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 +29 -4
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.cts +10 -0
- package/build/dive.d.ts +10 -0
- package/build/dive.js +35 -5
- package/build/dive.js.map +1 -1
- package/package.json +1 -1
- package/src/group/Group.ts +16 -1
- package/src/group/__test__/Group.test.ts +97 -0
- package/src/math/degToRad/__test__/degToRad.test.ts +179 -0
- package/src/math/degToRad/degToRad.ts +5 -0
- package/src/math/index.ts +6 -0
- package/src/math/radToDeg/__test__/radToDeg.test.ts +162 -0
- package/src/math/radToDeg/radToDeg.ts +5 -0
- package/src/model/Model.ts +1 -1
- package/src/model/__test__/Model.test.ts +5 -3
- package/src/node/Node.ts +3 -0
- package/src/primitive/Primitive.ts +1 -1
- package/src/primitive/__test__/Primitive.test.ts +4 -3
package/build/dive.d.cts
CHANGED
|
@@ -391,6 +391,9 @@ declare class DIVENode extends Object3D implements DIVESelectable, DIVEMovable {
|
|
|
391
391
|
SetScale(scale: Vector3Like): void;
|
|
392
392
|
SetVisibility(visible: boolean): void;
|
|
393
393
|
SetToWorldOrigin(): void;
|
|
394
|
+
/**
|
|
395
|
+
* Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
|
|
396
|
+
*/
|
|
394
397
|
onMove(): void;
|
|
395
398
|
onSelect(): void;
|
|
396
399
|
onDeselect(): void;
|
|
@@ -401,6 +404,7 @@ declare class DIVEGroup extends DIVENode {
|
|
|
401
404
|
private _members;
|
|
402
405
|
private _lines;
|
|
403
406
|
constructor();
|
|
407
|
+
SetPosition(position: Vector3Like): void;
|
|
404
408
|
SetLinesVisibility(visible: boolean, object?: Object3D): void;
|
|
405
409
|
attach(object: DIVESceneObject): this;
|
|
406
410
|
remove(object: DIVESceneObject): this;
|
|
@@ -1005,6 +1009,10 @@ declare function toFixedExp(number: number, decimals?: number): string;
|
|
|
1005
1009
|
|
|
1006
1010
|
declare function truncateExp(number: number, decimals?: number): number;
|
|
1007
1011
|
|
|
1012
|
+
declare function radToDeg(radians: number): number;
|
|
1013
|
+
|
|
1014
|
+
declare function degToRad(degrees: number): number;
|
|
1015
|
+
|
|
1008
1016
|
declare const DIVEMath: {
|
|
1009
1017
|
ceilExp: typeof ceilExp;
|
|
1010
1018
|
floorExp: typeof floorExp;
|
|
@@ -1012,6 +1020,8 @@ declare const DIVEMath: {
|
|
|
1012
1020
|
toFixedExp: typeof toFixedExp;
|
|
1013
1021
|
truncateExp: typeof truncateExp;
|
|
1014
1022
|
signedAngleTo: typeof signedAngleTo;
|
|
1023
|
+
radToDeg: typeof radToDeg;
|
|
1024
|
+
degToRad: typeof degToRad;
|
|
1015
1025
|
};
|
|
1016
1026
|
|
|
1017
1027
|
type DIVESettings = {
|
package/build/dive.d.ts
CHANGED
|
@@ -391,6 +391,9 @@ declare class DIVENode extends Object3D implements DIVESelectable, DIVEMovable {
|
|
|
391
391
|
SetScale(scale: Vector3Like): void;
|
|
392
392
|
SetVisibility(visible: boolean): void;
|
|
393
393
|
SetToWorldOrigin(): void;
|
|
394
|
+
/**
|
|
395
|
+
* Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
|
|
396
|
+
*/
|
|
394
397
|
onMove(): void;
|
|
395
398
|
onSelect(): void;
|
|
396
399
|
onDeselect(): void;
|
|
@@ -401,6 +404,7 @@ declare class DIVEGroup extends DIVENode {
|
|
|
401
404
|
private _members;
|
|
402
405
|
private _lines;
|
|
403
406
|
constructor();
|
|
407
|
+
SetPosition(position: Vector3Like): void;
|
|
404
408
|
SetLinesVisibility(visible: boolean, object?: Object3D): void;
|
|
405
409
|
attach(object: DIVESceneObject): this;
|
|
406
410
|
remove(object: DIVESceneObject): this;
|
|
@@ -1005,6 +1009,10 @@ declare function toFixedExp(number: number, decimals?: number): string;
|
|
|
1005
1009
|
|
|
1006
1010
|
declare function truncateExp(number: number, decimals?: number): number;
|
|
1007
1011
|
|
|
1012
|
+
declare function radToDeg(radians: number): number;
|
|
1013
|
+
|
|
1014
|
+
declare function degToRad(degrees: number): number;
|
|
1015
|
+
|
|
1008
1016
|
declare const DIVEMath: {
|
|
1009
1017
|
ceilExp: typeof ceilExp;
|
|
1010
1018
|
floorExp: typeof floorExp;
|
|
@@ -1012,6 +1020,8 @@ declare const DIVEMath: {
|
|
|
1012
1020
|
toFixedExp: typeof toFixedExp;
|
|
1013
1021
|
truncateExp: typeof truncateExp;
|
|
1014
1022
|
signedAngleTo: typeof signedAngleTo;
|
|
1023
|
+
radToDeg: typeof radToDeg;
|
|
1024
|
+
degToRad: typeof degToRad;
|
|
1015
1025
|
};
|
|
1016
1026
|
|
|
1017
1027
|
type DIVESettings = {
|
package/build/dive.js
CHANGED
|
@@ -1458,6 +1458,9 @@ var DIVENode = class extends Object3D5 {
|
|
|
1458
1458
|
}
|
|
1459
1459
|
);
|
|
1460
1460
|
}
|
|
1461
|
+
/**
|
|
1462
|
+
* Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
|
|
1463
|
+
*/
|
|
1461
1464
|
onMove() {
|
|
1462
1465
|
var _a;
|
|
1463
1466
|
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
|
|
@@ -1555,7 +1558,7 @@ var DIVEModel = class extends DIVENode {
|
|
|
1555
1558
|
var _a;
|
|
1556
1559
|
const worldPos = this.getWorldPosition(this._positionWorldBuffer);
|
|
1557
1560
|
const oldWorldPos = worldPos.clone();
|
|
1558
|
-
worldPos.y =
|
|
1561
|
+
worldPos.y = (this._boundingBox.max.y - this._boundingBox.min.y) / 2;
|
|
1559
1562
|
if (worldPos.y === oldWorldPos.y) return;
|
|
1560
1563
|
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
|
|
1561
1564
|
"UPDATE_OBJECT",
|
|
@@ -1704,7 +1707,7 @@ var DIVEPrimitive = class extends DIVENode {
|
|
|
1704
1707
|
var _a;
|
|
1705
1708
|
const worldPos = this.getWorldPosition(this._positionWorldBuffer);
|
|
1706
1709
|
const oldWorldPos = worldPos.clone();
|
|
1707
|
-
worldPos.y =
|
|
1710
|
+
worldPos.y = (this._boundingBox.max.y - this._boundingBox.min.y) / 2;
|
|
1708
1711
|
if (worldPos.y === oldWorldPos.y) return;
|
|
1709
1712
|
(_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction(
|
|
1710
1713
|
"UPDATE_OBJECT",
|
|
@@ -1878,7 +1881,12 @@ var DIVEPrimitive = class extends DIVENode {
|
|
|
1878
1881
|
};
|
|
1879
1882
|
|
|
1880
1883
|
// src/group/Group.ts
|
|
1881
|
-
import {
|
|
1884
|
+
import {
|
|
1885
|
+
BufferGeometry as BufferGeometry2,
|
|
1886
|
+
Line,
|
|
1887
|
+
LineDashedMaterial,
|
|
1888
|
+
Vector3 as Vector35
|
|
1889
|
+
} from "three";
|
|
1882
1890
|
var DIVEGroup = class extends DIVENode {
|
|
1883
1891
|
// lines to children
|
|
1884
1892
|
constructor() {
|
|
@@ -1888,6 +1896,14 @@ var DIVEGroup = class extends DIVENode {
|
|
|
1888
1896
|
this._members = [];
|
|
1889
1897
|
this._lines = [];
|
|
1890
1898
|
}
|
|
1899
|
+
SetPosition(position) {
|
|
1900
|
+
super.SetPosition(position);
|
|
1901
|
+
this._members.forEach((member) => {
|
|
1902
|
+
if ("isDIVENode" in member) {
|
|
1903
|
+
member.onMove();
|
|
1904
|
+
}
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1891
1907
|
SetLinesVisibility(visible, object) {
|
|
1892
1908
|
if (!object) {
|
|
1893
1909
|
this._lines.forEach((line) => {
|
|
@@ -2931,7 +2947,7 @@ DIVEInfo._supportsWebXR = null;
|
|
|
2931
2947
|
// package.json
|
|
2932
2948
|
var package_default = {
|
|
2933
2949
|
name: "@shopware-ag/dive",
|
|
2934
|
-
version: "1.16.
|
|
2950
|
+
version: "1.16.10",
|
|
2935
2951
|
description: "Shopware Spatial Framework",
|
|
2936
2952
|
type: "module",
|
|
2937
2953
|
main: "./build/dive.cjs",
|
|
@@ -3049,6 +3065,18 @@ function truncateExp(number, decimals = 0) {
|
|
|
3049
3065
|
return shift(Math.trunc(n), -decimals);
|
|
3050
3066
|
}
|
|
3051
3067
|
|
|
3068
|
+
// src/math/radToDeg/radToDeg.ts
|
|
3069
|
+
import { MathUtils as MathUtils3 } from "three";
|
|
3070
|
+
function radToDeg(radians) {
|
|
3071
|
+
return (MathUtils3.radToDeg(radians) + 360) % 360;
|
|
3072
|
+
}
|
|
3073
|
+
|
|
3074
|
+
// src/math/degToRad/degToRad.ts
|
|
3075
|
+
import { MathUtils as MathUtils4 } from "three";
|
|
3076
|
+
function degToRad(degrees) {
|
|
3077
|
+
return MathUtils4.degToRad(degrees);
|
|
3078
|
+
}
|
|
3079
|
+
|
|
3052
3080
|
// src/math/index.ts
|
|
3053
3081
|
var DIVEMath = {
|
|
3054
3082
|
ceilExp,
|
|
@@ -3056,7 +3084,9 @@ var DIVEMath = {
|
|
|
3056
3084
|
roundExp: roundExponential,
|
|
3057
3085
|
toFixedExp,
|
|
3058
3086
|
truncateExp,
|
|
3059
|
-
signedAngleTo
|
|
3087
|
+
signedAngleTo,
|
|
3088
|
+
radToDeg,
|
|
3089
|
+
degToRad
|
|
3060
3090
|
};
|
|
3061
3091
|
|
|
3062
3092
|
// src/dive.ts
|