x_ite 4.7.6 → 4.7.7
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/.vscode/settings.json +1 -2
- package/Makefile +1 -0
- package/build/components/annotation.build.js +2 -2
- package/build/components/cad-geometry.build.js +2 -2
- package/build/components/cube-map-texturing.build.js +2 -2
- package/build/components/dis.build.js +2 -2
- package/build/components/event-utilities.build.js +2 -2
- package/build/components/geometry2d.build.js +2 -2
- package/build/components/geospatial.build.js +2 -2
- package/build/components/h-anim.build.js +2 -2
- package/build/components/key-device-sensor.build.js +2 -2
- package/build/components/layout.build.js +2 -2
- package/build/components/nurbs.build.js +2 -2
- package/build/components/particle-systems.build.js +2 -2
- package/build/components/picking.build.js +2 -2
- package/build/components/projective-texture-mapping.build.js +2 -2
- package/build/components/rigid-body-physics.build.js +2 -2
- package/build/components/scripting.build.js +2 -2
- package/build/components/texturing-3d.build.js +2 -2
- package/build/components/volume-rendering.build.js +2 -2
- package/build/components/x_ite.build.js +2 -2
- package/build/parts/default.end.frag.js +3 -0
- package/build/parts/default.start.frag.js +15 -0
- package/build/parts/{x_ite.end.frag → x_ite.end.frag.js} +4 -2
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +2 -2
- package/dist/assets/components/annotation.js +17 -7
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +17 -7
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +17 -7
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +17 -7
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +17 -7
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +17 -7
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +17 -7
- package/dist/assets/components/geospatial.min.js +2 -2
- package/dist/assets/components/h-anim.js +17 -7
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +17 -7
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +17 -7
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +17 -7
- package/dist/assets/components/nurbs.min.js +2 -2
- package/dist/assets/components/particle-systems.js +17 -7
- package/dist/assets/components/particle-systems.min.js +2 -2
- package/dist/assets/components/picking.js +21 -11
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +17 -7
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +17 -7
- package/dist/assets/components/rigid-body-physics.min.js +17 -17
- package/dist/assets/components/scripting.js +24 -9
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +17 -7
- package/dist/assets/components/texturing-3d.min.js +41 -41
- package/dist/assets/components/volume-rendering.js +19 -9
- package/dist/assets/components/volume-rendering.min.js +3 -3
- package/dist/assets/components/x_ite.js +17 -7
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/dist/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl1/Phong.fs +0 -1
- package/dist/assets/shaders/webgl1/Unlit.fs +0 -3
- package/dist/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl2/Phong.fs +0 -1
- package/dist/assets/shaders/webgl2/Unlit.fs +0 -3
- package/dist/example.html +2 -2
- package/dist/x_ite.css +2 -2
- package/dist/x_ite.js +29492 -29016
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/Accessing-the-External-Browser.md +31 -2
- package/docs/What's-New.md +23 -0
- package/docs/_config.yml +1 -1
- package/docs/index.md +20 -13
- package/docs/reference/Browser-Services.md +36 -8
- package/docs/reference/Script-Node-Authoring-Interface.md +12 -4
- package/package.json +3 -3
- package/src/assets/components/picking.js +2 -2
- package/src/assets/components/volume-rendering.js +2 -2
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/src/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl1/Phong.fs +0 -1
- package/src/assets/shaders/webgl1/Unlit.fs +0 -3
- package/src/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl2/Phong.fs +0 -1
- package/src/assets/shaders/webgl2/Unlit.fs +0 -3
- package/src/bookmarks.js +8 -11
- package/src/examples.js +1 -1
- package/src/locale/de.po +15 -71
- package/src/locale/fr.po +14 -71
- package/src/standard/Time/MicroTime.js +3 -1
- package/src/standard/Utility/DataStorage.js +7 -10
- package/src/tests.js +1 -1
- package/src/x_ite/Browser/Core/BrowserOptions.js +40 -28
- package/src/x_ite/Browser/Core/BrowserTimings.js +12 -21
- package/src/x_ite/Browser/Core/ContextMenu.js +26 -12
- package/src/x_ite/Browser/Core/X3DCoreContext.js +95 -42
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +4 -1
- package/src/x_ite/Browser/Shaders/ShaderTest.js +3 -3
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +70 -50
- package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
- package/src/x_ite/Components/Scripting/Script.js +7 -2
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +10 -12
- package/src/x_ite/Components/Shaders.js +9 -9
- package/src/x_ite/Execution/X3DExecutionContext.js +9 -11
- package/src/x_ite/Fields/SFColor.js +5 -5
- package/src/x_ite/Fields/SFColorRGBA.js +6 -6
- package/src/x_ite/Fields/SFDouble.js +1 -1
- package/src/x_ite/Fields/SFFloat.js +1 -1
- package/src/x_ite/Fields/SFImage.js +13 -13
- package/src/x_ite/Fields/SFMatrix3.js +1 -1
- package/src/x_ite/Fields/SFMatrix4.js +1 -1
- package/src/x_ite/Fields/SFNode.js +23 -19
- package/src/x_ite/Fields/SFNodeCache.js +14 -10
- package/src/x_ite/Fields/SFRotation.js +6 -6
- package/src/x_ite/Fields/SFString.js +1 -1
- package/src/x_ite/Fields/SFVec2.js +2 -2
- package/src/x_ite/Fields/SFVec3.js +3 -3
- package/src/x_ite/Fields/SFVec4.js +4 -4
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +3 -3
- package/src/x_ite/InputOutput/Generator.js +71 -62
- package/src/x_ite/Parser/X3DParser.js +6 -0
- package/src/x_ite/Parser/XMLParser.js +1 -1
- package/src/x_ite/X3D.js +8 -2
- package/src/x_ite.js +21 -12
- package/build/parts/default.end.frag +0 -2
- package/build/parts/default.start.frag +0 -6
- package/build/parts/x_ite.start.frag +0 -8
|
@@ -93,7 +93,7 @@ function (X3DConstants)
|
|
|
93
93
|
},
|
|
94
94
|
PadRight: function (string, pad)
|
|
95
95
|
{
|
|
96
|
-
for (
|
|
96
|
+
for (let i = 0, length = pad - string .length; i < length; ++ i)
|
|
97
97
|
string += " ";
|
|
98
98
|
|
|
99
99
|
return string;
|
|
@@ -145,7 +145,7 @@ function (X3DConstants)
|
|
|
145
145
|
},
|
|
146
146
|
ExportedNodes: function (exportedNodes)
|
|
147
147
|
{
|
|
148
|
-
|
|
148
|
+
const index = this .exportedNodesIndex .get (this .ExecutionContext ());
|
|
149
149
|
|
|
150
150
|
exportedNodes .forEach (function (exportedNode)
|
|
151
151
|
{
|
|
@@ -159,7 +159,7 @@ function (X3DConstants)
|
|
|
159
159
|
},
|
|
160
160
|
ImportedNodes: function (importedNodes)
|
|
161
161
|
{
|
|
162
|
-
|
|
162
|
+
const index = this .importedNodesIndex .get (this .ExecutionContext ());
|
|
163
163
|
|
|
164
164
|
importedNodes .forEach (function (importedNode)
|
|
165
165
|
{
|
|
@@ -197,72 +197,79 @@ function (X3DConstants)
|
|
|
197
197
|
{
|
|
198
198
|
return this .nodes .has (baseNode);
|
|
199
199
|
},
|
|
200
|
-
Name: function (
|
|
200
|
+
Name: (function ()
|
|
201
201
|
{
|
|
202
|
-
|
|
202
|
+
const _TrailingNumbers = /(_\d+$)/;
|
|
203
203
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
if (name !== undefined)
|
|
207
|
-
return name;
|
|
208
|
-
|
|
209
|
-
var names = this .names .get (this .ExecutionContext ());
|
|
210
|
-
|
|
211
|
-
// The node has no name
|
|
212
|
-
|
|
213
|
-
if (baseNode .getName () .length === 0)
|
|
204
|
+
return function (baseNode)
|
|
214
205
|
{
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
var name = this .UniqueName ();
|
|
206
|
+
// Is the node already in index
|
|
218
207
|
|
|
219
|
-
|
|
220
|
-
this .namesByNode .set (baseNode, name);
|
|
208
|
+
const name = this .namesByNode .get (baseNode);
|
|
221
209
|
|
|
210
|
+
if (name !== undefined)
|
|
211
|
+
{
|
|
222
212
|
return name;
|
|
223
213
|
}
|
|
214
|
+
else
|
|
215
|
+
{
|
|
216
|
+
const names = this .names .get (this .ExecutionContext ());
|
|
224
217
|
|
|
225
|
-
|
|
218
|
+
// The node has no name
|
|
226
219
|
|
|
227
|
-
|
|
228
|
-
|
|
220
|
+
if (baseNode .getName () .length === 0)
|
|
221
|
+
{
|
|
222
|
+
if (this .NeedsName (baseNode))
|
|
223
|
+
{
|
|
224
|
+
const name = this .UniqueName ();
|
|
229
225
|
|
|
230
|
-
|
|
226
|
+
names .set (name, baseNode);
|
|
227
|
+
this .namesByNode .set (baseNode, name);
|
|
231
228
|
|
|
232
|
-
|
|
229
|
+
return name;
|
|
230
|
+
}
|
|
233
231
|
|
|
234
|
-
|
|
235
|
-
var hasNumber = name .match (_TrailingNumbers) !== null;
|
|
232
|
+
// The node doesn't need a name
|
|
236
233
|
|
|
237
|
-
|
|
234
|
+
return baseNode .getName ();
|
|
235
|
+
}
|
|
238
236
|
|
|
239
|
-
|
|
240
|
-
{
|
|
241
|
-
if (this .NeedsName (baseNode))
|
|
242
|
-
name = this .UniqueName ();
|
|
237
|
+
// The node has a name
|
|
243
238
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
else
|
|
248
|
-
{
|
|
249
|
-
var
|
|
250
|
-
i = 0,
|
|
251
|
-
newName = hasNumber ? name + '_' + (++ i) : name;
|
|
239
|
+
let name = baseNode .getName ();
|
|
240
|
+
const hasNumber = name .match (_TrailingNumbers) !== null;
|
|
252
241
|
|
|
253
|
-
|
|
254
|
-
{
|
|
255
|
-
newName = name + '_' + (++ i);
|
|
256
|
-
}
|
|
242
|
+
name = name .replace (_TrailingNumbers, "");
|
|
257
243
|
|
|
258
|
-
|
|
259
|
-
|
|
244
|
+
if (name .length === 0)
|
|
245
|
+
{
|
|
246
|
+
if (this .NeedsName (baseNode))
|
|
247
|
+
name = this .UniqueName ();
|
|
260
248
|
|
|
261
|
-
|
|
262
|
-
|
|
249
|
+
else
|
|
250
|
+
return "";
|
|
251
|
+
}
|
|
252
|
+
else
|
|
253
|
+
{
|
|
254
|
+
let
|
|
255
|
+
i = 0,
|
|
256
|
+
newName = hasNumber ? name + '_' + (++ i) : name;
|
|
263
257
|
|
|
264
|
-
|
|
265
|
-
|
|
258
|
+
while (names .has (newName))
|
|
259
|
+
{
|
|
260
|
+
newName = name + '_' + (++ i);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
name = newName;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
names .set (name, baseNode);
|
|
267
|
+
this .namesByNode .set (baseNode, name);
|
|
268
|
+
|
|
269
|
+
return name;
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
})(),
|
|
266
273
|
NeedsName: function (baseNode)
|
|
267
274
|
{
|
|
268
275
|
if (baseNode .getCloneCount () > 1)
|
|
@@ -271,7 +278,7 @@ function (X3DConstants)
|
|
|
271
278
|
if (baseNode .hasRoutes ())
|
|
272
279
|
return true;
|
|
273
280
|
|
|
274
|
-
|
|
281
|
+
const
|
|
275
282
|
executionContext = baseNode .getExecutionContext (),
|
|
276
283
|
index = this .importedNodesIndex .get (executionContext);
|
|
277
284
|
|
|
@@ -280,24 +287,26 @@ function (X3DConstants)
|
|
|
280
287
|
if (index .has (baseNode))
|
|
281
288
|
return true;
|
|
282
289
|
}
|
|
290
|
+
else
|
|
291
|
+
{
|
|
292
|
+
const index = this .exportedNodesIndex .get (executionContext);
|
|
283
293
|
|
|
284
|
-
|
|
294
|
+
if (index)
|
|
295
|
+
{
|
|
296
|
+
if (index .has (baseNode))
|
|
297
|
+
return true;
|
|
298
|
+
}
|
|
285
299
|
|
|
286
|
-
|
|
287
|
-
{
|
|
288
|
-
if (index .has (baseNode))
|
|
289
|
-
return true;
|
|
300
|
+
return false;
|
|
290
301
|
}
|
|
291
|
-
|
|
292
|
-
return false;
|
|
293
302
|
},
|
|
294
303
|
UniqueName: function ()
|
|
295
304
|
{
|
|
296
|
-
|
|
305
|
+
const names = this .names .get (this .ExecutionContext ());
|
|
297
306
|
|
|
298
307
|
for (; ;)
|
|
299
308
|
{
|
|
300
|
-
|
|
309
|
+
const name = '_' + (++ this .newName);
|
|
301
310
|
|
|
302
311
|
if (names .has (name))
|
|
303
312
|
continue;
|
|
@@ -307,7 +316,7 @@ function (X3DConstants)
|
|
|
307
316
|
},
|
|
308
317
|
LocalName: function (baseNode)
|
|
309
318
|
{
|
|
310
|
-
|
|
319
|
+
const importedName = this .importedNames .get (baseNode);
|
|
311
320
|
|
|
312
321
|
if (importedName !== undefined)
|
|
313
322
|
return importedName;
|
|
@@ -373,7 +382,7 @@ function (X3DConstants)
|
|
|
373
382
|
{
|
|
374
383
|
if (this .units)
|
|
375
384
|
{
|
|
376
|
-
|
|
385
|
+
const executionContext = this .ExecutionContext ();
|
|
377
386
|
|
|
378
387
|
if (executionContext)
|
|
379
388
|
return executionContext .toUnit (category, value);
|
|
@@ -130,6 +130,12 @@ define (function ()
|
|
|
130
130
|
providerUrls .add (providerUrl);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
if (typeof globalRequire === "function")
|
|
134
|
+
{
|
|
135
|
+
for (const url of providerUrls)
|
|
136
|
+
globalRequire (new URL (url) .pathname);
|
|
137
|
+
}
|
|
138
|
+
|
|
133
139
|
return Array .from (providerUrls);
|
|
134
140
|
};
|
|
135
141
|
})(),
|
package/src/x_ite/X3D.js
CHANGED
|
@@ -106,7 +106,12 @@ function ($,
|
|
|
106
106
|
|
|
107
107
|
function getComponentUrl (name)
|
|
108
108
|
{
|
|
109
|
-
|
|
109
|
+
const url = urls .getProviderUrl (name);
|
|
110
|
+
|
|
111
|
+
if (typeof globalRequire === "function")
|
|
112
|
+
globalRequire (new URL (url) .pathname);
|
|
113
|
+
|
|
114
|
+
return url;
|
|
110
115
|
}
|
|
111
116
|
|
|
112
117
|
function createBrowser (url, parameter)
|
|
@@ -180,11 +185,12 @@ function ($,
|
|
|
180
185
|
});
|
|
181
186
|
}
|
|
182
187
|
|
|
188
|
+
require .getComponentUrl = getComponentUrl;
|
|
189
|
+
|
|
183
190
|
Object .assign (X3D,
|
|
184
191
|
{
|
|
185
192
|
require: require,
|
|
186
193
|
define: define,
|
|
187
|
-
getComponentUrl: getComponentUrl,
|
|
188
194
|
|
|
189
195
|
getBrowser: getBrowser,
|
|
190
196
|
createBrowser: createBrowser,
|
package/src/x_ite.js
CHANGED
|
@@ -46,9 +46,6 @@
|
|
|
46
46
|
*
|
|
47
47
|
******************************************************************************/
|
|
48
48
|
|
|
49
|
-
if (typeof module === 'undefined')
|
|
50
|
-
var module = { };
|
|
51
|
-
|
|
52
49
|
require .config ({
|
|
53
50
|
"waitSeconds": 0,
|
|
54
51
|
});
|
|
@@ -71,7 +68,10 @@ define .hide = function ()
|
|
|
71
68
|
|
|
72
69
|
const getScriptURL = (function ()
|
|
73
70
|
{
|
|
74
|
-
|
|
71
|
+
if (document .currentScript)
|
|
72
|
+
var src = document .currentScript .src;
|
|
73
|
+
else if (typeof __filename === "string")
|
|
74
|
+
var src = "file://" + __filename;
|
|
75
75
|
|
|
76
76
|
return function ()
|
|
77
77
|
{
|
|
@@ -85,15 +85,21 @@ const getScriptURL = (function ()
|
|
|
85
85
|
|
|
86
86
|
function X_ITE (callback, fallback)
|
|
87
87
|
{
|
|
88
|
-
|
|
89
|
-
{
|
|
90
|
-
PrivateX3D (callback, fallback);
|
|
91
|
-
}
|
|
92
|
-
else
|
|
88
|
+
const promise = new Promise (function (resolve, reject)
|
|
93
89
|
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
if (PrivateX3D)
|
|
91
|
+
{
|
|
92
|
+
PrivateX3D (resolve, reject);
|
|
93
|
+
PrivateX3D (callback, fallback);
|
|
94
|
+
}
|
|
95
|
+
else
|
|
96
|
+
{
|
|
97
|
+
callbacks .push (resolve, callback);
|
|
98
|
+
fallbacks .push (reject, fallback);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
return promise;
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
function fallback (error)
|
|
@@ -129,6 +135,9 @@ const getScriptURL = (function ()
|
|
|
129
135
|
// Now assign temporary X3D.
|
|
130
136
|
window .X3D = X_ITE;
|
|
131
137
|
|
|
138
|
+
if (typeof globalModule === "object" && typeof globalModule .exports === "object")
|
|
139
|
+
globalModule .exports = X_ITE;
|
|
140
|
+
|
|
132
141
|
// IE fix.
|
|
133
142
|
document .createElement ("X3DCanvas");
|
|
134
143
|
|