x_ite 4.7.5 → 4.7.9

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 (157) hide show
  1. package/.vscode/launch.json +15 -0
  2. package/.vscode/settings.json +2 -5
  3. package/Makefile +1 -0
  4. package/README.md +1 -1
  5. package/build/components/annotation.build.js +2 -2
  6. package/build/components/cad-geometry.build.js +2 -2
  7. package/build/components/cube-map-texturing.build.js +2 -2
  8. package/build/components/dis.build.js +2 -2
  9. package/build/components/event-utilities.build.js +2 -2
  10. package/build/components/geometry2d.build.js +2 -2
  11. package/build/components/geospatial.build.js +2 -2
  12. package/build/components/h-anim.build.js +2 -2
  13. package/build/components/key-device-sensor.build.js +2 -2
  14. package/build/components/layout.build.js +2 -2
  15. package/build/components/nurbs.build.js +2 -2
  16. package/build/components/particle-systems.build.js +2 -2
  17. package/build/components/picking.build.js +2 -2
  18. package/build/components/projective-texture-mapping.build.js +2 -2
  19. package/build/components/rigid-body-physics.build.js +2 -2
  20. package/build/components/scripting.build.js +2 -2
  21. package/build/components/texturing-3d.build.js +2 -2
  22. package/build/components/volume-rendering.build.js +2 -2
  23. package/build/components/x_ite.build.js +2 -2
  24. package/build/parts/default.end.frag.js +2 -0
  25. package/build/parts/default.start.frag.js +8 -0
  26. package/build/parts/{x_ite.end.frag → x_ite.end.frag.js} +4 -2
  27. package/build/parts/x_ite.start.frag.js +16 -0
  28. package/build/x_ite.build.js +2 -2
  29. package/dist/assets/components/annotation.js +9 -7
  30. package/dist/assets/components/annotation.min.js +1 -1
  31. package/dist/assets/components/cad-geometry.js +9 -7
  32. package/dist/assets/components/cad-geometry.min.js +1 -1
  33. package/dist/assets/components/cube-map-texturing.js +9 -7
  34. package/dist/assets/components/cube-map-texturing.min.js +1 -1
  35. package/dist/assets/components/dis.js +9 -7
  36. package/dist/assets/components/dis.min.js +1 -1
  37. package/dist/assets/components/event-utilities.js +9 -7
  38. package/dist/assets/components/event-utilities.min.js +1 -1
  39. package/dist/assets/components/geometry2d.js +9 -7
  40. package/dist/assets/components/geometry2d.min.js +1 -1
  41. package/dist/assets/components/geospatial.js +9 -7
  42. package/dist/assets/components/geospatial.min.js +2 -2
  43. package/dist/assets/components/h-anim.js +9 -7
  44. package/dist/assets/components/h-anim.min.js +1 -1
  45. package/dist/assets/components/key-device-sensor.js +9 -7
  46. package/dist/assets/components/key-device-sensor.min.js +1 -1
  47. package/dist/assets/components/layout.js +9 -7
  48. package/dist/assets/components/layout.min.js +1 -1
  49. package/dist/assets/components/nurbs.js +9 -7
  50. package/dist/assets/components/nurbs.min.js +2 -2
  51. package/dist/assets/components/particle-systems.js +9 -7
  52. package/dist/assets/components/particle-systems.min.js +2 -2
  53. package/dist/assets/components/picking.js +13 -11
  54. package/dist/assets/components/picking.min.js +1 -1
  55. package/dist/assets/components/projective-texture-mapping.js +9 -7
  56. package/dist/assets/components/projective-texture-mapping.min.js +1 -1
  57. package/dist/assets/components/rigid-body-physics.js +9 -7
  58. package/dist/assets/components/rigid-body-physics.min.js +17 -17
  59. package/dist/assets/components/scripting.js +16 -9
  60. package/dist/assets/components/scripting.min.js +1 -1
  61. package/dist/assets/components/texturing-3d.js +9 -7
  62. package/dist/assets/components/texturing-3d.min.js +3 -3
  63. package/dist/assets/components/volume-rendering.js +11 -9
  64. package/dist/assets/components/volume-rendering.min.js +3 -3
  65. package/dist/assets/components/x_ite.js +9 -7
  66. package/dist/assets/components/x_ite.min.js +1 -1
  67. package/dist/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
  68. package/dist/assets/shaders/webgl1/Gouraud.vs +0 -1
  69. package/dist/assets/shaders/webgl1/Phong.fs +0 -1
  70. package/dist/assets/shaders/webgl1/Unlit.fs +0 -3
  71. package/dist/assets/shaders/webgl2/Gouraud.vs +0 -1
  72. package/dist/assets/shaders/webgl2/Phong.fs +0 -1
  73. package/dist/assets/shaders/webgl2/Unlit.fs +0 -3
  74. package/dist/example.html +2 -2
  75. package/dist/x_ite.css +4 -3
  76. package/dist/x_ite.js +28281 -27706
  77. package/dist/x_ite.min.js +41 -41
  78. package/dist/x_ite.zip +0 -0
  79. package/docs/Accessing-the-External-Browser.md +32 -3
  80. package/docs/Custom-Shaders.md +165 -174
  81. package/docs/What's-New.md +61 -6
  82. package/docs/_config.yml +1 -1
  83. package/docs/index.md +21 -14
  84. package/docs/reference/Browser-Services.md +36 -8
  85. package/docs/reference/Script-Node-Authoring-Interface.md +12 -4
  86. package/package.json +13 -6
  87. package/src/assets/components/picking.js +2 -2
  88. package/src/assets/components/volume-rendering.js +2 -2
  89. package/src/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
  90. package/src/assets/shaders/webgl1/Gouraud.vs +0 -1
  91. package/src/assets/shaders/webgl1/Phong.fs +0 -1
  92. package/src/assets/shaders/webgl1/Unlit.fs +0 -3
  93. package/src/assets/shaders/webgl2/Gouraud.vs +0 -1
  94. package/src/assets/shaders/webgl2/Phong.fs +0 -1
  95. package/src/assets/shaders/webgl2/Unlit.fs +0 -3
  96. package/src/bookmarks.js +8 -11
  97. package/src/examples.js +1 -1
  98. package/src/locale/de.po +19 -75
  99. package/src/locale/fr.po +18 -75
  100. package/src/standard/Time/MicroTime.js +3 -1
  101. package/src/standard/Utility/DataStorage.js +7 -10
  102. package/src/tests.js +2 -1
  103. package/src/x_ite/Browser/Core/BrowserOptions.js +40 -28
  104. package/src/x_ite/Browser/Core/BrowserTimings.js +13 -24
  105. package/src/x_ite/Browser/Core/ContextMenu.js +26 -12
  106. package/src/x_ite/Browser/Core/X3DCoreContext.js +95 -42
  107. package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
  108. package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
  109. package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -0
  110. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -0
  111. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +1 -3
  112. package/src/x_ite/Browser/Networking/urls.js +25 -0
  113. package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
  114. package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +4 -1
  115. package/src/x_ite/Browser/Shaders/ShaderTest.js +3 -3
  116. package/src/x_ite/Browser/VERSION.js +1 -1
  117. package/src/x_ite/Browser/X3DBrowser.js +70 -50
  118. package/src/x_ite/Components/Grouping/Switch.js +1 -1
  119. package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -1
  120. package/src/x_ite/Components/Navigation/Collision.js +1 -1
  121. package/src/x_ite/Components/Navigation/LOD.js +1 -1
  122. package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
  123. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +25 -11
  124. package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +35 -1
  125. package/src/x_ite/Components/Scripting/Script.js +7 -2
  126. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +10 -12
  127. package/src/x_ite/Components/Shaders.js +9 -9
  128. package/src/x_ite/Execution/X3DExecutionContext.js +9 -11
  129. package/src/x_ite/Fields/SFColor.js +20 -7
  130. package/src/x_ite/Fields/SFColorRGBA.js +6 -6
  131. package/src/x_ite/Fields/SFDouble.js +2 -2
  132. package/src/x_ite/Fields/SFFloat.js +2 -2
  133. package/src/x_ite/Fields/SFImage.js +13 -13
  134. package/src/x_ite/Fields/SFMatrix3.js +5 -5
  135. package/src/x_ite/Fields/SFMatrix4.js +6 -6
  136. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +14 -3
  137. package/src/x_ite/Fields/SFNode.js +23 -19
  138. package/src/x_ite/Fields/SFNodeCache.js +14 -10
  139. package/src/x_ite/Fields/SFRotation.js +10 -10
  140. package/src/x_ite/Fields/SFString.js +1 -1
  141. package/src/x_ite/Fields/SFTime.js +1 -1
  142. package/src/x_ite/Fields/SFVec2.js +6 -6
  143. package/src/x_ite/Fields/SFVec3.js +7 -7
  144. package/src/x_ite/Fields/SFVec4.js +8 -8
  145. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +7 -6
  146. package/src/x_ite/InputOutput/Generator.js +85 -65
  147. package/src/x_ite/Parser/X3DParser.js +6 -0
  148. package/src/x_ite/Parser/XMLParser.js +1 -1
  149. package/src/x_ite/X3D.js +8 -2
  150. package/src/x_ite.config.js +0 -5
  151. package/src/x_ite.css +2 -1
  152. package/src/x_ite.html +3 -3
  153. package/src/x_ite.js +21 -12
  154. package/x_ite.min.html +3 -3
  155. package/build/parts/default.end.frag +0 -2
  156. package/build/parts/default.start.frag +0 -6
  157. package/build/parts/x_ite.start.frag +0 -8
@@ -51,10 +51,12 @@ define ([
51
51
  "standard/Math/Numbers/Color3",
52
52
  "x_ite/Basic/X3DField",
53
53
  "x_ite/Bits/X3DConstants",
54
+ "x_ite/InputOutput/Generator",
54
55
  ],
55
56
  function (Color3,
56
57
  X3DField,
57
- X3DConstants)
58
+ X3DConstants,
59
+ Generator)
58
60
  {
59
61
  "use strict";
60
62
 
@@ -116,14 +118,14 @@ function (Color3,
116
118
  },
117
119
  lerp: (function ()
118
120
  {
119
- var
121
+ const
120
122
  s = [ ],
121
123
  d = [ ],
122
124
  r = [ ];
123
125
 
124
126
  return function (destination, t)
125
127
  {
126
- var result = new SFColor ();
128
+ const result = new SFColor ();
127
129
 
128
130
  this .getValue () .getHSV (s),
129
131
  destination .getValue () .getHSV (d),
@@ -136,7 +138,18 @@ function (Color3,
136
138
  })(),
137
139
  toStream: function (stream)
138
140
  {
139
- stream .string += this .getValue () .toString ();
141
+ const
142
+ generator = Generator .Get (stream),
143
+ value = this .getValue (),
144
+ last = value .length - 1;
145
+
146
+ for (let i = 0; i < last; ++ i)
147
+ {
148
+ stream .string += generator .Precision (value [i]);
149
+ stream .string += " ";
150
+ }
151
+
152
+ stream .string += generator .Precision (value [last]);
140
153
  },
141
154
  toVRMLStream: function (stream)
142
155
  {
@@ -148,7 +161,7 @@ function (Color3,
148
161
  },
149
162
  });
150
163
 
151
- var r = {
164
+ const r = {
152
165
  get: function ()
153
166
  {
154
167
  return this .getValue () .r;
@@ -162,7 +175,7 @@ function (Color3,
162
175
  configurable: false
163
176
  };
164
177
 
165
- var g = {
178
+ const g = {
166
179
  get: function ()
167
180
  {
168
181
  return this .getValue () .g;
@@ -176,7 +189,7 @@ function (Color3,
176
189
  configurable: false
177
190
  };
178
191
 
179
- var b = {
192
+ const b = {
180
193
  get: function ()
181
194
  {
182
195
  return this .getValue () .b;
@@ -113,14 +113,14 @@ function (X3DField,
113
113
  },
114
114
  lerp: (function ()
115
115
  {
116
- var
116
+ const
117
117
  s = [ ],
118
118
  d = [ ],
119
119
  r = [ ];
120
120
 
121
121
  return function (destination, t)
122
122
  {
123
- var result = new SFColorRGBA ();
123
+ const result = new SFColorRGBA ();
124
124
 
125
125
  this .getValue () .getHSVA (s),
126
126
  destination .getValue () .getHSVA (d),
@@ -136,7 +136,7 @@ function (X3DField,
136
136
  toXMLStream: SFColor .prototype .toXMLStream,
137
137
  });
138
138
 
139
- var r = {
139
+ const r = {
140
140
  get: function ()
141
141
  {
142
142
  return this .getValue () .r;
@@ -150,7 +150,7 @@ function (X3DField,
150
150
  configurable: false
151
151
  };
152
152
 
153
- var g = {
153
+ const g = {
154
154
  get: function ()
155
155
  {
156
156
  return this .getValue () .g;
@@ -164,7 +164,7 @@ function (X3DField,
164
164
  configurable: false
165
165
  };
166
166
 
167
- var b = {
167
+ const b = {
168
168
  get: function ()
169
169
  {
170
170
  return this .getValue () .b;
@@ -178,7 +178,7 @@ function (X3DField,
178
178
  configurable: false
179
179
  };
180
180
 
181
- var a = {
181
+ const a = {
182
182
  get: function ()
183
183
  {
184
184
  return this .getValue () .a;
@@ -89,11 +89,11 @@ function (X3DField,
89
89
  valueOf: X3DField .prototype .getValue,
90
90
  toStream: function (stream)
91
91
  {
92
- var
92
+ const
93
93
  generator = Generator .Get (stream),
94
94
  category = generator .Unit (this .getUnit ());
95
95
 
96
- stream .string += String (generator .ToUnit (category, this .getValue ()));
96
+ stream .string += generator .DoublePrecision (generator .ToUnit (category, this .getValue ()));
97
97
  },
98
98
  toVRMLStream: function (stream)
99
99
  {
@@ -89,11 +89,11 @@ function (X3DField,
89
89
  valueOf: X3DField .prototype .getValue,
90
90
  toStream: function (stream)
91
91
  {
92
- var
92
+ const
93
93
  generator = Generator .Get (stream),
94
94
  category = generator .Unit (this .getUnit ());
95
95
 
96
- stream .string += String (generator .ToUnit (category, this .getValue ()));
96
+ stream .string += generator .Precision (generator .ToUnit (category, this .getValue ()));
97
97
  },
98
98
  toVRMLStream: function (stream)
99
99
  {
@@ -64,7 +64,7 @@ function (X3DField,
64
64
 
65
65
  function Image (width, height, comp, array)
66
66
  {
67
- var MFInt32 = require ("x_ite/Fields/ArrayFields") .MFInt32;
67
+ const MFInt32 = require ("x_ite/Fields/ArrayFields") .MFInt32;
68
68
 
69
69
  this .width = ~~width;
70
70
  this .height = ~~height;
@@ -73,7 +73,7 @@ function (X3DField,
73
73
  this .array .setValue (array);
74
74
  this .array .length = this .width * this .height;
75
75
  }
76
-
76
+
77
77
  Image .prototype =
78
78
  {
79
79
  constructor: Image,
@@ -105,7 +105,7 @@ function (X3DField,
105
105
  setWidth: function (value)
106
106
  {
107
107
  this .width = ~~value;
108
- this .array .length = this .width * this .height;
108
+ this .array .length = this .width * this .height;
109
109
  },
110
110
  getWidth: function ()
111
111
  {
@@ -114,7 +114,7 @@ function (X3DField,
114
114
  setHeight: function (value)
115
115
  {
116
116
  this .height = ~~value;
117
- this .array .length = this .width * this .height;
117
+ this .array .length = this .width * this .height;
118
118
  },
119
119
  getHeight: function ()
120
120
  {
@@ -131,7 +131,7 @@ function (X3DField,
131
131
  setArray: function (value)
132
132
  {
133
133
  this .array .assign (value);
134
- this .array .length = this .width * this .height;
134
+ this .array .length = this .width * this .height;
135
135
  },
136
136
  getArray: function ()
137
137
  {
@@ -145,8 +145,8 @@ function (X3DField,
145
145
 
146
146
  function SFImage (width, height, comp, array)
147
147
  {
148
- var MFInt32 = require ("x_ite/Fields/ArrayFields") .MFInt32;
149
-
148
+ const MFInt32 = require ("x_ite/Fields/ArrayFields") .MFInt32;
149
+
150
150
  if (arguments [0] instanceof Image)
151
151
  X3DField .call (this, arguments [0]);
152
152
  else if (arguments .length === 4)
@@ -195,13 +195,13 @@ function (X3DField,
195
195
  },
196
196
  toStream: function (stream)
197
197
  {
198
- var
198
+ const
199
199
  array = this .array,
200
200
  int = new SFInt32 ();
201
201
 
202
202
  stream .string += this .width + " " + this .height + " " + this .comp;
203
203
 
204
- for (var i = 0, length = this .width * this .height; i < length; ++ i)
204
+ for (let i = 0, length = this .width * this .height; i < length; ++ i)
205
205
  {
206
206
  stream .string += " 0x";
207
207
 
@@ -219,7 +219,7 @@ function (X3DField,
219
219
  },
220
220
  });
221
221
 
222
- var width = {
222
+ const width = {
223
223
  get: function ()
224
224
  {
225
225
  return this .getValue () .getWidth ();
@@ -233,7 +233,7 @@ function (X3DField,
233
233
  configurable: false
234
234
  };
235
235
 
236
- var height = {
236
+ const height = {
237
237
  get: function ()
238
238
  {
239
239
  return this .getValue () .getHeight ();
@@ -247,7 +247,7 @@ function (X3DField,
247
247
  configurable: false
248
248
  };
249
249
 
250
- var comp = {
250
+ const comp = {
251
251
  get: function ()
252
252
  {
253
253
  return this .getValue () .getComp ();
@@ -261,7 +261,7 @@ function (X3DField,
261
261
  configurable: false
262
262
  };
263
263
 
264
- var array = {
264
+ const array = {
265
265
  get: function ()
266
266
  {
267
267
  return this .getValue () .getArray ();
@@ -63,7 +63,7 @@ function (X3DField,
63
63
  {
64
64
  "use strict";
65
65
 
66
- function SFMatrix3Template (TypeName, Type, SFVec2)
66
+ function SFMatrix3Template (TypeName, Type, SFVec2, double)
67
67
  {
68
68
  function SFMatrix3 (m00, m01, m02,
69
69
  m10, m11, m12,
@@ -87,7 +87,7 @@ function (X3DField,
87
87
  }
88
88
 
89
89
  SFMatrix3 .prototype = Object .assign (Object .create (X3DField .prototype),
90
- SFMatrixPrototypeTemplate (Matrix3, SFVec2),
90
+ SFMatrixPrototypeTemplate (Matrix3, SFVec2, double),
91
91
  {
92
92
  constructor: SFMatrix3,
93
93
  getTypeName: function ()
@@ -128,14 +128,14 @@ function (X3DField,
128
128
  });
129
129
  }
130
130
 
131
- for (var i = 0; i < Matrix3 .prototype .length; ++ i)
131
+ for (let i = 0; i < Matrix3 .prototype .length; ++ i)
132
132
  defineProperty (i);
133
133
 
134
134
  return SFMatrix3;
135
135
  }
136
136
 
137
137
  return {
138
- SFMatrix3d: SFMatrix3Template ("SFMatrix3d", X3DConstants .SFMatrix3d, SFVec2 .SFVec2d),
139
- SFMatrix3f: SFMatrix3Template ("SFMatrix3f", X3DConstants .SFMatrix3f, SFVec2 .SFVec2f),
138
+ SFMatrix3d: SFMatrix3Template ("SFMatrix3d", X3DConstants .SFMatrix3d, SFVec2 .SFVec2d, true),
139
+ SFMatrix3f: SFMatrix3Template ("SFMatrix3f", X3DConstants .SFMatrix3f, SFVec2 .SFVec2f, false),
140
140
  };
141
141
  });
@@ -62,7 +62,7 @@ function (X3DField,
62
62
  {
63
63
  "use strict";
64
64
 
65
- function SFMatrix4Template (TypeName, Type, SFVec3)
65
+ function SFMatrix4Template (TypeName, Type, SFVec3, double)
66
66
  {
67
67
  function SFMatrix4 (m00, m01, m02, m03,
68
68
  m10, m11, m12, m13,
@@ -88,7 +88,7 @@ function (X3DField,
88
88
  }
89
89
 
90
90
  SFMatrix4 .prototype = Object .assign (Object .create (X3DField .prototype),
91
- SFMatrixPrototypeTemplate (Matrix4, SFVec3),
91
+ SFMatrixPrototypeTemplate (Matrix4, SFVec3, double),
92
92
  {
93
93
  constructor: SFMatrix4,
94
94
  getTypeName: function ()
@@ -119,15 +119,15 @@ function (X3DField,
119
119
  });
120
120
  }
121
121
 
122
- for (var i = 0; i < Matrix4 .prototype .length; ++ i)
122
+ for (let i = 0; i < Matrix4 .prototype .length; ++ i)
123
123
  defineProperty (i);
124
124
 
125
125
  return SFMatrix4;
126
126
  }
127
127
 
128
128
  return {
129
- SFMatrix4d: SFMatrix4Template ("SFMatrix4d", X3DConstants .SFMatrix4d, SFVec3 .SFVec3d),
130
- SFMatrix4f: SFMatrix4Template ("SFMatrix4f", X3DConstants .SFMatrix4f, SFVec3 .SFVec3f),
131
- VrmlMatrix: SFMatrix4Template ("VrmlMatrix", X3DConstants .VrmlMatrix, SFVec3 .SFVec3f),
129
+ SFMatrix4d: SFMatrix4Template ("SFMatrix4d", X3DConstants .SFMatrix4d, SFVec3 .SFVec3d, true),
130
+ SFMatrix4f: SFMatrix4Template ("SFMatrix4f", X3DConstants .SFMatrix4f, SFVec3 .SFVec3f, false),
131
+ VrmlMatrix: SFMatrix4Template ("VrmlMatrix", X3DConstants .VrmlMatrix, SFVec3 .SFVec3f, false),
132
132
  };
133
133
  });
@@ -54,7 +54,7 @@ function (X3DField)
54
54
  {
55
55
  "use strict";
56
56
 
57
- return function (Matrix, SFVec)
57
+ return function (Matrix, SFVec, double)
58
58
  {
59
59
  return Object .assign (Object .create (X3DField .prototype),
60
60
  {
@@ -132,9 +132,20 @@ function (X3DField)
132
132
  },
133
133
  toStream: function (stream)
134
134
  {
135
- stream .string += this .getValue () .toString ();
135
+ const
136
+ generator = Generator .Get (stream),
137
+ value = this .getValue (),
138
+ last = value .length - 1;
139
+
140
+ for (let i = 0; i < last; ++ i)
141
+ {
142
+ stream .string += double ? generator .DoublePrecision (value [i]) : generator .Precision (value [i]);
143
+ stream .string += " ";
144
+ }
145
+
146
+ stream .string += double ? generator .DoublePrecision (value [last]) : generator .Precision (value [last]);
136
147
  },
137
- toVRMLStream: function (stream)
148
+ toVRMLStream: function (stream)
138
149
  {
139
150
  this .toStream (stream);
140
151
  },
@@ -60,18 +60,18 @@ function (X3DField,
60
60
  {
61
61
  "use strict";
62
62
 
63
- var handler =
63
+ const handler =
64
64
  {
65
65
  get: function (target, key)
66
66
  {
67
67
  try
68
68
  {
69
- var value = target [key];
69
+ const value = target [key];
70
70
 
71
71
  if (value !== undefined)
72
72
  return value;
73
73
 
74
- var
74
+ const
75
75
  field = target .getValue () .getField (key),
76
76
  accessType = field .getAccessType ();
77
77
 
@@ -97,7 +97,7 @@ function (X3DField,
97
97
 
98
98
  try
99
99
  {
100
- var
100
+ const
101
101
  field = target .getValue () .getField (key),
102
102
  accessType = field .getAccessType ();
103
103
 
@@ -127,6 +127,8 @@ function (X3DField,
127
127
 
128
128
  function SFNode (value)
129
129
  {
130
+ // Node need to test for X3DBaseNode, because there is a special version of SFNode in Script.
131
+
130
132
  if (value)
131
133
  {
132
134
  value .addParent (this);
@@ -151,7 +153,7 @@ function (X3DField,
151
153
  },
152
154
  copy: function (instance)
153
155
  {
154
- var value = this .getValue ();
156
+ const value = this .getValue ();
155
157
 
156
158
  if (value)
157
159
  return new SFNode (value .copy (instance));
@@ -179,7 +181,7 @@ function (X3DField,
179
181
  },
180
182
  set: function (value)
181
183
  {
182
- var current = this .getValue ();
184
+ const current = this .getValue ();
183
185
 
184
186
  if (current)
185
187
  {
@@ -187,6 +189,8 @@ function (X3DField,
187
189
  current .removeParent (this);
188
190
  }
189
191
 
192
+ // Node need to test for X3DBaseNode, because there is a special version of SFNode in Script.
193
+
190
194
  if (value)
191
195
  {
192
196
  value .addParent (this);
@@ -201,7 +205,7 @@ function (X3DField,
201
205
  },
202
206
  getNodeTypeName: function ()
203
207
  {
204
- var value = this .getValue ();
208
+ const value = this .getValue ();
205
209
 
206
210
  if (value)
207
211
  return value .getTypeName ();
@@ -210,7 +214,7 @@ function (X3DField,
210
214
  },
211
215
  getNodeName: function ()
212
216
  {
213
- var value = this .getValue ();
217
+ const value = this .getValue ();
214
218
 
215
219
  if (value)
216
220
  return value .getName ();
@@ -219,7 +223,7 @@ function (X3DField,
219
223
  },
220
224
  getNodeType: function ()
221
225
  {
222
- var value = this .getValue ();
226
+ const value = this .getValue ();
223
227
 
224
228
  if (value)
225
229
  return value .getType () .slice ();
@@ -228,7 +232,7 @@ function (X3DField,
228
232
  },
229
233
  getFieldDefinitions: function ()
230
234
  {
231
- var value = this .getValue ();
235
+ const value = this .getValue ();
232
236
 
233
237
  if (value)
234
238
  return value .getFieldDefinitions ();
@@ -245,7 +249,7 @@ function (X3DField,
245
249
  }
246
250
  case 3:
247
251
  {
248
- var value = this .getValue ();
252
+ const value = this .getValue ();
249
253
 
250
254
  if (value)
251
255
  return value .getField (name) .addFieldCallback (string, object);
@@ -264,7 +268,7 @@ function (X3DField,
264
268
  }
265
269
  case 2:
266
270
  {
267
- var value = this .getValue ();
271
+ const value = this .getValue ();
268
272
 
269
273
  if (value)
270
274
  return value .getField (name) .removeFieldCallback (string);
@@ -275,7 +279,7 @@ function (X3DField,
275
279
  },
276
280
  addCloneCount: function (count)
277
281
  {
278
- var value = this .getValue ();
282
+ const value = this .getValue ();
279
283
 
280
284
  this ._cloneCount += count;
281
285
 
@@ -284,7 +288,7 @@ function (X3DField,
284
288
  },
285
289
  removeCloneCount: function (count)
286
290
  {
287
- var value = this .getValue ();
291
+ const value = this .getValue ();
288
292
 
289
293
  this ._cloneCount -= count;
290
294
 
@@ -293,7 +297,7 @@ function (X3DField,
293
297
  },
294
298
  valueOf: function ()
295
299
  {
296
- var value = this .getValue ();
300
+ const value = this .getValue ();
297
301
 
298
302
  if (value)
299
303
  return SFNodeCache .get (value);
@@ -302,7 +306,7 @@ function (X3DField,
302
306
  },
303
307
  toStream: function (stream)
304
308
  {
305
- var value = this .getValue ();
309
+ const value = this .getValue ();
306
310
 
307
311
  if (value)
308
312
  value .toStream (stream);
@@ -311,7 +315,7 @@ function (X3DField,
311
315
  },
312
316
  toVRMLStream: function (stream)
313
317
  {
314
- var value = this .getValue ();
318
+ const value = this .getValue ();
315
319
 
316
320
  if (value)
317
321
  value .toVRMLStream (stream);
@@ -320,7 +324,7 @@ function (X3DField,
320
324
  },
321
325
  toXMLString: function ()
322
326
  {
323
- var
327
+ const
324
328
  stream = { string: "" },
325
329
  generator = Generator .Get (stream),
326
330
  value = this .getValue ();
@@ -335,7 +339,7 @@ function (X3DField,
335
339
  },
336
340
  toXMLStream: function (stream)
337
341
  {
338
- var value = this .getValue ();
342
+ const value = this .getValue ();
339
343
 
340
344
  if (value)
341
345
  value .toXMLStream (stream);
@@ -51,7 +51,7 @@ define (function ()
51
51
  {
52
52
  "use strict";
53
53
 
54
- var cache = new WeakMap ();
54
+ const cache = new WeakMap ();
55
55
 
56
56
  function SFNodeCache () { }
57
57
 
@@ -59,9 +59,9 @@ define (function ()
59
59
  {
60
60
  add: function (baseNode, node)
61
61
  {
62
- var SFNode = require ("x_ite/Fields/SFNode");
62
+ const SFNode = require ("x_ite/Fields/SFNode");
63
63
 
64
- var node = node ? SFNode .call (node, baseNode) : new SFNode (baseNode);
64
+ node = node ? SFNode .call (node, baseNode) : new SFNode (baseNode);
65
65
 
66
66
  cache .set (baseNode, node);
67
67
 
@@ -69,19 +69,23 @@ define (function ()
69
69
  },
70
70
  get: function (baseNode)
71
71
  {
72
- var node = cache .get (baseNode);
72
+ const node = cache .get (baseNode);
73
73
 
74
74
  if (node)
75
+ {
75
76
  return node;
77
+ }
78
+ else
79
+ {
80
+ const SFNode = require ("x_ite/Fields/SFNode");
76
81
 
77
- var SFNode = require ("x_ite/Fields/SFNode");
82
+ // Always create new instance!
83
+ const node = new SFNode (baseNode);
78
84
 
79
- // Always create new instance!
80
- node = new SFNode (baseNode);
85
+ cache .set (baseNode, node);
81
86
 
82
- cache .set (baseNode, node);
83
-
84
- return node;
87
+ return node;
88
+ }
85
89
  },
86
90
  };
87
91
 
@@ -62,7 +62,7 @@ function (SFVec3,
62
62
  {
63
63
  "use strict";
64
64
 
65
- var SFVec3f = SFVec3 .SFVec3f;
65
+ const SFVec3f = SFVec3 .SFVec3f;
66
66
 
67
67
  function SFRotation (x, y, z, angle)
68
68
  {
@@ -141,14 +141,14 @@ function (SFVec3,
141
141
  },
142
142
  toStream: function (stream)
143
143
  {
144
- var
144
+ const
145
145
  generator = Generator .Get (stream),
146
146
  rotation = this .getValue ();
147
147
 
148
- stream .string += rotation .x + " " +
149
- rotation .y + " " +
150
- rotation .z + " " +
151
- generator .ToUnit ("angle", rotation .angle);
148
+ stream .string += generator .DoublePrecision (rotation .x) + " " +
149
+ generator .DoublePrecision (rotation .y) + " " +
150
+ generator .DoublePrecision (rotation .z) + " " +
151
+ generator .DoublePrecision (generator .ToUnit ("angle", rotation .angle));
152
152
  },
153
153
  toVRMLStream: function (stream)
154
154
  {
@@ -160,7 +160,7 @@ function (SFVec3,
160
160
  },
161
161
  });
162
162
 
163
- var x = {
163
+ const x = {
164
164
  get: function ()
165
165
  {
166
166
  return this .getValue () .x;
@@ -174,7 +174,7 @@ function (SFVec3,
174
174
  configurable: false
175
175
  };
176
176
 
177
- var y = {
177
+ const y = {
178
178
  get: function ()
179
179
  {
180
180
  return this .getValue () .y;
@@ -188,7 +188,7 @@ function (SFVec3,
188
188
  configurable: false
189
189
  };
190
190
 
191
- var z = {
191
+ const z = {
192
192
  get: function ()
193
193
  {
194
194
  return this .getValue () .z;
@@ -202,7 +202,7 @@ function (SFVec3,
202
202
  configurable: false
203
203
  };
204
204
 
205
- var angle = {
205
+ const angle = {
206
206
  get: function ()
207
207
  {
208
208
  return this .getValue () .angle;
@@ -58,7 +58,7 @@ function (X3DField,
58
58
  {
59
59
  "use strict";
60
60
 
61
- var
61
+ const
62
62
  unescape = /\\(.)/g,
63
63
  escape = /([\\"])/g;
64
64
 
@@ -87,7 +87,7 @@ function (X3DField,
87
87
  valueOf: X3DField .prototype .getValue,
88
88
  toStream: function (stream)
89
89
  {
90
- stream .string += String (this .getValue ());
90
+ stream .string += this .getValue ();
91
91
  },
92
92
  toVRMLStream: function (stream)
93
93
  {