sunrize 2.0.17 → 2.1.1
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 +11 -11
- package/src/Editors/OutlineEditor.js +4 -0
- package/src/Tools/Grids/X3DGridNodeTool.js +11 -11
- package/src/Tools/Grouping/X3DBoundedObjectTool.x3d +45 -42
- package/src/Tools/Grouping/X3DTransformNodeTool.js +9 -10
- package/src/Tools/Grouping/X3DTransformNodeTool.x3d +31 -31
- package/src/Tools/Layout/LayoutGroupTool.js +39 -1
- package/src/Tools/SnapTool/SnapTarget.js +11 -11
- package/src/Undo/Editor.js +12 -11
- package/src/assets/X3DUOM.xml +339 -330
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"description": "Sunrize — A Multi-Platform X3D Editor",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -80,20 +80,20 @@
|
|
|
80
80
|
"url": "https://patreon.com/X_ITE"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@electron-forge/cli": "^7.11.
|
|
84
|
-
"@electron-forge/maker-deb": "^7.11.
|
|
85
|
-
"@electron-forge/maker-dmg": "^7.11.
|
|
86
|
-
"@electron-forge/maker-rpm": "^7.11.
|
|
87
|
-
"@electron-forge/maker-squirrel": "^7.11.
|
|
88
|
-
"@electron-forge/maker-zip": "^7.11.
|
|
89
|
-
"@electron-forge/publisher-github": "^7.11.
|
|
83
|
+
"@electron-forge/cli": "^7.11.2",
|
|
84
|
+
"@electron-forge/maker-deb": "^7.11.2",
|
|
85
|
+
"@electron-forge/maker-dmg": "^7.11.2",
|
|
86
|
+
"@electron-forge/maker-rpm": "^7.11.2",
|
|
87
|
+
"@electron-forge/maker-squirrel": "^7.11.2",
|
|
88
|
+
"@electron-forge/maker-zip": "^7.11.2",
|
|
89
|
+
"@electron-forge/publisher-github": "^7.11.2",
|
|
90
90
|
"shell-tools": "^1.1.9"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@vscode/codicons": "^0.0.45",
|
|
94
94
|
"capitalize": "^2.0.4",
|
|
95
95
|
"console": "^0.7.2",
|
|
96
|
-
"electron": "^42.
|
|
96
|
+
"electron": "^42.2.0",
|
|
97
97
|
"electron-prompt": "^1.7.0",
|
|
98
98
|
"electron-squirrel-startup": "^1.0.1",
|
|
99
99
|
"electron-tabs": "^1.0.4",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"jquery-ui-dist": "^1.13.3",
|
|
103
103
|
"jstree": "^3.3.17",
|
|
104
104
|
"material-icons": "^1.13.14",
|
|
105
|
-
"material-symbols": "^0.44.
|
|
105
|
+
"material-symbols": "^0.44.9",
|
|
106
106
|
"md5": "^2.3.0",
|
|
107
107
|
"mime-types": "^3.0.2",
|
|
108
108
|
"monaco-editor": "^0.55.1",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"string-similarity": "^4.0.4",
|
|
113
113
|
"tweakpane": "^4.0.5",
|
|
114
114
|
"update-electron-app": "^3.2.0",
|
|
115
|
-
"x_ite": "^15.0.
|
|
115
|
+
"x_ite": "^15.0.3",
|
|
116
116
|
"x3d-traverse": "^1.0.22"
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -688,6 +688,10 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
688
688
|
label: "LayoutLayer",
|
|
689
689
|
args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Layout", "LayoutLayer", "children"],
|
|
690
690
|
},
|
|
691
|
+
{
|
|
692
|
+
label: "LayoutGroup",
|
|
693
|
+
args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Layout", "LayoutGroup", "children"],
|
|
694
|
+
},
|
|
691
695
|
{
|
|
692
696
|
label: "ScreenGroup",
|
|
693
697
|
args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Layout", "ScreenGroup", "children"],
|
|
@@ -185,7 +185,7 @@ class X3DGridNodeTool extends X3DActiveLayerNodeTool
|
|
|
185
185
|
invGridMatrix = gridMatrix .copy () .inverse ();
|
|
186
186
|
|
|
187
187
|
const
|
|
188
|
-
snapMatrix =
|
|
188
|
+
snapMatrix = X3D .Matrix4 .fromTransform (gridMatrix .multVecMatrix (this .getSnapPosition (invGridMatrix .multVecMatrix (position .copy ()), true)) .subtract (position)),
|
|
189
189
|
currentMatrix = absoluteMatrix .multRight (snapMatrix) .multRight (transformTool .getModelMatrix () .copy () .inverse ());
|
|
190
190
|
|
|
191
191
|
transformTool .setUserData (this .#changing, true);
|
|
@@ -261,12 +261,12 @@ class X3DGridNodeTool extends X3DActiveLayerNodeTool
|
|
|
261
261
|
invModelMatrix .multDirMatrix (snapVector .copy ())
|
|
262
262
|
);
|
|
263
263
|
|
|
264
|
-
const currentMatrix =
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
264
|
+
const currentMatrix = X3D .Matrix4
|
|
265
|
+
.fromTransform (transformTool ._translation .getValue (),
|
|
266
|
+
transformTool ._rotation .getValue () .copy () .multRight (snapRotation),
|
|
267
|
+
transformTool ._scale .getValue (),
|
|
268
|
+
transformTool ._scaleOrientation .getValue (),
|
|
269
|
+
transformTool ._center .getValue ());
|
|
270
270
|
|
|
271
271
|
transformTool .setUserData (this .#changing, true);
|
|
272
272
|
|
|
@@ -515,8 +515,8 @@ class X3DGridNodeTool extends X3DActiveLayerNodeTool
|
|
|
515
515
|
if (transformTool .tool .scaleMode === "SCALE_FROM_OPPOSITE_HANDLE")
|
|
516
516
|
distanceFromCenter .subtract (offset);
|
|
517
517
|
|
|
518
|
-
const translation =
|
|
519
|
-
.
|
|
518
|
+
const translation = X3D .Matrix4
|
|
519
|
+
.fromTransform (distanceFromCenter .subtract (scaleMatrix .multDirMatrix (distanceFromCenter .copy ())));
|
|
520
520
|
|
|
521
521
|
return translation;
|
|
522
522
|
}
|
|
@@ -528,8 +528,8 @@ class X3DGridNodeTool extends X3DActiveLayerNodeTool
|
|
|
528
528
|
{
|
|
529
529
|
const tool = this .tool;
|
|
530
530
|
|
|
531
|
-
return
|
|
532
|
-
.
|
|
531
|
+
return X3D .Matrix4
|
|
532
|
+
.fromTransform (tool .translation .getValue (), tool .rotation .getValue (), tool .scale .getValue ());
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.
|
|
3
|
-
<X3D profile='Interchange' version='4.
|
|
2
|
+
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.1//EN" "https://www.web3d.org/specifications/x3d-4.1.dtd">
|
|
3
|
+
<X3D profile='Interchange' version='4.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.1.xsd'>
|
|
4
4
|
<head>
|
|
5
|
+
<component name='Core' level='2'/>
|
|
5
6
|
<component name='Layout' level='2'/>
|
|
7
|
+
<component name='Navigation' level='2'/>
|
|
8
|
+
<component name='Networking' level='2'/>
|
|
6
9
|
<component name='Scripting' level='1'/>
|
|
10
|
+
<component name='Shaders' level='1'/>
|
|
7
11
|
<component name='X_ITE' level='1'/>
|
|
8
12
|
<unit category='angle' name='degree' conversionFactor='0.017453292519943295'/>
|
|
9
13
|
<meta name='comment' content='Rise and Shine'/>
|
|
10
14
|
<meta name='created' content='Fri, 29 Aug 2014 13:13:27 GMT'/>
|
|
11
15
|
<meta name='creator' content='Holger Seelig'/>
|
|
12
|
-
<meta name='generator' content='Sunrize X3D Editor
|
|
13
|
-
<meta name='modified' content='
|
|
16
|
+
<meta name='generator' content='Sunrize X3D Editor V2.1.0, https://create3000.github.io/sunrize/'/>
|
|
17
|
+
<meta name='modified' content='Mon, 11 May 2026 14:22:17 GMT'/>
|
|
14
18
|
</head>
|
|
15
19
|
<Scene>
|
|
16
20
|
<ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
|
|
@@ -22,8 +26,8 @@
|
|
|
22
26
|
<field accessType='inputOutput' type='SFVec3f' name='center'/>
|
|
23
27
|
<field accessType='inputOutput' type='SFBool' name='centerDisplay'/>
|
|
24
28
|
<field accessType='inputOutput' type='SFVec3f' name='axisOfRotation'/>
|
|
25
|
-
<field accessType='inputOutput' type='SFBool' name='
|
|
26
|
-
<field accessType='inputOutput' type='
|
|
29
|
+
<field accessType='inputOutput' type='SFBool' name='layoutDisplay'/>
|
|
30
|
+
<field accessType='inputOutput' type='SFVec4f' name='layoutRectangle' value='0 0 0 0'/>
|
|
27
31
|
<field accessType='inputOutput' type='SFBool' name='bboxEvents' value='true'/>
|
|
28
32
|
<field accessType='inputOutput' type='SFBool' name='bboxDisplay'/>
|
|
29
33
|
<field accessType='inputOutput' type='SFInt32' name='bboxStyle' value='1'/>
|
|
@@ -245,16 +249,15 @@
|
|
|
245
249
|
</Group>
|
|
246
250
|
<Transform DEF='Rectangle'>
|
|
247
251
|
<IS>
|
|
248
|
-
<connect nodeField='visible' protoField='
|
|
252
|
+
<connect nodeField='visible' protoField='layoutDisplay'/>
|
|
249
253
|
</IS>
|
|
250
254
|
<Shape DEF='Box_1'
|
|
251
255
|
castShadow='false'>
|
|
252
256
|
<Appearance>
|
|
253
257
|
<LineProperties
|
|
254
258
|
linewidthScaleFactor='2'/>
|
|
255
|
-
<
|
|
259
|
+
<UnlitMaterial
|
|
256
260
|
emissiveColor='0 1 0'/>
|
|
257
|
-
<ProtoInstance name='ToolShader' USE='_11' containerField='shaders'/>
|
|
258
261
|
<DepthMode USE='_12'/>
|
|
259
262
|
</Appearance>
|
|
260
263
|
<IndexedLineSet
|
|
@@ -267,8 +270,8 @@
|
|
|
267
270
|
</Collision>
|
|
268
271
|
<Script DEF='BBoxScript'
|
|
269
272
|
directOutput='true'>
|
|
270
|
-
<field accessType='inputOutput' type='SFBool' name='
|
|
271
|
-
<field accessType='inputOutput' type='
|
|
273
|
+
<field accessType='inputOutput' type='SFBool' name='layoutDisplay'/>
|
|
274
|
+
<field accessType='inputOutput' type='SFVec4f' name='layoutRectangle'/>
|
|
272
275
|
<field accessType='inputOutput' type='SFVec3f' name='bboxSize'/>
|
|
273
276
|
<field accessType='initializeOnly' type='SFNode' name='rectangle'>
|
|
274
277
|
<Coordinate USE='Rectangle_1'/>
|
|
@@ -280,8 +283,8 @@
|
|
|
280
283
|
<Coordinate USE='AxesCoord'/>
|
|
281
284
|
</field>
|
|
282
285
|
<IS>
|
|
283
|
-
<connect nodeField='
|
|
284
|
-
<connect nodeField='
|
|
286
|
+
<connect nodeField='layoutDisplay' protoField='layoutDisplay'/>
|
|
287
|
+
<connect nodeField='layoutRectangle' protoField='layoutRectangle'/>
|
|
285
288
|
<connect nodeField='bboxSize' protoField='bboxSize'/>
|
|
286
289
|
</IS>
|
|
287
290
|
<![CDATA[ecmascript:
|
|
@@ -293,39 +296,39 @@ function initialize ()
|
|
|
293
296
|
|
|
294
297
|
function eventsProcessed ()
|
|
295
298
|
{
|
|
296
|
-
const
|
|
299
|
+
const { x, y, z } = bboxSize .divide (2);
|
|
297
300
|
|
|
298
301
|
// Axes
|
|
299
302
|
|
|
300
|
-
axes .point = new MFVec3f (new SFVec3f (-
|
|
301
|
-
new SFVec3f (
|
|
302
|
-
new SFVec3f (0, -
|
|
303
|
-
new SFVec3f (0,
|
|
304
|
-
new SFVec3f (0,
|
|
305
|
-
new SFVec3f (0,
|
|
303
|
+
axes .point = new MFVec3f (new SFVec3f (-x, 0, 0),
|
|
304
|
+
new SFVec3f ( x, 0, 0),
|
|
305
|
+
new SFVec3f ( 0, -y, 0),
|
|
306
|
+
new SFVec3f ( 0, y, 0),
|
|
307
|
+
new SFVec3f ( 0, 0, -z),
|
|
308
|
+
new SFVec3f ( 0, 0, z));
|
|
306
309
|
|
|
307
310
|
|
|
308
311
|
// BBox
|
|
309
312
|
|
|
310
|
-
bbox .point = new MFVec3f (new SFVec3f (-
|
|
311
|
-
new SFVec3f (-
|
|
312
|
-
new SFVec3f (
|
|
313
|
-
new SFVec3f (
|
|
314
|
-
new SFVec3f (-
|
|
315
|
-
new SFVec3f (-
|
|
316
|
-
new SFVec3f (
|
|
317
|
-
new SFVec3f (
|
|
313
|
+
bbox .point = new MFVec3f (new SFVec3f (-x, y, z),
|
|
314
|
+
new SFVec3f (-x, -y, z),
|
|
315
|
+
new SFVec3f ( x, -y, z),
|
|
316
|
+
new SFVec3f ( x, y, z),
|
|
317
|
+
new SFVec3f (-x, y, -z),
|
|
318
|
+
new SFVec3f (-x, -y, -z),
|
|
319
|
+
new SFVec3f ( x, -y, -z),
|
|
320
|
+
new SFVec3f ( x, y, -z));
|
|
318
321
|
|
|
319
|
-
if (
|
|
322
|
+
if (layoutDisplay)
|
|
320
323
|
{
|
|
321
|
-
const
|
|
324
|
+
const [x, y, w, h] = layoutRectangle;
|
|
322
325
|
|
|
323
326
|
// BBox
|
|
324
327
|
|
|
325
|
-
rectangle .point = new MFVec3f (new SFVec3f (-
|
|
326
|
-
new SFVec3f (-
|
|
327
|
-
new SFVec3f (
|
|
328
|
-
new SFVec3f (
|
|
328
|
+
rectangle .point = new MFVec3f (new SFVec3f (x - w / 2, y + h / 2, 0),
|
|
329
|
+
new SFVec3f (x - w / 2, y - h / 2, 0),
|
|
330
|
+
new SFVec3f (x + w / 2, y - h / 2, 0),
|
|
331
|
+
new SFVec3f (x + w / 2, y + h / 2, 0));
|
|
329
332
|
}
|
|
330
333
|
}
|
|
331
334
|
]]>
|
|
@@ -365,14 +368,14 @@ function eventsProcessed ()
|
|
|
365
368
|
{
|
|
366
369
|
// Position the arrows.
|
|
367
370
|
|
|
368
|
-
const
|
|
371
|
+
const { x, y, z } = bboxSize .divide (2);
|
|
369
372
|
|
|
370
|
-
xBack .translation = new SFVec3f (-
|
|
371
|
-
xFront .translation = new SFVec3f (
|
|
372
|
-
yBack .translation = new SFVec3f (0, -
|
|
373
|
-
yFront .translation = new SFVec3f (0,
|
|
374
|
-
zBack .translation = new SFVec3f (0, 0, -
|
|
375
|
-
zFront .translation = new SFVec3f (0, 0,
|
|
373
|
+
xBack .translation = new SFVec3f (-x, 0, 0);
|
|
374
|
+
xFront .translation = new SFVec3f ( x, 0, 0);
|
|
375
|
+
yBack .translation = new SFVec3f (0, -y, 0);
|
|
376
|
+
yFront .translation = new SFVec3f (0, y, 0);
|
|
377
|
+
zBack .translation = new SFVec3f (0, 0, -z);
|
|
378
|
+
zFront .translation = new SFVec3f (0, 0, z);
|
|
376
379
|
}
|
|
377
380
|
]]>
|
|
378
381
|
</Script>
|
|
@@ -425,7 +428,7 @@ function initialize ()
|
|
|
425
428
|
|
|
426
429
|
function eventsProcessed ()
|
|
427
430
|
{
|
|
428
|
-
if (vector .
|
|
431
|
+
if (vector .equals (SFVec3f .ZERO))
|
|
429
432
|
{
|
|
430
433
|
inline .visible = false;
|
|
431
434
|
}
|
|
@@ -189,7 +189,7 @@ class X3DTransformNodeTool extends X3DChildNodeTool
|
|
|
189
189
|
scale = new X3D .Vector3 (1, 1, 1),
|
|
190
190
|
scaleOrientation = new X3D .Rotation4 ();
|
|
191
191
|
|
|
192
|
-
matrix .
|
|
192
|
+
matrix .getTransform (translation, rotation, scale, scaleOrientation);
|
|
193
193
|
|
|
194
194
|
if (!this .tool .tools .includes ("TRANSLATE"))
|
|
195
195
|
translation .set (0, 0, 0);
|
|
@@ -203,7 +203,7 @@ class X3DTransformNodeTool extends X3DChildNodeTool
|
|
|
203
203
|
scaleOrientation .set (0, 0, 1, 0);
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
matrix .
|
|
206
|
+
matrix .setTransform (translation, rotation, scale, scaleOrientation);
|
|
207
207
|
|
|
208
208
|
if (keepCenter)
|
|
209
209
|
this .setMatrixKeepCenter (matrix);
|
|
@@ -230,7 +230,7 @@ class X3DTransformNodeTool extends X3DChildNodeTool
|
|
|
230
230
|
scale = new X3D .Vector3 (1, 1, 1),
|
|
231
231
|
scaleOrientation = new X3D .Rotation4 ();
|
|
232
232
|
|
|
233
|
-
matrix .
|
|
233
|
+
matrix .getTransform (translation, rotation, scale, scaleOrientation, center);
|
|
234
234
|
|
|
235
235
|
this ._translation = translation;
|
|
236
236
|
this ._rotation = rotation;
|
|
@@ -241,13 +241,12 @@ class X3DTransformNodeTool extends X3DChildNodeTool
|
|
|
241
241
|
|
|
242
242
|
getCurrentMatrix ()
|
|
243
243
|
{
|
|
244
|
-
const matrix =
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
this ._center .getValue ());
|
|
244
|
+
const matrix = X3D .Matrix4
|
|
245
|
+
.fromTransform (this ._translation .getValue (),
|
|
246
|
+
this ._rotation .getValue (),
|
|
247
|
+
this ._scale .getValue (),
|
|
248
|
+
this ._scaleOrientation .getValue (),
|
|
249
|
+
this ._center .getValue ());
|
|
251
250
|
|
|
252
251
|
return matrix;
|
|
253
252
|
}
|
|
@@ -847,29 +847,29 @@ function initialize ()
|
|
|
847
847
|
|
|
848
848
|
function eventsProcessed ()
|
|
849
849
|
{
|
|
850
|
-
const
|
|
850
|
+
const { x, y, z } = bboxSize .divide (2);
|
|
851
851
|
|
|
852
852
|
// Axes
|
|
853
853
|
|
|
854
854
|
axes .point = new MFVec3f (new SFVec3f (),
|
|
855
|
-
new SFVec3f (
|
|
856
|
-
new SFVec3f (-
|
|
857
|
-
new SFVec3f (0,
|
|
858
|
-
new SFVec3f (0, -
|
|
859
|
-
new SFVec3f (0,
|
|
860
|
-
new SFVec3f (0,
|
|
855
|
+
new SFVec3f ( x, 0, 0),
|
|
856
|
+
new SFVec3f (-x, 0, 0),
|
|
857
|
+
new SFVec3f ( 0, y, 0),
|
|
858
|
+
new SFVec3f ( 0, -y, 0),
|
|
859
|
+
new SFVec3f ( 0, 0, z),
|
|
860
|
+
new SFVec3f ( 0, 0, -z));
|
|
861
861
|
|
|
862
862
|
|
|
863
863
|
// BBox
|
|
864
864
|
|
|
865
|
-
bbox .point = new MFVec3f (new SFVec3f (-
|
|
866
|
-
new SFVec3f (-
|
|
867
|
-
new SFVec3f (
|
|
868
|
-
new SFVec3f (
|
|
869
|
-
new SFVec3f (-
|
|
870
|
-
new SFVec3f (-
|
|
871
|
-
new SFVec3f (
|
|
872
|
-
new SFVec3f (
|
|
865
|
+
bbox .point = new MFVec3f (new SFVec3f (-x, y, z),
|
|
866
|
+
new SFVec3f (-x, -y, z),
|
|
867
|
+
new SFVec3f ( x, -y, z),
|
|
868
|
+
new SFVec3f ( x, y, z),
|
|
869
|
+
new SFVec3f (-x, y, -z),
|
|
870
|
+
new SFVec3f (-x, -y, -z),
|
|
871
|
+
new SFVec3f ( x, -y, -z),
|
|
872
|
+
new SFVec3f ( x, y, -z));
|
|
873
873
|
}
|
|
874
874
|
]]>
|
|
875
875
|
</Script>
|
|
@@ -959,27 +959,27 @@ function set_bboxSize ()
|
|
|
959
959
|
{
|
|
960
960
|
// Position the axis handles.
|
|
961
961
|
|
|
962
|
-
const
|
|
962
|
+
const { x, y, z } = bboxSize .divide (2);
|
|
963
963
|
|
|
964
|
-
axisHandles [0] .translation = new SFVec3f (
|
|
965
|
-
axisHandles [1] .translation = new SFVec3f (0,
|
|
966
|
-
axisHandles [2] .translation = new SFVec3f (0, 0,
|
|
964
|
+
axisHandles [0] .translation = new SFVec3f (x, 0, 0);
|
|
965
|
+
axisHandles [1] .translation = new SFVec3f (0, y, 0);
|
|
966
|
+
axisHandles [2] .translation = new SFVec3f (0, 0, z);
|
|
967
967
|
|
|
968
|
-
axisHandles [3] .translation = new SFVec3f (-
|
|
969
|
-
axisHandles [4] .translation = new SFVec3f (0, -
|
|
970
|
-
axisHandles [5] .translation = new SFVec3f (0, 0, -
|
|
968
|
+
axisHandles [3] .translation = new SFVec3f (-x, 0, 0);
|
|
969
|
+
axisHandles [4] .translation = new SFVec3f (0, -y, 0);
|
|
970
|
+
axisHandles [5] .translation = new SFVec3f (0, 0, -z);
|
|
971
971
|
|
|
972
972
|
// Position uniform scale handles and set axis rotation of corresponding sensor.
|
|
973
973
|
|
|
974
|
-
scaleHandles [0] .translation = new SFVec3f (
|
|
975
|
-
scaleHandles [1] .translation = new SFVec3f (-
|
|
976
|
-
scaleHandles [2] .translation = new SFVec3f (-
|
|
977
|
-
scaleHandles [3] .translation = new SFVec3f (
|
|
974
|
+
scaleHandles [0] .translation = new SFVec3f ( x, y, z);
|
|
975
|
+
scaleHandles [1] .translation = new SFVec3f (-x, y, z);
|
|
976
|
+
scaleHandles [2] .translation = new SFVec3f (-x, -y, z);
|
|
977
|
+
scaleHandles [3] .translation = new SFVec3f ( x, -y, z);
|
|
978
978
|
|
|
979
|
-
scaleHandles [4] .translation = new SFVec3f (
|
|
980
|
-
scaleHandles [5] .translation = new SFVec3f (-
|
|
981
|
-
scaleHandles [6] .translation = new SFVec3f (-
|
|
982
|
-
scaleHandles [7] .translation = new SFVec3f (
|
|
979
|
+
scaleHandles [4] .translation = new SFVec3f ( x, y, -z);
|
|
980
|
+
scaleHandles [5] .translation = new SFVec3f (-x, y, -z);
|
|
981
|
+
scaleHandles [6] .translation = new SFVec3f (-x, -y, -z);
|
|
982
|
+
scaleHandles [7] .translation = new SFVec3f ( x, -y, -z);
|
|
983
983
|
|
|
984
984
|
for (let i = 0; i < 8; ++ i)
|
|
985
985
|
scaleSensors [i] .axisRotation = new SFRotation (xAxis, scaleHandles [i] .translation);
|
|
@@ -1715,7 +1715,7 @@ function scaleTransform (value, centerOffset)
|
|
|
1715
1715
|
}
|
|
1716
1716
|
|
|
1717
1717
|
const scaleMatrix = new SFMatrix4f ();
|
|
1718
|
-
scaleMatrix .setTransform (
|
|
1718
|
+
scaleMatrix .setTransform (null, null, value);
|
|
1719
1719
|
|
|
1720
1720
|
const
|
|
1721
1721
|
scaledMatrix = initialMatrix .multLeft (scaleMatrix),
|
|
@@ -2,11 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
const
|
|
4
4
|
X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"),
|
|
5
|
-
ToolColors = require ("../Core/ToolColors")
|
|
5
|
+
ToolColors = require ("../Core/ToolColors"),
|
|
6
|
+
X3D = require ("../../X3D");
|
|
6
7
|
|
|
7
8
|
class LayoutGroupTool extends X3DBoundedObjectTool
|
|
8
9
|
{
|
|
9
10
|
toolBBoxColor = ToolColors .DARK_GREEN;
|
|
11
|
+
|
|
12
|
+
#scale = new X3D .Vector3 ();
|
|
13
|
+
#rectangleScale = new X3D .Vector4 ();
|
|
14
|
+
#rectangle = new X3D .Vector4 ();
|
|
15
|
+
|
|
16
|
+
traverse (type, renderObject)
|
|
17
|
+
{
|
|
18
|
+
if (this .tool)
|
|
19
|
+
{
|
|
20
|
+
if (this .layoutNode)
|
|
21
|
+
{
|
|
22
|
+
if (!this .tool .layoutDisplay)
|
|
23
|
+
this .tool .layoutDisplay = true;
|
|
24
|
+
|
|
25
|
+
renderObject .modelViewMatrix .get () .getTransform (null, null, this .#scale);
|
|
26
|
+
this .#rectangleScale .set (this .#scale .x, this .#scale .y, this .#scale .x, this .#scale .y);
|
|
27
|
+
|
|
28
|
+
this .layoutNode .push (type, renderObject);
|
|
29
|
+
|
|
30
|
+
const rectangle = this .#rectangle
|
|
31
|
+
.assign (renderObject .getLayoutRectangles () .at (-1))
|
|
32
|
+
.divVec (this .#rectangleScale);
|
|
33
|
+
|
|
34
|
+
if (!this .tool .layoutRectangle .getValue () .equals (rectangle))
|
|
35
|
+
this .tool .layoutRectangle = rectangle;
|
|
36
|
+
|
|
37
|
+
this .layoutNode .pop (type, renderObject);
|
|
38
|
+
}
|
|
39
|
+
else
|
|
40
|
+
{
|
|
41
|
+
if (this .tool .layoutDisplay)
|
|
42
|
+
this .tool .layoutDisplay = false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
super .traverse (type, renderObject);
|
|
47
|
+
}
|
|
10
48
|
}
|
|
11
49
|
|
|
12
50
|
module .exports = LayoutGroupTool;
|
|
@@ -146,7 +146,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
146
146
|
// Snap translation.
|
|
147
147
|
|
|
148
148
|
const
|
|
149
|
-
snapMatrix =
|
|
149
|
+
snapMatrix = X3D .Matrix4 .fromTransform (snapTranslation),
|
|
150
150
|
currentMatrix = absoluteMatrix .multRight (snapMatrix) .multRight (transformTool .getModelMatrix () .copy () .inverse ());
|
|
151
151
|
|
|
152
152
|
transformTool .setUserData (this .#changing, true);
|
|
@@ -258,12 +258,12 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
258
258
|
|
|
259
259
|
// Snap rotation.
|
|
260
260
|
|
|
261
|
-
const currentMatrix =
|
|
262
|
-
.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
261
|
+
const currentMatrix = X3D .Matrix4
|
|
262
|
+
.fromTransform (transformTool ._translation .getValue (),
|
|
263
|
+
transformTool ._rotation .getValue () .copy () .multRight (snapRotation),
|
|
264
|
+
transformTool ._scale .getValue (),
|
|
265
|
+
transformTool ._scaleOrientation .getValue (),
|
|
266
|
+
transformTool ._center .getValue ());
|
|
267
267
|
|
|
268
268
|
transformTool .setUserData (this .#changing, true);
|
|
269
269
|
|
|
@@ -402,7 +402,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
402
402
|
|
|
403
403
|
const
|
|
404
404
|
center = subAABBox .center,
|
|
405
|
-
snapMatrix =
|
|
405
|
+
snapMatrix = X3D .Matrix4 .fromTransform (null, null, snapScale, null, center);
|
|
406
406
|
|
|
407
407
|
snapMatrix .multRight (transformTool .getCurrentMatrix ());
|
|
408
408
|
|
|
@@ -443,7 +443,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
443
443
|
const
|
|
444
444
|
subAABBoxAxes = subAABBox .getAxes (SnapTarget .#axes),
|
|
445
445
|
center = subAABBoxAxes [axis] .multiply (-sgn) .add (subAABBox .center),
|
|
446
|
-
snapMatrix =
|
|
446
|
+
snapMatrix = X3D .Matrix4 .fromTransform (null, null, snapScale, null, center);
|
|
447
447
|
|
|
448
448
|
snapMatrix .multRight (transformTool .getCurrentMatrix ());
|
|
449
449
|
|
|
@@ -546,7 +546,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
546
546
|
const
|
|
547
547
|
snapScale = new X3D .Vector3 (aRatio, aRatio, aRatio),
|
|
548
548
|
center = subAABBox .center,
|
|
549
|
-
snapMatrix =
|
|
549
|
+
snapMatrix = X3D .Matrix4 .fromTransform (null, null, snapScale, null, center);
|
|
550
550
|
|
|
551
551
|
snapMatrix .multRight (transformTool .getCurrentMatrix ());
|
|
552
552
|
|
|
@@ -606,7 +606,7 @@ class SnapTarget extends X3DSnapNodeTool
|
|
|
606
606
|
snapScale = new X3D .Vector3 (aRatio, aRatio, aRatio),
|
|
607
607
|
subAABBoxPoints = subAABBox .getPoints (SnapTarget .#points),
|
|
608
608
|
center = subAABBoxPoints [SnapTarget .#oppositePoints [handle]],
|
|
609
|
-
snapMatrix =
|
|
609
|
+
snapMatrix = X3D .Matrix4 .fromTransform (null, null, snapScale, null, center);
|
|
610
610
|
|
|
611
611
|
snapMatrix .multRight (transformTool .getCurrentMatrix ());
|
|
612
612
|
|
package/src/Undo/Editor.js
CHANGED
|
@@ -2495,11 +2495,11 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
2495
2495
|
scale = new X3D .Vector3 (1, 1, 1),
|
|
2496
2496
|
scaleOrientation = new X3D .Rotation4 ();
|
|
2497
2497
|
|
|
2498
|
-
matrix .
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2498
|
+
matrix .getTransform (translation,
|
|
2499
|
+
rotation,
|
|
2500
|
+
scale,
|
|
2501
|
+
scaleOrientation,
|
|
2502
|
+
center);
|
|
2503
2503
|
|
|
2504
2504
|
this .roundToIntegerIfAlmostEqual (translation);
|
|
2505
2505
|
this .roundToIntegerIfAlmostEqual (rotation);
|
|
@@ -2682,7 +2682,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
2682
2682
|
center = (moveCenter ? bboxCenter .copy () : (sourcePosition ?.copy () ?? bboxCenter .copy () .add (axis))) .subtract (modelMatrices [0] .origin),
|
|
2683
2683
|
translation = targetPosition .copy () .subtract (center),
|
|
2684
2684
|
rotation = new X3D .Rotation4 (sourceNormal ?? axis, targetNormal .copy () .negate ()),
|
|
2685
|
-
snapMatrix =
|
|
2685
|
+
snapMatrix = X3D .Matrix4 .fromTransform (translation, rotation, null, null, center);
|
|
2686
2686
|
|
|
2687
2687
|
const
|
|
2688
2688
|
invModelMatrix = modelMatrices [0] .copy () .inverse (),
|
|
@@ -3395,7 +3395,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
3395
3395
|
{
|
|
3396
3396
|
const rotation = new X3D .Rotation4 ();
|
|
3397
3397
|
|
|
3398
|
-
modelMatrix .
|
|
3398
|
+
modelMatrix .getTransform (null, rotation);
|
|
3399
3399
|
|
|
3400
3400
|
const
|
|
3401
3401
|
position = modelMatrix .multVecMatrix (node .getPosition () .copy ()),
|
|
@@ -3413,7 +3413,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
3413
3413
|
{
|
|
3414
3414
|
const rotation = new X3D .Rotation4 ();
|
|
3415
3415
|
|
|
3416
|
-
modelMatrix .
|
|
3416
|
+
modelMatrix .getTransform (null, rotation);
|
|
3417
3417
|
|
|
3418
3418
|
const
|
|
3419
3419
|
position = modelMatrix .multVecMatrix (node ._position .getValue () .copy ()),
|
|
@@ -3440,7 +3440,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
3440
3440
|
|
|
3441
3441
|
const rotation = new X3D .Rotation4 ();
|
|
3442
3442
|
|
|
3443
|
-
modelMatrix .
|
|
3443
|
+
modelMatrix .getTransform (null, rotation);
|
|
3444
3444
|
|
|
3445
3445
|
if (node ._direction)
|
|
3446
3446
|
{
|
|
@@ -3464,7 +3464,8 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
3464
3464
|
}
|
|
3465
3465
|
case X3D .X3DConstants .X3DEnvironmentalSensorNode:
|
|
3466
3466
|
{
|
|
3467
|
-
const matrix =
|
|
3467
|
+
const matrix = X3D .Matrix4
|
|
3468
|
+
.fromTransform (node ._center .getValue (), null, node ._size .getValue ());
|
|
3468
3469
|
|
|
3469
3470
|
modelMatrix .multLeft (matrix);
|
|
3470
3471
|
|
|
@@ -3472,7 +3473,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
3472
3473
|
center = new X3D .Vector3 (),
|
|
3473
3474
|
size = new X3D .Vector3 ();
|
|
3474
3475
|
|
|
3475
|
-
modelMatrix .
|
|
3476
|
+
modelMatrix .getTransform (center, null, size);
|
|
3476
3477
|
|
|
3477
3478
|
this .roundToIntegerIfAlmostEqual (center);
|
|
3478
3479
|
this .roundToIntegerIfAlmostEqual (size);
|