sunrize 1.8.22 → 1.8.24
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.24",
|
|
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.34.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": "^12.0.
|
|
113
|
+
"x_ite": "^12.0.2",
|
|
114
114
|
"x3d-traverse": "^1.0.13"
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -220,22 +220,22 @@ class X3DGridNodeTool extends X3DActiveLayerNodeTool
|
|
|
220
220
|
index2 = (index0 + 2) % 3;
|
|
221
221
|
|
|
222
222
|
const y = [
|
|
223
|
-
absoluteMatrix .
|
|
224
|
-
absoluteMatrix .
|
|
225
|
-
absoluteMatrix .
|
|
223
|
+
absoluteMatrix .X_AXIS .copy (),
|
|
224
|
+
absoluteMatrix .Y_AXIS .copy (),
|
|
225
|
+
absoluteMatrix .Z_AXIS .copy (),
|
|
226
226
|
]; // Rotation axis, equates to grid normal
|
|
227
227
|
|
|
228
228
|
const z = [
|
|
229
|
-
absoluteMatrix .
|
|
230
|
-
absoluteMatrix .
|
|
231
|
-
absoluteMatrix .
|
|
229
|
+
absoluteMatrix .Y_AXIS .copy (),
|
|
230
|
+
absoluteMatrix .Z_AXIS .copy (),
|
|
231
|
+
absoluteMatrix .Y_AXIS .copy (),
|
|
232
232
|
]; // Axis which snaps, later transformed to grid space
|
|
233
233
|
|
|
234
234
|
const gridMatrix = this .getGridMatrix ();
|
|
235
235
|
|
|
236
236
|
const
|
|
237
237
|
Y = y [index1] .copy () .cross (y [index2]) .normalize (), // Normal of rotation plane
|
|
238
|
-
X = gridMatrix .
|
|
238
|
+
X = gridMatrix .Y_AXIS .copy () .cross (Y), // Intersection between both planes
|
|
239
239
|
Z = X .copy () .cross (Y), // Front vector
|
|
240
240
|
gridPlane = gridMatrix .submatrix .copy ();
|
|
241
241
|
|
|
@@ -245,7 +245,7 @@ class X3DGridNodeTool extends X3DActiveLayerNodeTool
|
|
|
245
245
|
|
|
246
246
|
// If X or Z are near 0 then Y is collinear to the y-axis.
|
|
247
247
|
|
|
248
|
-
if (1 - Math .abs (gridMatrix .
|
|
248
|
+
if (1 - Math .abs (gridMatrix .Y_AXIS .normalize () .dot (Y)) < 1e-6)
|
|
249
249
|
{
|
|
250
250
|
rotationPlane = new X3D .Matrix3 ();
|
|
251
251
|
gridRotation = new X3D .Matrix3 ();
|
|
@@ -138,7 +138,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
138
138
|
|
|
139
139
|
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
140
140
|
|
|
141
|
-
if (snapTranslation .equals (X3D .Vector3 .
|
|
141
|
+
if (snapTranslation .equals (X3D .Vector3 .ZERO))
|
|
142
142
|
return;
|
|
143
143
|
|
|
144
144
|
// Snap translation.
|
|
@@ -183,9 +183,9 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
183
183
|
index2 = (index0 + 2) % 3;
|
|
184
184
|
|
|
185
185
|
const axes = [
|
|
186
|
-
absoluteMatrix .
|
|
187
|
-
absoluteMatrix .
|
|
188
|
-
absoluteMatrix .
|
|
186
|
+
absoluteMatrix .X_AXIS .copy (),
|
|
187
|
+
absoluteMatrix .Y_AXIS .copy (),
|
|
188
|
+
absoluteMatrix .Z_AXIS .copy (),
|
|
189
189
|
]; // Rotation axis, equates to grid normal.
|
|
190
190
|
|
|
191
191
|
const
|
|
@@ -251,7 +251,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
251
251
|
|
|
252
252
|
this .tool .snapped = Math .abs (snapRotation .angle) > 0.0001;
|
|
253
253
|
|
|
254
|
-
if (snapRotation .equals (X3D .Rotation4 .
|
|
254
|
+
if (snapRotation .equals (X3D .Rotation4 .IDENTITY))
|
|
255
255
|
return;
|
|
256
256
|
|
|
257
257
|
// Snap rotation.
|
|
@@ -379,7 +379,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
379
379
|
|
|
380
380
|
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
381
381
|
|
|
382
|
-
if (snapTranslation .equals (X3D .Vector3 .
|
|
382
|
+
if (snapTranslation .equals (X3D .Vector3 .ZERO))
|
|
383
383
|
return undefined;
|
|
384
384
|
|
|
385
385
|
const
|
|
@@ -419,7 +419,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
419
419
|
|
|
420
420
|
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
421
421
|
|
|
422
|
-
if (snapTranslation .equals (X3D .Vector3 .
|
|
422
|
+
if (snapTranslation .equals (X3D .Vector3 .ZERO))
|
|
423
423
|
return undefined;
|
|
424
424
|
|
|
425
425
|
const
|
|
@@ -527,7 +527,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
527
527
|
|
|
528
528
|
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
529
529
|
|
|
530
|
-
if (snapTranslation .equals (X3D .Vector3 .
|
|
530
|
+
if (snapTranslation .equals (X3D .Vector3 .ZERO))
|
|
531
531
|
return undefined;
|
|
532
532
|
|
|
533
533
|
const
|
|
@@ -586,7 +586,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
586
586
|
|
|
587
587
|
this .tool .snapped = snapTranslation .norm () > 0.0001;
|
|
588
588
|
|
|
589
|
-
if (snapTranslation .equals (X3D .Vector3 .
|
|
589
|
+
if (snapTranslation .equals (X3D .Vector3 .ZERO))
|
|
590
590
|
return undefined;
|
|
591
591
|
|
|
592
592
|
const
|
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 .
|
|
2409
|
-
bboxYAxes = bboxMatrix .
|
|
2410
|
-
bboxZAxes = bboxMatrix .
|
|
2408
|
+
bboxXAxes = bboxMatrix .X_AXIS .norm () ? bboxMatrix .X_AXIS : X3D .Vector3 .X_AXIS,
|
|
2409
|
+
bboxYAxes = bboxMatrix .Y_AXIS .norm () ? bboxMatrix .Y_AXIS : X3D .Vector3 .Y_AXIS,
|
|
2410
|
+
bboxZAxes = bboxMatrix .Z_AXIS .norm () ? bboxMatrix .Z_AXIS : X3D .Vector3 .Z_AXIS;
|
|
2411
2411
|
|
|
2412
2412
|
const axes = [
|
|
2413
2413
|
bboxXAxes .copy (), // right
|
|
@@ -2603,17 +2603,17 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
2603
2603
|
switch (type)
|
|
2604
2604
|
{
|
|
2605
2605
|
case X3D .X3DConstants .DirectionalLight:
|
|
2606
|
-
return new X3D .Box3 (X3D .Vector3 .
|
|
2607
|
-
.multLeft (new X3D .Matrix4 () .setRotation (new X3D .Rotation4 (X3D .Vector3 .
|
|
2606
|
+
return new X3D .Box3 (X3D .Vector3 .ONE, innerNode .getMetaData ("DirectionalLight/location", new X3D .Vector3 ()))
|
|
2607
|
+
.multLeft (new X3D .Matrix4 () .setRotation (new X3D .Rotation4 (X3D .Vector3 .Z_AXIS, innerNode ._direction .getValue ())))
|
|
2608
2608
|
.multRight (modelMatrix);
|
|
2609
2609
|
case X3D .X3DConstants .PointLight:
|
|
2610
|
-
return new X3D .Box3 (X3D .Vector3 .
|
|
2610
|
+
return new X3D .Box3 (X3D .Vector3 .ONE, innerNode ._location .getValue ())
|
|
2611
2611
|
.multRight (modelMatrix);
|
|
2612
2612
|
case X3D .X3DConstants .SpotLight:
|
|
2613
2613
|
case X3D .X3DConstants .Sound:
|
|
2614
2614
|
case X3D .X3DConstants .X3DTextureProjectorNode:
|
|
2615
|
-
return new X3D .Box3 (X3D .Vector3 .
|
|
2616
|
-
.multLeft (new X3D .Matrix4 () .setRotation (new X3D .Rotation4 (X3D .Vector3 .
|
|
2615
|
+
return new X3D .Box3 (X3D .Vector3 .ONE, innerNode ._location .getValue ())
|
|
2616
|
+
.multLeft (new X3D .Matrix4 () .setRotation (new X3D .Rotation4 (X3D .Vector3 .Z_AXIS, innerNode ._direction .getValue ())))
|
|
2617
2617
|
.multRight (modelMatrix);
|
|
2618
2618
|
case X3D .X3DConstants .X3DBoundedObject:
|
|
2619
2619
|
return innerNode .getBBox (new X3D .Box3 ()) .multRight (modelMatrix);
|
|
@@ -2624,7 +2624,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
2624
2624
|
return new X3D .Box3 (innerNode ._size .getValue (), innerNode ._center .getValue ())
|
|
2625
2625
|
.multRight (modelMatrix);
|
|
2626
2626
|
case X3D .X3DConstants .X3DViewpointNode:
|
|
2627
|
-
return new X3D .Box3 (X3D .Vector3 .
|
|
2627
|
+
return new X3D .Box3 (X3D .Vector3 .ONE, innerNode ._position .getValue ())
|
|
2628
2628
|
.multLeft (new X3D .Matrix4 () .setRotation (innerNode ._orientation .getValue ()))
|
|
2629
2629
|
.multRight (modelMatrix);
|
|
2630
2630
|
case X3D .X3DConstants .X3DLayerNode:
|
|
@@ -3300,7 +3300,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
3300
3300
|
this .setFieldValue (executionContext, node, node ._position, position, undoManager);
|
|
3301
3301
|
}
|
|
3302
3302
|
|
|
3303
|
-
if (node ._direction && !node ._direction .getValue () .equals (X3D .Vector3 .
|
|
3303
|
+
if (node ._direction && !node ._direction .getValue () .equals (X3D .Vector3 .ZERO))
|
|
3304
3304
|
{
|
|
3305
3305
|
const direction = modelMatrix .multDirMatrix (node ._direction .getValue () .copy ()) .normalize ();
|
|
3306
3306
|
|