sunrize 1.7.16 → 1.7.18
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 +4 -4
- package/src/Controls/TexturePreviewPopover.js +6 -4
- package/src/Tools/Core/ToolColors.js +3 -2
- package/src/Tools/Core/X3DChildNodeTool.js +0 -5
- package/src/Tools/Core/X3DNodeTool.js +50 -30
- package/src/Tools/EnvironmentalSensor/X3DEnvironmentalSensorNodeTool.js +1 -1
- package/src/Tools/Grouping/X3DBoundedObjectTool.js +1 -1
- package/src/Tools/Grouping/X3DTransformNodeTool.js +1 -1
- package/src/Tools/Layering/X3DActiveLayerNodeTool.js +1 -1
- package/src/Tools/Lighting/X3DLightNodeTool.js +1 -1
- package/src/Tools/NURBS/NurbsCurveTool.js +20 -2
- package/src/Tools/NURBS/NurbsPatchSurfaceTool.js +2 -2
- package/src/Tools/NURBS/NurbsTrimmedSurfaceTool.js +2 -2
- package/src/Tools/NURBS/X3DNurbsSurfaceGeometryNodeTool.js +21 -0
- package/src/Tools/NURBS/X3DParametricGeometryNodeTool.js +61 -0
- package/src/Tools/NURBS/X3DParametricGeometryNodeTool.x3d +92 -0
- package/src/Tools/Navigation/X3DViewpointNodeTool.js +1 -1
- package/src/Tools/Rendering/X3DGeometryNodeTool.js +9 -9
- package/src/Tools/Rendering/X3DLineGeometryNodeTool.js +6 -6
- package/src/Tools/Rendering/X3DPointGeometryNodeTool.js +6 -6
- package/src/Tools/Sound/ListenerPointSourceTool.js +1 -1
- package/src/Tools/Sound/SoundTool.js +1 -1
- package/src/Tools/Sound/SpatialSoundTool.js +1 -1
- package/src/Tools/TextureProjection/X3DTextureProjectorNodeTool.js +1 -1
- package/src/Tools/TextureProjection/X3DTextureProjectorNodeTool.x3d +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.18",
|
|
5
5
|
"description": "A Multi-Platform X3D Editor",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"capitalize": "^2.0.4",
|
|
92
92
|
"console": "^0.7.2",
|
|
93
|
-
"electron": "^32.0.
|
|
93
|
+
"electron": "^32.0.2",
|
|
94
94
|
"electron-prompt": "^1.7.0",
|
|
95
95
|
"electron-squirrel-startup": "^1.0.1",
|
|
96
96
|
"electron-tabs": "^1.0.4",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"jquery-ui-dist": "^1.13.3",
|
|
100
100
|
"jstree": "^3.3.16",
|
|
101
101
|
"material-icons": "^1.13.12",
|
|
102
|
-
"material-symbols": "^0.
|
|
102
|
+
"material-symbols": "^0.23.0",
|
|
103
103
|
"md5": "^2.3.0",
|
|
104
104
|
"mime-types": "^2.1.35",
|
|
105
105
|
"monaco-editor": "^0.50.0",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"string-similarity": "^4.0.4",
|
|
110
110
|
"tweakpane": "^3.1.10",
|
|
111
111
|
"update-electron-app": "^3.0.0",
|
|
112
|
-
"x_ite": "^10.
|
|
112
|
+
"x_ite": "^10.5.1"
|
|
113
113
|
},
|
|
114
114
|
"config": {
|
|
115
115
|
"forge": {
|
|
@@ -117,28 +117,30 @@ $.fn.texturePreviewPopover = async function (node)
|
|
|
117
117
|
|
|
118
118
|
function sizesText ()
|
|
119
119
|
{
|
|
120
|
+
const format = node .isTransparent () ? "RGBA" : "RGB";
|
|
121
|
+
|
|
120
122
|
for (const type of node .getType () .toReversed ())
|
|
121
123
|
{
|
|
122
124
|
switch (type)
|
|
123
125
|
{
|
|
124
126
|
case X3D .X3DConstants .MovieTexture:
|
|
125
127
|
{
|
|
126
|
-
sizes .text (`${node .getWidth ()} × ${node .getHeight ()}, ${formatTime (node ._duration_changed .getValue ())}`);
|
|
128
|
+
sizes .text (`${node .getWidth ()} × ${node .getHeight ()}, ${formatTime (node ._duration_changed .getValue ())}, ${format}`);
|
|
127
129
|
break;
|
|
128
130
|
}
|
|
129
131
|
case X3D .X3DConstants .X3DEnvironmentTextureNode:
|
|
130
132
|
{
|
|
131
|
-
sizes .text (`${node .getSize ()} × ${node .getSize ()}`);
|
|
133
|
+
sizes .text (`${node .getSize ()} × ${node .getSize ()}, ${format}`);
|
|
132
134
|
break;
|
|
133
135
|
}
|
|
134
136
|
case X3D .X3DConstants .X3DTexture2DNode:
|
|
135
137
|
{
|
|
136
|
-
sizes .text (`${node .getWidth ()} × ${node .getHeight ()}`);
|
|
138
|
+
sizes .text (`${node .getWidth ()} × ${node .getHeight ()}, ${format}`);
|
|
137
139
|
break;
|
|
138
140
|
}
|
|
139
141
|
case X3D .X3DConstants .X3DTexture3DNode:
|
|
140
142
|
{
|
|
141
|
-
sizes .text (`${node .getWidth ()} × ${node .getHeight ()} × ${node .getDepth ()}`);
|
|
143
|
+
sizes .text (`${node .getWidth ()} × ${node .getHeight ()} × ${node .getDepth ()}, ${format}`);
|
|
142
144
|
break;
|
|
143
145
|
}
|
|
144
146
|
default:
|
|
@@ -26,8 +26,9 @@ module .exports = class ToolColors
|
|
|
26
26
|
static DARK_RED = new X3D .Color3 (0.5, 0.175, 0.175); //
|
|
27
27
|
static DARK_ORANGE = new X3D .Color3 (0.5, 0.35, 0.175); // VolumeData
|
|
28
28
|
|
|
29
|
-
static
|
|
30
|
-
static
|
|
29
|
+
static LIGHT_GREY = new X3D .Color3 (0.90, 0.90, 0.90); // Hull
|
|
30
|
+
static GREY = new X3D .Color3 (0.7, 0.7, 0.7); //
|
|
31
|
+
static DARK_GREY = new X3D .Color3 (0.35, 0.35, 0.35); // StaticGroup
|
|
31
32
|
|
|
32
33
|
static PROXIMITY_SENSOR = new X3D .Color3 (0.5, 0, 1);
|
|
33
34
|
static TRANSFORM_SENSOR = new X3D .Color3 (0, 1, 0);
|
|
@@ -30,10 +30,11 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
30
30
|
static #sensors = [ ]; // Always empty
|
|
31
31
|
|
|
32
32
|
tool = null;
|
|
33
|
+
#tools = new Set ();
|
|
33
34
|
#proxy = null;
|
|
34
35
|
#selected = false;
|
|
35
|
-
#promise =
|
|
36
|
-
#
|
|
36
|
+
#promise = new Map ();
|
|
37
|
+
#innerNodes = [ ];
|
|
37
38
|
#externalNodes = new Map ();
|
|
38
39
|
#groupedTools = new Set ();
|
|
39
40
|
#initialValues = new Map ();
|
|
@@ -68,25 +69,28 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
68
69
|
{
|
|
69
70
|
this .#selected = value;
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
for (const tool of this .#tools)
|
|
73
|
+
{
|
|
74
|
+
if (!this [tool])
|
|
75
|
+
continue;
|
|
73
76
|
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
if (this [tool] .hasOwnProperty ("selected"))
|
|
78
|
+
this [tool] .selected = value;
|
|
79
|
+
}
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
// Tool Loading
|
|
79
83
|
|
|
80
|
-
async getToolInstance ()
|
|
84
|
+
async getToolInstance (tool = "tool")
|
|
81
85
|
{
|
|
82
|
-
await this .#promise;
|
|
86
|
+
await this .#promise .get (tool);
|
|
83
87
|
|
|
84
|
-
return this
|
|
88
|
+
return this [tool];
|
|
85
89
|
}
|
|
86
90
|
|
|
87
|
-
getToolScene ()
|
|
91
|
+
getToolScene (tool = "tool")
|
|
88
92
|
{
|
|
89
|
-
return this
|
|
93
|
+
return this [tool] .getValue () .getExecutionContext ();
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
addTool ()
|
|
@@ -109,15 +113,18 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
109
113
|
{
|
|
110
114
|
await this .initializeTool ();
|
|
111
115
|
|
|
112
|
-
|
|
116
|
+
for (const tool of this .#tools)
|
|
117
|
+
{
|
|
118
|
+
// X3DLayerNodeTool and X3DPrototypeInstanceTool have no own tool.
|
|
113
119
|
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
if (!this [tool])
|
|
121
|
+
continue;
|
|
116
122
|
|
|
117
|
-
|
|
123
|
+
this .#innerNodes .push (this [tool] .getValue () .getInnerNode ());
|
|
118
124
|
|
|
119
|
-
|
|
120
|
-
|
|
125
|
+
if (this [tool] .hasOwnProperty ("selected"))
|
|
126
|
+
this [tool] .selected = this .#selected;
|
|
127
|
+
}
|
|
121
128
|
}
|
|
122
129
|
catch (error)
|
|
123
130
|
{
|
|
@@ -125,9 +132,9 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
125
132
|
}
|
|
126
133
|
}
|
|
127
134
|
|
|
128
|
-
|
|
135
|
+
initializeTool () { }
|
|
129
136
|
|
|
130
|
-
loadTool (... args)
|
|
137
|
+
loadTool (tool, ... args)
|
|
131
138
|
{
|
|
132
139
|
const
|
|
133
140
|
filePath = path .resolve (... args),
|
|
@@ -135,9 +142,11 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
135
142
|
protoURL = url .pathToFileURL (filePath),
|
|
136
143
|
promise = X3DNodeTool .#scenes .get (protoURL .href);
|
|
137
144
|
|
|
145
|
+
this .#tools .add (tool);
|
|
146
|
+
|
|
138
147
|
if (promise)
|
|
139
148
|
{
|
|
140
|
-
this .#promise
|
|
149
|
+
this .#promise .set (tool, promise);
|
|
141
150
|
}
|
|
142
151
|
else
|
|
143
152
|
{
|
|
@@ -163,22 +172,22 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
163
172
|
|
|
164
173
|
X3DNodeTool .#scenes .set (protoURL .href, promise);
|
|
165
174
|
|
|
166
|
-
this .#promise
|
|
175
|
+
this .#promise .set (tool, promise);
|
|
167
176
|
}
|
|
168
177
|
|
|
169
178
|
if (this .#disposed)
|
|
170
179
|
return Promise .reject (new Error ("Tool is already disposed."));
|
|
171
180
|
|
|
172
|
-
this .#promise .then (scene => this .createTool (scene, protoName));
|
|
181
|
+
this .#promise .get (tool) .then (scene => this .createTool (tool, scene, protoName));
|
|
173
182
|
|
|
174
|
-
return this .#promise;
|
|
183
|
+
return this .#promise .get (tool);
|
|
175
184
|
}
|
|
176
185
|
|
|
177
|
-
createTool (scene, protoName)
|
|
186
|
+
createTool (tool, scene, protoName)
|
|
178
187
|
{
|
|
179
|
-
this
|
|
188
|
+
this [tool] = scene .createProto (protoName);
|
|
180
189
|
|
|
181
|
-
this
|
|
190
|
+
this [tool] .getValue () .setPrivate (true);
|
|
182
191
|
|
|
183
192
|
X3DNodeTool .tools .add (this);
|
|
184
193
|
X3DNodeTool .processToolInterests ();
|
|
@@ -207,7 +216,10 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
207
216
|
|
|
208
217
|
const nodesToDispose = [ ]
|
|
209
218
|
|
|
210
|
-
|
|
219
|
+
for (const tool of this .#tools)
|
|
220
|
+
{
|
|
221
|
+
Traverse .traverse (this [tool], Traverse .ROOT_NODES | Traverse .INLINE_SCENE | Traverse .PROTOTYPE_INSTANCES, node => nodesToDispose .push (node));
|
|
222
|
+
}
|
|
211
223
|
|
|
212
224
|
for (const node of nodesToDispose .filter (node => !this .#externalNodes .has (node)))
|
|
213
225
|
node .dispose ();
|
|
@@ -435,12 +447,19 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
435
447
|
|
|
436
448
|
// Traverse
|
|
437
449
|
|
|
450
|
+
#childBBox = new X3D .Box3 ();
|
|
451
|
+
|
|
438
452
|
getToolBBox (bbox, shadows)
|
|
439
453
|
{
|
|
454
|
+
bbox .set ();
|
|
455
|
+
|
|
440
456
|
if (shadows)
|
|
441
|
-
return bbox
|
|
457
|
+
return bbox;
|
|
458
|
+
|
|
459
|
+
for (const innerNode of this .#innerNodes)
|
|
460
|
+
bbox .add (innerNode .getBBox (this .#childBBox, shadows));
|
|
442
461
|
|
|
443
|
-
return
|
|
462
|
+
return bbox;
|
|
444
463
|
}
|
|
445
464
|
|
|
446
465
|
toolPointingEnabled = true;
|
|
@@ -463,7 +482,8 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
463
482
|
renderObject .getHumanoids () .push (null);
|
|
464
483
|
renderObject .getSensors () .push (X3DNodeTool .#sensors);
|
|
465
484
|
|
|
466
|
-
|
|
485
|
+
for (const innerNode of this .#innerNodes)
|
|
486
|
+
innerNode ?.traverse (type, renderObject);
|
|
467
487
|
|
|
468
488
|
renderObject .getSensors () .pop ();
|
|
469
489
|
renderObject .getHumanoids () .pop ();
|
|
@@ -10,7 +10,7 @@ class X3DEnvironmentalSensorNodeTool extends X3DChildNodeTool
|
|
|
10
10
|
|
|
11
11
|
async initializeTool ()
|
|
12
12
|
{
|
|
13
|
-
await super .
|
|
13
|
+
await super .loadTool ("tool", __dirname, "X3DEnvironmentalSensorNodeTool.x3d");
|
|
14
14
|
|
|
15
15
|
this .tool .getField ("size") .addReference (this .node ._size);
|
|
16
16
|
this .tool .getField ("center") .addReference (this .node ._center);
|
|
@@ -8,7 +8,7 @@ class X3DBoundedObjectTool extends X3DChildNodeTool
|
|
|
8
8
|
{
|
|
9
9
|
async initializeTool ()
|
|
10
10
|
{
|
|
11
|
-
await super .
|
|
11
|
+
await super .loadTool ("tool", __dirname, "X3DBoundedObjectTool.x3d");
|
|
12
12
|
|
|
13
13
|
this .getBrowser () .displayEvents () .addInterest ("reshapeTool", this);
|
|
14
14
|
|
|
@@ -14,7 +14,7 @@ class X3DTransformNodeTool extends X3DChildNodeTool
|
|
|
14
14
|
|
|
15
15
|
async initializeTool ()
|
|
16
16
|
{
|
|
17
|
-
await super .
|
|
17
|
+
await super .loadTool ("tool", __dirname, "X3DTransformNodeTool.x3d");
|
|
18
18
|
|
|
19
19
|
X3DTransformNodeTool .#transformTools .add (this);
|
|
20
20
|
|
|
@@ -19,7 +19,7 @@ class X3DActiveLayerNodeTool extends X3DChildNodeTool
|
|
|
19
19
|
|
|
20
20
|
async initializeTool (... args)
|
|
21
21
|
{
|
|
22
|
-
await super .
|
|
22
|
+
await super .loadTool ("tool", ... args);
|
|
23
23
|
|
|
24
24
|
this .getBrowser () ._activeLayer .addInterest ("set_activeLayer", this);
|
|
25
25
|
|
|
@@ -8,7 +8,7 @@ class X3DLightNodeTool extends X3DChildNodeTool
|
|
|
8
8
|
|
|
9
9
|
async initializeTool ()
|
|
10
10
|
{
|
|
11
|
-
await super .
|
|
11
|
+
await super .loadTool ("tool", __dirname, "X3DLightNodeTool.x3d");
|
|
12
12
|
|
|
13
13
|
this .tool .getField ("on") .addReference (this .node ._on);
|
|
14
14
|
this .tool .getField ("color") .addReference (this .node ._color);
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const
|
|
4
|
+
X3DParametricGeometryNodeTool = require ("./X3DParametricGeometryNodeTool"),
|
|
5
|
+
X3DLineGeometryNodeTool = require ("../Rendering/X3DLineGeometryNodeTool");
|
|
4
6
|
|
|
5
|
-
class NurbsCurveTool extends X3DLineGeometryNodeTool
|
|
7
|
+
class NurbsCurveTool extends X3DParametricGeometryNodeTool (X3DLineGeometryNodeTool)
|
|
8
|
+
{
|
|
9
|
+
async initializeTool ()
|
|
10
|
+
{
|
|
11
|
+
await super .initializeTool ();
|
|
12
|
+
|
|
13
|
+
this .set_toolRebuildParametricGeometry ();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
set_toolRebuildParametricGeometry ()
|
|
17
|
+
{
|
|
18
|
+
this .parametricGeometryNodeTool .uDimension = this .node ._controlPoint .getValue () ?._point .length ?? 0;
|
|
19
|
+
this .parametricGeometryNodeTool .vDimension = 1;
|
|
20
|
+
|
|
21
|
+
super .set_toolRebuildParametricGeometry ();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
6
24
|
|
|
7
25
|
module .exports = NurbsCurveTool;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const X3DNurbsSurfaceGeometryNodeTool = require ("./X3DNurbsSurfaceGeometryNodeTool");
|
|
4
4
|
|
|
5
|
-
class NurbsPatchSurfaceTool extends
|
|
5
|
+
class NurbsPatchSurfaceTool extends X3DNurbsSurfaceGeometryNodeTool { }
|
|
6
6
|
|
|
7
7
|
module .exports = NurbsPatchSurfaceTool;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const X3DNurbsSurfaceGeometryNodeTool = require ("./X3DNurbsSurfaceGeometryNodeTool");
|
|
4
4
|
|
|
5
|
-
class NurbsTrimmedSurfaceTool extends
|
|
5
|
+
class NurbsTrimmedSurfaceTool extends X3DNurbsSurfaceGeometryNodeTool { }
|
|
6
6
|
|
|
7
7
|
module .exports = NurbsTrimmedSurfaceTool;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const
|
|
4
|
+
X3DGeometryNodeTool = require ("../Rendering/X3DGeometryNodeTool"),
|
|
5
|
+
X3DParametricGeometryNodeTool = require ("./X3DParametricGeometryNodeTool");;
|
|
6
|
+
|
|
7
|
+
class X3DNurbsSurfaceGeometryNodeTool extends X3DParametricGeometryNodeTool (X3DGeometryNodeTool)
|
|
8
|
+
{
|
|
9
|
+
async initializeTool ()
|
|
10
|
+
{
|
|
11
|
+
await super .initializeTool ();
|
|
12
|
+
|
|
13
|
+
this .parametricGeometryNodeTool .getField ("uDimension") .addReference (this .node ._uDimension);
|
|
14
|
+
this .parametricGeometryNodeTool .getField ("vDimension") .addReference (this .node ._vDimension);
|
|
15
|
+
|
|
16
|
+
this .set_toolRebuildParametricGeometry ();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
module .exports = X3DNurbsSurfaceGeometryNodeTool;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const ToolColors = require ("../Core/ToolColors");
|
|
4
|
+
|
|
5
|
+
const X3DParametricGeometryNodeTool = Base => class extends Base
|
|
6
|
+
{
|
|
7
|
+
async initializeTool ()
|
|
8
|
+
{
|
|
9
|
+
await Promise .all ([
|
|
10
|
+
super .initializeTool (),
|
|
11
|
+
super .loadTool ("parametricGeometryNodeTool", __dirname, "X3DParametricGeometryNodeTool.x3d"),
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
this .node ._rebuild .addInterest ("set_toolRebuildParametricGeometry", this);
|
|
15
|
+
|
|
16
|
+
this .parametricGeometryNodeTool .hullColor = ToolColors .LIGHT_GREY;
|
|
17
|
+
this .parametricGeometryNodeTool .controlPointColor = ToolColors .DARK_BLUE;
|
|
18
|
+
|
|
19
|
+
this .parametricGeometryNodeTool .getField ("controlPoint") .addReference (this .node ._controlPoint);
|
|
20
|
+
|
|
21
|
+
this .addExternalNode (this .node ._controlPoint);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
set_toolRebuildParametricGeometry ()
|
|
25
|
+
{
|
|
26
|
+
const
|
|
27
|
+
uDimension = this .parametricGeometryNodeTool .uDimension,
|
|
28
|
+
vDimension = this .parametricGeometryNodeTool .vDimension,
|
|
29
|
+
hullIndex = [ ];
|
|
30
|
+
|
|
31
|
+
// Generate u connections.
|
|
32
|
+
|
|
33
|
+
if (uDimension > 1)
|
|
34
|
+
{
|
|
35
|
+
for (let v = 0; v < vDimension; ++ v)
|
|
36
|
+
{
|
|
37
|
+
for (let u = 0; u < uDimension; ++ u)
|
|
38
|
+
hullIndex .push (v * uDimension + u);
|
|
39
|
+
|
|
40
|
+
hullIndex .push (-1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Generate v connections.
|
|
45
|
+
|
|
46
|
+
if (vDimension > 1)
|
|
47
|
+
{
|
|
48
|
+
for (let u = 0; u < uDimension; ++ u)
|
|
49
|
+
{
|
|
50
|
+
for (let v = 0; v < vDimension; ++ v)
|
|
51
|
+
hullIndex .push (v * uDimension + u);
|
|
52
|
+
|
|
53
|
+
hullIndex .push (-1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
this .parametricGeometryNodeTool .set_hullIndex = hullIndex;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
module .exports = X3DParametricGeometryNodeTool;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "http://www.web3d.org/specifications/x3d-4.0.dtd">
|
|
3
|
+
<X3D profile='Interchange' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
|
|
4
|
+
<head>
|
|
5
|
+
<component name='Scripting' level='1'/>
|
|
6
|
+
<component name='X_ITE' level='1'/>
|
|
7
|
+
<meta name='created' content='Tue, 28 Nov 2023 21:59:27 GMT'/>
|
|
8
|
+
<meta name='comment' content='Rise and Shine'/>
|
|
9
|
+
<meta name='creator' content='Holger Seelig'/>
|
|
10
|
+
<meta name='generator' content='Sunrize X3D Editor V1.7.17, https://create3000.github.io/sunrize/'/>
|
|
11
|
+
<meta name='modified' content='Sun, 08 Sep 2024 13:04:14 GMT'/>
|
|
12
|
+
</head>
|
|
13
|
+
<Scene>
|
|
14
|
+
<ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
|
|
15
|
+
<field accessType='inputOutput' type='SFBool' name='instanced'/>
|
|
16
|
+
</ExternProtoDeclare>
|
|
17
|
+
<ProtoDeclare name='X3DParametricGeometryNodeTool'>
|
|
18
|
+
<ProtoInterface>
|
|
19
|
+
<field accessType='inputOutput' type='SFBool' name='selected'/>
|
|
20
|
+
<field accessType='inputOutput' type='SFString' name='group' value='NONE'/>
|
|
21
|
+
<field accessType='inputOutput' type='SFBool' name='undo'/>
|
|
22
|
+
<field accessType='inputOutput' type='SFInt32' name='uDimension'/>
|
|
23
|
+
<field accessType='inputOutput' type='SFInt32' name='vDimension'/>
|
|
24
|
+
<field accessType='inputOnly' type='MFInt32' name='set_hullIndex'/>
|
|
25
|
+
<field accessType='inputOutput' type='SFColor' name='hullColor' value='1 1 1'/>
|
|
26
|
+
<field accessType='inputOutput' type='SFColor' name='controlPointColor' value='1 1 1'/>
|
|
27
|
+
<field accessType='inputOutput' type='SFNode' name='controlPoint'/>
|
|
28
|
+
</ProtoInterface>
|
|
29
|
+
<ProtoBody>
|
|
30
|
+
<Group>
|
|
31
|
+
<Shape DEF='Hull'>
|
|
32
|
+
<Appearance>
|
|
33
|
+
<LineProperties
|
|
34
|
+
linetype='3'
|
|
35
|
+
linewidthScaleFactor='2'/>
|
|
36
|
+
<UnlitMaterial>
|
|
37
|
+
<IS>
|
|
38
|
+
<connect nodeField='emissiveColor' protoField='hullColor'/>
|
|
39
|
+
</IS>
|
|
40
|
+
</UnlitMaterial>
|
|
41
|
+
<DepthMode DEF='_4'
|
|
42
|
+
depthRange='0 0'/>
|
|
43
|
+
</Appearance>
|
|
44
|
+
<IndexedLineSet DEF='_3'>
|
|
45
|
+
<IS>
|
|
46
|
+
<connect nodeField='set_coordIndex' protoField='set_hullIndex'/>
|
|
47
|
+
<connect nodeField='coord' protoField='controlPoint'/>
|
|
48
|
+
</IS>
|
|
49
|
+
</IndexedLineSet>
|
|
50
|
+
</Shape>
|
|
51
|
+
<Shape DEF='ControlPoints'>
|
|
52
|
+
<Appearance>
|
|
53
|
+
<PointProperties
|
|
54
|
+
pointSizeScaleFactor='5'
|
|
55
|
+
pointSizeMinValue='5'
|
|
56
|
+
pointSizeMaxValue='5'/>
|
|
57
|
+
<Material
|
|
58
|
+
diffuseColor='0 0 0'>
|
|
59
|
+
<IS>
|
|
60
|
+
<connect nodeField='emissiveColor' protoField='controlPointColor'/>
|
|
61
|
+
</IS>
|
|
62
|
+
</Material>
|
|
63
|
+
<ProtoInstance name='ToolShader' containerField='shaders'/>
|
|
64
|
+
<DepthMode USE='_4'/>
|
|
65
|
+
</Appearance>
|
|
66
|
+
<PointSet DEF='_2'>
|
|
67
|
+
<IS>
|
|
68
|
+
<connect nodeField='coord' protoField='controlPoint'/>
|
|
69
|
+
</IS>
|
|
70
|
+
</PointSet>
|
|
71
|
+
</Shape>
|
|
72
|
+
</Group>
|
|
73
|
+
<Script DEF='CloneCountScript'>
|
|
74
|
+
<field accessType='initializeOnly' type='SFNode' name='points'>
|
|
75
|
+
<PointSet USE='_2'/>
|
|
76
|
+
</field>
|
|
77
|
+
<field accessType='initializeOnly' type='SFNode' name='lines'>
|
|
78
|
+
<IndexedLineSet USE='_3'/>
|
|
79
|
+
</field>
|
|
80
|
+
<![CDATA[ecmascript:
|
|
81
|
+
|
|
82
|
+
function initialize ()
|
|
83
|
+
{
|
|
84
|
+
points .getValue () .setPrivate (true);
|
|
85
|
+
lines .getValue () .setPrivate (true);
|
|
86
|
+
}
|
|
87
|
+
]]>
|
|
88
|
+
</Script>
|
|
89
|
+
</ProtoBody>
|
|
90
|
+
</ProtoDeclare>
|
|
91
|
+
</Scene>
|
|
92
|
+
</X3D>
|
|
@@ -10,7 +10,7 @@ class X3DViewpointNodeTool extends X3DChildNodeTool
|
|
|
10
10
|
|
|
11
11
|
async initializeTool ()
|
|
12
12
|
{
|
|
13
|
-
await super .
|
|
13
|
+
await super .loadTool ("tool", __dirname, "X3DViewpointNodeTool.x3d");
|
|
14
14
|
|
|
15
15
|
this .tool .getField ("isActive") .addInterest ("handleUndo", this);
|
|
16
16
|
|
|
@@ -8,38 +8,38 @@ class X3DGeometryNodeTool extends X3DNodeTool
|
|
|
8
8
|
{
|
|
9
9
|
async initializeTool (type)
|
|
10
10
|
{
|
|
11
|
-
await super .loadTool (__dirname, "X3DGeometryNodeTool.x3d");
|
|
11
|
+
await super .loadTool ("tool", __dirname, "X3DGeometryNodeTool.x3d");
|
|
12
12
|
|
|
13
13
|
this .tool .linesColor = ToolColors .BLUE;
|
|
14
14
|
|
|
15
15
|
if (type === "CUSTOM")
|
|
16
16
|
return;
|
|
17
17
|
|
|
18
|
-
this .node ._rebuild .addInterest ("
|
|
18
|
+
this .node ._rebuild .addInterest ("set_toolRebuildGeometry", this);
|
|
19
19
|
|
|
20
20
|
this .tool .linesCoord = this .getToolScene () .createNode ("CoordinateDouble");
|
|
21
21
|
|
|
22
|
-
this .
|
|
22
|
+
this .set_toolRebuildGeometry ();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
disposeTool ()
|
|
26
26
|
{
|
|
27
|
-
this .node ._rebuild .removeInterest ("
|
|
27
|
+
this .node ._rebuild .removeInterest ("set_toolRebuildGeometry", this);
|
|
28
28
|
|
|
29
29
|
super .disposeTool ();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
set_toolRebuildGeometry ()
|
|
33
33
|
{
|
|
34
34
|
const
|
|
35
|
-
points
|
|
36
|
-
|
|
35
|
+
points = this .node .getVertices () .filter ((_, i) => i % 4 < 3),
|
|
36
|
+
numPoints = points .length / 3;
|
|
37
37
|
|
|
38
|
-
if (
|
|
38
|
+
if (numPoints !== this .tool .linesCoord .point .length)
|
|
39
39
|
{
|
|
40
40
|
const coordIndex = [ ];
|
|
41
41
|
|
|
42
|
-
for (let i = 0; i <
|
|
42
|
+
for (let i = 0; i < numPoints; i += 3)
|
|
43
43
|
coordIndex .push (i, i + 1, i + 2, i, -1);
|
|
44
44
|
|
|
45
45
|
this .tool .set_linesCoordIndex = coordIndex;
|
|
@@ -8,30 +8,30 @@ class X3DLineGeometryNodeTool extends X3DGeometryNodeTool
|
|
|
8
8
|
{
|
|
9
9
|
async initializeTool (type)
|
|
10
10
|
{
|
|
11
|
-
await super .loadTool (__dirname, "X3DLineGeometryNodeTool.x3d");
|
|
11
|
+
await super .loadTool ("tool", __dirname, "X3DLineGeometryNodeTool.x3d");
|
|
12
12
|
|
|
13
13
|
this .tool .pointsColor = ToolColors .BLUE;
|
|
14
14
|
|
|
15
15
|
if (type === "CUSTOM")
|
|
16
16
|
return;
|
|
17
17
|
|
|
18
|
-
this .node ._rebuild .addInterest ("
|
|
18
|
+
this .node ._rebuild .addInterest ("set_toolRebuildGeometry", this);
|
|
19
19
|
|
|
20
20
|
this .tool .pointsCoord = this .getToolScene () .createNode ("CoordinateDouble");
|
|
21
21
|
|
|
22
|
-
this .
|
|
22
|
+
this .set_toolRebuildGeometry ();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
disposeTool ()
|
|
26
26
|
{
|
|
27
|
-
this .node ._rebuild .removeInterest ("
|
|
27
|
+
this .node ._rebuild .removeInterest ("set_toolRebuildGeometry", this);
|
|
28
28
|
|
|
29
29
|
super .disposeTool ();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
set_toolRebuildGeometry ()
|
|
33
33
|
{
|
|
34
|
-
const points = this .node .getVertices () .filter ((_, i) => i % 4
|
|
34
|
+
const points = this .node .getVertices () .filter ((_, i) => i % 4 < 3);
|
|
35
35
|
|
|
36
36
|
this .tool .pointsCoord .point = points;
|
|
37
37
|
}
|
|
@@ -8,30 +8,30 @@ class X3DPointGeometryNodeTool extends X3DGeometryNodeTool
|
|
|
8
8
|
{
|
|
9
9
|
async initializeTool (type)
|
|
10
10
|
{
|
|
11
|
-
await super .loadTool (__dirname, "X3DPointGeometryNodeTool.x3d");
|
|
11
|
+
await super .loadTool ("tool", __dirname, "X3DPointGeometryNodeTool.x3d");
|
|
12
12
|
|
|
13
13
|
this .tool .pointsColor = ToolColors .BLUE;
|
|
14
14
|
|
|
15
15
|
if (type === "CUSTOM")
|
|
16
16
|
return;
|
|
17
17
|
|
|
18
|
-
this .node ._rebuild .addInterest ("
|
|
18
|
+
this .node ._rebuild .addInterest ("set_toolRebuildGeometry", this);
|
|
19
19
|
|
|
20
20
|
this .tool .pointsCoord = this .getToolScene () .createNode ("CoordinateDouble");
|
|
21
21
|
|
|
22
|
-
this .
|
|
22
|
+
this .set_toolRebuildGeometry ();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
disposeTool ()
|
|
26
26
|
{
|
|
27
|
-
this .node ._rebuild .removeInterest ("
|
|
27
|
+
this .node ._rebuild .removeInterest ("set_toolRebuildGeometry", this);
|
|
28
28
|
|
|
29
29
|
super .disposeTool ();
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
set_toolRebuildGeometry ()
|
|
33
33
|
{
|
|
34
|
-
const points = this .node .getVertices () .filter ((_, i) => i % 4
|
|
34
|
+
const points = this .node .getVertices () .filter ((_, i) => i % 4 < 3);
|
|
35
35
|
|
|
36
36
|
this .tool .pointsCoord .point = points;
|
|
37
37
|
}
|
|
@@ -8,7 +8,7 @@ class ListenerPointSourceTool extends X3DChildNodeTool
|
|
|
8
8
|
|
|
9
9
|
async initializeTool ()
|
|
10
10
|
{
|
|
11
|
-
await super .
|
|
11
|
+
await super .loadTool ("tool", __dirname, "ListenerPointSourceTool.x3d");
|
|
12
12
|
|
|
13
13
|
this .tool .getField ("position") .addReference (this .node ._position);
|
|
14
14
|
this .tool .getField ("orientation") .addReference (this .node ._orientation);
|
|
@@ -10,7 +10,7 @@ class SoundTool extends X3DChildNodeTool
|
|
|
10
10
|
|
|
11
11
|
async initializeTool ()
|
|
12
12
|
{
|
|
13
|
-
await super .
|
|
13
|
+
await super .loadTool ("tool", __dirname, "SoundTool.x3d");
|
|
14
14
|
|
|
15
15
|
this .tool .getField ("location") .addReference (this .node ._location);
|
|
16
16
|
this .tool .getField ("direction") .addReference (this .node ._direction);
|
|
@@ -8,7 +8,7 @@ class SpatialSoundTool extends X3DChildNodeTool
|
|
|
8
8
|
|
|
9
9
|
async initializeTool ()
|
|
10
10
|
{
|
|
11
|
-
await super .
|
|
11
|
+
await super .loadTool ("tool", __dirname, "SpatialSoundTool.x3d");
|
|
12
12
|
|
|
13
13
|
this .tool .getField ("location") .addReference (this .node ._location);
|
|
14
14
|
this .tool .getField ("direction") .addReference (this .node ._direction);
|
|
@@ -8,7 +8,7 @@ class X3DTextureProjectorNodeTool extends X3DChildNodeTool
|
|
|
8
8
|
|
|
9
9
|
async initializeTool ()
|
|
10
10
|
{
|
|
11
|
-
await super .
|
|
11
|
+
await super .loadTool ("tool", __dirname, "X3DTextureProjectorNodeTool.x3d");
|
|
12
12
|
|
|
13
13
|
this .tool .getField ("on") .addReference (this .node ._on);
|
|
14
14
|
this .tool .getField ("location") .addReference (this .node ._location);
|
|
@@ -220,8 +220,8 @@
|
|
|
220
220
|
|
|
221
221
|
async function initialize ()
|
|
222
222
|
{
|
|
223
|
-
this
|
|
224
|
-
textureAppearance .getValue () .
|
|
223
|
+
this .getValue () .setPrivate (true);
|
|
224
|
+
textureAppearance .getValue () .setPrivate (true);
|
|
225
225
|
|
|
226
226
|
const tool = await transform .getValue () .addTool () .getToolInstance ();
|
|
227
227
|
|