x_ite 8.10.1 → 8.11.1

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 (137) hide show
  1. package/Makefile +3 -0
  2. package/build/bin/version.pl +28 -20
  3. package/build/docs/glTF-samples.pl +151 -0
  4. package/build/docs/nodes.pl +1 -1
  5. package/build/src/nodes.pl +41 -0
  6. package/dist/assets/components/Annotation.js +13 -13
  7. package/dist/assets/components/Annotation.min.js +1 -1
  8. package/dist/assets/components/CADGeometry.js +13 -13
  9. package/dist/assets/components/CADGeometry.min.js +1 -1
  10. package/dist/assets/components/CubeMapTexturing.js +30 -26
  11. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  12. package/dist/assets/components/DIS.js +14 -14
  13. package/dist/assets/components/DIS.min.js +1 -1
  14. package/dist/assets/components/EventUtilities.js +9 -9
  15. package/dist/assets/components/EventUtilities.min.js +1 -1
  16. package/dist/assets/components/Geometry2D.js +19 -19
  17. package/dist/assets/components/Geometry2D.min.js +1 -1
  18. package/dist/assets/components/Geospatial.js +33 -33
  19. package/dist/assets/components/Geospatial.min.js +1 -1
  20. package/dist/assets/components/HAnim.js +394 -30
  21. package/dist/assets/components/HAnim.min.js +1 -1
  22. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  23. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  24. package/dist/assets/components/Layout.js +26 -26
  25. package/dist/assets/components/Layout.min.js +1 -1
  26. package/dist/assets/components/NURBS.js +24 -24
  27. package/dist/assets/components/NURBS.min.js +1 -1
  28. package/dist/assets/components/ParticleSystems.js +73 -74
  29. package/dist/assets/components/ParticleSystems.min.js +1 -1
  30. package/dist/assets/components/Picking.js +18 -18
  31. package/dist/assets/components/Picking.min.js +1 -1
  32. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  33. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  34. package/dist/assets/components/Scripting.js +37 -37
  35. package/dist/assets/components/Scripting.min.js +1 -1
  36. package/dist/assets/components/Text.js +55 -63
  37. package/dist/assets/components/Text.min.js +1 -1
  38. package/dist/assets/components/TextureProjector.js +14 -14
  39. package/dist/assets/components/TextureProjector.min.js +1 -1
  40. package/dist/assets/components/Texturing3D.js +35 -31
  41. package/dist/assets/components/Texturing3D.min.js +1 -1
  42. package/dist/assets/components/VolumeRendering.js +20 -20
  43. package/dist/assets/components/VolumeRendering.min.js +1 -1
  44. package/dist/assets/components/X_ITE.js +9 -9
  45. package/dist/assets/components/X_ITE.min.js +1 -1
  46. package/dist/x_ite.css +1 -1
  47. package/dist/x_ite.js +1456 -844
  48. package/dist/x_ite.min.js +1 -1
  49. package/dist/x_ite.zip +0 -0
  50. package/docs/_config.yml +2 -2
  51. package/docs/_posts/components/Core/MetadataBoolean.md +6 -4
  52. package/docs/_posts/components/Core/MetadataDouble.md +6 -4
  53. package/docs/_posts/components/Core/MetadataFloat.md +6 -4
  54. package/docs/_posts/components/Core/MetadataInteger.md +6 -4
  55. package/docs/_posts/components/Core/MetadataSet.md +6 -4
  56. package/docs/_posts/components/Core/MetadataString.md +6 -4
  57. package/docs/_posts/components/DIS/DISEntityTypeMapping.md +1 -1
  58. package/docs/_posts/components/HAnim/HAnimMotion.md +48 -48
  59. package/docs/_posts/components/RigidBodyPhysics/Contact.md +1 -1
  60. package/docs/_posts/getting-started.md +45 -35
  61. package/docs/_posts/reference/browser-services.md +6 -0
  62. package/docs/_tabs/playground.html +215 -15
  63. package/docs/assets/css/style.scss +35 -2
  64. package/docs/assets/js/example.js +95 -3
  65. package/docs/laboratory/gltf-sample-viewer.html +603 -235
  66. package/package.json +2 -2
  67. package/src/assets/shaders/Types.glsl.js +4 -0
  68. package/src/assets/shaders/webgl1/include/Hatch.glsl.js +2 -3
  69. package/src/assets/shaders/webgl2/Compose.fs.js +29 -0
  70. package/src/assets/shaders/webgl2/Compose.vs.js +14 -0
  71. package/src/assets/shaders/webgl2/include/Fragment.glsl.js +24 -2
  72. package/src/assets/shaders/webgl2/include/Hatch.glsl.js +2 -3
  73. package/src/assets/shaders/webgl2/include/Stipple.glsl.js +5 -3
  74. package/src/bookmarks.js +92 -5
  75. package/src/examples.js +1 -0
  76. package/src/standard/Math/Numbers/Quaternion.js +191 -13
  77. package/src/standard/Math/Numbers/Rotation4.js +23 -0
  78. package/src/standard/Time/{MicroTime.js → Time.js} +21 -28
  79. package/src/x_ite/Base/X3DChildObject.js +5 -4
  80. package/src/x_ite/Browser/Core/BrowserOptions.js +71 -60
  81. package/src/x_ite/Browser/Core/Context.js +2 -2
  82. package/src/x_ite/Browser/Core/X3DCoreContext.js +6 -0
  83. package/src/x_ite/Browser/DOMIntegration.js +0 -17
  84. package/src/x_ite/Browser/Navigation/ExamineViewer.js +5 -4
  85. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +7 -4
  86. package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +20 -15
  87. package/src/x_ite/Browser/Shaders/Shaders.js +19 -15
  88. package/src/x_ite/Browser/Text/X3DTextContext.js +16 -16
  89. package/src/x_ite/Browser/Time/X3DTimeContext.js +3 -2
  90. package/src/x_ite/Browser/VERSION.js +1 -1
  91. package/src/x_ite/Browser/VolumeRendering/VolumeMaterial.js +2 -2
  92. package/src/x_ite/Browser/X3DBrowser.js +1 -2
  93. package/src/x_ite/Browser/X3DBrowserContext.js +0 -5
  94. package/src/x_ite/Components/Core/MetadataBoolean.js +8 -1
  95. package/src/x_ite/Components/Core/MetadataDouble.js +8 -1
  96. package/src/x_ite/Components/Core/MetadataFloat.js +8 -1
  97. package/src/x_ite/Components/Core/MetadataInteger.js +8 -1
  98. package/src/x_ite/Components/Core/MetadataSet.js +8 -1
  99. package/src/x_ite/Components/Core/MetadataString.js +8 -1
  100. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +9 -6
  101. package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +2 -1
  102. package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +1 -1
  103. package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +5 -1
  104. package/src/x_ite/Components/Grouping/X3DGroupingNode.js +2 -0
  105. package/src/x_ite/Components/HAnim/HAnimHumanoid.js +34 -2
  106. package/src/x_ite/Components/HAnim/HAnimMotion.js +331 -15
  107. package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -3
  108. package/src/x_ite/Components/Lighting/PointLight.js +1 -3
  109. package/src/x_ite/Components/Lighting/SpotLight.js +1 -3
  110. package/src/x_ite/Components/Networking/X3DUrlObject.js +5 -4
  111. package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +47 -51
  112. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +4 -2
  113. package/src/x_ite/Components/RigidBodyPhysics/Contact.js +1 -1
  114. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1 -1
  115. package/src/x_ite/Components/Shape/FillProperties.js +4 -0
  116. package/src/x_ite/Components/Shape/LineProperties.js +4 -0
  117. package/src/x_ite/Components/Shape/PointProperties.js +4 -0
  118. package/src/x_ite/Components/Shape/X3DMaterialNode.js +44 -20
  119. package/src/x_ite/Components/Sound/AudioClip.js +2 -1
  120. package/src/x_ite/Components/Text/X3DFontStyleNode.js +13 -23
  121. package/src/x_ite/Components/Texturing/ImageTexture.js +2 -1
  122. package/src/x_ite/Components/Texturing/MovieTexture.js +2 -1
  123. package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +2 -1
  124. package/src/x_ite/Components/Time/TimeSensor.js +25 -24
  125. package/src/x_ite/Components/Time/X3DTimeDependentNode.js +5 -4
  126. package/src/x_ite/Execution/BindableList.js +3 -3
  127. package/src/x_ite/Execution/X3DScene.js +2 -0
  128. package/src/x_ite/Parser/XMLParser.js +12 -2
  129. package/src/x_ite/Rendering/MultiSampleFrameBuffer.js +264 -26
  130. package/src/x_ite/Rendering/PointingBuffer.js +5 -7
  131. package/src/x_ite/Rendering/TextureBuffer.js +6 -14
  132. package/src/x_ite/Rendering/X3DRenderObject.js +28 -28
  133. package/src/x_ite/X3D.js +0 -1
  134. package/src/x_ite/X3DCanvasElement.js +2 -0
  135. package/src/x_ite.html +23 -24
  136. package/x_ite.min.html +23 -24
  137. /package/build/{bin → docs}/tags.pl +0 -0
@@ -1,4 +1,4 @@
1
- /* X_ITE v8.10.1 */(() => { // webpackBootstrap
1
+ /* X_ITE v8.11.1 */(() => { // webpackBootstrap
2
2
  /******/ "use strict";
3
3
  /******/ // The require scope
4
4
  /******/ var __webpack_require__ = {};
@@ -39,25 +39,25 @@ var __webpack_exports__ = {};
39
39
  // UNUSED EXPORTS: default
40
40
 
41
41
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
42
- const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components");
42
+ const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components");
43
43
  var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
44
44
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
45
- const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Fields");
45
+ const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Fields");
46
46
  var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
47
47
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
48
- const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/X3DFieldDefinition");
48
+ const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Base/X3DFieldDefinition");
49
49
  var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
50
50
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
51
- const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/FieldDefinitionArray");
51
+ const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Base/FieldDefinitionArray");
52
52
  var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
53
53
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/X3DGeometricPropertyNode\")"
54
- const X3DGeometricPropertyNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Rendering/X3DGeometricPropertyNode");
54
+ const X3DGeometricPropertyNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Rendering/X3DGeometricPropertyNode");
55
55
  var X3DGeometricPropertyNode_default = /*#__PURE__*/__webpack_require__.n(X3DGeometricPropertyNode_namespaceObject);
56
56
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
57
- const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/X3DConstants");
57
+ const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Base/X3DConstants");
58
58
  var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
59
59
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
60
- const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Namespace");
60
+ const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Namespace");
61
61
  var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
62
62
  ;// CONCATENATED MODULE: ./src/x_ite/Components/HAnim/HAnimDisplacer.js
63
63
  /*******************************************************************************
@@ -166,25 +166,25 @@ const __default__ = HAnimDisplacer;
166
166
  Namespace_default().set ("x_ite/Components/HAnim/HAnimDisplacer", __default__);
167
167
  /* harmony default export */ const HAnim_HAnimDisplacer = (__default__);
168
168
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DChildNode\")"
169
- const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Core/X3DChildNode");
169
+ const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Core/X3DChildNode");
170
170
  var X3DChildNode_default = /*#__PURE__*/__webpack_require__.n(X3DChildNode_namespaceObject);
171
171
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Grouping/Group\")"
172
- const Group_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Grouping/Group");
172
+ const Group_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Grouping/Group");
173
173
  var Group_default = /*#__PURE__*/__webpack_require__.n(Group_namespaceObject);
174
174
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Grouping/Transform\")"
175
- const Transform_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Grouping/Transform");
175
+ const Transform_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Grouping/Transform");
176
176
  var Transform_default = /*#__PURE__*/__webpack_require__.n(Transform_namespaceObject);
177
177
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Grouping/X3DBoundedObject\")"
178
- const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Grouping/X3DBoundedObject");
178
+ const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Grouping/X3DBoundedObject");
179
179
  var X3DBoundedObject_default = /*#__PURE__*/__webpack_require__.n(X3DBoundedObject_namespaceObject);
180
180
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/TraverseType\")"
181
- const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Rendering/TraverseType");
181
+ const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Rendering/TraverseType");
182
182
  var TraverseType_default = /*#__PURE__*/__webpack_require__.n(TraverseType_namespaceObject);
183
183
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
184
- const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/X3DCast");
184
+ const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Base/X3DCast");
185
185
  var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
186
186
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix4\")"
187
- const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("standard/Math/Numbers/Matrix4");
187
+ const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("standard/Math/Numbers/Matrix4");
188
188
  var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
189
189
  ;// CONCATENATED MODULE: ./src/x_ite/Components/HAnim/HAnimHumanoid.js
190
190
  /*******************************************************************************
@@ -266,6 +266,7 @@ function HAnimHumanoid (executionContext)
266
266
  this .viewpointsNode = new (Group_default()) (executionContext);
267
267
  this .skinNode = new (Group_default()) (executionContext);
268
268
  this .transformNode = new (Transform_default()) (executionContext);
269
+ this .motionNodes = [ ];
269
270
  this .jointNodes = [ ];
270
271
  this .jointBindingMatrices = [ ];
271
272
  this .displacementWeights = [ ];
@@ -373,15 +374,18 @@ Object .assign (Object .setPrototypeOf (HAnimHumanoid .prototype, (X3DChildNode_
373
374
 
374
375
  // Events
375
376
 
376
- this ._joints .addInterest ("set_joints__", this);
377
+ this ._motionsEnabled .addInterest ("set_motions__", this);
378
+ this ._motions .addInterest ("set_motions__", this);
377
379
  this ._jointBindingPositions .addInterest ("set_joints__", this);
378
380
  this ._jointBindingRotations .addInterest ("set_joints__", this);
379
381
  this ._jointBindingScales .addInterest ("set_joints__", this);
382
+ this ._joints .addInterest ("set_joints__", this);
380
383
  this ._jointTextures .addInterest ("set_jointTextures__", this);
381
384
  this ._displacementsTexture .addInterest ("set_displacementsTexture__", this);
382
385
  this ._displacementWeightsTexture .addInterest ("set_displacementWeightsTexture__", this);
383
386
  this ._skinCoord .addInterest ("set_skinCoord__", this);
384
387
 
388
+ this .set_motions__ ();
385
389
  this .set_joints__ ();
386
390
  this .set_skinCoord__ ();
387
391
  },
@@ -393,6 +397,31 @@ Object .assign (Object .setPrototypeOf (HAnimHumanoid .prototype, (X3DChildNode_
393
397
  {
394
398
  return this .transformNode .getMatrix ();
395
399
  },
400
+ set_motions__ ()
401
+ {
402
+ const
403
+ motionsEnabled = this ._motionsEnabled,
404
+ motionNodes = this .motionNodes;
405
+
406
+ for (const motionNode of motionNodes)
407
+ motionNode .setJoints ([ ]);
408
+
409
+ motionNodes .length = 0;
410
+
411
+ for (const [i, node] of this ._motions .entries ())
412
+ {
413
+ if (i < motionsEnabled .length && !motionsEnabled [i])
414
+ continue;
415
+
416
+ const motionNode = X3DCast_default() ((X3DConstants_default()).HAnimMotion, node);
417
+
418
+ if (motionNode)
419
+ motionNodes .push (motionNode);
420
+ }
421
+
422
+ for (const motionNode of motionNodes)
423
+ motionNode .setJoints (this .jointNodes);
424
+ },
396
425
  set_joints__ ()
397
426
  {
398
427
  const
@@ -452,6 +481,9 @@ Object .assign (Object .setPrototypeOf (HAnimHumanoid .prototype, (X3DChildNode_
452
481
  this ._jointTextures .addEvent ();
453
482
  this ._displacementsTexture .addEvent ();
454
483
  this ._displacementWeightsTexture .addEvent ();
484
+
485
+ for (const motionNode of this .motionNodes)
486
+ motionNode .setJoints (jointNodes);
455
487
  },
456
488
  set_jointTextures__ ()
457
489
  {
@@ -515,7 +547,7 @@ Object .assign (Object .setPrototypeOf (HAnimHumanoid .prototype, (X3DChildNode_
515
547
  const d = displacerNode ._displacements;
516
548
 
517
549
  for (const [i, index] of displacerNode ._coordIndex .entries ())
518
- displacements [index] ?.push (... d [i]);
550
+ displacements [index] ?.push (... d [i], j);
519
551
  }
520
552
  }
521
553
 
@@ -800,10 +832,11 @@ const HAnimHumanoid_default_ = HAnimHumanoid;
800
832
  Namespace_default().set ("x_ite/Components/HAnim/HAnimHumanoid", HAnimHumanoid_default_);
801
833
  /* harmony default export */ const HAnim_HAnimHumanoid = (HAnimHumanoid_default_);
802
834
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Grouping/X3DTransformNode\")"
803
- const X3DTransformNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Grouping/X3DTransformNode");
835
+ const X3DTransformNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Grouping/X3DTransformNode");
804
836
  var X3DTransformNode_default = /*#__PURE__*/__webpack_require__.n(X3DTransformNode_namespaceObject);
805
837
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
806
- const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("standard/Math/Numbers/Vector3");
838
+ const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("standard/Math/Numbers/Vector3");
839
+ var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
807
840
  ;// CONCATENATED MODULE: ./src/x_ite/Components/HAnim/HAnimJoint.js
808
841
  /*******************************************************************************
809
842
  *
@@ -1007,6 +1040,21 @@ const HAnimJoint_default_ = HAnimJoint;
1007
1040
 
1008
1041
  Namespace_default().set ("x_ite/Components/HAnim/HAnimJoint", HAnimJoint_default_);
1009
1042
  /* harmony default export */ const HAnim_HAnimJoint = (HAnimJoint_default_);
1043
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Time/TimeSensor\")"
1044
+ const TimeSensor_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Time/TimeSensor");
1045
+ var TimeSensor_default = /*#__PURE__*/__webpack_require__.n(TimeSensor_namespaceObject);
1046
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Interpolation/PositionInterpolator\")"
1047
+ const PositionInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Interpolation/PositionInterpolator");
1048
+ var PositionInterpolator_default = /*#__PURE__*/__webpack_require__.n(PositionInterpolator_namespaceObject);
1049
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Interpolation/OrientationInterpolator\")"
1050
+ const OrientationInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Interpolation/OrientationInterpolator");
1051
+ var OrientationInterpolator_default = /*#__PURE__*/__webpack_require__.n(OrientationInterpolator_namespaceObject);
1052
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Rotation4\")"
1053
+ const Rotation4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("standard/Math/Numbers/Rotation4");
1054
+ var Rotation4_default = /*#__PURE__*/__webpack_require__.n(Rotation4_namespaceObject);
1055
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithm\")"
1056
+ const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("standard/Math/Algorithm");
1057
+ var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceObject);
1010
1058
  ;// CONCATENATED MODULE: ./src/x_ite/Components/HAnim/HAnimMotion.js
1011
1059
  /*******************************************************************************
1012
1060
  *
@@ -1061,11 +1109,21 @@ Namespace_default().set ("x_ite/Components/HAnim/HAnimJoint", HAnimJoint_default
1061
1109
 
1062
1110
 
1063
1111
 
1112
+
1113
+
1114
+
1115
+
1116
+
1117
+
1064
1118
  function HAnimMotion (executionContext)
1065
1119
  {
1066
1120
  X3DChildNode_default().call (this, executionContext);
1067
1121
 
1068
1122
  this .addType ((X3DConstants_default()).HAnimMotion);
1123
+
1124
+ this .timeSensor = new (TimeSensor_default()) (this .getExecutionContext ());
1125
+ this .interpolators = [ ];
1126
+ this .jointsIndex = new Map ();
1069
1127
  }
1070
1128
 
1071
1129
  Object .assign (Object .setPrototypeOf (HAnimMotion .prototype, (X3DChildNode_default()).prototype),
@@ -1073,6 +1131,312 @@ Object .assign (Object .setPrototypeOf (HAnimMotion .prototype, (X3DChildNode_de
1073
1131
  initialize ()
1074
1132
  {
1075
1133
  X3DChildNode_default().prototype .initialize .call (this);
1134
+
1135
+ this ._loop .addFieldInterest (this .timeSensor ._loop);
1136
+
1137
+ this .timeSensor ._cycleTime .addFieldInterest (this ._cycleTime);
1138
+ this .timeSensor ._elapsedTime .addFieldInterest (this ._elapsedTime);
1139
+
1140
+ this .timeSensor ._enabled = false;
1141
+ this .timeSensor ._loop = this ._loop;
1142
+ this .timeSensor ._stopTime = 1;
1143
+
1144
+ this .timeSensor .setup ();
1145
+
1146
+ this ._enabled .addInterest ("set_enabled__", this);
1147
+ this ._joints .addInterest ("set_connectInterpolators__", this);
1148
+ this ._channelsEnabled .addInterest ("set_connectInterpolators__", this);
1149
+ this ._channels .addInterest ("set_interpolators__", this);
1150
+ this ._values .addInterest ("set_interpolators__", this);
1151
+ this ._next .addInterest ("set_next_or_previous__", this, 1);
1152
+ this ._previous .addInterest ("set_next_or_previous__", this, -1);
1153
+ this ._frameIndex .addInterest ("set_frameIndex__", this);
1154
+ this ._frameDuration .addInterest ("set_frameDuration__", this);
1155
+ this ._frameIncrement .addInterest ("set_timeSensor_enabled__", this);
1156
+ this ._startFrame .addInterest ("set_start_or_endFrame__", this);
1157
+ this ._endFrame .addInterest ("set_start_or_endFrame__", this);
1158
+
1159
+ this .set_enabled__ ();
1160
+ this .set_interpolators__ ();
1161
+ },
1162
+ setJoints (jointNodes)
1163
+ {
1164
+ // Create joints index.
1165
+
1166
+ const jointsIndex = this .jointsIndex;
1167
+
1168
+ jointsIndex .clear ();
1169
+
1170
+ for (const jointNode of jointNodes)
1171
+ jointsIndex .set (jointNode ._name .getValue () .trim (), jointNode);
1172
+
1173
+ jointsIndex .delete ("IGNORED");
1174
+
1175
+ // Connect joint nodes.
1176
+
1177
+ this .set_timeSensor_enabled__ ();
1178
+ this .set_enabled__ ();
1179
+ this .set_connectInterpolators__ ();
1180
+ },
1181
+ set_timeSensor_enabled__ ()
1182
+ {
1183
+ this .timeSensor ._enabled = this .jointsIndex .size && this ._frameIncrement .getValue ();
1184
+ },
1185
+ set_enabled__ ()
1186
+ {
1187
+ if (this ._enabled .getValue ())
1188
+ this .timeSensor ._startTime = Time .now () / 1000;
1189
+ else
1190
+ this .timeSensor ._stopTime = Time .now () / 1000;
1191
+ },
1192
+ set_interpolators__ ()
1193
+ {
1194
+ // Disconnect old interpolators.
1195
+
1196
+ const timeSensor = this .timeSensor;
1197
+
1198
+ for (const field of timeSensor ._fraction_changed .getFieldInterests ())
1199
+ timeSensor ._fraction_changed .removeFieldInterest (field);
1200
+
1201
+ // Create interpolators.
1202
+
1203
+ const channels = this ._channels .getValue ()
1204
+ .replace (/^[\s,\d]+|[\s,\d]+$/sg, "")
1205
+ .split (/[\s,]+\d+[\s,]+/s)
1206
+ .map (string => string .split (/[\s,]+/s));
1207
+
1208
+ const
1209
+ values = this ._values,
1210
+ numChannels = channels .reduce ((v, c) => v + c .length, 0),
1211
+ frameCount = Math .floor (numChannels ? values .length / numChannels : 0),
1212
+ types = new Map (),
1213
+ interpolators = Array .from ({length: channels .length}, () => ({ }));
1214
+
1215
+ this .interpolators = interpolators;
1216
+
1217
+ for (let frame = 0, v = 0; frame < frameCount; ++ frame)
1218
+ {
1219
+ for (const [j, joint] of channels .entries ())
1220
+ {
1221
+ types .clear ();
1222
+
1223
+ for (const channel of joint)
1224
+ types .set (channel, values [v ++]);
1225
+
1226
+ if (types .has ("Xposition") || types .has ("Yposition") || types .has ("Zposition"))
1227
+ {
1228
+ const interpolator = interpolators [j] .positionInterpolator
1229
+ ?? this .createPositionInterpolator (interpolators, j);
1230
+
1231
+ const
1232
+ key = frame / (frameCount - 1),
1233
+ keyValue = new (Vector3_default()) (types .get ("Xposition") ?? 0,
1234
+ types .get ("Yposition") ?? 0,
1235
+ types .get ("Zposition") ?? 0);
1236
+
1237
+ interpolator ._key .push (key);
1238
+ interpolator ._keyValue .push (keyValue);
1239
+ }
1240
+
1241
+ if (types .has ("Xrotation") || types .has ("Yrotation") || types .has ("Zrotation"))
1242
+ {
1243
+ const interpolator = interpolators [j] .orientationInterpolator
1244
+ ?? this .createOrientationInterpolator (interpolators, j);
1245
+
1246
+ const
1247
+ key = frame / (frameCount - 1),
1248
+ keyValue = Rotation4_default().fromEuler (Algorithm_default().radians (types .get ("Xrotation") ?? 0),
1249
+ Algorithm_default().radians (types .get ("Yrotation") ?? 0),
1250
+ Algorithm_default().radians (types .get ("Zrotation") ?? 0));
1251
+
1252
+ interpolator ._key .push (key);
1253
+ interpolator ._keyValue .push (keyValue);
1254
+ }
1255
+
1256
+ if (types .has ("Xscale") || types .has ("Yscale") || types .has ("Zscale"))
1257
+ {
1258
+ const interpolator = interpolators [j] .scaleInterpolator
1259
+ ?? this .createScaleInterpolator (interpolators, j);
1260
+
1261
+ const
1262
+ key = frame / (frameCount - 1),
1263
+ keyValue = new (Vector3_default()) (types .get ("Xscale") ?? 1,
1264
+ types .get ("Yscale") ?? 1,
1265
+ types .get ("Zscale") ?? 1);
1266
+
1267
+ interpolator ._key .push (key);
1268
+ interpolator ._keyValue .push (keyValue);
1269
+ }
1270
+ }
1271
+ }
1272
+
1273
+ for (const { positionInterpolator, orientationInterpolator, scaleInterpolator } of interpolators)
1274
+ {
1275
+ positionInterpolator ?.setup ();
1276
+ orientationInterpolator ?.setup ();
1277
+ scaleInterpolator ?.setup ();
1278
+ }
1279
+
1280
+ this ._frameIndex = 0;
1281
+ this ._startFrame = 0;
1282
+ this ._endFrame = frameCount - 1;
1283
+ this ._frameCount = frameCount;
1284
+
1285
+ this .set_connectInterpolators__ ();
1286
+ this .set_frameDuration__ ();
1287
+ },
1288
+ set_connectInterpolators__ ()
1289
+ {
1290
+ const
1291
+ timeSensor = this .timeSensor,
1292
+ channelsEnabled = this ._channelsEnabled,
1293
+ joints = this ._joints .getValue () .replace (/^[\s,]+|[\s,]+$/sg, "") .split (/[\s,]+/s),
1294
+ jointsIndex = this .jointsIndex;
1295
+
1296
+ // Disconnect old joint nodes.
1297
+
1298
+ for (const { positionInterpolator, orientationInterpolator, scaleInterpolator } of this .interpolators)
1299
+ {
1300
+ if (positionInterpolator)
1301
+ {
1302
+ for (const field of positionInterpolator ._value_changed .getFieldInterests ())
1303
+ positionInterpolator ._value_changed .removeFieldInterest (field);
1304
+ }
1305
+
1306
+ if (orientationInterpolator)
1307
+ {
1308
+ for (const field of orientationInterpolator ._value_changed .getFieldInterests ())
1309
+ orientationInterpolator ._value_changed .removeFieldInterest (field);
1310
+ }
1311
+
1312
+ if (scaleInterpolator)
1313
+ {
1314
+ for (const field of scaleInterpolator ._value_changed .getFieldInterests ())
1315
+ scaleInterpolator ._value_changed .removeFieldInterest (field);
1316
+ }
1317
+ }
1318
+
1319
+ // Connect interpolators.
1320
+
1321
+ if (!jointsIndex .size)
1322
+ return;
1323
+
1324
+ for (const [j, { positionInterpolator, orientationInterpolator, scaleInterpolator }] of this .interpolators .entries ())
1325
+ {
1326
+ if (j < channelsEnabled .length && !channelsEnabled [j])
1327
+ continue;
1328
+
1329
+ if (j >= joints .length)
1330
+ continue;
1331
+
1332
+ const jointNode = jointsIndex .get (joints [j])
1333
+ ?? (positionInterpolator && jointsIndex .get ("humanoid_root"));
1334
+
1335
+ if (!jointNode)
1336
+ continue;
1337
+
1338
+ if (positionInterpolator)
1339
+ {
1340
+ timeSensor ._fraction_changed .addFieldInterest (positionInterpolator ._set_fraction);
1341
+ positionInterpolator ._value_changed .addFieldInterest (jointNode ._translation);
1342
+ }
1343
+
1344
+ if (orientationInterpolator)
1345
+ {
1346
+ timeSensor ._fraction_changed .addFieldInterest (orientationInterpolator ._set_fraction);
1347
+ orientationInterpolator ._value_changed .addFieldInterest (jointNode ._rotation);
1348
+ }
1349
+
1350
+ if (scaleInterpolator)
1351
+ {
1352
+ timeSensor ._fraction_changed .addFieldInterest (scaleInterpolator ._set_fraction);
1353
+ scaleInterpolator ._value_changed .addFieldInterest (jointNode ._scale);
1354
+ }
1355
+ }
1356
+ },
1357
+ set_next_or_previous__ (direction, field)
1358
+ {
1359
+ if (!field .getValue ())
1360
+ return;
1361
+
1362
+ const
1363
+ fraction = this .getFraction (),
1364
+ frameCount = this ._frameCount .getValue (),
1365
+ frameIncrement = this ._frameIncrement .getValue (),
1366
+ frameIndex = (frameCount > 1 ? Math .floor (fraction * (frameCount - 1)) : 0) + frameIncrement * direction;
1367
+
1368
+ if (frameIndex > this .endFrame)
1369
+ {
1370
+ if (!this ._loop .getValue ())
1371
+ return;
1372
+
1373
+ this ._frameIndex = this .startFrame;
1374
+ }
1375
+ else if (frameIndex < this .startFrame)
1376
+ {
1377
+ if (!this ._loop .getValue ())
1378
+ return;
1379
+
1380
+ this ._frameIndex = this .endFrame;
1381
+ }
1382
+ else
1383
+ {
1384
+ this ._frameIndex = frameIndex;
1385
+ }
1386
+ },
1387
+ set_frameIndex__ ()
1388
+ {
1389
+ const
1390
+ frameCount = this ._frameCount .getValue (),
1391
+ frameIndex = Algorithm_default().clamp (this ._frameIndex .getValue (), 0, frameCount),
1392
+ fraction = frameCount > 1 ? frameIndex / (frameCount - 1) : 0;
1393
+
1394
+ this .timeSensor ._range [0] = fraction;
1395
+
1396
+ if (this .timeSensor ._isActive .getValue ())
1397
+ return;
1398
+
1399
+ for (const field of this .timeSensor ._fraction_changed .getFieldInterests ())
1400
+ field .setValue (fraction);
1401
+ },
1402
+ set_frameDuration__ ()
1403
+ {
1404
+ const
1405
+ frameCount = this ._frameCount .getValue (),
1406
+ frameDuration = Math .max (this ._frameDuration .getValue (), 0);
1407
+
1408
+ this .timeSensor ._cycleInterval = frameCount > 1 ? (frameCount - 1) * frameDuration : 0;
1409
+ },
1410
+ set_start_or_endFrame__ ()
1411
+ {
1412
+ const
1413
+ frameCount = this ._frameCount .getValue (),
1414
+ startFrame = Algorithm_default().clamp (this ._startFrame .getValue (), 0, frameCount),
1415
+ endFrame = Algorithm_default().clamp (this ._endFrame .getValue (), 0, frameCount);
1416
+
1417
+ this .startFrame = Math .min (startFrame, endFrame);
1418
+ this .endFrame = Math .max (startFrame, endFrame);
1419
+ this .timeSensor ._range [1] = frameCount > 1 ? this .startFrame / (frameCount - 1) : 0;
1420
+ this .timeSensor ._range [2] = frameCount > 1 ? this .endFrame / (frameCount - 1) : 0;
1421
+ },
1422
+ createPositionInterpolator (interpolators, j)
1423
+ {
1424
+ return interpolators [j] .positionInterpolator = new (PositionInterpolator_default()) (this .getExecutionContext ());
1425
+ },
1426
+ createOrientationInterpolator (interpolators, j)
1427
+ {
1428
+ return interpolators [j] .orientationInterpolator = new (OrientationInterpolator_default()) (this .getExecutionContext ());
1429
+ },
1430
+ createScaleInterpolator (interpolators, j)
1431
+ {
1432
+ return interpolators [j] .scaleInterpolator = new (PositionInterpolator_default()) (this .getExecutionContext ());
1433
+ },
1434
+ getFraction ()
1435
+ {
1436
+ for (const field of this .timeSensor ._fraction_changed .getFieldInterests ())
1437
+ return field .getValue ();
1438
+
1439
+ return 0;
1076
1440
  },
1077
1441
  });
1078
1442
 
@@ -1090,7 +1454,7 @@ Object .defineProperties (HAnimMotion,
1090
1454
  },
1091
1455
  containerField:
1092
1456
  {
1093
- value: "children",
1457
+ value: "motions",
1094
1458
  enumerable: true,
1095
1459
  },
1096
1460
  specificationRange:
@@ -1104,19 +1468,19 @@ Object .defineProperties (HAnimMotion,
1104
1468
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1105
1469
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "description", new (Fields_default()).SFString ()),
1106
1470
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "enabled", new (Fields_default()).SFBool (true)),
1471
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "loa", new (Fields_default()).SFInt32 (-1)),
1472
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "joints", new (Fields_default()).SFString ()),
1473
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "channelsEnabled", new (Fields_default()).MFBool ()),
1474
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "channels", new (Fields_default()).SFString ()),
1475
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "values", new (Fields_default()).MFFloat ()),
1476
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "loop", new (Fields_default()).SFBool ()),
1107
1477
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOnly, "next", new (Fields_default()).SFBool ()),
1108
1478
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOnly, "previous", new (Fields_default()).SFBool ()),
1109
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "startFrame", new (Fields_default()).SFInt32 ()),
1110
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "endFrame", new (Fields_default()).SFInt32 ()),
1479
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "frameIndex", new (Fields_default()).SFInt32 (0)),
1111
1480
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "frameDuration", new (Fields_default()).SFTime (0.1)),
1112
1481
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "frameIncrement", new (Fields_default()).SFInt32 (1)),
1113
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "frameIndex", new (Fields_default()).SFInt32 (0)),
1114
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "loop", new (Fields_default()).SFBool ()),
1115
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "channelsEnabled", new (Fields_default()).MFBool ()),
1116
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "channels", new (Fields_default()).SFString ()),
1117
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "joints", new (Fields_default()).SFString ()),
1118
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "loa", new (Fields_default()).SFInt32 (-1)),
1119
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "values", new (Fields_default()).MFFloat ()),
1482
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "startFrame", new (Fields_default()).SFInt32 ()),
1483
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "endFrame", new (Fields_default()).SFInt32 ()),
1120
1484
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).outputOnly, "cycleTime", new (Fields_default()).SFTime ()),
1121
1485
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).outputOnly, "elapsedTime", new (Fields_default()).SFTime ()),
1122
1486
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).outputOnly, "frameCount", new (Fields_default()).SFInt32 ()),
@@ -1131,7 +1495,7 @@ const HAnimMotion_default_ = HAnimMotion;
1131
1495
  Namespace_default().set ("x_ite/Components/HAnim/HAnimMotion", HAnimMotion_default_);
1132
1496
  /* harmony default export */ const HAnim_HAnimMotion = (HAnimMotion_default_);
1133
1497
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Grouping/X3DGroupingNode\")"
1134
- const X3DGroupingNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Grouping/X3DGroupingNode");
1498
+ const X3DGroupingNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.1")] .require ("x_ite/Components/Grouping/X3DGroupingNode");
1135
1499
  var X3DGroupingNode_default = /*#__PURE__*/__webpack_require__.n(X3DGroupingNode_namespaceObject);
1136
1500
  ;// CONCATENATED MODULE: ./src/x_ite/Components/HAnim/HAnimSegment.js
1137
1501
  /*******************************************************************************