sunrize 1.8.16 → 1.8.17
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.17",
|
|
5
5
|
"description": "A Multi-Platform X3D Editor",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"jquery-ui-dist": "^1.13.3",
|
|
101
101
|
"jstree": "^3.3.17",
|
|
102
102
|
"material-icons": "^1.13.14",
|
|
103
|
-
"material-symbols": "^0.
|
|
103
|
+
"material-symbols": "^0.33.0",
|
|
104
104
|
"md5": "^2.3.0",
|
|
105
105
|
"mime-types": "^3.0.1",
|
|
106
106
|
"monaco-editor": "^0.50.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"string-similarity": "^4.0.4",
|
|
111
111
|
"tweakpane": "^3.1.10",
|
|
112
112
|
"update-electron-app": "^3.1.1",
|
|
113
|
-
"x_ite": "^11.6.
|
|
113
|
+
"x_ite": "^11.6.2",
|
|
114
114
|
"x3d-traverse": "^1.0.13"
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -1145,7 +1145,7 @@ Viewpoint {
|
|
|
1145
1145
|
nodes = selection .nodes,
|
|
1146
1146
|
[values, bbox] = Editor .getModelMatricesAndBBoxes (executionContext, layerNode, nodes);
|
|
1147
1147
|
|
|
1148
|
-
if (!bbox .size .
|
|
1148
|
+
if (!bbox .size .norm ())
|
|
1149
1149
|
return;
|
|
1150
1150
|
|
|
1151
1151
|
UndoManager .shared .beginUndo (_("Center SnapTarget in Selection"));
|
|
@@ -425,18 +425,14 @@ DEF ScreenText Transform {
|
|
|
425
425
|
typeName: "EnvironmentLight",
|
|
426
426
|
x3dSyntax: `
|
|
427
427
|
EnvironmentLight {
|
|
428
|
-
|
|
429
|
-
url "https://cdn.jsdelivr.net/npm/x3d-image@2.
|
|
430
|
-
textureProperties
|
|
428
|
+
specularTexture ImageCubeMapTexture {
|
|
429
|
+
url "https://cdn.jsdelivr.net/npm/x3d-image@2.2.0/src/images/cannon-exterior.avif"
|
|
430
|
+
textureProperties TextureProperties {
|
|
431
431
|
generateMipMaps TRUE
|
|
432
432
|
minificationFilter "NICEST"
|
|
433
433
|
magnificationFilter "NICEST"
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
specularTexture ImageCubeMapTexture {
|
|
437
|
-
url "https://cdn.jsdelivr.net/npm/x3d-image@2.1.3/src/images/cannon-exterior-specular.avif"
|
|
438
|
-
textureProperties USE _1
|
|
439
|
-
}
|
|
440
436
|
}
|
|
441
437
|
`
|
|
442
438
|
},
|
|
@@ -20,10 +20,10 @@ class AngleGridTool extends X3DGridNodeTool
|
|
|
20
20
|
// Calculate snapping radius and snapping angle
|
|
21
21
|
|
|
22
22
|
const
|
|
23
|
-
complex
|
|
24
|
-
phi
|
|
25
|
-
radius
|
|
26
|
-
angle
|
|
23
|
+
complex = new X3D .Complex (translation .x, translation .z),
|
|
24
|
+
phi = 2 * Math .PI / this .tool .dimension [1],
|
|
25
|
+
radius = complex .magnitude,
|
|
26
|
+
angle = complex .angle;
|
|
27
27
|
|
|
28
28
|
let
|
|
29
29
|
snapRadius = Math .round (radius),
|
|
@@ -136,7 +136,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
136
136
|
|
|
137
137
|
const snapTranslation = snapTranslationX .add (snapTranslationY) .add (snapTranslationZ);
|
|
138
138
|
|
|
139
|
-
this .tool .snapped = snapTranslation .
|
|
139
|
+
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
140
140
|
|
|
141
141
|
if (snapTranslation .equals (X3D .Vector3 .Zero))
|
|
142
142
|
return;
|
|
@@ -206,7 +206,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
206
206
|
|
|
207
207
|
const
|
|
208
208
|
dynamicSnapDistance = this .getDynamicSnapDistance () * 2,
|
|
209
|
-
distance = Math .max (bbox .center .distance (center), bbox .size .
|
|
209
|
+
distance = Math .max (bbox .center .distance (center), bbox .size .norm ()),
|
|
210
210
|
snapPoint = snapVector .copy () .multiply (distance),
|
|
211
211
|
point1a = axis1 .copy () .multiply (distance),
|
|
212
212
|
point1b = axis1 .copy () .negate () .multiply (distance),
|
|
@@ -326,7 +326,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
326
326
|
axis = axes [i],
|
|
327
327
|
normal = normals [i],
|
|
328
328
|
positionPlane = new X3D .Plane3 (position, normal),
|
|
329
|
-
axisLine = new X3D .Line3 (center, axis .
|
|
329
|
+
axisLine = new X3D .Line3 (center, axis .norm () > 0 ? axis .copy () .normalize () : normal),
|
|
330
330
|
intersection = new X3D .Vector3 (),
|
|
331
331
|
intersected = positionPlane .intersectsLine (axisLine, intersection);
|
|
332
332
|
|
|
@@ -335,14 +335,14 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
335
335
|
|
|
336
336
|
const translation = intersection .subtract (center);
|
|
337
337
|
|
|
338
|
-
if (translation .
|
|
338
|
+
if (translation .norm () > snapDistance)
|
|
339
339
|
continue;
|
|
340
340
|
|
|
341
341
|
translations .push ([translation, i]);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
if (translations .length)
|
|
345
|
-
return translations .reduce (([p, pi], [c, ci]) => p .
|
|
345
|
+
return translations .reduce (([p, pi], [c, ci]) => p .norm () < c .norm () ? [p, pi] : [c, ci]);
|
|
346
346
|
|
|
347
347
|
return [new X3D .Vector3 (), undefined];
|
|
348
348
|
}
|
|
@@ -377,7 +377,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
377
377
|
|
|
378
378
|
const [snapTranslation, aAxis] = this .getSnapTranslation (absolutePosition, aCenters, aAxes, aNormals, dynamicSnapDistance);
|
|
379
379
|
|
|
380
|
-
this .tool .snapped = snapTranslation .
|
|
380
|
+
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
381
381
|
|
|
382
382
|
if (snapTranslation .equals (X3D .Vector3 .Zero))
|
|
383
383
|
return undefined;
|
|
@@ -386,7 +386,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
386
386
|
aBefore = aAxes [aAxis],
|
|
387
387
|
aAfter = aAxes [aAxis] .copy () .add (snapTranslation),
|
|
388
388
|
aDelta = aAfter .distance (aBefore),
|
|
389
|
-
aRatio = aAfter .
|
|
389
|
+
aRatio = aAfter .norm () / aBefore .norm ();
|
|
390
390
|
|
|
391
391
|
if (Math .abs (aDelta) < MIN_DELTA || Math .abs (aRatio) < MIN_RATIO || isNaN (aRatio) || Math .abs (aRatio) === Infinity)
|
|
392
392
|
{
|
|
@@ -417,7 +417,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
417
417
|
|
|
418
418
|
const [snapTranslation, aAxis] = this .getSnapTranslation (absolutePosition, aCenters, aAxes, aNormals, dynamicSnapDistance);
|
|
419
419
|
|
|
420
|
-
this .tool .snapped = snapTranslation .
|
|
420
|
+
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
421
421
|
|
|
422
422
|
if (snapTranslation .equals (X3D .Vector3 .Zero))
|
|
423
423
|
return undefined;
|
|
@@ -426,7 +426,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
426
426
|
aBefore = aAxes [aAxis] .copy () .multiply (2),
|
|
427
427
|
aAfter = aBefore .copy () .add (snapTranslation),
|
|
428
428
|
aDelta = aAfter .distance (aBefore),
|
|
429
|
-
aRatio = aAfter .
|
|
429
|
+
aRatio = aAfter .norm () / aBefore .norm ();
|
|
430
430
|
|
|
431
431
|
if (Math .abs (aDelta) < MIN_DELTA || Math .abs (aRatio) < MIN_RATIO || isNaN (aRatio) || Math .abs (aRatio) === Infinity)
|
|
432
432
|
{
|
|
@@ -525,7 +525,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
525
525
|
|
|
526
526
|
const [snapTranslation, aAxis] = this .getSnapTranslation (absolutePosition, aCenters, aAxes, aNormals, dynamicSnapDistance);
|
|
527
527
|
|
|
528
|
-
this .tool .snapped = snapTranslation .
|
|
528
|
+
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
529
529
|
|
|
530
530
|
if (snapTranslation .equals (X3D .Vector3 .Zero))
|
|
531
531
|
return undefined;
|
|
@@ -534,7 +534,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
534
534
|
aBefore = aAxes [aAxis],
|
|
535
535
|
aAfter = aAxes [aAxis] .copy () .add (snapTranslation),
|
|
536
536
|
aDelta = aAfter .distance (aBefore),
|
|
537
|
-
aRatio = aAfter .
|
|
537
|
+
aRatio = aAfter .norm () / aBefore .norm ();
|
|
538
538
|
|
|
539
539
|
if (Math .abs (aDelta) < MIN_DELTA || Math .abs (aRatio) < MIN_RATIO || isNaN (aRatio) || Math .abs (aRatio) === Infinity)
|
|
540
540
|
{
|
|
@@ -584,7 +584,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
584
584
|
|
|
585
585
|
const [snapTranslation, aAxis] = this .getSnapTranslation (absolutePosition, aCenters, aAxes, aNormals, dynamicSnapDistance);
|
|
586
586
|
|
|
587
|
-
this .tool .snapped = snapTranslation .
|
|
587
|
+
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
588
588
|
|
|
589
589
|
if (snapTranslation .equals (X3D .Vector3 .Zero))
|
|
590
590
|
return undefined;
|
|
@@ -593,7 +593,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
593
593
|
aBefore = aAxes [aAxis] .copy () .multiply (2),
|
|
594
594
|
aAfter = aBefore .copy () .add (snapTranslation),
|
|
595
595
|
aDelta = aAfter .distance (aBefore),
|
|
596
|
-
aRatio = aAfter .
|
|
596
|
+
aRatio = aAfter .norm () / aBefore .norm ();
|
|
597
597
|
|
|
598
598
|
if (Math .abs (aDelta) < MIN_DELTA || Math .abs (aRatio) < MIN_RATIO || isNaN (aRatio) || Math .abs (aRatio) === Infinity)
|
|
599
599
|
{
|
package/src/Undo/Editor.js
CHANGED
|
@@ -2405,9 +2405,9 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
2405
2405
|
{
|
|
2406
2406
|
const
|
|
2407
2407
|
bboxMatrix = subBBoxes [0] .matrix,
|
|
2408
|
-
bboxXAxes = bboxMatrix .xAxis .
|
|
2409
|
-
bboxYAxes = bboxMatrix .yAxis .
|
|
2410
|
-
bboxZAxes = bboxMatrix .zAxis .
|
|
2408
|
+
bboxXAxes = bboxMatrix .xAxis .norm () ? bboxMatrix .xAxis : X3D .Vector3 .xAxis,
|
|
2409
|
+
bboxYAxes = bboxMatrix .yAxis .norm () ? bboxMatrix .yAxis : X3D .Vector3 .yAxis,
|
|
2410
|
+
bboxZAxes = bboxMatrix .zAxis .norm () ? bboxMatrix .zAxis : X3D .Vector3 .zAxis;
|
|
2411
2411
|
|
|
2412
2412
|
const axes = [
|
|
2413
2413
|
bboxXAxes .copy (), // right
|