x_ite 8.7.4 → 8.7.6

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 (271) hide show
  1. package/.vscode/tasks.json +1 -1
  2. package/dist/assets/components/Annotation.js +13 -13
  3. package/dist/assets/components/Annotation.min.js +1 -1
  4. package/dist/assets/components/CADGeometry.js +13 -13
  5. package/dist/assets/components/CADGeometry.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturing.js +25 -25
  7. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  8. package/dist/assets/components/DIS.js +13 -13
  9. package/dist/assets/components/DIS.min.js +1 -1
  10. package/dist/assets/components/EventUtilities.js +9 -9
  11. package/dist/assets/components/EventUtilities.min.js +1 -1
  12. package/dist/assets/components/Geometry2D.js +21 -23
  13. package/dist/assets/components/Geometry2D.min.js +1 -1
  14. package/dist/assets/components/Geospatial.js +35 -36
  15. package/dist/assets/components/Geospatial.min.js +1 -1
  16. package/dist/assets/components/HAnim.js +18 -18
  17. package/dist/assets/components/HAnim.min.js +1 -1
  18. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  19. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  20. package/dist/assets/components/Layout.js +37 -32
  21. package/dist/assets/components/Layout.min.js +1 -1
  22. package/dist/assets/components/NURBS.js +24 -24
  23. package/dist/assets/components/NURBS.min.js +1 -1
  24. package/dist/assets/components/ParticleSystems.js +22 -22
  25. package/dist/assets/components/ParticleSystems.min.js +1 -1
  26. package/dist/assets/components/Picking.js +20 -20
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/RigidBodyPhysics.js +25 -25
  29. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  30. package/dist/assets/components/Scripting.js +28 -28
  31. package/dist/assets/components/Scripting.min.js +1 -1
  32. package/dist/assets/components/Text.js +26 -27
  33. package/dist/assets/components/Text.min.js +1 -1
  34. package/dist/assets/components/TextureProjector.js +15 -15
  35. package/dist/assets/components/TextureProjector.min.js +1 -1
  36. package/dist/assets/components/Texturing3D.js +30 -30
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +19 -19
  39. package/dist/assets/components/VolumeRendering.min.js +1 -1
  40. package/dist/assets/components/X_ITE.js +9 -9
  41. package/dist/assets/components/X_ITE.min.js +1 -1
  42. package/dist/x_ite.css +1 -1
  43. package/dist/x_ite.js +1187 -1686
  44. package/dist/x_ite.min.js +1 -1
  45. package/dist/x_ite.zip +0 -0
  46. package/docs/_config.yml +1 -1
  47. package/docs/_includes/scripts.html +0 -1
  48. package/docs/_posts/components/CADGeometry/QuadSet.md +1 -1
  49. package/docs/_posts/components/CubeMapTexturing/ComposedCubeMapTexture.md +1 -1
  50. package/docs/_posts/components/CubeMapTexturing/GeneratedCubeMapTexture.md +1 -1
  51. package/docs/_posts/components/EnvironmentalEffects/Background.md +1 -1
  52. package/docs/_posts/components/EnvironmentalEffects/Fog.md +1 -1
  53. package/docs/_posts/components/EnvironmentalEffects/LocalFog.md +1 -1
  54. package/docs/_posts/components/EnvironmentalEffects/TextureBackground.md +1 -1
  55. package/docs/_posts/components/EnvironmentalSensor/ProximitySensor.md +1 -1
  56. package/docs/_posts/components/EnvironmentalSensor/TransformSensor.md +1 -1
  57. package/docs/_posts/components/EnvironmentalSensor/VisibilitySensor.md +1 -1
  58. package/docs/_posts/components/EventUtilities/IntegerSequencer.md +1 -1
  59. package/docs/_posts/components/Followers/ColorChaser.md +1 -1
  60. package/docs/_posts/components/Followers/ColorDamper.md +1 -1
  61. package/docs/_posts/components/Followers/CoordinateChaser.md +1 -1
  62. package/docs/_posts/components/Followers/ScalarChaser.md +1 -1
  63. package/docs/_posts/components/Geometry2D/Arc2D.md +1 -1
  64. package/docs/_posts/components/Geometry2D/ArcClose2D.md +1 -1
  65. package/docs/_posts/components/Geometry2D/Circle2D.md +1 -1
  66. package/docs/_posts/components/Geometry2D/Disk2D.md +1 -1
  67. package/docs/_posts/components/Geometry2D/Polyline2D.md +1 -1
  68. package/docs/_posts/components/Geometry2D/Polypoint2D.md +1 -1
  69. package/docs/_posts/components/Geometry2D/Rectangle2D.md +1 -1
  70. package/docs/_posts/components/Geometry2D/TriangleSet2D.md +1 -1
  71. package/docs/_posts/components/Geometry3D/Box.md +1 -1
  72. package/docs/_posts/components/Geometry3D/Cone.md +1 -1
  73. package/docs/_posts/components/Geometry3D/Cylinder.md +1 -1
  74. package/docs/_posts/components/Geometry3D/ElevationGrid.md +1 -1
  75. package/docs/_posts/components/Geometry3D/Extrusion.md +1 -1
  76. package/docs/_posts/components/Geometry3D/IndexedFaceSet.md +1 -1
  77. package/docs/_posts/components/Geometry3D/Sphere.md +1 -1
  78. package/docs/_posts/components/Geospatial/GeoElevationGrid.md +1 -1
  79. package/docs/_posts/components/Geospatial/GeoLOD.md +1 -1
  80. package/docs/_posts/components/Geospatial/GeoViewpoint.md +1 -1
  81. package/docs/_posts/components/Grouping/Group.md +1 -1
  82. package/docs/_posts/components/Grouping/Switch.md +1 -1
  83. package/docs/_posts/components/Grouping/Transform.md +1 -1
  84. package/docs/_posts/components/HAnim/HAnimHumanoid.md +1 -1
  85. package/docs/_posts/components/Interpolation/ColorInterpolator.md +1 -1
  86. package/docs/_posts/components/Interpolation/CoordinateInterpolator.md +1 -1
  87. package/docs/_posts/components/Interpolation/OrientationInterpolator.md +1 -1
  88. package/docs/_posts/components/Interpolation/PositionInterpolator.md +1 -1
  89. package/docs/_posts/components/Interpolation/PositionInterpolator2D.md +1 -1
  90. package/docs/_posts/components/Interpolation/ScalarInterpolator.md +1 -1
  91. package/docs/_posts/components/Interpolation/SplineScalarInterpolator.md +1 -1
  92. package/docs/_posts/components/Interpolation/SquadOrientationInterpolator.md +1 -1
  93. package/docs/_posts/components/KeyDeviceSensor/KeySensor.md +1 -1
  94. package/docs/_posts/components/KeyDeviceSensor/StringSensor.md +1 -1
  95. package/docs/_posts/components/Layering/LayerSet.md +1 -1
  96. package/docs/_posts/components/Layering/Viewport.md +1 -1
  97. package/docs/_posts/components/Lighting/DirectionalLight.md +1 -1
  98. package/docs/_posts/components/Lighting/PointLight.md +1 -1
  99. package/docs/_posts/components/Lighting/SpotLight.md +1 -1
  100. package/docs/_posts/components/NURBS/NurbsCurve.md +1 -1
  101. package/docs/_posts/components/NURBS/NurbsPatchSurface.md +1 -1
  102. package/docs/_posts/components/NURBS/NurbsSweptSurface.md +1 -1
  103. package/docs/_posts/components/Navigation/Billboard.md +1 -1
  104. package/docs/_posts/components/Navigation/Collision.md +1 -1
  105. package/docs/_posts/components/Navigation/NavigationInfo.md +1 -1
  106. package/docs/_posts/components/Navigation/OrthoViewpoint.md +1 -1
  107. package/docs/_posts/components/Navigation/Viewpoint.md +1 -1
  108. package/docs/_posts/components/Networking/Anchor.md +1 -1
  109. package/docs/_posts/components/Networking/Inline.md +1 -1
  110. package/docs/_posts/components/Networking/LoadSensor.md +1 -1
  111. package/docs/_posts/components/ParticleSystems/ConeEmitter.md +1 -1
  112. package/docs/_posts/components/ParticleSystems/ExplosionEmitter.md +1 -1
  113. package/docs/_posts/components/ParticleSystems/ForcePhysicsModel.md +1 -1
  114. package/docs/_posts/components/ParticleSystems/ParticleSystem.md +1 -1
  115. package/docs/_posts/components/ParticleSystems/PointEmitter.md +1 -1
  116. package/docs/_posts/components/ParticleSystems/PolylineEmitter.md +1 -1
  117. package/docs/_posts/components/ParticleSystems/SurfaceEmitter.md +1 -1
  118. package/docs/_posts/components/ParticleSystems/VolumeEmitter.md +1 -1
  119. package/docs/_posts/components/ParticleSystems/WindPhysicsModel.md +1 -1
  120. package/docs/_posts/components/Picking/LinePickSensor.md +1 -1
  121. package/docs/_posts/components/Picking/PointPickSensor.md +1 -1
  122. package/docs/_posts/components/Picking/PrimitivePickSensor.md +1 -1
  123. package/docs/_posts/components/PointingDeviceSensor/CylinderSensor.md +1 -1
  124. package/docs/_posts/components/PointingDeviceSensor/PlaneSensor.md +1 -1
  125. package/docs/_posts/components/Rendering/ClipPlane.md +1 -1
  126. package/docs/_posts/components/Rendering/Color.md +1 -1
  127. package/docs/_posts/components/Rendering/ColorRGBA.md +1 -1
  128. package/docs/_posts/components/Rendering/Coordinate.md +1 -1
  129. package/docs/_posts/components/Rendering/IndexedLineSet.md +1 -1
  130. package/docs/_posts/components/Rendering/IndexedTriangleFanSet.md +1 -1
  131. package/docs/_posts/components/Rendering/IndexedTriangleSet.md +1 -1
  132. package/docs/_posts/components/Rendering/LineSet.md +1 -1
  133. package/docs/_posts/components/Rendering/PointSet.md +1 -1
  134. package/docs/_posts/components/RigidBodyPhysics/BallJoint.md +1 -1
  135. package/docs/_posts/components/RigidBodyPhysics/CollidableShape.md +1 -1
  136. package/docs/_posts/components/RigidBodyPhysics/CollisionCollection.md +1 -1
  137. package/docs/_posts/components/RigidBodyPhysics/RigidBody.md +1 -1
  138. package/docs/_posts/components/RigidBodyPhysics/RigidBodyCollection.md +1 -1
  139. package/docs/_posts/components/RigidBodyPhysics/SingleAxisHingeJoint.md +1 -1
  140. package/docs/_posts/components/RigidBodyPhysics/SliderJoint.md +1 -1
  141. package/docs/_posts/components/Shaders/ComposedShader.md +1 -1
  142. package/docs/_posts/components/Shaders/FloatVertexAttribute.md +1 -1
  143. package/docs/_posts/components/Shaders/ShaderPart.md +1 -1
  144. package/docs/_posts/components/Shape/Appearance.md +1 -1
  145. package/docs/_posts/components/Shape/FillProperties.md +1 -1
  146. package/docs/_posts/components/Shape/LineProperties.md +1 -1
  147. package/docs/_posts/components/Shape/Material.md +1 -1
  148. package/docs/_posts/components/Shape/TwoSidedMaterial.md +1 -1
  149. package/docs/_posts/components/Sound/AudioClip.md +1 -1
  150. package/docs/_posts/components/Text/FontStyle.md +1 -1
  151. package/docs/_posts/components/Text/Text.md +1 -1
  152. package/docs/_posts/components/Texturing/ImageTexture.md +1 -1
  153. package/docs/_posts/components/Texturing/MovieTexture.md +1 -1
  154. package/docs/_posts/components/Texturing/MultiTexture.md +1 -1
  155. package/docs/_posts/components/Texturing/PixelTexture.md +1 -1
  156. package/docs/_posts/components/Texturing3D/ImageTexture3D.md +1 -1
  157. package/docs/_posts/components/Texturing3D/ImageTextureAtlas.md +1 -1
  158. package/docs/_posts/components/Time/TimeSensor.md +1 -1
  159. package/docs/_posts/components/VolumeRendering/EdgeEnhancementVolumeStyle.md +1 -1
  160. package/docs/_posts/components/VolumeRendering/IsoSurfaceVolumeData.md +1 -1
  161. package/docs/_posts/components/VolumeRendering/SegmentedVolumeData.md +1 -1
  162. package/docs/_posts/components/VolumeRendering/ShadedVolumeStyle.md +1 -1
  163. package/docs/_posts/components/VolumeRendering/ToneMappedVolumeStyle.md +1 -1
  164. package/docs/_posts/components/VolumeRendering/VolumeData.md +1 -1
  165. package/docs/_posts/components/X_ITE/BlendMode.md +1 -1
  166. package/docs/_posts/custom-shaders.md +1 -1
  167. package/docs/_posts/getting-started.md +7 -2
  168. package/docs/_posts/reference/browser-services.md +6 -0
  169. package/docs/_posts/reference/field-services-and-objects.md +26 -6
  170. package/docs/_posts/tutorials/adding-backgrounds.md +2 -2
  171. package/docs/_posts/tutorials/adding-sound.md +1 -1
  172. package/docs/_posts/tutorials/building-a-x3d-world.md +1 -1
  173. package/docs/_posts/tutorials/building-elevation-grids.md +1 -1
  174. package/docs/_posts/tutorials/building-primitive-shapes.md +2 -2
  175. package/docs/_posts/tutorials/controlling-appearance-with-materials.md +1 -1
  176. package/docs/_posts/tutorials/controlling-detail.md +1 -1
  177. package/docs/_posts/tutorials/hello-world.md +1 -1
  178. package/docs/_posts/tutorials/naming-nodes.md +1 -1
  179. package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +1 -1
  180. package/package.json +3 -3
  181. package/src/lib/jquery.js +13 -0
  182. package/src/standard/Geospatial/UniversalTransverseMercator.js +0 -1
  183. package/src/standard/Math/Algorithms/eigen_decomposition.js +9 -9
  184. package/src/standard/Math/Geometry/Box2.js +37 -24
  185. package/src/standard/Math/Geometry/Box3.js +37 -24
  186. package/src/standard/Math/Geometry/Cylinder3.js +1 -1
  187. package/src/standard/Math/Geometry/Line2.js +1 -1
  188. package/src/standard/Math/Geometry/Line3.js +1 -1
  189. package/src/standard/Math/Geometry/Plane3.js +1 -1
  190. package/src/standard/Math/Geometry/Sphere3.js +14 -14
  191. package/src/standard/Math/Numbers/Color3.js +10 -18
  192. package/src/standard/Math/Numbers/Color4.js +12 -23
  193. package/src/standard/Math/Numbers/Complex.js +59 -58
  194. package/src/standard/Math/Numbers/Matrix2.js +31 -45
  195. package/src/standard/Math/Numbers/Matrix3.js +59 -94
  196. package/src/standard/Math/Numbers/Matrix4.js +73 -114
  197. package/src/standard/Math/Numbers/Quaternion.js +70 -132
  198. package/src/standard/Math/Numbers/Rotation4.js +15 -42
  199. package/src/standard/Math/Numbers/Vector2.js +12 -78
  200. package/src/standard/Math/Numbers/Vector3.js +17 -94
  201. package/src/standard/Math/Numbers/Vector4.js +22 -94
  202. package/src/x_ite/Base/X3DInfoArray.js +9 -7
  203. package/src/x_ite/Base/X3DObject.js +9 -32
  204. package/src/x_ite/Base/X3DObjectArrayField.js +35 -64
  205. package/src/x_ite/Browser/Core/BrowserOptions.js +37 -0
  206. package/src/x_ite/Browser/Core/X3DCoreContext.js +21 -3
  207. package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +4 -4
  208. package/src/x_ite/Browser/Interpolation/SquatInterpolator.js +12 -7
  209. package/src/x_ite/Browser/Layout/ScreenText.js +9 -4
  210. package/src/x_ite/Browser/Navigation/ExamineViewer.js +9 -9
  211. package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -3
  212. package/src/x_ite/Browser/Navigation/WalkViewer.js +2 -2
  213. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +7 -7
  214. package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
  215. package/src/x_ite/Browser/Shaders/X3DShadersContext.js +0 -1
  216. package/src/x_ite/Browser/Text/X3DTextGeometry.js +2 -3
  217. package/src/x_ite/Browser/VERSION.js +1 -1
  218. package/src/x_ite/Browser/X3DBrowser.js +61 -68
  219. package/src/x_ite/Browser/X3DBrowserContext.js +8 -8
  220. package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +1 -1
  221. package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +1 -1
  222. package/src/x_ite/Components/Followers/OrientationChaser.js +3 -3
  223. package/src/x_ite/Components/Followers/OrientationDamper.js +3 -3
  224. package/src/x_ite/Components/Geometry2D/Rectangle2D.js +2 -3
  225. package/src/x_ite/Components/Geometry3D/Box.js +3 -10
  226. package/src/x_ite/Components/Geometry3D/Cone.js +1 -1
  227. package/src/x_ite/Components/Geometry3D/Cylinder.js +2 -2
  228. package/src/x_ite/Components/Geometry3D/Extrusion.js +3 -3
  229. package/src/x_ite/Components/Geospatial/GeoViewpoint.js +2 -2
  230. package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +2 -2
  231. package/src/x_ite/Components/Layering/X3DLayerNode.js +1 -1
  232. package/src/x_ite/Components/Layout/Layout.js +1 -1
  233. package/src/x_ite/Components/Navigation/Billboard.js +1 -1
  234. package/src/x_ite/Components/Navigation/X3DViewpointNode.js +12 -13
  235. package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
  236. package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +7 -7
  237. package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +1 -1
  238. package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +9 -9
  239. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +1 -1
  240. package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +2 -2
  241. package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +1 -1
  242. package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +1 -1
  243. package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +3 -3
  244. package/src/x_ite/Components/TextureProjector/X3DTextureProjectorNode.js +1 -1
  245. package/src/x_ite/Execution/X3DExecutionContext.js +52 -58
  246. package/src/x_ite/Execution/X3DExportedNode.js +13 -11
  247. package/src/x_ite/Execution/X3DImportedNode.js +25 -25
  248. package/src/x_ite/Execution/X3DScene.js +129 -53
  249. package/src/x_ite/Fields/ArrayFields.js +1 -1
  250. package/src/x_ite/Fields/SFColor.js +10 -15
  251. package/src/x_ite/Fields/SFColorRGBA.js +11 -18
  252. package/src/x_ite/Fields/SFImage.js +38 -33
  253. package/src/x_ite/Fields/SFMatrix3.js +1 -3
  254. package/src/x_ite/Fields/SFMatrix4.js +1 -5
  255. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +6 -5
  256. package/src/x_ite/Fields/SFNodeCache.js +2 -2
  257. package/src/x_ite/Fields/SFRotation.js +14 -21
  258. package/src/x_ite/Fields/SFString.js +0 -1
  259. package/src/x_ite/Fields/SFVec2.js +8 -15
  260. package/src/x_ite/Fields/SFVec3.js +11 -18
  261. package/src/x_ite/Fields/SFVec4.js +12 -23
  262. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +17 -16
  263. package/src/x_ite/Parser/SVGParser.js +3 -3
  264. package/src/x_ite/Parser/X3DOptimizer.js +1 -1
  265. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +26 -27
  266. package/src/x_ite/Prototype/X3DProtoDeclaration.js +16 -15
  267. package/src/x_ite/Rendering/X3DRenderObject.js +3 -3
  268. package/src/x_ite/Routing/X3DRoute.js +26 -25
  269. package/src/x_ite/X3DCanvasElement.js +1 -0
  270. package/docs/assets/js/autoupdate.js +0 -25
  271. package/src/x_ite/Execution/Scene.js +0 -145
@@ -54,7 +54,6 @@ function Vector2 (x, y)
54
54
  Vector2 .prototype =
55
55
  {
56
56
  constructor: Vector2,
57
- length: 2,
58
57
  [Symbol .iterator]: function* ()
59
58
  {
60
59
  yield this .x;
@@ -214,20 +213,19 @@ Vector2 .prototype =
214
213
  }
215
214
  };
216
215
 
217
- Object .defineProperty (Vector2 .prototype, "0",
216
+ Object .defineProperties (Vector2 .prototype,
218
217
  {
219
- get: function () { return this .x; },
220
- set: function (value) { this .x = value; },
221
- enumerable: false,
222
- configurable: false
223
- });
224
-
225
- Object .defineProperty (Vector2 .prototype, "1",
226
- {
227
- get: function () { return this .y; },
228
- set: function (value) { this .y = value; },
229
- enumerable: false,
230
- configurable: false
218
+ length: { value: 2 },
219
+ 0:
220
+ {
221
+ get: function () { return this .x; },
222
+ set: function (value) { this .x = value; },
223
+ },
224
+ 1:
225
+ {
226
+ get: function () { return this .y; },
227
+ set: function (value) { this .y = value; },
228
+ },
231
229
  });
232
230
 
233
231
  Object .assign (Vector2,
@@ -236,70 +234,6 @@ Object .assign (Vector2,
236
234
  One: new Vector2 (1, 1),
237
235
  xAxis: new Vector2 (1, 0),
238
236
  yAxis: new Vector2 (0, 1),
239
- negate: function (vector)
240
- {
241
- return vector .copy () .negate ();
242
- },
243
- inverse: function (vector)
244
- {
245
- return vector .copy () .inverse ();
246
- },
247
- add: function (lhs, rhs)
248
- {
249
- return lhs .copy () .add (rhs);
250
- },
251
- subtract: function (lhs, rhs)
252
- {
253
- return lhs .copy () .subtract (rhs);
254
- },
255
- multiply: function (lhs, rhs)
256
- {
257
- return lhs .copy () .multiply (rhs);
258
- },
259
- multVec: function (lhs, rhs)
260
- {
261
- return lhs .copy () .multVec (rhs);
262
- },
263
- divide: function (lhs, rhs)
264
- {
265
- return lhs .copy () .divide (rhs);
266
- },
267
- divVec: function (lhs, rhs)
268
- {
269
- return lhs .copy () .divVec (rhs);
270
- },
271
- normalize: function (vector)
272
- {
273
- return vector .copy () .normalize ();
274
- },
275
- dot: function (lhs, rhs)
276
- {
277
- return lhs .dot (rhs);
278
- },
279
- magnitude: function (vector)
280
- {
281
- return vector .magnitude ();
282
- },
283
- distance: function (lhs, rhs)
284
- {
285
- return lhs .distance (rhs);
286
- },
287
- lerp: function (source, destination, t)
288
- {
289
- return source .copy () .lerp (destination, t);
290
- },
291
- abs: function (vector)
292
- {
293
- return vector .copy () .abs ();
294
- },
295
- min: function (lhs, rhs)
296
- {
297
- return this .prototype .min .apply (lhs .copy (), arguments);
298
- },
299
- max: function (lhs, rhs)
300
- {
301
- return this .prototype .max .apply (lhs .copy (), arguments);
302
- },
303
237
  });
304
238
 
305
239
  export default Vector2;
@@ -57,7 +57,6 @@ function Vector3 (x, y, z)
57
57
  Vector3 .prototype =
58
58
  {
59
59
  constructor: Vector3,
60
- length: 3,
61
60
  [Symbol .iterator]: function* ()
62
61
  {
63
62
  yield this .x;
@@ -262,28 +261,24 @@ Vector3 .prototype =
262
261
  }
263
262
  };
264
263
 
265
- Object .defineProperty (Vector3 .prototype, "0",
264
+ Object .defineProperties (Vector3 .prototype,
266
265
  {
267
- get: function () { return this .x; },
268
- set: function (value) { this .x = value; },
269
- enumerable: false,
270
- configurable: false
271
- });
272
-
273
- Object .defineProperty (Vector3 .prototype, "1",
274
- {
275
- get: function () { return this .y; },
276
- set: function (value) { this .y = value; },
277
- enumerable: false,
278
- configurable: false
279
- });
280
-
281
- Object .defineProperty (Vector3 .prototype, "2",
282
- {
283
- get: function () { return this .z; },
284
- set: function (value) { this .z = value; },
285
- enumerable: false,
286
- configurable: false
266
+ length: { value: 3 },
267
+ 0:
268
+ {
269
+ get: function () { return this .x; },
270
+ set: function (value) { this .x = value; },
271
+ },
272
+ 1:
273
+ {
274
+ get: function () { return this .y; },
275
+ set: function (value) { this .y = value; },
276
+ },
277
+ 2:
278
+ {
279
+ get: function () { return this .z; },
280
+ set: function (value) { this .z = value; },
281
+ },
287
282
  });
288
283
 
289
284
  Object .assign (Vector3,
@@ -293,78 +288,6 @@ Object .assign (Vector3,
293
288
  xAxis: new Vector3 (1, 0, 0),
294
289
  yAxis: new Vector3 (0, 1, 0),
295
290
  zAxis: new Vector3 (0, 0, 1),
296
- negate: function (vector)
297
- {
298
- return vector .copy () .negate ();
299
- },
300
- inverse: function (vector)
301
- {
302
- return vector .copy () .inverse ();
303
- },
304
- add: function (lhs, rhs)
305
- {
306
- return lhs .copy () .add (rhs);
307
- },
308
- subtract: function (lhs, rhs)
309
- {
310
- return lhs .copy () .subtract (rhs);
311
- },
312
- multiply: function (lhs, rhs)
313
- {
314
- return lhs .copy () .multiply (rhs);
315
- },
316
- multVec: function (lhs, rhs)
317
- {
318
- return lhs .copy () .multVec (rhs);
319
- },
320
- divide: function (lhs, rhs)
321
- {
322
- return lhs .copy () .divide (rhs);
323
- },
324
- divVec: function (lhs, rhs)
325
- {
326
- return lhs .copy () .divVec (rhs);
327
- },
328
- cross: function (lhs, rhs)
329
- {
330
- return lhs .copy () .cross (rhs);
331
- },
332
- normalize: function (vector)
333
- {
334
- return vector .copy () .normalize ();
335
- },
336
- dot: function (lhs, rhs)
337
- {
338
- return lhs .dot (rhs);
339
- },
340
- magnitude: function (vector)
341
- {
342
- return vector .magnitude ();
343
- },
344
- distance: function (lhs, rhs)
345
- {
346
- return lhs .distance (rhs);
347
- },
348
- lerp: function (source, destination, t)
349
- {
350
- return source .copy () .lerp (destination, t);
351
- },
352
- slerp: function (source, destination, t)
353
- {
354
- return source .copy () .slerp (destination, t);
355
- },
356
- abs: function (vector)
357
- {
358
- return vector .copy () .abs ();
359
- },
360
- min: function (lhs, rhs)
361
- {
362
- return this .prototype .min .apply (lhs .copy (), arguments);
363
- },
364
- max: function (lhs, rhs)
365
- {
366
- return this .prototype .max .apply (lhs .copy (), arguments);
367
- },
368
291
  });
369
292
 
370
293
  export default Vector3;
@@ -56,7 +56,6 @@ function Vector4 (x, y, z, w)
56
56
  Vector4 .prototype =
57
57
  {
58
58
  constructor: Vector4,
59
- length: 4,
60
59
  [Symbol .iterator]: function* ()
61
60
  {
62
61
  yield this .x;
@@ -271,36 +270,29 @@ Vector4 .prototype =
271
270
  },
272
271
  };
273
272
 
274
- Object .defineProperty (Vector4 .prototype, "0",
273
+ Object .defineProperties (Vector4 .prototype,
275
274
  {
276
- get: function () { return this .x; },
277
- set: function (value) { this .x = value; },
278
- enumerable: false,
279
- configurable: false
280
- });
281
-
282
- Object .defineProperty (Vector4 .prototype, "1",
283
- {
284
- get: function () { return this .y; },
285
- set: function (value) { this .y = value; },
286
- enumerable: false,
287
- configurable: false
288
- });
289
-
290
- Object .defineProperty (Vector4 .prototype, "2",
291
- {
292
- get: function () { return this .z; },
293
- set: function (value) { this .z = value; },
294
- enumerable: false,
295
- configurable: false
296
- });
297
-
298
- Object .defineProperty (Vector4 .prototype, "3",
299
- {
300
- get: function () { return this .w; },
301
- set: function (value) { this .w = value; },
302
- enumerable: false,
303
- configurable: false
275
+ length: { value: 4 },
276
+ 0:
277
+ {
278
+ get: function () { return this .x; },
279
+ set: function (value) { this .x = value; },
280
+ },
281
+ 1:
282
+ {
283
+ get: function () { return this .y; },
284
+ set: function (value) { this .y = value; },
285
+ },
286
+ 2:
287
+ {
288
+ get: function () { return this .z; },
289
+ set: function (value) { this .z = value; },
290
+ },
291
+ 3:
292
+ {
293
+ get: function () { return this .w; },
294
+ set: function (value) { this .w = value; },
295
+ },
304
296
  });
305
297
 
306
298
  Object .assign (Vector4,
@@ -311,70 +303,6 @@ Object .assign (Vector4,
311
303
  yAxis: new Vector4 (0, 1, 0, 0),
312
304
  zAxis: new Vector4 (0, 0, 1, 0),
313
305
  wAxis: new Vector4 (0, 0, 0, 1),
314
- negate: function (vector)
315
- {
316
- return vector .copy () .negate ();
317
- },
318
- inverse: function (vector)
319
- {
320
- return vector .copy () .inverse ();
321
- },
322
- add: function (lhs, rhs)
323
- {
324
- return lhs .copy () .add (rhs);
325
- },
326
- subtract: function (lhs, rhs)
327
- {
328
- return lhs .copy () .subtract (rhs);
329
- },
330
- multiply: function (lhs, rhs)
331
- {
332
- return lhs .copy () .multiply (rhs);
333
- },
334
- multVec: function (lhs, rhs)
335
- {
336
- return lhs .copy () .multVec (rhs);
337
- },
338
- divide: function (lhs, rhs)
339
- {
340
- return lhs .copy () .divide (rhs);
341
- },
342
- divVec: function (lhs, rhs)
343
- {
344
- return lhs .copy () .divVec (rhs);
345
- },
346
- normalize: function (vector)
347
- {
348
- return vector .copy () .normalize ();
349
- },
350
- dot: function (lhs, rhs)
351
- {
352
- return lhs .dot (rhs);
353
- },
354
- magnitude: function (vector)
355
- {
356
- return vector .magnitude ();
357
- },
358
- distance: function (lhs, rhs)
359
- {
360
- return lhs .distance (rhs);
361
- },
362
- lerp: function (source, destination, t)
363
- {
364
- return source .copy () .lerp (destination, t);
365
- },
366
- abs: function (vector)
367
- {
368
- return vector .copy () .abs ();
369
- },
370
- min: function (lhs, rhs)
371
- {
372
- return this .prototype .min .apply (lhs .copy (), arguments);
373
- },
374
- max: function (lhs, rhs)
375
- {
376
- return this .prototype .max .apply (lhs .copy (), arguments);
377
- },
378
306
  });
379
307
 
380
308
  export default Vector4;
@@ -356,14 +356,16 @@ X3DInfoArray .prototype = {
356
356
  for (const key of Reflect .ownKeys (X3DInfoArray .prototype))
357
357
  Object .defineProperty (X3DInfoArray .prototype, key, { enumerable: false });
358
358
 
359
- Object .defineProperty (X3DInfoArray .prototype, "length",
359
+ Object .defineProperties (X3DInfoArray .prototype,
360
360
  {
361
- get: function () { return this [_array] .length; },
362
- });
363
-
364
- Object .defineProperty (X3DInfoArray .prototype, Symbol .toStringTag,
365
- {
366
- get: function () { return this .getTypeName (); },
361
+ length:
362
+ {
363
+ get: function () { return this [_array] .length; },
364
+ },
365
+ [Symbol .toStringTag]:
366
+ {
367
+ get: function () { return this .getTypeName (); },
368
+ },
367
369
  });
368
370
 
369
371
  export default X3DInfoArray;
@@ -83,16 +83,9 @@ X3DObject .prototype =
83
83
  {
84
84
  return this [_name];
85
85
  },
86
- getInterestId: function (callbackName, object)
87
- {
88
- if (typeof callbackName === "symbol")
89
- return X3DObject .getId (object) + ".Symbol(" + SymbolId (callbackName) + ")";
90
-
91
- return X3DObject .getId (object) + "." + String (callbackName);
92
- },
93
86
  hasInterest: function (callbackName, object)
94
87
  {
95
- return this [_interests] .has (this .getInterestId (callbackName, object));
88
+ return this [_interests] .has (X3DObject .getInterestId (callbackName, object));
96
89
  },
97
90
  addInterest: function (callbackName, object, ... args)
98
91
  {
@@ -103,14 +96,14 @@ X3DObject .prototype =
103
96
  }
104
97
 
105
98
  const
106
- interestId = this .getInterestId (callbackName, object),
99
+ interestId = X3DObject .getInterestId (callbackName, object),
107
100
  callback = object [callbackName];
108
101
 
109
102
  this [_interests] .set (interestId, callback .bind (object, ... args, this));
110
103
  },
111
104
  removeInterest: function (callbackName, object)
112
105
  {
113
- this [_interests] .delete (this .getInterestId (callbackName, object));
106
+ this [_interests] .delete (X3DObject .getInterestId (callbackName, object));
114
107
  },
115
108
  getInterests: function ()
116
109
  {
@@ -185,7 +178,7 @@ X3DObject .prototype =
185
178
  },
186
179
  toStream: function (generator)
187
180
  {
188
- generator .string = "[object " + this .getTypeName () + "]";
181
+ generator .string = `[object ${this .getTypeName ()}]`;
189
182
  },
190
183
  dispose: function ()
191
184
  {
@@ -208,7 +201,7 @@ Object .assign (X3DObject,
208
201
  {
209
202
  const map = new WeakMap ();
210
203
 
211
- let counter = 0;
204
+ let counter = 0; // In the future we can use a bigint here (0n).
212
205
 
213
206
  return function (object)
214
207
  {
@@ -222,26 +215,10 @@ Object .assign (X3DObject,
222
215
  return counter;
223
216
  };
224
217
  })(),
225
- });
226
-
227
- // In the future we can use getId, because WeakMap will accept Symbols as key.
228
- const SymbolId = (function ()
229
- {
230
- const map = new Map ();
231
-
232
- let counter = 0;
233
-
234
- return function (object)
218
+ getInterestId: function (callbackName, object)
235
219
  {
236
- const id = map .get (object);
237
-
238
- if (id !== undefined)
239
- return id;
240
-
241
- map .set (object, ++ counter);
242
-
243
- return counter;
244
- };
245
- })();
220
+ return `${this .getId (object)}.${this .getId (object [callbackName])}`;
221
+ },
222
+ });
246
223
 
247
224
  export default X3DObject;
@@ -50,8 +50,7 @@ import X3DArrayField from "./X3DArrayField.js";
50
50
 
51
51
  const
52
52
  _target = Symbol (),
53
- _proxy = Symbol (),
54
- _find = Symbol ();
53
+ _proxy = Symbol ();
55
54
 
56
55
  const handler =
57
56
  {
@@ -193,6 +192,10 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
193
192
 
194
193
  return true;
195
194
  },
195
+ isDefaultValue: function ()
196
+ {
197
+ return this .length === 0;
198
+ },
196
199
  set: function (value)
197
200
  {
198
201
  const target = this [_target];
@@ -204,10 +207,6 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
204
207
  for (let i = 0, length = value .length; i < length; ++ i)
205
208
  array [i] .set (value [i] instanceof X3DField ? value [i] .getValue () : value [i]);
206
209
  },
207
- isDefaultValue: function ()
208
- {
209
- return this .length === 0;
210
- },
211
210
  setValue: function (value)
212
211
  {
213
212
  const target = this [_target];
@@ -242,10 +241,14 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
242
241
 
243
242
  if (array .length)
244
243
  {
245
- const field = array .shift ();
244
+ const
245
+ field = array .shift (),
246
+ result = field .valueOf ();
247
+
246
248
  target .removeChildObject (field);
247
249
  target .addEvent ();
248
- return field .valueOf ();
250
+
251
+ return result;
249
252
  }
250
253
  },
251
254
  push: function (value)
@@ -275,10 +278,14 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
275
278
 
276
279
  if (array .length)
277
280
  {
278
- const field = array .pop ();
281
+ const
282
+ field = array .pop (),
283
+ result = field .valueOf ();
284
+
279
285
  target .removeChildObject (field);
280
286
  target .addEvent ();
281
- return field .valueOf ();
287
+
288
+ return result;
282
289
  }
283
290
  },
284
291
  splice: function (index, deleteCount, ... insertValues)
@@ -319,53 +326,28 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
319
326
 
320
327
  target .addEvent ();
321
328
  },
322
- [_find]: function (first, last, value)
323
- {
324
- const
325
- target = this [_target],
326
- values = target .getValue ();
327
-
328
- if (typeof value === "function")
329
- {
330
- for (let i = first; i < last; ++ i)
331
- {
332
- if (value (values [i] .valueOf ()))
333
- return i;
334
- }
335
-
336
- return last;
337
- }
338
-
339
- for (let i = first; i < last; ++ i)
340
- {
341
- if (values [i] .equals (value))
342
- return i;
343
- }
344
-
345
- return last;
346
- },
347
329
  remove: function (first, last, value)
348
330
  {
349
331
  const
350
332
  target = this [_target],
351
- values = target .getValue ();
333
+ array = target .getValue ();
352
334
 
353
335
  if (typeof value === "function")
354
336
  {
355
- first = target [_find] (first, last, value);
337
+ first = array .findIndex ((current, index) => index >= first && value (current .valueOf ()))
356
338
 
357
- if (first !== last)
339
+ if (first !== -1)
358
340
  {
359
341
  for (let i = first; ++ i < last; )
360
342
  {
361
- const current = values [i];
343
+ const current = array [i];
362
344
 
363
345
  if (!value (current .valueOf ()))
364
346
  {
365
- const tmp = values [first];
347
+ const tmp = array [first];
366
348
 
367
- values [first ++] = current;
368
- values [i] = tmp;
349
+ array [first ++] = current;
350
+ array [i] = tmp;
369
351
  }
370
352
  }
371
353
  }
@@ -376,25 +358,25 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
376
358
  return first;
377
359
  }
378
360
 
379
- first = target [_find] (first, last, value);
361
+ first = array .findIndex ((current, index) => index >= first && current .equals (value))
380
362
 
381
- if (first !== last)
363
+ if (first !== -1)
382
364
  {
383
365
  for (let i = first; ++ i < last; )
384
366
  {
385
- const current = values [i];
367
+ const current = array [i];
386
368
 
387
369
  if (!current .equals (value))
388
370
  {
389
- const tmp = values [first];
371
+ const tmp = array [first];
390
372
 
391
- values [first ++] = current;
392
- values [i] = tmp;
373
+ array [first ++] = current;
374
+ array [i] = tmp;
393
375
  }
394
376
  }
395
377
  }
396
378
 
397
- if (first !== last)
379
+ if (first !== -1)
398
380
  target .addEvent ();
399
381
 
400
382
  return first;
@@ -403,14 +385,15 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
403
385
  {
404
386
  const
405
387
  target = this [_target],
406
- values = target .getValue () .splice (first, last - first);
388
+ values = target .getValue () .splice (first, last - first),
389
+ result = new (target .constructor) (values);
407
390
 
408
391
  for (const value of values)
409
392
  target .removeChildObject (value);
410
393
 
411
394
  target .addEvent ();
412
395
 
413
- return new (target .constructor) (values);
396
+ return result;
414
397
  },
415
398
  resize: function (size, value, silently)
416
399
  {
@@ -453,6 +436,7 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
453
436
  removeChildObject: function (value)
454
437
  {
455
438
  value .removeParent (this [_proxy]);
439
+ value .dispose ();
456
440
  },
457
441
  reverse: function ()
458
442
  {
@@ -597,19 +581,6 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
597
581
  generator .string += ']';
598
582
  }
599
583
  },
600
- dispose: function ()
601
- {
602
- const
603
- target = this [_target],
604
- array = target .getValue ();
605
-
606
- for (const value of array)
607
- target .removeChildObject (value);
608
-
609
- array .length = 0;
610
-
611
- X3DArrayField .prototype .dispose .call (target);
612
- },
613
584
  });
614
585
 
615
586
  for (const key of Reflect .ownKeys (X3DObjectArrayField .prototype))