x_ite 8.6.20 → 8.6.22
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/Makefile +1 -4
- package/build/bin/components.js +45 -0
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +25 -25
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +18 -18
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -27
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +24 -24
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +22 -22
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +18 -18
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +28 -28
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +14 -14
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +30 -30
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +746 -613
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +2 -2
- package/docs/_posts/dom-integration.md +14 -12
- package/docs/_posts/getting-started.md +13 -11
- package/docs/_posts/reference/ecmascript-object-and-function-definitions.md +1 -1
- package/docs/_posts/reference/scene-services.md +6 -3
- package/docs/_posts/report-a-bug.md +5 -3
- package/docs/_posts/setup-a-localhost-server.md +7 -7
- package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +1 -1
- package/docs/_tabs/playground.html +8 -12
- package/package.json +1 -1
- package/src/locale/de.po.js +9 -0
- package/src/locale/fr.po.js +31 -25
- package/src/tests.js +1 -0
- package/src/x_ite/Base/X3DBaseNode.js +2 -12
- package/src/x_ite/Base/X3DInfoArray.js +0 -2
- package/src/x_ite/Base/X3DObjectArrayField.js +0 -2
- package/src/x_ite/Base/X3DTypedArrayField.js +0 -2
- package/src/x_ite/Browser/Core/BrowserTimings.js +147 -67
- package/src/x_ite/Browser/Core/ContextMenu.js +2 -2
- package/src/x_ite/Browser/Core/X3DCoreContext.js +6 -2
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +7 -3
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +0 -10
- package/src/x_ite/Browser/X3DBrowserContext.js +0 -1
- package/src/x_ite/Components/Core/X3DNode.js +40 -9
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +5 -5
- package/src/x_ite/Configuration/ComponentInfo.js +2 -1
- package/src/x_ite/Configuration/ProfileInfo.js +1 -0
- package/src/x_ite/Configuration/UnitInfo.js +3 -5
- package/src/x_ite/Execution/BindableList.js +34 -27
- package/src/x_ite/Execution/BindableStack.js +15 -17
- package/src/x_ite/Execution/X3DExecutionContext.js +7 -17
- package/src/x_ite/Execution/X3DExportedNode.js +1 -3
- package/src/x_ite/Execution/X3DImportedNode.js +2 -6
- package/src/x_ite/Execution/X3DScene.js +30 -28
- package/src/x_ite/Fields/ArrayFields.js +4 -4
- package/src/x_ite/Fields/SFColor.js +0 -3
- package/src/x_ite/Fields/SFColorRGBA.js +0 -4
- package/src/x_ite/Fields/SFImage.js +0 -4
- package/src/x_ite/Fields/SFMatrix3.js +0 -1
- package/src/x_ite/Fields/SFMatrix4.js +0 -1
- package/src/x_ite/Fields/SFRotation.js +0 -4
- package/src/x_ite/Fields/SFString.js +7 -4
- package/src/x_ite/Fields/SFVec2.js +0 -2
- package/src/x_ite/Fields/SFVec3.js +0 -3
- package/src/x_ite/Fields/SFVec4.js +0 -4
- package/src/x_ite/InputOutput/Generator.js +86 -16
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +2 -8
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +2 -6
- package/src/x_ite/Routing/X3DRoute.js +1 -5
- package/src/x_ite/X3DCanvasElement.js +2 -0
- package/src/x_ite.css +5 -1
- package/src/x_ite.html +4 -36
- package/x_ite.min.html +4 -36
|
@@ -55,7 +55,6 @@ function BrowserTimings (executionContext)
|
|
|
55
55
|
|
|
56
56
|
this .localStorage = this .getBrowser () .getLocalStorage () .addNameSpace ("BrowserTimings.");
|
|
57
57
|
this .fps = new StopWatch ();
|
|
58
|
-
this .localeOptions = { minimumFractionDigits: 2, maximumFractionDigits: 2 };
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
@@ -81,17 +80,101 @@ BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototy
|
|
|
81
80
|
|
|
82
81
|
this .localStorage .addDefaultValues ({ type: "LESS" });
|
|
83
82
|
|
|
84
|
-
this .element = $("<div></div>")
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
this .
|
|
90
|
-
|
|
83
|
+
this .element = $("<div></div>")
|
|
84
|
+
.hide ()
|
|
85
|
+
.addClass ("x_ite-private-browser-timings")
|
|
86
|
+
.appendTo (this .getBrowser () .getSurface ());
|
|
87
|
+
|
|
88
|
+
this .table = $("<table></table>")
|
|
89
|
+
.appendTo (this .element);
|
|
90
|
+
|
|
91
|
+
this .header = $("<thead></thead>")
|
|
92
|
+
.append ($("<tr></tr>")
|
|
93
|
+
.append ($("<th colspan='2'></th>")
|
|
94
|
+
.text (_("Browser Timings"))))
|
|
95
|
+
.appendTo (this .table);
|
|
96
|
+
|
|
97
|
+
this .body = $("<tbody></tbody>")
|
|
98
|
+
.appendTo (this .table);
|
|
99
|
+
|
|
100
|
+
this .footer = $("<tfoot></tfoot>")
|
|
101
|
+
.append ($("<tr></tr>")
|
|
102
|
+
.append ($("<td colspan='2'></td>")))
|
|
103
|
+
.appendTo (this .table);
|
|
104
|
+
|
|
105
|
+
this .button = $("<button></button>")
|
|
106
|
+
.attr ("type", "button")
|
|
107
|
+
.appendTo (this .footer .find ("td"));
|
|
108
|
+
|
|
109
|
+
this .frameRate = $("<td></td>");
|
|
110
|
+
this .speed = $("<td></td>");
|
|
111
|
+
this .frameRate = $("<td></td>");
|
|
112
|
+
this .speed = $("<td></td>");
|
|
113
|
+
this .browserTime = $("<td></td>");
|
|
114
|
+
this .x3dTotal = $("<td></td>");
|
|
115
|
+
this .eventProcessing = $("<td></td>");
|
|
116
|
+
this .pointerTime = $("<td></td>");
|
|
117
|
+
this .cameraTime = $("<td></td>");
|
|
118
|
+
this .pickingTime = $("<td></td>");
|
|
119
|
+
this .collisionTime = $("<td></td>");
|
|
120
|
+
this .renderTime = $("<td></td>");
|
|
121
|
+
this .numShapes = $("<td></td>");
|
|
122
|
+
this .sensors = $("<td></td>");
|
|
123
|
+
|
|
124
|
+
this .body .append ($("<tr></tr>")
|
|
125
|
+
.append ($("<td></td>") .text (_("Frame rate") + ":"))
|
|
126
|
+
.append (this .frameRate));
|
|
127
|
+
|
|
128
|
+
this .body .append ($("<tr></tr>")
|
|
129
|
+
.append ($("<td></td>") .text (_("Speed") + ":"))
|
|
130
|
+
.append (this .speed)
|
|
131
|
+
.addClass ("x_ite-private-more"));
|
|
132
|
+
|
|
133
|
+
this .body .append ($("<tr></tr>")
|
|
134
|
+
.append ($("<td></td>") .text (_("Browser") + ":"))
|
|
135
|
+
.append (this .browserTime));
|
|
136
|
+
|
|
137
|
+
this .body .append ($("<tr></tr>")
|
|
138
|
+
.append ($("<td></td>") .text (_("X3D total") + ":"))
|
|
139
|
+
.append (this .x3dTotal));
|
|
140
|
+
|
|
141
|
+
this .body .append ($("<tr></tr>")
|
|
142
|
+
.append ($("<td></td>") .text (_("Event Processing") + ":"))
|
|
143
|
+
.append (this .eventProcessing));
|
|
144
|
+
|
|
145
|
+
this .body .append ($("<tr></tr>")
|
|
146
|
+
.append ($("<td></td>") .text (_("Pointer") + ":"))
|
|
147
|
+
.append (this .pointerTime));
|
|
148
|
+
|
|
149
|
+
this .body .append ($("<tr></tr>")
|
|
150
|
+
.append ($("<td></td>") .text (_("Camera") + ":"))
|
|
151
|
+
.append (this .cameraTime));
|
|
152
|
+
|
|
153
|
+
this .body .append ($("<tr></tr>")
|
|
154
|
+
.append ($("<td></td>") .text (_("Picking") + ":"))
|
|
155
|
+
.append (this .pickingTime));
|
|
156
|
+
|
|
157
|
+
this .body .append ($("<tr></tr>")
|
|
158
|
+
.append ($("<td></td>") .text (_("Collision Detection") + ":"))
|
|
159
|
+
.append (this .collisionTime));
|
|
160
|
+
|
|
161
|
+
this .body .append ($("<tr></tr>")
|
|
162
|
+
.append ($("<td></td>") .text (_("Rendering") + ":"))
|
|
163
|
+
.append (this .renderTime));
|
|
164
|
+
|
|
165
|
+
this .body .append ($("<tr></tr>")
|
|
166
|
+
.append ($("<td></td>") .text (_("Number of Shapes") + ":"))
|
|
167
|
+
.append (this .numShapes));
|
|
168
|
+
|
|
169
|
+
this .body .append ($("<tr></tr>")
|
|
170
|
+
.append ($("<td></td>") .text (_("Number of Sensors") + ":"))
|
|
171
|
+
.append (this .sensors));
|
|
91
172
|
|
|
92
173
|
this .button .on ("click touchend", this .set_type__ .bind (this));
|
|
93
174
|
|
|
94
|
-
this .
|
|
175
|
+
this .localStorage .type = this .localStorage .type === "MORE" ? "LESS" : "MORE";
|
|
176
|
+
|
|
177
|
+
this .set_type__ ();
|
|
95
178
|
},
|
|
96
179
|
set_enabled__: function ()
|
|
97
180
|
{
|
|
@@ -112,9 +195,17 @@ BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototy
|
|
|
112
195
|
set_type__: function ()
|
|
113
196
|
{
|
|
114
197
|
if (this .localStorage .type === "MORE")
|
|
198
|
+
{
|
|
115
199
|
this .localStorage .type = "LESS";
|
|
200
|
+
this .table .addClass ("less");
|
|
201
|
+
this .table .removeClass ("more");
|
|
202
|
+
}
|
|
116
203
|
else
|
|
204
|
+
{
|
|
117
205
|
this .localStorage .type = "MORE";
|
|
206
|
+
this .table .addClass ("more");
|
|
207
|
+
this .table .removeClass ("less");
|
|
208
|
+
}
|
|
118
209
|
|
|
119
210
|
this .set_button__ ();
|
|
120
211
|
this .build ();
|
|
@@ -140,68 +231,45 @@ BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototy
|
|
|
140
231
|
},
|
|
141
232
|
build: function ()
|
|
142
233
|
{
|
|
143
|
-
const
|
|
144
|
-
browser = this .getBrowser (),
|
|
145
|
-
language = navigator .language || navigator .userLanguage,
|
|
146
|
-
fixed = this .localeOptions,
|
|
147
|
-
rows = this .rows;
|
|
234
|
+
const browser = this .getBrowser ();
|
|
148
235
|
|
|
149
|
-
|
|
236
|
+
this .frameRate .text (f2(1000 / this .fps .averageTime) + " " + _("fps"));
|
|
237
|
+
this .speed .text (f2(this .getSpeed (browser .currentSpeed)) + " " + this .getSpeedUnit (browser .currentSpeed));
|
|
150
238
|
|
|
151
|
-
|
|
152
|
-
|
|
239
|
+
if (this .localStorage .type !== "MORE" || !browser .getWorld ())
|
|
240
|
+
return;
|
|
153
241
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
let
|
|
166
|
-
opaqueShapes = 0,
|
|
167
|
-
transparentShapes = 0;
|
|
168
|
-
|
|
169
|
-
for (const layer of layers)
|
|
170
|
-
{
|
|
171
|
-
opaqueShapes += layer .numOpaqueShapes;
|
|
172
|
-
transparentShapes += layer .numTransparentShapes;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
rows [1] .addClass ("x_ite-private-more");
|
|
176
|
-
|
|
177
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Browser") + ":")) .append ($("<td></td>") .text (f2(browser .getSystemTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
|
|
178
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("X3D total") + ":")) .append ($("<td></td>") .text (f2(browser .getBrowserTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
|
|
179
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Event Processing") + ":")) .append ($("<td></td>") .text (f2(routingTime) .toLocaleString (language, fixed) + " " + _("ms")));
|
|
180
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Pointer") + ":")) .append ($("<td></td>") .text (f2(browser .getPointingTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
|
|
181
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Camera") + ":")) .append ($("<td></td>") .text (f2(browser .getCameraTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
|
|
182
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Picking") + ":")) .append ($("<td></td>") .text (f2(browser .getPickingTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
|
|
183
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Collision Detection") + ":")) .append ($("<td></td>") .text (f2(collisionTime) .toLocaleString (language, fixed) + " " + _("ms")));
|
|
184
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Rendering") + ":")) .append ($("<td></td>") .text (f2(browser .getDisplayTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
|
|
185
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Number of Shapes") + ":")) .append ($("<td></td>") .text (opaqueShapes + " + " + transparentShapes));
|
|
186
|
-
rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Number of Sensors") + ":")) .append ($("<td></td>") .text (prepareEvents + sensors));
|
|
187
|
-
|
|
188
|
-
browser .getSystemTime () .reset ();
|
|
189
|
-
browser .getBrowserTime () .reset ();
|
|
190
|
-
browser .getPointingTime () .reset ();
|
|
191
|
-
browser .getCameraTime () .reset ();
|
|
192
|
-
browser .getPickingTime () .reset ();
|
|
193
|
-
browser .getCollisionTime () .reset ();
|
|
194
|
-
browser .getDisplayTime () .reset ();
|
|
195
|
-
|
|
196
|
-
if (activeLayer)
|
|
197
|
-
activeLayer .getCollisionTime () .reset ();
|
|
198
|
-
}
|
|
242
|
+
const
|
|
243
|
+
layers = browser .getWorld () .getLayerSet () .getLayers (),
|
|
244
|
+
activeLayer = browser .getActiveLayer (),
|
|
245
|
+
navigationTime = activeLayer && browser .getCollisionCount () ? activeLayer .getCollisionTime () .averageTime : 0,
|
|
246
|
+
collisionTime = browser .getCollisionTime () .averageTime + navigationTime,
|
|
247
|
+
routingTime = Math .max (0, browser .getBrowserTime () .averageTime - (browser .getCameraTime () .averageTime + browser .getCollisionTime () .averageTime + browser .getDisplayTime () .averageTime)),
|
|
248
|
+
prepareEvents = browser .prepareEvents () .getInterests () .size - 1,
|
|
249
|
+
sensors = browser .sensorEvents () .getInterests () .size,
|
|
250
|
+
opaqueShapes = layers .reduce ((n, layer) => n + layer .getNumOpaqueShapes (), 0),
|
|
251
|
+
transparentShapes = layers .reduce ((n, layer) => n + layer .getNumTransparentShapes (), 0);
|
|
199
252
|
|
|
200
|
-
|
|
253
|
+
this .browserTime .text (f2(browser .getSystemTime () .averageTime) + " " + _("ms"));
|
|
254
|
+
this .x3dTotal .text (f2(browser .getBrowserTime () .averageTime) + " " + _("ms"));
|
|
255
|
+
this .eventProcessing .text (f2(routingTime) + " " + _("ms"));
|
|
256
|
+
this .pointerTime .text (f2(browser .getPointingTime () .averageTime) + " " + _("ms"));
|
|
257
|
+
this .cameraTime .text (f2(browser .getCameraTime () .averageTime) + " " + _("ms"));
|
|
258
|
+
this .pickingTime .text (f2(browser .getPickingTime () .averageTime) + " " + _("ms"));
|
|
259
|
+
this .collisionTime .text (f2(collisionTime) + " " + _("ms"));
|
|
260
|
+
this .renderTime .text (f2(browser .getDisplayTime () .averageTime) + " " + _("ms"));
|
|
261
|
+
this .numShapes .text (opaqueShapes + " + " + transparentShapes);
|
|
262
|
+
this .sensors .text (prepareEvents + sensors);
|
|
201
263
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
264
|
+
browser .getSystemTime () .reset ();
|
|
265
|
+
browser .getBrowserTime () .reset ();
|
|
266
|
+
browser .getPointingTime () .reset ();
|
|
267
|
+
browser .getCameraTime () .reset ();
|
|
268
|
+
browser .getPickingTime () .reset ();
|
|
269
|
+
browser .getCollisionTime () .reset ();
|
|
270
|
+
browser .getDisplayTime () .reset ();
|
|
271
|
+
|
|
272
|
+
activeLayer ?.getCollisionTime () .reset ();
|
|
205
273
|
},
|
|
206
274
|
getSpeed: function (speed)
|
|
207
275
|
{
|
|
@@ -219,6 +287,18 @@ BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototy
|
|
|
219
287
|
},
|
|
220
288
|
});
|
|
221
289
|
|
|
222
|
-
|
|
290
|
+
const f2 = (function ()
|
|
291
|
+
{
|
|
292
|
+
const format = new Intl .NumberFormat (navigator .language || navigator .userLanguage, {
|
|
293
|
+
notation: "standard",
|
|
294
|
+
minimumFractionDigits: 2,
|
|
295
|
+
maximumFractionDigits: 2,
|
|
296
|
+
}) .format;
|
|
297
|
+
|
|
298
|
+
return function (value)
|
|
299
|
+
{
|
|
300
|
+
return format (Number .isFinite (value) ? value : 0);
|
|
301
|
+
};
|
|
302
|
+
})();
|
|
223
303
|
|
|
224
304
|
export default BrowserTimings;
|
|
@@ -278,7 +278,7 @@ ContextMenu .prototype = Object .assign (Object .create (X3DBaseNode .prototype)
|
|
|
278
278
|
className: "context-menu-icon x_ite-private-icon-shading",
|
|
279
279
|
items: {
|
|
280
280
|
"point": {
|
|
281
|
-
name: _("
|
|
281
|
+
name: _("Points"),
|
|
282
282
|
type: "radio",
|
|
283
283
|
radio: "shading",
|
|
284
284
|
selected: browser .getBrowserOption ("Shading") === "POINT",
|
|
@@ -286,7 +286,7 @@ ContextMenu .prototype = Object .assign (Object .create (X3DBaseNode .prototype)
|
|
|
286
286
|
click: function ()
|
|
287
287
|
{
|
|
288
288
|
browser .setBrowserOption ("Shading", "POINT");
|
|
289
|
-
browser .getNotification () ._string = _("Shading") + ": " + _("
|
|
289
|
+
browser .getNotification () ._string = _("Shading") + ": " + _("Points");
|
|
290
290
|
}
|
|
291
291
|
.bind (this),
|
|
292
292
|
},
|
|
@@ -156,7 +156,6 @@ X3DCoreContext .prototype =
|
|
|
156
156
|
this .loadURL (new Fields .MFString (value), new Fields .MFString ());
|
|
157
157
|
},
|
|
158
158
|
enumerable: true,
|
|
159
|
-
configurable: false,
|
|
160
159
|
});
|
|
161
160
|
|
|
162
161
|
Object .defineProperty (this .getElement () .get (0), "url",
|
|
@@ -170,7 +169,6 @@ X3DCoreContext .prototype =
|
|
|
170
169
|
this .loadURL (value, new Fields .MFString ());
|
|
171
170
|
},
|
|
172
171
|
enumerable: true,
|
|
173
|
-
configurable: false,
|
|
174
172
|
});
|
|
175
173
|
|
|
176
174
|
// Configure browser event handlers.
|
|
@@ -272,6 +270,12 @@ X3DCoreContext .prototype =
|
|
|
272
270
|
this .setBrowserOption ("Antialiased", this .parseBooleanAttribute (newValue, true));
|
|
273
271
|
break;
|
|
274
272
|
}
|
|
273
|
+
case "baseURL":
|
|
274
|
+
case "baseurl":
|
|
275
|
+
{
|
|
276
|
+
this .setBaseURL (newValue);
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
275
279
|
case "cache":
|
|
276
280
|
{
|
|
277
281
|
this .setBrowserOption ("Cache", this .parseBooleanAttribute (newValue, true));
|
|
@@ -60,7 +60,7 @@ const
|
|
|
60
60
|
|
|
61
61
|
function getBaseURI (element)
|
|
62
62
|
{
|
|
63
|
-
let baseURI = element .baseURI;
|
|
63
|
+
let baseURI = element .prop ("baseURI");
|
|
64
64
|
|
|
65
65
|
// Fix for Edge.
|
|
66
66
|
if (baseURI .startsWith ("about:"))
|
|
@@ -77,7 +77,7 @@ function X3DNetworkingContext ()
|
|
|
77
77
|
this [_loadingTotal] = 0;
|
|
78
78
|
this [_loadingObjects] = new Set ();
|
|
79
79
|
this [_loading] = false;
|
|
80
|
-
this [_baseURL] = getBaseURI (this .getElement ()
|
|
80
|
+
this [_baseURL] = getBaseURI (this .getElement ());
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
X3DNetworkingContext .prototype =
|
|
@@ -96,7 +96,11 @@ X3DNetworkingContext .prototype =
|
|
|
96
96
|
},
|
|
97
97
|
setBaseURL: function (value)
|
|
98
98
|
{
|
|
99
|
-
|
|
99
|
+
const
|
|
100
|
+
base = getBaseURI (this .getElement ()),
|
|
101
|
+
url = new URL (value, base);
|
|
102
|
+
|
|
103
|
+
this [_baseURL] = url .protocol === "data:" ? base : url .href;
|
|
100
104
|
},
|
|
101
105
|
getDefaultScene: function ()
|
|
102
106
|
{
|
|
@@ -828,35 +828,30 @@ Object .defineProperty (X3DBrowser .prototype, "name",
|
|
|
828
828
|
{
|
|
829
829
|
get: X3DBrowser .prototype .getName,
|
|
830
830
|
enumerable: true,
|
|
831
|
-
configurable: false
|
|
832
831
|
});
|
|
833
832
|
|
|
834
833
|
Object .defineProperty (X3DBrowser .prototype, "version",
|
|
835
834
|
{
|
|
836
835
|
get: X3DBrowser .prototype .getVersion,
|
|
837
836
|
enumerable: true,
|
|
838
|
-
configurable: false
|
|
839
837
|
});
|
|
840
838
|
|
|
841
839
|
Object .defineProperty (X3DBrowser .prototype, "providerUrl",
|
|
842
840
|
{
|
|
843
841
|
get: X3DBrowser .prototype .getProviderUrl,
|
|
844
842
|
enumerable: true,
|
|
845
|
-
configurable: false
|
|
846
843
|
});
|
|
847
844
|
|
|
848
845
|
Object .defineProperty (X3DBrowser .prototype, "currentFrameRate",
|
|
849
846
|
{
|
|
850
847
|
get: X3DBrowser .prototype .getCurrentFrameRate,
|
|
851
848
|
enumerable: true,
|
|
852
|
-
configurable: false
|
|
853
849
|
});
|
|
854
850
|
|
|
855
851
|
Object .defineProperty (X3DBrowser .prototype, "currentSpeed",
|
|
856
852
|
{
|
|
857
853
|
get: X3DBrowser .prototype .getCurrentSpeed,
|
|
858
854
|
enumerable: true,
|
|
859
|
-
configurable: false
|
|
860
855
|
});
|
|
861
856
|
|
|
862
857
|
Object .defineProperty (X3DBrowser .prototype, "description",
|
|
@@ -864,7 +859,6 @@ Object .defineProperty (X3DBrowser .prototype, "description",
|
|
|
864
859
|
get: X3DBrowser .prototype .getDescription,
|
|
865
860
|
set: X3DBrowser .prototype .setDescription,
|
|
866
861
|
enumerable: true,
|
|
867
|
-
configurable: false
|
|
868
862
|
});
|
|
869
863
|
|
|
870
864
|
Object .defineProperty (X3DBrowser .prototype, "baseURL",
|
|
@@ -872,7 +866,6 @@ Object .defineProperty (X3DBrowser .prototype, "baseURL",
|
|
|
872
866
|
get: X3DBrowser .prototype .getBaseURL,
|
|
873
867
|
set: X3DBrowser .prototype .setBaseURL,
|
|
874
868
|
enumerable: true,
|
|
875
|
-
configurable: false
|
|
876
869
|
});
|
|
877
870
|
|
|
878
871
|
Object .defineProperty (X3DBrowser .prototype, "currentScene",
|
|
@@ -882,7 +875,6 @@ Object .defineProperty (X3DBrowser .prototype, "currentScene",
|
|
|
882
875
|
return this .getScriptStack () .at (-1) .getExecutionContext ();
|
|
883
876
|
},
|
|
884
877
|
enumerable: true,
|
|
885
|
-
configurable: false
|
|
886
878
|
});
|
|
887
879
|
|
|
888
880
|
Object .defineProperty (X3DBrowser .prototype, "supportedProfiles",
|
|
@@ -892,7 +884,6 @@ Object .defineProperty (X3DBrowser .prototype, "supportedProfiles",
|
|
|
892
884
|
return SupportedProfiles;
|
|
893
885
|
},
|
|
894
886
|
enumerable: true,
|
|
895
|
-
configurable: false
|
|
896
887
|
});
|
|
897
888
|
|
|
898
889
|
Object .defineProperty (X3DBrowser .prototype, "supportedComponents",
|
|
@@ -902,7 +893,6 @@ Object .defineProperty (X3DBrowser .prototype, "supportedComponents",
|
|
|
902
893
|
return SupportedComponents;
|
|
903
894
|
},
|
|
904
895
|
enumerable: true,
|
|
905
|
-
configurable: false
|
|
906
896
|
});
|
|
907
897
|
|
|
908
898
|
export default X3DBrowser;
|
|
@@ -460,6 +460,13 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
460
460
|
generator .string += generator .Indent ();
|
|
461
461
|
generator .string += "<";
|
|
462
462
|
generator .string += this .getTypeName ();
|
|
463
|
+
|
|
464
|
+
if (generator .html && this .getTypeName () === "Script")
|
|
465
|
+
{
|
|
466
|
+
generator .string += generator .Space ();
|
|
467
|
+
generator .string += "type='model/x3d+xml'";
|
|
468
|
+
}
|
|
469
|
+
|
|
463
470
|
generator .string += generator .Space ();
|
|
464
471
|
generator .string += "USE='";
|
|
465
472
|
generator .string += generator .XMLEncode (name);
|
|
@@ -478,7 +485,16 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
478
485
|
}
|
|
479
486
|
}
|
|
480
487
|
|
|
481
|
-
generator .
|
|
488
|
+
if (generator .closingTags)
|
|
489
|
+
{
|
|
490
|
+
generator .string += "></";
|
|
491
|
+
generator .string += this .getTypeName ();
|
|
492
|
+
generator .string += ">";
|
|
493
|
+
}
|
|
494
|
+
else
|
|
495
|
+
{
|
|
496
|
+
generator .string += "/>";
|
|
497
|
+
}
|
|
482
498
|
|
|
483
499
|
generator .LeaveScope ();
|
|
484
500
|
return;
|
|
@@ -489,6 +505,12 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
489
505
|
generator .string += "<";
|
|
490
506
|
generator .string += this .getTypeName ();
|
|
491
507
|
|
|
508
|
+
if (generator .html && this .getTypeName () === "Script")
|
|
509
|
+
{
|
|
510
|
+
generator .string += generator .Space ();
|
|
511
|
+
generator .string += "type='model/x3d+xml'";
|
|
512
|
+
}
|
|
513
|
+
|
|
492
514
|
if (name .length)
|
|
493
515
|
{
|
|
494
516
|
generator .AddNode (this);
|
|
@@ -522,7 +544,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
522
544
|
|
|
523
545
|
let cdata = this .getSourceText ();
|
|
524
546
|
|
|
525
|
-
if (cdata &&
|
|
547
|
+
if (cdata ?.length === 0 || (generator .html && this .getTypeName () !== "Script"))
|
|
526
548
|
cdata = null;
|
|
527
549
|
|
|
528
550
|
generator .IncIndent ();
|
|
@@ -572,7 +594,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
572
594
|
generator .string += field .getName ();
|
|
573
595
|
generator .string += "='";
|
|
574
596
|
|
|
575
|
-
field .toXMLStream (generator);
|
|
597
|
+
field .toXMLStream (generator, field === this .getSourceText ());
|
|
576
598
|
|
|
577
599
|
generator .string += "'";
|
|
578
600
|
break;
|
|
@@ -591,7 +613,16 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
591
613
|
|
|
592
614
|
if ((!this .canUserDefinedFields () || !userDefinedFields .length) && (!references .length || sharedNode) && !childNodes .length && !cdata)
|
|
593
615
|
{
|
|
594
|
-
generator .
|
|
616
|
+
if (generator .closingTags)
|
|
617
|
+
{
|
|
618
|
+
generator .string += "></";
|
|
619
|
+
generator .string += this .getTypeName ();
|
|
620
|
+
generator .string += ">";
|
|
621
|
+
}
|
|
622
|
+
else
|
|
623
|
+
{
|
|
624
|
+
generator .string += "/>";
|
|
625
|
+
}
|
|
595
626
|
}
|
|
596
627
|
else
|
|
597
628
|
{
|
|
@@ -640,7 +671,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
640
671
|
|
|
641
672
|
if (!field .isInitializable () || field .isDefaultValue ())
|
|
642
673
|
{
|
|
643
|
-
generator .string += "/>";
|
|
674
|
+
generator .string += generator .closingTags ? "></field>" : "/>";
|
|
644
675
|
generator .string += generator .TidyBreak ();
|
|
645
676
|
}
|
|
646
677
|
else
|
|
@@ -680,7 +711,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
680
711
|
field .toXMLStream (generator);
|
|
681
712
|
|
|
682
713
|
generator .string += "'";
|
|
683
|
-
generator .string += "/>";
|
|
714
|
+
generator .string += generator .closingTags ? "></field>" : "/>";
|
|
684
715
|
generator .string += generator .TidyBreak ();
|
|
685
716
|
break;
|
|
686
717
|
}
|
|
@@ -692,7 +723,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
692
723
|
if (generator .ExecutionContext ())
|
|
693
724
|
references .push (field);
|
|
694
725
|
|
|
695
|
-
generator .string += "/>";
|
|
726
|
+
generator .string += generator .closingTags ? "></field>" : "/>";
|
|
696
727
|
generator .string += generator .TidyBreak ();
|
|
697
728
|
}
|
|
698
729
|
}
|
|
@@ -722,7 +753,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
722
753
|
generator .string += "protoField='";
|
|
723
754
|
generator .string += generator .XMLEncode (protoField .getName ());
|
|
724
755
|
generator .string += "'";
|
|
725
|
-
generator .string += "/>";
|
|
756
|
+
generator .string += generator .closingTags ? "></connect>" : "/>";
|
|
726
757
|
generator .string += generator .TidyBreak ();
|
|
727
758
|
}
|
|
728
759
|
}
|
|
@@ -750,7 +781,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
750
781
|
for (const value of cdata)
|
|
751
782
|
{
|
|
752
783
|
generator .string += "<![CDATA[";
|
|
753
|
-
generator .string +=
|
|
784
|
+
generator .string += value;
|
|
754
785
|
generator .string += "]]>";
|
|
755
786
|
generator .string += generator .TidyBreak ();
|
|
756
787
|
}
|
|
@@ -405,7 +405,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
generator .string += "/>";
|
|
408
|
+
generator .string += generator .closingTags ? "></ProtoInstance>" : "/>";
|
|
409
409
|
|
|
410
410
|
generator .LeaveScope ();
|
|
411
411
|
return;
|
|
@@ -446,7 +446,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
446
446
|
|
|
447
447
|
if (fields .length === 0)
|
|
448
448
|
{
|
|
449
|
-
generator .string += "/>";
|
|
449
|
+
generator .string += generator .closingTags ? "></ProtoInstance>" : "/>";
|
|
450
450
|
}
|
|
451
451
|
else
|
|
452
452
|
{
|
|
@@ -494,7 +494,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
494
494
|
|
|
495
495
|
if (field .length === 0)
|
|
496
496
|
{
|
|
497
|
-
generator .string += "/>";
|
|
497
|
+
generator .string += generator .closingTags ? "></fieldValue>" : "/>";
|
|
498
498
|
generator .string += generator .TidyBreak ();
|
|
499
499
|
}
|
|
500
500
|
else
|
|
@@ -568,7 +568,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
568
568
|
field .toXMLStream (generator);
|
|
569
569
|
|
|
570
570
|
generator .string += "'";
|
|
571
|
-
generator .string += "/>";
|
|
571
|
+
generator .string += generator .closingTags ? "></fieldValue>" : "/>";
|
|
572
572
|
generator .string += generator .TidyBreak ();
|
|
573
573
|
break;
|
|
574
574
|
}
|
|
@@ -604,7 +604,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
604
604
|
generator .string += "protoField='";
|
|
605
605
|
generator .string += generator .XMLEncode (protoField .getName ());
|
|
606
606
|
generator .string += "'";
|
|
607
|
-
generator .string += "/>";
|
|
607
|
+
generator .string += generator .closingTags ? "></connect>" : "/>";
|
|
608
608
|
generator .string += generator .TidyBreak ();
|
|
609
609
|
}
|
|
610
610
|
}
|
|
@@ -68,6 +68,7 @@ ComponentInfo .prototype = Object .assign (Object .create (X3DObject .prototype)
|
|
|
68
68
|
},
|
|
69
69
|
toVRMLStream: function (generator)
|
|
70
70
|
{
|
|
71
|
+
generator .string += generator .Indent ();
|
|
71
72
|
generator .string += "COMPONENT";
|
|
72
73
|
generator .string += generator .Space ();
|
|
73
74
|
generator .string += this .name;
|
|
@@ -88,7 +89,7 @@ ComponentInfo .prototype = Object .assign (Object .create (X3DObject .prototype)
|
|
|
88
89
|
generator .string += "level='";
|
|
89
90
|
generator .string += this .level;
|
|
90
91
|
generator .string += "'";
|
|
91
|
-
generator .string += "/>";
|
|
92
|
+
generator .string += generator .closingTags ? "></component>" : "/>";
|
|
92
93
|
},
|
|
93
94
|
toJSONStream: function (generator)
|
|
94
95
|
{
|
|
@@ -64,6 +64,7 @@ ProfileInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
64
64
|
},
|
|
65
65
|
toVRMLStream: function (generator)
|
|
66
66
|
{
|
|
67
|
+
generator .string += generator .Indent ();
|
|
67
68
|
generator .string += "PROFILE";
|
|
68
69
|
generator .string += generator .Space ();
|
|
69
70
|
generator .string += this .name;
|