x_ite 4.7.8 → 4.7.12

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 (84) hide show
  1. package/build/parts/default.end.frag.js +1 -2
  2. package/build/parts/default.start.frag.js +1 -8
  3. package/build/parts/x_ite.end.frag.js +1 -11
  4. package/build/parts/x_ite.start.frag.js +1 -7
  5. package/dist/assets/components/annotation.js +2 -10
  6. package/dist/assets/components/annotation.min.js +1 -1
  7. package/dist/assets/components/cad-geometry.js +2 -10
  8. package/dist/assets/components/cad-geometry.min.js +1 -1
  9. package/dist/assets/components/cube-map-texturing.js +2 -10
  10. package/dist/assets/components/cube-map-texturing.min.js +1 -1
  11. package/dist/assets/components/dis.js +2 -10
  12. package/dist/assets/components/dis.min.js +1 -1
  13. package/dist/assets/components/event-utilities.js +2 -10
  14. package/dist/assets/components/event-utilities.min.js +1 -1
  15. package/dist/assets/components/geometry2d.js +2 -10
  16. package/dist/assets/components/geometry2d.min.js +1 -1
  17. package/dist/assets/components/geospatial.js +2 -10
  18. package/dist/assets/components/geospatial.min.js +2 -2
  19. package/dist/assets/components/h-anim.js +2 -10
  20. package/dist/assets/components/h-anim.min.js +1 -1
  21. package/dist/assets/components/key-device-sensor.js +2 -10
  22. package/dist/assets/components/key-device-sensor.min.js +1 -1
  23. package/dist/assets/components/layout.js +2 -10
  24. package/dist/assets/components/layout.min.js +1 -1
  25. package/dist/assets/components/nurbs.js +2 -10
  26. package/dist/assets/components/nurbs.min.js +2 -2
  27. package/dist/assets/components/particle-systems.js +2 -10
  28. package/dist/assets/components/particle-systems.min.js +2 -2
  29. package/dist/assets/components/picking.js +2 -10
  30. package/dist/assets/components/picking.min.js +1 -1
  31. package/dist/assets/components/projective-texture-mapping.js +2 -10
  32. package/dist/assets/components/projective-texture-mapping.min.js +1 -1
  33. package/dist/assets/components/rigid-body-physics.js +2 -10
  34. package/dist/assets/components/rigid-body-physics.min.js +17 -17
  35. package/dist/assets/components/scripting.js +2 -10
  36. package/dist/assets/components/scripting.min.js +1 -1
  37. package/dist/assets/components/texturing-3d.js +2 -10
  38. package/dist/assets/components/texturing-3d.min.js +41 -41
  39. package/dist/assets/components/volume-rendering.js +2 -10
  40. package/dist/assets/components/volume-rendering.min.js +3 -3
  41. package/dist/assets/components/x_ite.js +2 -10
  42. package/dist/assets/components/x_ite.min.js +1 -1
  43. package/dist/example.html +2 -2
  44. package/dist/x_ite.css +14 -9
  45. package/dist/x_ite.js +194 -127
  46. package/dist/x_ite.min.js +41 -41
  47. package/dist/x_ite.zip +0 -0
  48. package/docs/Accessing-the-External-Browser.md +1 -15
  49. package/docs/_config.yml +1 -1
  50. package/docs/index.md +24 -3
  51. package/docs/reference/Browser-Services.md +2 -2
  52. package/package.json +5 -4
  53. package/src/locale/de.po +4 -4
  54. package/src/locale/fr.po +4 -4
  55. package/src/standard/Utility/DataStorage.js +16 -2
  56. package/src/x_ite/Basic/X3DBaseNode.js +1 -1
  57. package/src/x_ite/Basic/X3DField.js +12 -7
  58. package/src/x_ite/Browser/Core/BrowserTimings.js +1 -3
  59. package/src/x_ite/Browser/Core/ContextMenu.js +69 -5
  60. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +1 -3
  61. package/src/x_ite/Browser/Networking/urls.js +0 -7
  62. package/src/x_ite/Browser/VERSION.js +1 -1
  63. package/src/x_ite/Fields/SFColor.js +15 -2
  64. package/src/x_ite/Fields/SFDouble.js +1 -1
  65. package/src/x_ite/Fields/SFFloat.js +1 -1
  66. package/src/x_ite/Fields/SFMatrix3.js +4 -4
  67. package/src/x_ite/Fields/SFMatrix4.js +5 -5
  68. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +14 -3
  69. package/src/x_ite/Fields/SFRotation.js +4 -4
  70. package/src/x_ite/Fields/SFTime.js +1 -1
  71. package/src/x_ite/Fields/SFVec2.js +4 -4
  72. package/src/x_ite/Fields/SFVec3.js +4 -4
  73. package/src/x_ite/Fields/SFVec4.js +4 -4
  74. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +6 -5
  75. package/src/x_ite/InputOutput/Generator.js +14 -3
  76. package/src/x_ite/Parser/X3DParser.js +5 -12
  77. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +1 -1
  78. package/src/x_ite/Prototype/X3DProtoDeclaration.js +1 -1
  79. package/src/x_ite/X3D.js +2 -7
  80. package/src/x_ite.config.js +0 -5
  81. package/src/x_ite.css +14 -8
  82. package/src/x_ite.html +3 -3
  83. package/src/x_ite.js +2 -9
  84. package/x_ite.min.html +3 -3
@@ -60,7 +60,7 @@ function (X3DField,
60
60
  {
61
61
  "use strict";
62
62
 
63
- function SFVec4Template (TypeName, Type)
63
+ function SFVec4Template (TypeName, Type, double)
64
64
  {
65
65
  function SFVec4 (x, y, z, w)
66
66
  {
@@ -80,7 +80,7 @@ function (X3DField,
80
80
  }
81
81
 
82
82
  SFVec4 .prototype = Object .assign (Object .create (X3DField .prototype),
83
- SFVecPrototypeTemplate (Vector4),
83
+ SFVecPrototypeTemplate (Vector4, double),
84
84
  {
85
85
  constructor: SFVec4,
86
86
  getTypeName: function ()
@@ -168,7 +168,7 @@ function (X3DField,
168
168
  }
169
169
 
170
170
  return {
171
- SFVec4d: SFVec4Template ("SFVec4d", X3DConstants .SFVec4d),
172
- SFVec4f: SFVec4Template ("SFVec4f", X3DConstants .SFVec4f),
171
+ SFVec4d: SFVec4Template ("SFVec4d", X3DConstants .SFVec4d, true),
172
+ SFVec4f: SFVec4Template ("SFVec4f", X3DConstants .SFVec4f, false),
173
173
  };
174
174
  });
@@ -56,7 +56,7 @@ function (X3DField,
56
56
  {
57
57
  "use strict";
58
58
 
59
- return function (Type)
59
+ return function (Type, double)
60
60
  {
61
61
  return Object .assign (Object .create (X3DField .prototype),
62
62
  {
@@ -129,15 +129,16 @@ function (X3DField,
129
129
  const
130
130
  generator = Generator .Get (stream),
131
131
  value = this .getValue (),
132
- category = generator .Unit (this .getUnit ());
132
+ category = generator .Unit (this .getUnit ()),
133
+ last = value .length - 1;
133
134
 
134
- for (let i = 0, l = value .length - 1; i < l; ++ i)
135
+ for (let i = 0; i < last; ++ i)
135
136
  {
136
- stream .string += String (generator .ToUnit (category, value [i]));
137
+ stream .string += double ? generator .DoublePrecision (generator .ToUnit (category, value [i])) : generator .Precision (generator .ToUnit (category, value [i]));
137
138
  stream .string += " ";
138
139
  }
139
140
 
140
- stream .string += String (generator .ToUnit (category, value [value .length - 1]));
141
+ stream .string += double ? generator .DoublePrecision (generator .ToUnit (category, value [last])) : generator .Precision (generator .ToUnit (category, value [last]));
141
142
  },
142
143
  toVRMLStream: function (stream)
143
144
  {
@@ -47,7 +47,6 @@
47
47
  ******************************************************************************/
48
48
 
49
49
 
50
-
51
50
  define ([
52
51
  "x_ite/Bits/X3DConstants",
53
52
  ],
@@ -57,8 +56,12 @@ function (X3DConstants)
57
56
 
58
57
  function Generator ()
59
58
  {
60
- this .indent = "";
61
- this .indentChar = " ";
59
+ this .indent = "";
60
+ this .indentChar = " ";
61
+ this .precision = 6;
62
+ this .doublePrecision = 14;
63
+ this .removeTrailingZeros = /\.?0*(?=$|[eE])/;
64
+
62
65
  this .executionContextStack = [ null ];
63
66
  this .importedNodesIndex = new Map ();
64
67
  this .exportedNodesIndex = new Map ();
@@ -98,6 +101,14 @@ function (X3DConstants)
98
101
 
99
102
  return string;
100
103
  },
104
+ Precision: function (value)
105
+ {
106
+ return Math .fround (value) .toPrecision (this .precision) .replace (this .removeTrailingZeros, "");
107
+ },
108
+ DoublePrecision: function (value)
109
+ {
110
+ return value .toPrecision (this .doublePrecision) .replace (this .removeTrailingZeros, "");
111
+ },
101
112
  PushExecutionContext: function (executionContext)
102
113
  {
103
114
  this .executionContextStack .push (executionContext);
@@ -125,22 +125,15 @@ define (function ()
125
125
  for (const component of components)
126
126
  {
127
127
  const providerUrl = component .providerUrl;
128
- if (providerUrl .match (componentsUrl))
128
+
129
+ if (providerUrl .match (componentsUrl))
129
130
  providerUrls .add (providerUrl);
130
131
  }
131
132
 
132
- if (typeof globalRequire === "function")
133
+ if (typeof globalRequire === "function" && typeof __filename === "string")
133
134
  {
134
- if (typeof globalProcess === "object" && globalProcess .platform === "win32")
135
- {
136
- for (const url of providerUrls)
137
- globalRequire (url);
138
- }
139
- else
140
- {
141
- for (const url of providerUrls)
142
- globalRequire (new URL (url) .pathname);
143
- }
135
+ for (const url of providerUrls)
136
+ globalRequire (globalRequire ("url") .fileURLToPath (url));
144
137
  }
145
138
 
146
139
  return Array .from (providerUrls);
@@ -164,7 +164,7 @@ function ($,
164
164
  this .setInternalScene (value);
165
165
 
166
166
  else
167
- this .setError ();
167
+ this .setError (new Error ("File could not be loaded."));
168
168
 
169
169
  this .getScene () .removeInitLoadCount (this);
170
170
  },
@@ -315,7 +315,7 @@ function (Fields,
315
315
 
316
316
  generator .IncIndent ();
317
317
 
318
- this .body .toXMLStream .call (stream);
318
+ this .body .toXMLStream (stream);
319
319
 
320
320
  generator .DecIndent ();
321
321
 
package/src/x_ite/X3D.js CHANGED
@@ -108,13 +108,8 @@ function ($,
108
108
  {
109
109
  const url = urls .getProviderUrl (name);
110
110
 
111
- if (typeof globalRequire === "function")
112
- {
113
- if (typeof globalProcess === "object" && globalProcess .platform === "win32")
114
- globalRequire (url);
115
- else
116
- globalRequire (new URL (url) .pathname);
117
- }
111
+ if (typeof globalRequire === "function" && typeof __filename === "string")
112
+ globalRequire (globalRequire ("url") .fileURLToPath (url));
118
113
 
119
114
  return url;
120
115
  }
@@ -36,11 +36,6 @@ require .config ({
36
36
  "location": "../node_modules/opentype.js",
37
37
  "main": "dist/opentype.js"
38
38
  },
39
- {
40
- "name": "sprintf",
41
- "location": "../node_modules/sprintf-js",
42
- "main": "dist/sprintf.min.js"
43
- },
44
39
  {
45
40
  "name": "contextMenu",
46
41
  "location": "../node_modules/jquery-contextmenu",
package/src/x_ite.css CHANGED
@@ -93,7 +93,7 @@ X3DCanvas .x_ite-private-notification {
93
93
 
94
94
  X3DCanvas .x_ite-private-notification span {
95
95
  padding: 0px 24px 0px 20px;
96
- background: url(assets/images/icon.bw.png) no-repeat 0px 3px;
96
+ background: url(assets/images/icon.bw.png) no-repeat 0px 2px;
97
97
  }
98
98
 
99
99
  X3DCanvas .x_ite-private-browser-timings {
@@ -335,11 +335,6 @@ X3DCanvas #context-menu-layer {
335
335
  letter-spacing: unset;
336
336
  }
337
337
 
338
- .x_ite-private-menu .context-menu-separator {
339
- padding-bottom: 0;
340
- border-bottom: 1px solid #111;
341
- }
342
-
343
338
  .x_ite-private-menu .context-menu-item > label > input,
344
339
  .x_ite-private-menu .context-menu-item > label > textarea {
345
340
  all: revert;
@@ -359,13 +354,24 @@ X3DCanvas #context-menu-layer {
359
354
  -moz-appearance: radio;
360
355
  }
361
356
 
362
- .x_ite-private-menu .context-menu-hover {
357
+ .x_ite-private-menu .context-menu-item:hover {
363
358
  cursor: pointer;
364
359
  background-color: #444;
365
360
  border-top: 1px solid #eee;
366
361
  border-bottom: 1px solid #eee;
367
362
  }
368
363
 
364
+ .x_ite-private-menu .context-menu-item.context-menu-separator {
365
+ padding-top: 0;
366
+ padding-bottom: 0;
367
+ border-top: 0;
368
+ border-bottom: 1px solid #111;
369
+ }
370
+
371
+ .x_ite-private-menu .context-menu-separator + .context-menu-separator {
372
+ display: none !important;
373
+ }
374
+
369
375
  .x_ite-private-menu .context-menu-disabled {
370
376
  color: #666;
371
377
  }
@@ -444,7 +450,7 @@ X3DCanvas #context-menu-layer {
444
450
  }
445
451
 
446
452
  .x_ite-private-menu .context-menu-item > .context-menu-list {
447
- top: 5px;
453
+ top: -9px;
448
454
  /* re-positioned by js */
449
455
  right: -5px;
450
456
  display: none;
package/src/x_ite.html CHANGED
@@ -34,7 +34,7 @@ body {
34
34
  padding-bottom: 100px;
35
35
  background: black;
36
36
  color: white;
37
- font-family: PT Sans, sans;
37
+ font-family: PT Sans, sans-serif;
38
38
  line-height: 1.3;
39
39
  }
40
40
 
@@ -114,7 +114,7 @@ main.color-management .browser {
114
114
  background: #313131;
115
115
  color: white;
116
116
  vertical-align: middle;
117
- font-family: PT Sans;
117
+ font-family: PT Sans, sans-serif;
118
118
  font-size: 10pt;
119
119
  }
120
120
 
@@ -130,7 +130,7 @@ main.color-management .browser {
130
130
  background: #313131;
131
131
  color: white;
132
132
  vertical-align: middle;
133
- font-family: PT Sans;
133
+ font-family: PT Sans, sans-serif;
134
134
  font-size: 10pt;
135
135
  }
136
136
 
package/src/x_ite.js CHANGED
@@ -69,16 +69,9 @@ define .hide = function ()
69
69
  const getScriptURL = (function ()
70
70
  {
71
71
  if (document .currentScript)
72
- {
73
72
  var src = document .currentScript .src;
74
- }
75
- else if (typeof __filename === "string")
76
- {
77
- if (typeof globalProcess === "object" && globalProcess .platform === "win32")
78
- var src = __filename;
79
- else
80
- var src = "file://" + __filename;
81
- }
73
+ else if (typeof globalRequire === "function" && typeof __filename === "string")
74
+ var src = globalRequire ("url") .pathToFileURL (__filename) .href;
82
75
 
83
76
  return function ()
84
77
  {
package/x_ite.min.html CHANGED
@@ -32,7 +32,7 @@ body {
32
32
  padding-bottom: 100px;
33
33
  background: black;
34
34
  color: white;
35
- font-family: PT Sans, sans;
35
+ font-family: PT Sans, sans-serif;
36
36
  line-height: 1.3;
37
37
  }
38
38
 
@@ -112,7 +112,7 @@ main.color-management .browser {
112
112
  background: #313131;
113
113
  color: white;
114
114
  vertical-align: middle;
115
- font-family: PT Sans;
115
+ font-family: PT Sans, sans-serif;
116
116
  font-size: 10pt;
117
117
  }
118
118
 
@@ -128,7 +128,7 @@ main.color-management .browser {
128
128
  background: #313131;
129
129
  color: white;
130
130
  vertical-align: middle;
131
- font-family: PT Sans;
131
+ font-family: PT Sans, sans-serif;
132
132
  font-size: 10pt;
133
133
  }
134
134