sunrize 1.5.13 → 1.6.0

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.
Files changed (41) hide show
  1. package/package.json +5 -5
  2. package/src/Application/Application.js +2 -7
  3. package/src/Application/Dashboard.js +10 -10
  4. package/src/Application/DataStorage.js +177 -177
  5. package/src/Application/Document.js +72 -127
  6. package/src/Application/Interface.js +4 -0
  7. package/src/Application/Tabs.js +3 -3
  8. package/src/Controls/Dialog.js +3 -1
  9. package/src/Editors/BrowserFrame.js +171 -0
  10. package/src/Editors/OutlineEditor.js +149 -123
  11. package/src/Editors/OutlineRouteGraph.js +493 -493
  12. package/src/Editors/OutlineView.js +102 -64
  13. package/src/Editors/SceneProperties.js +137 -136
  14. package/src/Editors/ScriptEditor.js +1 -1
  15. package/src/Tools/Core/X3DNodeTool.js +66 -12
  16. package/src/Tools/Grids/AngleGridTool.js +0 -5
  17. package/src/Tools/Grids/AngleGridTool.x3d +1 -0
  18. package/src/Tools/Grids/AxonometricGrid.x3d +5 -5
  19. package/src/Tools/Grids/AxonometricGridTool.js +0 -5
  20. package/src/Tools/Grids/AxonometricGridTool.x3d +1 -0
  21. package/src/Tools/Grids/GridTool.js +0 -5
  22. package/src/Tools/Grids/GridTool.x3d +1 -0
  23. package/src/Tools/Grids/X3DGridNodeTool.js +131 -84
  24. package/src/Tools/Grouping/X3DTransformNodeTool.js +19 -21
  25. package/src/Tools/Grouping/X3DTransformNodeTool.x3d +20 -15
  26. package/src/Tools/Layering/X3DActiveLayerNodeTool.js +16 -21
  27. package/src/Tools/Lighting/DirectionalLightTool.js +32 -1
  28. package/src/Tools/Lighting/X3DLightNodeTool.x3d +4 -21
  29. package/src/Tools/Shaders/TextureShader.x3d +16 -3
  30. package/src/Tools/SnapTool/{SnapSourceTool.js → SnapSource.js} +2 -7
  31. package/src/Tools/SnapTool/SnapTarget.js +650 -0
  32. package/src/Tools/SnapTool/SnapTool.x3d +28 -27
  33. package/src/Tools/SnapTool/X3DSnapNodeTool.js +16 -15
  34. package/src/Tools/Sound/SoundTool.x3d +4 -21
  35. package/src/Tools/TextureProjection/X3DTextureProjectorNodeTool.x3d +19 -26
  36. package/src/Undo/Editor.js +185 -46
  37. package/src/assets/Info.plist +56 -56
  38. package/src/assets/themes/default-template.css +1 -0
  39. package/src/assets/themes/default.css +1 -0
  40. package/src/Editors/BrowserSize.js +0 -101
  41. package/src/Tools/SnapTool/SnapTargetTool.js +0 -20
@@ -7,9 +7,9 @@
7
7
  <meta name='comment' content='Rise and Shine'/>
8
8
  <meta name='created' content='Mon, 12 Oct 2015 11:18:05 GMT'/>
9
9
  <meta name='creator' content='Holger Seelig'/>
10
- <meta name='generator' content='Sunrize X3D Editor V1.5.5, https://create3000.github.io/sunrize/'/>
10
+ <meta name='generator' content='Sunrize X3D Editor V1.5.14, https://create3000.github.io/sunrize/'/>
11
11
  <meta name='identifier' content='file:///home/holger/Projekte/Titania/libtitania-x3d/share/titania/tools/SnapTool.x3dv'/>
12
- <meta name='modified' content='Wed, 21 Feb 2024 12:13:47 GMT'/>
12
+ <meta name='modified' content='Mon, 04 Mar 2024 18:31:11 GMT'/>
13
13
  </head>
14
14
  <Scene>
15
15
  <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
@@ -17,6 +17,7 @@
17
17
  <ProtoDeclare name='SnapTool'>
18
18
  <ProtoInterface>
19
19
  <field accessType='inputOutput' type='SFString' name='type' value='SNAP_TARGET'/>
20
+ <field accessType='inputOutput' type='SFBool' name='snapToCenter' value='true'/>
20
21
  <field accessType='inputOutput' type='SFVec3f' name='position'/>
21
22
  <field accessType='inputOutput' type='SFVec3f' name='normal' value='0 0 1'/>
22
23
  <field accessType='inputOutput' type='SFBool' name='snapped'/>
@@ -26,7 +27,7 @@
26
27
  <IS>
27
28
  <connect nodeField='translation' protoField='position'/>
28
29
  </IS>
29
- <ScreenGroup DEF='Vector_2'>
30
+ <ScreenGroup DEF='Vector'>
30
31
  <Transform
31
32
  rotation='1 0 0 1.5708'>
32
33
  <Transform DEF='Cone'
@@ -107,42 +108,42 @@ var zAxis = new SFVec3f (0, 0, 1);
107
108
 
108
109
  function initialize ()
109
110
  {
110
- set_type (type, 0);
111
- set_normal (normal, 0);
111
+ set_type (type, 0);
112
+ set_normal (normal, 0);
112
113
  }
113
114
 
114
115
  function set_type (value, time)
115
116
  {
116
- if (snapped)
117
- {
118
- appearance .material = snapMaterial;
119
- }
120
- else
121
- {
122
- switch (type)
123
- {
124
- case "SNAP_SOURCE":
125
- {
126
- appearance .material = sourceMaterial;
127
- break;
128
- }
129
- default: // "SNAP_TARGET"
130
- {
131
- appearance .material = targetMaterial;
132
- break;
133
- }
134
- }
135
- }
117
+ if (snapped)
118
+ {
119
+ appearance .material = snapMaterial;
120
+ }
121
+ else
122
+ {
123
+ switch (type)
124
+ {
125
+ case "SNAP_SOURCE":
126
+ {
127
+ appearance .material = sourceMaterial;
128
+ break;
129
+ }
130
+ default: // "SNAP_TARGET"
131
+ {
132
+ appearance .material = targetMaterial;
133
+ break;
134
+ }
135
+ }
136
+ }
136
137
  }
137
138
 
138
139
  function set_normal (value, time)
139
140
  {
140
- tool .rotation = new SFRotation (zAxis, value);
141
+ tool .rotation = new SFRotation (zAxis, value);
141
142
  }
142
143
 
143
144
  function set_snapped (value, time)
144
145
  {
145
- set_type (type);
146
+ set_type (type);
146
147
  }
147
148
  ]]>
148
149
  </Script>
@@ -3,7 +3,6 @@
3
3
  const
4
4
  X3DActiveLayerNodeTool = require ("../Layering/X3DActiveLayerNodeTool"),
5
5
  ActionKeys = require ("../../Application/ActionKeys"),
6
- X3D = require ("../../X3D"),
7
6
  $ = require ("jquery");
8
7
 
9
8
  class X3DSnapNodeTool extends X3DActiveLayerNodeTool
@@ -20,33 +19,21 @@ class X3DSnapNodeTool extends X3DActiveLayerNodeTool
20
19
  {
21
20
  super .connectTool ();
22
21
 
23
- X3DSnapNodeTool .addToolInterest (this, () => this .set_transform_tools ());
24
-
25
22
  $(this .getBrowser () .element .shadowRoot) .find ("canvas")
26
23
  .on (`mousedown.X3DSnapNodeTool${this .getId ()}`, event => this .onmousedown (event))
27
24
  .on (`mouseup.X3DSnapNodeTool${this .getId ()}`, event => this .onmouseup (event));
28
-
29
- this .set_transform_tools ();
30
25
  }
31
26
 
32
27
  disconnectTool ()
33
28
  {
34
- X3DSnapNodeTool .removeToolInterest (this);
35
-
36
- $(this .getBrowser () .element .shadowRoot) .find ("canvas") .off (`.X3DSnapNodeTool${this .getId ()}`);
29
+ $(this .getBrowser () .element .shadowRoot) .find ("canvas")
30
+ .off (`.X3DSnapNodeTool${this .getId ()}`);
37
31
 
38
32
  super .disconnectTool ();
39
33
  }
40
34
 
41
- set_transform_tools ()
42
- {
43
- }
44
-
45
35
  onmousedown (event, show = false)
46
36
  {
47
- if ($("#secondary-toolbar .hand") .hasClass ("active"))
48
- return;
49
-
50
37
  if (ActionKeys .value !== this .toolModifiers && !show)
51
38
  return;
52
39
 
@@ -74,6 +61,8 @@ class X3DSnapNodeTool extends X3DActiveLayerNodeTool
74
61
  {
75
62
  $(this .getBrowser () .element .shadowRoot) .find ("canvas")
76
63
  .off (`mousemove.X3DSnapNodeTool${this .getId ()}`);
64
+
65
+ this .tool .snapped = false;
77
66
  }
78
67
 
79
68
  onmousemove (event)
@@ -96,6 +85,18 @@ class X3DSnapNodeTool extends X3DActiveLayerNodeTool
96
85
 
97
86
  this .tool .position = viewMatrix .copy () .inverse () .multVecMatrix (point .copy ());
98
87
  this .tool .normal = viewMatrix .submatrix .transpose () .multVecMatrix (normal .copy ()) .normalize ();
88
+
89
+ if (!X3DSnapNodeTool .gridNode ?._visible .getValue ())
90
+ return;
91
+
92
+ if (!X3DSnapNodeTool .gridNode .tool .snapping)
93
+ return;
94
+
95
+ const
96
+ gridMatrix = X3DSnapNodeTool .gridNode .getGridMatrix (),
97
+ invGridMatrix = gridMatrix .copy () .inverse ();
98
+
99
+ this .tool .position = gridMatrix .multVecMatrix (X3DSnapNodeTool .gridNode .getSnapPosition (invGridMatrix .multVecMatrix (this .tool .position .getValue () .copy ()), true));
99
100
  }
100
101
  }
101
102
 
@@ -277,6 +277,7 @@
277
277
  <field accessType='inputOutput' type='SFBool' name='selected'/>
278
278
  <field accessType='inputOutput' type='SFBool' name='active'/>
279
279
  <field accessType='inputOutput' type='SFVec3f' name='direction'/>
280
+ <field accessType='initializeOnly' type='SFVec3f' name='upVector' value='0 1 0'/>
280
281
  <field accessType='inputOnly' type='SFRotation' name='set_rotation'/>
281
282
  <field accessType='inputOnly' type='SFTime' name='set_minBackTime'/>
282
283
  <field accessType='inputOnly' type='SFBool' name='set_minBackActive'/>
@@ -371,8 +372,8 @@ function set_direction (value)
371
372
 
372
373
  changing = true;
373
374
 
374
- transform .rotation = straightenHorizon (new SFRotation (new SFVec3f (0, 0, 1), value),
375
- new SFVec3f (0, 1, 0));
375
+ transform .rotation = new SFRotation (new SFVec3f (0, 0, 1), value)
376
+ .straighten (upVector);
376
377
  }
377
378
 
378
379
  function set_rotation (value)
@@ -386,25 +387,7 @@ function set_rotation (value)
386
387
  changing = true;
387
388
 
388
389
  direction = transform .rotation .multVec (new SFVec3f (0, 0, 1));
389
- }
390
-
391
- function straightenHorizon (orientation, upVector)
392
- {
393
- const
394
- localXAxis = orientation .multVec (new SFVec3f (-1, 0, 0)),
395
- localZAxis = orientation .multVec (new SFVec3f (0, 0, 1)),
396
- vector = localZAxis .cross (upVector);
397
-
398
- // If viewer looks along the up vector.
399
- if (Math .abs (localZAxis .dot (upVector)) >= 1)
400
- return orientation;
401
-
402
- if (Math .abs (vector .dot (localXAxis)) >= 1)
403
- return orientation;
404
-
405
- const rotation = new SFRotation (localXAxis, vector);
406
-
407
- return orientation .multiply (rotation);
390
+ upVector = transform .rotation .multVec (new SFVec3f (0, 1, 0));
408
391
  }
409
392
 
410
393
  // minBack
@@ -7,14 +7,15 @@
7
7
  <meta name='comment' content='Rise and Shine'/>
8
8
  <meta name='created' content='Fri, 01 Aug 2014 17:41:58 GMT'/>
9
9
  <meta name='creator' content='Holger Seelig'/>
10
- <meta name='generator' content='Sunrize X3D Editor V1.5.12, https://create3000.github.io/sunrize/'/>
10
+ <meta name='generator' content='Sunrize X3D Editor V1.5.13, https://create3000.github.io/sunrize/'/>
11
11
  <meta name='identifier' content='file:///Users/holger/Desktop/X_ITE/sunrize/src/sunrize/Tools/TextureProjector/X3DTextureProjectorNodeTool.x3d'/>
12
- <meta name='modified' content='Mon, 26 Feb 2024 14:04:08 GMT'/>
12
+ <meta name='modified' content='Fri, 01 Mar 2024 09:56:33 GMT'/>
13
13
  </head>
14
14
  <Scene>
15
15
  <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
16
16
  </ExternProtoDeclare>
17
17
  <ExternProtoDeclare name='TextureShader' url='"../Shaders/TextureShader.x3d"'>
18
+ <field accessType='inputOutput' type='SFBool' name='flipY'/>
18
19
  </ExternProtoDeclare>
19
20
  <ExternProtoDeclare name='BooleanSwitch' url='"../Grouping/BooleanSwitch.x3d"'>
20
21
  <field accessType='inputOutput' type='SFBool' name='whichChoice'/>
@@ -169,7 +170,7 @@
169
170
  <field accessType='inputOutput' type='SFBool' name='selected'/>
170
171
  <field accessType='inputOutput' type='SFVec3f' name='direction'/>
171
172
  <field accessType='inputOutput' type='SFVec3f' name='upVector'/>
172
- <field accessType='inputOutput' type='SFRotation' name='rotation'/>
173
+ <field accessType='inputOnly' type='SFRotation' name='set_rotation'/>
173
174
  <field accessType='inputOutput' type='MFFloat' name='parallelFieldOfView'/>
174
175
  <field accessType='inputOutput' type='SFFloat' name='parallelNearDistance'/>
175
176
  <field accessType='inputOutput' type='SFFloat' name='parallelFarDistance'/>
@@ -220,6 +221,7 @@
220
221
 
221
222
  async function initialize ()
222
223
  {
224
+ this .getValue () .collectCloneCount = () => 0;
223
225
  textureAppearance .getValue () .collectCloneCount = () => 0;
224
226
 
225
227
  const tool = await transform .getValue () .addTool () .getToolInstance ();
@@ -262,9 +264,8 @@ function set_directionAndUpVector (i)
262
264
 
263
265
  changing [i] = true;
264
266
 
265
- const rotation = new SFRotation (new SFVec3f (0, 0, 1), direction);
266
-
267
- transform .rotation = straightenHorizon (rotation, upVector .normalize ());
267
+ transform .rotation = new SFRotation (new SFVec3f (0, 0, 1), direction)
268
+ .straighten (upVector);
268
269
  }
269
270
 
270
271
  function set_rotation ()
@@ -281,25 +282,6 @@ function set_rotation ()
281
282
  upVector = transform .rotation .multVec (new SFVec3f (0, 1, 0));
282
283
  }
283
284
 
284
- function straightenHorizon (orientation, upVector)
285
- {
286
- const
287
- localXAxis = orientation .multVec (new SFVec3f (-1, 0, 0)),
288
- localZAxis = orientation .multVec (new SFVec3f (0, 0, 1)),
289
- vector = localZAxis .cross (upVector);
290
-
291
- // If viewer looks along the up vector.
292
- if (Math .abs (localZAxis .dot (upVector)) >= 1)
293
- return orientation;
294
-
295
- if (Math .abs (vector .dot (localXAxis)) >= 1)
296
- return orientation;
297
-
298
- const rotation = new SFRotation (localXAxis, vector);
299
-
300
- return orientation .multiply (rotation);
301
- }
302
-
303
285
  function set_parallelFieldOfView ()
304
286
  {
305
287
  set_parallel ();
@@ -453,7 +435,18 @@ function set_perspective ()
453
435
 
454
436
  function set_texture (value)
455
437
  {
456
- textureAppearance .shaders = value
438
+ switch (value ?.getNodeType () .at (-1))
439
+ {
440
+ case X3DConstants .ImageTexture:
441
+ case X3DConstants .MovieTexture:
442
+ textureShader .flipY = true;
443
+ break;
444
+ case X3DConstants .PixelTexture:
445
+ textureShader .flipY = false;
446
+ break;
447
+ }
448
+
449
+ textureAppearance .shaders = value
457
450
  ? new MFNode (textureShader)
458
451
  : new MFNode ();
459
452
  }]]>