x_ite 8.7.3 → 8.7.5

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 (112) hide show
  1. package/.vscode/tasks.json +1 -1
  2. package/build/bin/bump.pl +2 -0
  3. package/dist/assets/components/Annotation.js +13 -13
  4. package/dist/assets/components/Annotation.min.js +1 -1
  5. package/dist/assets/components/CADGeometry.js +13 -13
  6. package/dist/assets/components/CADGeometry.min.js +1 -1
  7. package/dist/assets/components/CubeMapTexturing.js +25 -25
  8. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  9. package/dist/assets/components/DIS.js +13 -13
  10. package/dist/assets/components/DIS.min.js +1 -1
  11. package/dist/assets/components/EventUtilities.js +9 -9
  12. package/dist/assets/components/EventUtilities.min.js +1 -1
  13. package/dist/assets/components/Geometry2D.js +19 -19
  14. package/dist/assets/components/Geometry2D.min.js +1 -1
  15. package/dist/assets/components/Geospatial.js +33 -33
  16. package/dist/assets/components/Geospatial.min.js +1 -1
  17. package/dist/assets/components/HAnim.js +18 -18
  18. package/dist/assets/components/HAnim.min.js +1 -1
  19. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  20. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  21. package/dist/assets/components/Layout.js +36 -31
  22. package/dist/assets/components/Layout.min.js +1 -1
  23. package/dist/assets/components/NURBS.js +24 -24
  24. package/dist/assets/components/NURBS.min.js +1 -1
  25. package/dist/assets/components/ParticleSystems.js +22 -22
  26. package/dist/assets/components/ParticleSystems.min.js +1 -1
  27. package/dist/assets/components/Picking.js +20 -20
  28. package/dist/assets/components/Picking.min.js +1 -1
  29. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  30. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  31. package/dist/assets/components/Scripting.js +28 -28
  32. package/dist/assets/components/Scripting.min.js +1 -1
  33. package/dist/assets/components/Text.js +24 -24
  34. package/dist/assets/components/Text.min.js +1 -1
  35. package/dist/assets/components/TextureProjector.js +14 -14
  36. package/dist/assets/components/TextureProjector.min.js +1 -1
  37. package/dist/assets/components/Texturing3D.js +31 -31
  38. package/dist/assets/components/Texturing3D.min.js +1 -1
  39. package/dist/assets/components/VolumeRendering.js +19 -19
  40. package/dist/assets/components/VolumeRendering.min.js +1 -1
  41. package/dist/assets/components/X_ITE.js +9 -9
  42. package/dist/assets/components/X_ITE.min.js +1 -1
  43. package/dist/x_ite.css +1 -1
  44. package/dist/x_ite.js +1297 -1436
  45. package/dist/x_ite.min.js +1 -1
  46. package/dist/x_ite.zip +0 -0
  47. package/docs/_config.yml +1 -1
  48. package/docs/_posts/reference/field-services-and-objects.md +27 -7
  49. package/package.json +2 -2
  50. package/src/standard/Math/Algorithms/eigen_decomposition.js +9 -9
  51. package/src/standard/Math/Geometry/Box2.js +20 -20
  52. package/src/standard/Math/Geometry/Box3.js +20 -20
  53. package/src/standard/Math/Numbers/Color3.js +10 -18
  54. package/src/standard/Math/Numbers/Color4.js +12 -23
  55. package/src/standard/Math/Numbers/Complex.js +59 -54
  56. package/src/standard/Math/Numbers/Matrix2.js +31 -45
  57. package/src/standard/Math/Numbers/Matrix3.js +59 -94
  58. package/src/standard/Math/Numbers/Matrix4.js +73 -114
  59. package/src/standard/Math/Numbers/Quaternion.js +49 -65
  60. package/src/standard/Math/Numbers/Rotation4.js +15 -13
  61. package/src/standard/Math/Numbers/Vector2.js +12 -14
  62. package/src/standard/Math/Numbers/Vector3.js +17 -22
  63. package/src/standard/Math/Numbers/Vector4.js +22 -30
  64. package/src/x_ite/Base/FieldArray.js +3 -2
  65. package/src/x_ite/Base/FieldDefinitionArray.js +3 -2
  66. package/src/x_ite/Base/X3DArrayField.js +27 -3
  67. package/src/x_ite/Base/X3DInfoArray.js +73 -14
  68. package/src/x_ite/Base/X3DObject.js +5 -0
  69. package/src/x_ite/Browser/Core/X3DCoreContext.js +3 -3
  70. package/src/x_ite/Browser/Layout/ScreenText.js +9 -4
  71. package/src/x_ite/Browser/VERSION.js +1 -1
  72. package/src/x_ite/Browser/X3DBrowser.js +60 -67
  73. package/src/x_ite/Browser/X3DBrowserContext.js +8 -8
  74. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +4 -4
  75. package/src/x_ite/Components/Layering/X3DLayerNode.js +1 -1
  76. package/src/x_ite/Components/Navigation/X3DViewpointNode.js +2 -3
  77. package/src/x_ite/Components/Picking/X3DPickSensorNode.js +2 -2
  78. package/src/x_ite/Configuration/ComponentInfoArray.js +2 -2
  79. package/src/x_ite/Configuration/ProfileInfoArray.js +2 -2
  80. package/src/x_ite/Configuration/UnitInfoArray.js +15 -1
  81. package/src/x_ite/Execution/BindableList.js +1 -1
  82. package/src/x_ite/Execution/ExportedNodesArray.js +4 -3
  83. package/src/x_ite/Execution/ImportedNodesArray.js +4 -3
  84. package/src/x_ite/Execution/NamedNodesArray.js +16 -2
  85. package/src/x_ite/Execution/X3DExecutionContext.js +52 -58
  86. package/src/x_ite/Execution/X3DExportedNode.js +13 -11
  87. package/src/x_ite/Execution/X3DImportedNode.js +25 -25
  88. package/src/x_ite/Execution/X3DScene.js +130 -54
  89. package/src/x_ite/Fields/SFColor.js +10 -15
  90. package/src/x_ite/Fields/SFColorRGBA.js +11 -18
  91. package/src/x_ite/Fields/SFImage.js +38 -33
  92. package/src/x_ite/Fields/SFMatrix3.js +1 -3
  93. package/src/x_ite/Fields/SFMatrix4.js +1 -5
  94. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +6 -5
  95. package/src/x_ite/Fields/SFNode.js +1 -1
  96. package/src/x_ite/Fields/SFRotation.js +14 -21
  97. package/src/x_ite/Fields/SFString.js +0 -1
  98. package/src/x_ite/Fields/SFVec2.js +8 -15
  99. package/src/x_ite/Fields/SFVec3.js +10 -17
  100. package/src/x_ite/Fields/SFVec4.js +12 -23
  101. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +15 -14
  102. package/src/x_ite/InputOutput/FileLoader.js +2 -2
  103. package/src/x_ite/Parser/SVGParser.js +2 -2
  104. package/src/x_ite/Parser/X3DOptimizer.js +1 -1
  105. package/src/x_ite/Parser/XMLParser.js +18 -18
  106. package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +3 -2
  107. package/src/x_ite/Prototype/ProtoDeclarationArray.js +4 -3
  108. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +26 -27
  109. package/src/x_ite/Prototype/X3DProtoDeclaration.js +16 -15
  110. package/src/x_ite/Routing/RouteArray.js +3 -2
  111. package/src/x_ite/Routing/X3DRoute.js +26 -25
  112. package/src/x_ite/Execution/Scene.js +0 -145
@@ -137,11 +137,11 @@ SFRotation .prototype = Object .assign (Object .create (X3DField .prototype),
137
137
  },
138
138
  inverse: function ()
139
139
  {
140
- return new SFRotation (Rotation4 .inverse (this .getValue ()));
140
+ return new SFRotation (this .getValue () .copy () .inverse ());
141
141
  },
142
142
  multiply: function (rotation)
143
143
  {
144
- return new SFRotation (Rotation4 .multRight (this .getValue (), rotation .getValue ()));
144
+ return new SFRotation (this .getValue () .copy () .multRight (rotation .getValue ()));
145
145
  },
146
146
  multVec: function (vector)
147
147
  {
@@ -149,7 +149,7 @@ SFRotation .prototype = Object .assign (Object .create (X3DField .prototype),
149
149
  },
150
150
  slerp: function (rotation, t)
151
151
  {
152
- return new SFRotation (Rotation4 .slerp (this .getValue (), rotation .getValue (), t));
152
+ return new SFRotation (this .getValue () .copy () .slerp (rotation .getValue (), t));
153
153
  },
154
154
  toStream: function (generator)
155
155
  {
@@ -211,7 +211,6 @@ const x = {
211
211
  this .getValue () .x = +value;
212
212
  this .addEvent ();
213
213
  },
214
- enumerable: true,
215
214
  };
216
215
 
217
216
  const y = {
@@ -224,7 +223,6 @@ const y = {
224
223
  this .getValue () .y = +value;
225
224
  this .addEvent ();
226
225
  },
227
- enumerable: true,
228
226
  };
229
227
 
230
228
  const z = {
@@ -237,7 +235,6 @@ const z = {
237
235
  this .getValue () .z = +value;
238
236
  this .addEvent ();
239
237
  },
240
- enumerable: true,
241
238
  };
242
239
 
243
240
  const angle = {
@@ -250,22 +247,18 @@ const angle = {
250
247
  this .getValue () .angle = +value;
251
248
  this .addEvent ();
252
249
  },
253
- enumerable: true,
254
250
  };
255
251
 
256
- Object .defineProperty (SFRotation .prototype, "x", x);
257
- Object .defineProperty (SFRotation .prototype, "y", y);
258
- Object .defineProperty (SFRotation .prototype, "z", z);
259
- Object .defineProperty (SFRotation .prototype, "angle", angle);
260
-
261
- x .enumerable = false;
262
- y .enumerable = false;
263
- z .enumerable = false;
264
- angle .enumerable = false;
265
-
266
- Object .defineProperty (SFRotation .prototype, "0", x);
267
- Object .defineProperty (SFRotation .prototype, "1", y);
268
- Object .defineProperty (SFRotation .prototype, "2", z);
269
- Object .defineProperty (SFRotation .prototype, "3", angle);
252
+ Object .defineProperties (SFRotation .prototype,
253
+ {
254
+ 0: x,
255
+ 1: y,
256
+ 2: z,
257
+ 3: angle,
258
+ x: Object .assign ({ enumerable: true }, x),
259
+ y: Object .assign ({ enumerable: true }, y),
260
+ z: Object .assign ({ enumerable: true }, z),
261
+ angle: Object .assign ({ enumerable: true }, angle),
262
+ });
270
263
 
271
264
  export default SFRotation;
@@ -130,7 +130,6 @@ Object .defineProperty (SFString .prototype, "length",
130
130
  {
131
131
  return this .getValue () .length;
132
132
  },
133
- enumerable: true,
134
133
  });
135
134
 
136
135
  export default SFString;
@@ -69,11 +69,7 @@ function SFVec2Template (TypeName, Type, double)
69
69
  throw new Error ("Invalid arguments.");
70
70
  }
71
71
 
72
- SFVec2 .prototype = Object .assign (Object .create (X3DField .prototype),
73
- SFVecPrototypeTemplate (TypeName, Type, Vector2, double),
74
- {
75
- constructor: SFVec2,
76
- });
72
+ SFVec2 .prototype = SFVecPrototypeTemplate (SFVec2, TypeName, Type, Vector2, double);
77
73
 
78
74
  for (const key of Reflect .ownKeys (SFVec2 .prototype))
79
75
  Object .defineProperty (SFVec2 .prototype, key, { enumerable: false });
@@ -88,7 +84,6 @@ function SFVec2Template (TypeName, Type, double)
88
84
  this .getValue () .x = +value;
89
85
  this .addEvent ();
90
86
  },
91
- enumerable: true,
92
87
  };
93
88
 
94
89
  const y = {
@@ -101,17 +96,15 @@ function SFVec2Template (TypeName, Type, double)
101
96
  this .getValue () .y = +value;
102
97
  this .addEvent ();
103
98
  },
104
- enumerable: true,
105
99
  };
106
100
 
107
- Object .defineProperty (SFVec2 .prototype, "x", x);
108
- Object .defineProperty (SFVec2 .prototype, "y", y);
109
-
110
- x .enumerable = false;
111
- y .enumerable = false;
112
-
113
- Object .defineProperty (SFVec2 .prototype, "0", x);
114
- Object .defineProperty (SFVec2 .prototype, "1", y);
101
+ Object .defineProperties (SFVec2 .prototype,
102
+ {
103
+ 0: x,
104
+ 1: y,
105
+ x: Object .assign ({ enumerable: true }, x),
106
+ y: Object .assign ({ enumerable: true }, y),
107
+ });
115
108
 
116
109
  return SFVec2;
117
110
  }
@@ -69,10 +69,8 @@ function SFVec3Template (TypeName, Type, double)
69
69
  throw new Error ("Invalid arguments.");
70
70
  }
71
71
 
72
- SFVec3 .prototype = Object .assign (Object .create (X3DField .prototype),
73
- SFVecPrototypeTemplate (TypeName, Type, Vector3, double),
72
+ SFVec3 .prototype = Object .assign (SFVecPrototypeTemplate (SFVec3, TypeName, Type, Vector3, double),
74
73
  {
75
- constructor: SFVec3,
76
74
  cross: function (vector)
77
75
  {
78
76
  return new (this .constructor) (Vector3 .cross (this .getValue (), vector .getValue ()));
@@ -92,7 +90,6 @@ function SFVec3Template (TypeName, Type, double)
92
90
  this .getValue () .x = +value;
93
91
  this .addEvent ();
94
92
  },
95
- enumerable: true,
96
93
  };
97
94
 
98
95
  const y = {
@@ -105,7 +102,6 @@ function SFVec3Template (TypeName, Type, double)
105
102
  this .getValue () .y = +value;
106
103
  this .addEvent ();
107
104
  },
108
- enumerable: true,
109
105
  };
110
106
 
111
107
  const z = {
@@ -118,20 +114,17 @@ function SFVec3Template (TypeName, Type, double)
118
114
  this .getValue () .z = +value;
119
115
  this .addEvent ();
120
116
  },
121
- enumerable: true,
122
117
  };
123
118
 
124
- Object .defineProperty (SFVec3 .prototype, "x", x);
125
- Object .defineProperty (SFVec3 .prototype, "y", y);
126
- Object .defineProperty (SFVec3 .prototype, "z", z);
127
-
128
- x .enumerable = false;
129
- y .enumerable = false;
130
- z .enumerable = false;
131
-
132
- Object .defineProperty (SFVec3 .prototype, "0", x);
133
- Object .defineProperty (SFVec3 .prototype, "1", y);
134
- Object .defineProperty (SFVec3 .prototype, "2", z);
119
+ Object .defineProperties (SFVec3 .prototype,
120
+ {
121
+ 0: x,
122
+ 1: y,
123
+ 2: z,
124
+ x: Object .assign ({ enumerable: true }, x),
125
+ y: Object .assign ({ enumerable: true }, y),
126
+ z: Object .assign ({ enumerable: true }, z),
127
+ });
135
128
 
136
129
  return SFVec3;
137
130
  }
@@ -69,11 +69,7 @@ function SFVec4Template (TypeName, Type, double)
69
69
  throw new Error ("Invalid arguments.");
70
70
  }
71
71
 
72
- SFVec4 .prototype = Object .assign (Object .create (X3DField .prototype),
73
- SFVecPrototypeTemplate (TypeName, Type, Vector4, double),
74
- {
75
- constructor: SFVec4,
76
- });
72
+ SFVec4 .prototype = SFVecPrototypeTemplate (SFVec4, TypeName, Type, Vector4, double);
77
73
 
78
74
  for (const key of Reflect .ownKeys (SFVec4 .prototype))
79
75
  Object .defineProperty (SFVec4 .prototype, key, { enumerable: false });
@@ -88,7 +84,6 @@ function SFVec4Template (TypeName, Type, double)
88
84
  this .getValue () .x = +value;
89
85
  this .addEvent ();
90
86
  },
91
- enumerable: true,
92
87
  };
93
88
 
94
89
  const y = {
@@ -101,7 +96,6 @@ function SFVec4Template (TypeName, Type, double)
101
96
  this .getValue () .y = +value;
102
97
  this .addEvent ();
103
98
  },
104
- enumerable: true,
105
99
  };
106
100
 
107
101
  const z = {
@@ -114,7 +108,6 @@ function SFVec4Template (TypeName, Type, double)
114
108
  this .getValue () .z = +value;
115
109
  this .addEvent ();
116
110
  },
117
- enumerable: true,
118
111
  };
119
112
 
120
113
  const w = {
@@ -127,23 +120,19 @@ function SFVec4Template (TypeName, Type, double)
127
120
  this .getValue () .w = +value;
128
121
  this .addEvent ();
129
122
  },
130
- enumerable: true,
131
123
  };
132
124
 
133
- Object .defineProperty (SFVec4 .prototype, "x", x);
134
- Object .defineProperty (SFVec4 .prototype, "y", y);
135
- Object .defineProperty (SFVec4 .prototype, "z", z);
136
- Object .defineProperty (SFVec4 .prototype, "w", w);
137
-
138
- x .enumerable = false;
139
- y .enumerable = false;
140
- z .enumerable = false;
141
- w .enumerable = false;
142
-
143
- Object .defineProperty (SFVec4 .prototype, "0", x);
144
- Object .defineProperty (SFVec4 .prototype, "1", y);
145
- Object .defineProperty (SFVec4 .prototype, "2", z);
146
- Object .defineProperty (SFVec4 .prototype, "3", w);
125
+ Object .defineProperties (SFVec4 .prototype,
126
+ {
127
+ 0: x,
128
+ 1: y,
129
+ 2: z,
130
+ 3: w,
131
+ x: Object .assign ({ enumerable: true }, x),
132
+ y: Object .assign ({ enumerable: true }, y),
133
+ z: Object .assign ({ enumerable: true }, z),
134
+ w: Object .assign ({ enumerable: true }, w),
135
+ });
147
136
 
148
137
  return SFVec4;
149
138
  }
@@ -47,12 +47,13 @@
47
47
 
48
48
  import X3DField from "../Base/X3DField.js";
49
49
 
50
- function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
50
+ function SFVecPrototypeTemplate (Constructor, TypeName, Type, ValueType, double)
51
51
  {
52
52
  const _formatter = double ? "DoubleFormat" : "FloatFormat";
53
53
 
54
54
  return Object .assign (Object .create (X3DField .prototype),
55
55
  {
56
+ constructor: Constructor,
56
57
  [Symbol .iterator]: function* ()
57
58
  {
58
59
  yield* this .getValue ();
@@ -83,11 +84,11 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
83
84
  },
84
85
  abs: function ()
85
86
  {
86
- return new (this .constructor) (ValueType .abs (this .getValue ()));
87
+ return new (this .constructor) (this .getValue () .copy () .abs ());
87
88
  },
88
89
  add: function (vector)
89
90
  {
90
- return new (this .constructor) (ValueType .add (this .getValue (), vector .getValue ()));
91
+ return new (this .constructor) (this .getValue () .copy () .add (vector .getValue ()));
91
92
  },
92
93
  distance: function (vector)
93
94
  {
@@ -95,11 +96,11 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
95
96
  },
96
97
  divide: function (value)
97
98
  {
98
- return new (this .constructor) (ValueType .divide (this .getValue (), value));
99
+ return new (this .constructor) (this .getValue () .copy () .divide (value));
99
100
  },
100
101
  divVec: function (vector)
101
102
  {
102
- return new (this .constructor) (ValueType .divVec (this .getValue (), vector .getValue ()));
103
+ return new (this .constructor) (this .getValue () .copy () .divVec (vector .getValue ()));
103
104
  },
104
105
  dot: function (vector)
105
106
  {
@@ -107,7 +108,7 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
107
108
  },
108
109
  inverse: function ()
109
110
  {
110
- return new (this .constructor) (ValueType .inverse (this .getValue ()));
111
+ return new (this .constructor) (this .getValue () .copy () .inverse ());
111
112
  },
112
113
  length: function ()
113
114
  {
@@ -115,35 +116,35 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
115
116
  },
116
117
  lerp: function (destination, t)
117
118
  {
118
- return new (this .constructor) (ValueType .lerp (this .getValue (), destination, t));
119
+ return new (this .constructor) (this .getValue () .copy () .lerp (destination, t));
119
120
  },
120
121
  max: function (vector)
121
122
  {
122
- return new (this .constructor) (ValueType .max (this .getValue (), vector .getValue ()));
123
+ return new (this .constructor) (this .getValue () .copy () .max (vector .getValue ()));
123
124
  },
124
125
  min: function (vector)
125
126
  {
126
- return new (this .constructor) (ValueType .min (this .getValue (), vector .getValue ()));
127
+ return new (this .constructor) (this .getValue () .copy () .min (vector .getValue ()));
127
128
  },
128
129
  multiply: function (value)
129
130
  {
130
- return new (this .constructor) (ValueType .multiply (this .getValue (), value));
131
+ return new (this .constructor) (this .getValue () .copy () .multiply (value));
131
132
  },
132
133
  multVec: function (vector)
133
134
  {
134
- return new (this .constructor) (ValueType .multVec (this .getValue (), vector .getValue ()));
135
+ return new (this .constructor) (this .getValue () .copy () .multVec (vector .getValue ()));
135
136
  },
136
137
  negate: function ()
137
138
  {
138
- return new (this .constructor) (ValueType .negate (this .getValue ()));
139
+ return new (this .constructor) (this .getValue () .copy () .negate ());
139
140
  },
140
141
  normalize: function (vector)
141
142
  {
142
- return new (this .constructor) (ValueType .normalize (this .getValue ()));
143
+ return new (this .constructor) (this .getValue () .copy () .normalize ());
143
144
  },
144
145
  subtract: function (vector)
145
146
  {
146
- return new (this .constructor) (ValueType .subtract (this .getValue (), vector .getValue ()));
147
+ return new (this .constructor) (this .getValue () .copy () .subtract (vector .getValue ()));
147
148
  },
148
149
  toStream: function (generator)
149
150
  {
@@ -64,13 +64,13 @@ const foreign = {
64
64
 
65
65
  const defaultParameter = new Fields .MFString ();
66
66
 
67
- function FileLoader (node, external)
67
+ function FileLoader (node)
68
68
  {
69
69
  X3DObject .call (this);
70
70
 
71
71
  this .node = node;
72
72
  this .browser = node .getBrowser ();
73
- this .external = external === undefined ? this .browser .isExternal () : external;
73
+ this .external = this .browser .isExternal ();
74
74
  this .executionContext = this .external ? node .getExecutionContext () : this .browser .currentScene;
75
75
  this .target = "";
76
76
  this .url = [ ];
@@ -1177,7 +1177,7 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
1177
1177
  m .scale (new Vector2 (1, -1));
1178
1178
 
1179
1179
  if (g .units === "userSpaceOnUse")
1180
- m .multLeft (Matrix3 .inverse (bbox .matrix));
1180
+ m .multLeft (bbox .matrix .copy () .inverse ());
1181
1181
  else
1182
1182
  m .multLeft (new Matrix3 (2, 0, 0, 0, 2, 0, -1, -1, 1));
1183
1183
 
@@ -2690,7 +2690,7 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
2690
2690
  const
2691
2691
  scene = this .getExecutionContext (),
2692
2692
  texCoordNode = scene .createNode ("TextureCoordinate"),
2693
- invMatrix = Matrix3 .inverse (bbox .matrix);
2693
+ invMatrix = bbox .matrix .copy () .inverse ();
2694
2694
 
2695
2695
  for (const point of coordinateNode .point)
2696
2696
  texCoordNode .point .push (invMatrix .multVecMatrix (new Vector2 (point .x, point .y)) .add (Vector2 .One) .divide (2));
@@ -66,7 +66,7 @@ X3DOptimizer .prototype = {
66
66
  },
67
67
  optimizeNodes: function (nodes, combine, removedNodes)
68
68
  {
69
- return nodes .flatMap (node => this .optimizeNode (node, combine, removedNodes));
69
+ return [... nodes] .flatMap (node => this .optimizeNode (node, combine, removedNodes));
70
70
  },
71
71
  optimizeNode: function (node, combine, removedNodes)
72
72
  {
@@ -331,10 +331,10 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
331
331
  componentSupportLevel = parseInt (xmlElement .getAttribute ("level"));
332
332
 
333
333
  if (componentNameIdCharacters === null)
334
- return console .warn ("XML Parser Error: Bad component statement: Expected name attribute.");
334
+ return console .warn ("XML Parser Error: Bad component statement. Expected name attribute.");
335
335
 
336
336
  if (componentSupportLevel === null)
337
- return console .warn ("XML Parser Error: Bad component statement: Expected level attribute.");
337
+ return console .warn ("XML Parser Error: Bad component statement. Expected level attribute.");
338
338
 
339
339
  var component = this .getBrowser () .getComponent (componentNameIdCharacters, componentSupportLevel);
340
340
 
@@ -353,13 +353,13 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
353
353
  conversionFactor = xmlElement .getAttribute ("conversionFactor"); //works for html5 as well
354
354
 
355
355
  if (category === null)
356
- return console .warn ("XML Parser Error: Bad unit statement: Expected category attribute.");
356
+ return console .warn ("XML Parser Error: Bad unit statement. Expected category attribute.");
357
357
 
358
358
  if (name === null)
359
- return console .warn ("XML Parser Error: Bad unit statement: Expected name attribute.");
359
+ return console .warn ("XML Parser Error: Bad unit statement. Expected name attribute.");
360
360
 
361
361
  if (conversionFactor === null)
362
- return console .warn ("XML Parser Error: Bad unit statement: Expected conversionFactor attribute.");
362
+ return console .warn ("XML Parser Error: Bad unit statement. Expected conversionFactor attribute.");
363
363
 
364
364
  this .getScene () .updateUnit (category, name, parseFloat (conversionFactor));
365
365
  },
@@ -370,10 +370,10 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
370
370
  metavalue = xmlElement .getAttribute ("content");
371
371
 
372
372
  if (metakey === null)
373
- return console .warn ("XML Parser Error: Bad meta statement: Expected name attribute.");
373
+ return console .warn ("XML Parser Error: Bad meta statement. Expected name attribute.");
374
374
 
375
375
  if (metavalue === null)
376
- return console .warn ("XML Parser Error: Bad meta statement: Expected content attribute.");
376
+ return console .warn ("XML Parser Error: Bad meta statement. Expected content attribute.");
377
377
 
378
378
  this .getScene () .addMetaData (metakey, metavalue);
379
379
  },
@@ -450,19 +450,19 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
450
450
  },
451
451
  externProtoDeclareElement: function (xmlElement)
452
452
  {
453
- var name = xmlElement .getAttribute ("name");
453
+ const name = xmlElement .getAttribute ("name");
454
454
 
455
455
  if (this .id (name))
456
456
  {
457
- var url = xmlElement .getAttribute ("url");
457
+ const url = xmlElement .getAttribute ("url");
458
458
 
459
- if (url === null)
460
- return console .warn ("XML Parser Error: Bad ExternProtoDeclare statement: Expected url attribute.");
459
+ this .parser .setInput (url ?? "");
460
+ this .parser .sfstringValues (this .url);
461
461
 
462
- this .parser .setInput (url);
463
- VRMLParser .prototype .sfstringValues .call (this .parser, this .url);
462
+ if (!this .url .length)
463
+ console .warn ("XML Parser Error: Bad ExternProtoDeclare statement. Expected url attribute with value.");
464
464
 
465
- var externproto = new X3DExternProtoDeclaration (this .getExecutionContext (), this .url);
465
+ const externproto = new X3DExternProtoDeclaration (this .getExecutionContext (), this .url);
466
466
 
467
467
  this .pushParent (externproto);
468
468
  this .protoInterfaceElement (xmlElement);
@@ -654,10 +654,10 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
654
654
  protoFieldName = xmlElement .getAttribute ("protoField");
655
655
 
656
656
  if (nodeFieldName === null)
657
- return console .warn ("XML Parser Error: Bad connect statement: Expected nodeField attribute.");
657
+ return console .warn ("XML Parser Error: Bad connect statement. Expected nodeField attribute.");
658
658
 
659
659
  if (protoFieldName === null)
660
- return console .warn ("XML Parser Error: Bad connect statement: Expected protoField attribute.");
660
+ return console .warn ("XML Parser Error: Bad connect statement. Expected protoField attribute.");
661
661
 
662
662
  try
663
663
  {
@@ -687,7 +687,7 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
687
687
  }
688
688
  catch (error)
689
689
  {
690
- console .warn ("XML Parser Error: Couldn't create IS reference: " + error .message);
690
+ console .warn ("XML Parser Error: Couldn't create IS reference. " + error .message);
691
691
  }
692
692
  },
693
693
  protoInstanceElement: function (xmlElement)
@@ -765,7 +765,7 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
765
765
  }
766
766
  catch (error)
767
767
  {
768
- console .warn ("XML Parser Error: Couldn't assign field value: " + error .message);
768
+ console .warn ("XML Parser Error: Couldn't assign field value. " + error .message);
769
769
  }
770
770
  },
771
771
  nodeElement: function (xmlElement)
@@ -45,11 +45,12 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import X3DInfoArray from "../Base/X3DInfoArray.js";
48
+ import X3DInfoArray from "../Base/X3DInfoArray.js";
49
+ import X3DExternProtoDeclaration from "./X3DExternProtoDeclaration.js"
49
50
 
50
51
  function ExternProtoDeclarationArray (values)
51
52
  {
52
- return X3DInfoArray .call (this, values);
53
+ return X3DInfoArray .call (this, values, X3DExternProtoDeclaration);
53
54
  }
54
55
 
55
56
  ExternProtoDeclarationArray .prototype = Object .assign (Object .create (X3DInfoArray .prototype),
@@ -45,11 +45,12 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import X3DInfoArray from "../Base/X3DInfoArray.js";
48
+ import X3DInfoArray from "../Base/X3DInfoArray.js";
49
+ import X3DProtoDeclaration from "./X3DProtoDeclaration.js"
49
50
 
50
- function ProtoDeclarationArray (array)
51
+ function ProtoDeclarationArray (values)
51
52
  {
52
- return X3DInfoArray .call (this, array);
53
+ return X3DInfoArray .call (this, values, X3DProtoDeclaration);
53
54
  }
54
55
 
55
56
  ProtoDeclarationArray .prototype = Object .assign (Object .create (X3DInfoArray .prototype),
@@ -408,34 +408,33 @@ X3DExternProtoDeclaration .prototype = Object .assign (Object .create (X3DProtoD
408
408
  for (const key of Reflect .ownKeys (X3DExternProtoDeclaration .prototype))
409
409
  Object .defineProperty (X3DExternProtoDeclaration .prototype, key, { enumerable: false });
410
410
 
411
- Object .defineProperty (X3DExternProtoDeclaration .prototype, "name",
411
+ Object .defineProperties (X3DExternProtoDeclaration .prototype,
412
412
  {
413
- get: X3DExternProtoDeclaration .prototype .getName,
414
- enumerable: true,
415
- });
416
-
417
- Object .defineProperty (X3DExternProtoDeclaration .prototype, "fields",
418
- {
419
- get: X3DExternProtoDeclaration .prototype .getFieldDefinitions,
420
- enumerable: true,
421
- });
422
-
423
- Object .defineProperty (X3DExternProtoDeclaration .prototype, "isExternProto",
424
- {
425
- value: true,
426
- enumerable: true,
427
- });
428
-
429
- Object .defineProperty (X3DExternProtoDeclaration .prototype, "urls",
430
- {
431
- get: function () { return this ._url; },
432
- enumerable: true,
433
- });
434
-
435
- Object .defineProperty (X3DExternProtoDeclaration .prototype, "loadState",
436
- {
437
- get: X3DExternProtoDeclaration .prototype .checkLoadState,
438
- enumerable: true,
413
+ name:
414
+ {
415
+ get: X3DExternProtoDeclaration .prototype .getName,
416
+ enumerable: true,
417
+ },
418
+ fields:
419
+ {
420
+ get: X3DExternProtoDeclaration .prototype .getFieldDefinitions,
421
+ enumerable: true,
422
+ },
423
+ isExternProto:
424
+ {
425
+ value: true,
426
+ enumerable: true,
427
+ },
428
+ urls:
429
+ {
430
+ get: function () { return this ._url; },
431
+ enumerable: true,
432
+ },
433
+ loadState:
434
+ {
435
+ get: X3DExternProtoDeclaration .prototype .checkLoadState,
436
+ enumerable: true,
437
+ },
439
438
  });
440
439
 
441
440
  export default X3DExternProtoDeclaration;
@@ -542,22 +542,23 @@ X3DProtoDeclaration .prototype = Object .assign (Object .create (X3DProtoDeclara
542
542
  for (const key of Reflect .ownKeys (X3DProtoDeclaration .prototype))
543
543
  Object .defineProperty (X3DProtoDeclaration .prototype, key, { enumerable: false });
544
544
 
545
- Object .defineProperty (X3DProtoDeclaration .prototype, "name",
545
+ Object .defineProperties (X3DProtoDeclaration .prototype,
546
546
  {
547
- get: X3DProtoDeclaration .prototype .getName,
548
- enumerable: true,
549
- });
550
-
551
- Object .defineProperty (X3DProtoDeclaration .prototype, "fields",
552
- {
553
- get: X3DProtoDeclaration .prototype .getFieldDefinitions,
554
- enumerable: true,
555
- });
556
-
557
- Object .defineProperty (X3DProtoDeclaration .prototype, "isExternProto",
558
- {
559
- value: false,
560
- enumerable: true,
547
+ name:
548
+ {
549
+ get: X3DProtoDeclaration .prototype .getName,
550
+ enumerable: true,
551
+ },
552
+ fields:
553
+ {
554
+ get: X3DProtoDeclaration .prototype .getFieldDefinitions,
555
+ enumerable: true,
556
+ },
557
+ isExternProto:
558
+ {
559
+ value: false,
560
+ enumerable: true,
561
+ },
561
562
  });
562
563
 
563
564
  export default X3DProtoDeclaration;
@@ -46,10 +46,11 @@
46
46
  ******************************************************************************/
47
47
 
48
48
  import X3DInfoArray from "../Base/X3DInfoArray.js";
49
+ import X3DRoute from "./X3DRoute.js";
49
50
 
50
- function RouteArray ()
51
+ function RouteArray (values)
51
52
  {
52
- return X3DInfoArray .call (this);
53
+ return X3DInfoArray .call (this, values, X3DRoute);
53
54
  }
54
55
 
55
56
  RouteArray .prototype = Object .assign (Object .create (X3DInfoArray .prototype),