x_ite 4.7.5 → 4.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/.vscode/launch.json +15 -0
  2. package/.vscode/settings.json +2 -5
  3. package/Makefile +1 -0
  4. package/README.md +1 -1
  5. package/build/components/annotation.build.js +2 -2
  6. package/build/components/cad-geometry.build.js +2 -2
  7. package/build/components/cube-map-texturing.build.js +2 -2
  8. package/build/components/dis.build.js +2 -2
  9. package/build/components/event-utilities.build.js +2 -2
  10. package/build/components/geometry2d.build.js +2 -2
  11. package/build/components/geospatial.build.js +2 -2
  12. package/build/components/h-anim.build.js +2 -2
  13. package/build/components/key-device-sensor.build.js +2 -2
  14. package/build/components/layout.build.js +2 -2
  15. package/build/components/nurbs.build.js +2 -2
  16. package/build/components/particle-systems.build.js +2 -2
  17. package/build/components/picking.build.js +2 -2
  18. package/build/components/projective-texture-mapping.build.js +2 -2
  19. package/build/components/rigid-body-physics.build.js +2 -2
  20. package/build/components/scripting.build.js +2 -2
  21. package/build/components/texturing-3d.build.js +2 -2
  22. package/build/components/volume-rendering.build.js +2 -2
  23. package/build/components/x_ite.build.js +2 -2
  24. package/build/parts/default.end.frag.js +2 -0
  25. package/build/parts/default.start.frag.js +8 -0
  26. package/build/parts/{x_ite.end.frag → x_ite.end.frag.js} +4 -2
  27. package/build/parts/x_ite.start.frag.js +16 -0
  28. package/build/x_ite.build.js +2 -2
  29. package/dist/assets/components/annotation.js +9 -7
  30. package/dist/assets/components/annotation.min.js +1 -1
  31. package/dist/assets/components/cad-geometry.js +9 -7
  32. package/dist/assets/components/cad-geometry.min.js +1 -1
  33. package/dist/assets/components/cube-map-texturing.js +9 -7
  34. package/dist/assets/components/cube-map-texturing.min.js +1 -1
  35. package/dist/assets/components/dis.js +9 -7
  36. package/dist/assets/components/dis.min.js +1 -1
  37. package/dist/assets/components/event-utilities.js +9 -7
  38. package/dist/assets/components/event-utilities.min.js +1 -1
  39. package/dist/assets/components/geometry2d.js +9 -7
  40. package/dist/assets/components/geometry2d.min.js +1 -1
  41. package/dist/assets/components/geospatial.js +9 -7
  42. package/dist/assets/components/geospatial.min.js +2 -2
  43. package/dist/assets/components/h-anim.js +9 -7
  44. package/dist/assets/components/h-anim.min.js +1 -1
  45. package/dist/assets/components/key-device-sensor.js +9 -7
  46. package/dist/assets/components/key-device-sensor.min.js +1 -1
  47. package/dist/assets/components/layout.js +9 -7
  48. package/dist/assets/components/layout.min.js +1 -1
  49. package/dist/assets/components/nurbs.js +9 -7
  50. package/dist/assets/components/nurbs.min.js +2 -2
  51. package/dist/assets/components/particle-systems.js +9 -7
  52. package/dist/assets/components/particle-systems.min.js +2 -2
  53. package/dist/assets/components/picking.js +13 -11
  54. package/dist/assets/components/picking.min.js +1 -1
  55. package/dist/assets/components/projective-texture-mapping.js +9 -7
  56. package/dist/assets/components/projective-texture-mapping.min.js +1 -1
  57. package/dist/assets/components/rigid-body-physics.js +9 -7
  58. package/dist/assets/components/rigid-body-physics.min.js +17 -17
  59. package/dist/assets/components/scripting.js +16 -9
  60. package/dist/assets/components/scripting.min.js +1 -1
  61. package/dist/assets/components/texturing-3d.js +9 -7
  62. package/dist/assets/components/texturing-3d.min.js +3 -3
  63. package/dist/assets/components/volume-rendering.js +11 -9
  64. package/dist/assets/components/volume-rendering.min.js +3 -3
  65. package/dist/assets/components/x_ite.js +9 -7
  66. package/dist/assets/components/x_ite.min.js +1 -1
  67. package/dist/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
  68. package/dist/assets/shaders/webgl1/Gouraud.vs +0 -1
  69. package/dist/assets/shaders/webgl1/Phong.fs +0 -1
  70. package/dist/assets/shaders/webgl1/Unlit.fs +0 -3
  71. package/dist/assets/shaders/webgl2/Gouraud.vs +0 -1
  72. package/dist/assets/shaders/webgl2/Phong.fs +0 -1
  73. package/dist/assets/shaders/webgl2/Unlit.fs +0 -3
  74. package/dist/example.html +2 -2
  75. package/dist/x_ite.css +4 -3
  76. package/dist/x_ite.js +28281 -27706
  77. package/dist/x_ite.min.js +41 -41
  78. package/dist/x_ite.zip +0 -0
  79. package/docs/Accessing-the-External-Browser.md +32 -3
  80. package/docs/Custom-Shaders.md +165 -174
  81. package/docs/What's-New.md +61 -6
  82. package/docs/_config.yml +1 -1
  83. package/docs/index.md +21 -14
  84. package/docs/reference/Browser-Services.md +36 -8
  85. package/docs/reference/Script-Node-Authoring-Interface.md +12 -4
  86. package/package.json +13 -6
  87. package/src/assets/components/picking.js +2 -2
  88. package/src/assets/components/volume-rendering.js +2 -2
  89. package/src/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
  90. package/src/assets/shaders/webgl1/Gouraud.vs +0 -1
  91. package/src/assets/shaders/webgl1/Phong.fs +0 -1
  92. package/src/assets/shaders/webgl1/Unlit.fs +0 -3
  93. package/src/assets/shaders/webgl2/Gouraud.vs +0 -1
  94. package/src/assets/shaders/webgl2/Phong.fs +0 -1
  95. package/src/assets/shaders/webgl2/Unlit.fs +0 -3
  96. package/src/bookmarks.js +8 -11
  97. package/src/examples.js +1 -1
  98. package/src/locale/de.po +19 -75
  99. package/src/locale/fr.po +18 -75
  100. package/src/standard/Time/MicroTime.js +3 -1
  101. package/src/standard/Utility/DataStorage.js +7 -10
  102. package/src/tests.js +2 -1
  103. package/src/x_ite/Browser/Core/BrowserOptions.js +40 -28
  104. package/src/x_ite/Browser/Core/BrowserTimings.js +13 -24
  105. package/src/x_ite/Browser/Core/ContextMenu.js +26 -12
  106. package/src/x_ite/Browser/Core/X3DCoreContext.js +95 -42
  107. package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
  108. package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
  109. package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -0
  110. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -0
  111. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +1 -3
  112. package/src/x_ite/Browser/Networking/urls.js +25 -0
  113. package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
  114. package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +4 -1
  115. package/src/x_ite/Browser/Shaders/ShaderTest.js +3 -3
  116. package/src/x_ite/Browser/VERSION.js +1 -1
  117. package/src/x_ite/Browser/X3DBrowser.js +70 -50
  118. package/src/x_ite/Components/Grouping/Switch.js +1 -1
  119. package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -1
  120. package/src/x_ite/Components/Navigation/Collision.js +1 -1
  121. package/src/x_ite/Components/Navigation/LOD.js +1 -1
  122. package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
  123. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +25 -11
  124. package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +35 -1
  125. package/src/x_ite/Components/Scripting/Script.js +7 -2
  126. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +10 -12
  127. package/src/x_ite/Components/Shaders.js +9 -9
  128. package/src/x_ite/Execution/X3DExecutionContext.js +9 -11
  129. package/src/x_ite/Fields/SFColor.js +20 -7
  130. package/src/x_ite/Fields/SFColorRGBA.js +6 -6
  131. package/src/x_ite/Fields/SFDouble.js +2 -2
  132. package/src/x_ite/Fields/SFFloat.js +2 -2
  133. package/src/x_ite/Fields/SFImage.js +13 -13
  134. package/src/x_ite/Fields/SFMatrix3.js +5 -5
  135. package/src/x_ite/Fields/SFMatrix4.js +6 -6
  136. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +14 -3
  137. package/src/x_ite/Fields/SFNode.js +23 -19
  138. package/src/x_ite/Fields/SFNodeCache.js +14 -10
  139. package/src/x_ite/Fields/SFRotation.js +10 -10
  140. package/src/x_ite/Fields/SFString.js +1 -1
  141. package/src/x_ite/Fields/SFTime.js +1 -1
  142. package/src/x_ite/Fields/SFVec2.js +6 -6
  143. package/src/x_ite/Fields/SFVec3.js +7 -7
  144. package/src/x_ite/Fields/SFVec4.js +8 -8
  145. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +7 -6
  146. package/src/x_ite/InputOutput/Generator.js +85 -65
  147. package/src/x_ite/Parser/X3DParser.js +6 -0
  148. package/src/x_ite/Parser/XMLParser.js +1 -1
  149. package/src/x_ite/X3D.js +8 -2
  150. package/src/x_ite.config.js +0 -5
  151. package/src/x_ite.css +2 -1
  152. package/src/x_ite.html +3 -3
  153. package/src/x_ite.js +21 -12
  154. package/x_ite.min.html +3 -3
  155. package/build/parts/default.end.frag +0 -2
  156. package/build/parts/default.start.frag +0 -6
  157. package/build/parts/x_ite.start.frag +0 -8
@@ -1,9 +1,11 @@
1
- (function () {
1
+ (function ()
2
+ {
3
+ // Undefine global variables.
4
+ var module = { }, exports, process;
2
5
 
3
- var
4
- define = X3D .define,
5
- require = X3D .require,
6
- module = { };
6
+ const
7
+ define = X3D .define,
8
+ require = X3D .require;
7
9
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
8
10
  *******************************************************************************
9
11
  *
@@ -364,9 +366,10 @@ function ($,
364
366
  text += "\n;var " + callbacks .join (",") + ";";
365
367
  text += "\n[" + callbacks .join (",") + "];";
366
368
 
369
+ this .global = this .getGlobal ();
370
+
367
371
  const
368
- global = this .getGlobal (),
369
- result = evaluate (global, text),
372
+ result = this .evaluate (text),
370
373
  context = { };
371
374
 
372
375
  for (let i = 0; i < callbacks .length; ++ i)
@@ -381,6 +384,10 @@ function ($,
381
384
  return { };
382
385
  }
383
386
  },
387
+ evaluate: function (text)
388
+ {
389
+ return evaluate (this .global, text);
390
+ },
384
391
  getGlobal: function ()
385
392
  {
386
393
  const
@@ -772,7 +779,7 @@ function ($,
772
779
  ******************************************************************************/
773
780
 
774
781
 
775
- define ([
782
+ define (require .getComponentUrl ("scripting"), [
776
783
  "x_ite/Components",
777
784
  "x_ite/Components/Scripting/Script",
778
785
  "x_ite/Components/Scripting/X3DScriptNode",
@@ -798,4 +805,4 @@ function (Components,
798
805
 
799
806
 
800
807
 
801
- }());
808
+ })();
@@ -1 +1 @@
1
- !function(){var define=X3D.define,require=X3D.require,module={};define("x_ite/Browser/Scripting/evaluate",[],function(){return function(){with(arguments[0])return eval(arguments[1])}}),define("x_ite/Components/Scripting/X3DScriptNode",["x_ite/Components/Core/X3DChildNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){t.call(this,n),e.call(this,n),this.addType(i.X3DScriptNode)}return n.prototype=Object.assign(Object.create(t.prototype),e.prototype,{constructor:n}),n}),define("x_ite/Components/Scripting/Script",["jquery","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Basic/X3DField","x_ite/Basic/X3DArrayField","x_ite/Fields","x_ite/Browser/X3DBrowser","x_ite/Configuration/ComponentInfo","x_ite/Configuration/ComponentInfoArray","x_ite/Configuration/ProfileInfo","x_ite/Configuration/ProfileInfoArray","x_ite/Configuration/UnitInfo","x_ite/Configuration/UnitInfoArray","x_ite/Execution/X3DExecutionContext","x_ite/Execution/X3DScene","x_ite/Prototype/ExternProtoDeclarationArray","x_ite/Prototype/ProtoDeclarationArray","x_ite/Prototype/X3DExternProtoDeclaration","x_ite/Prototype/X3DProtoDeclaration","x_ite/Routing/RouteArray","x_ite/Routing/X3DRoute","x_ite/Browser/Scripting/evaluate","x_ite/Components/Scripting/X3DScriptNode","x_ite/InputOutput/FileLoader","x_ite/Bits/X3DConstants","x_ite/Fields/SFNodeCache"],function(t,e,i,n,o,r,s,a,c,u,l,d,p,h,f,_,F,v,S,g,x,M,m,E,y,D){function w(t){m.call(this,t),this.addChildObjects("buffer",new r.MFString),this.addType(y.Script),this.pauseTime=0}return w.prototype=Object.assign(Object.create(m.prototype),{constructor:w,fieldDefinitions:new i([new e(y.inputOutput,"metadata",new r.SFNode),new e(y.inputOutput,"url",new r.MFString),new e(y.inputOutput,"autoRefresh",new r.SFTime),new e(y.inputOutput,"autoRefreshTimeLimit",new r.SFTime(3600)),new e(y.initializeOnly,"directOutput",new r.SFBool),new e(y.initializeOnly,"mustEvaluate",new r.SFBool)]),getTypeName:function(){return"Script"},getComponentName:function(){return"Scripting"},getContainerField:function(){return"children"},initialize:function(){m.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.buffer_.addInterest("set_buffer__",this),this.getUserDefinedFields().forEach(function(t){t.setModificationTime(0)}),this.set_url__()},set_url__:function(){this.setLoadState(y.NOT_STARTED_STATE),this.requestImmediateLoad()},getExtendedEventHandling:function(){return!1},hasUserDefinedFields:function(){return!0},getSourceText:function(){return this.url_},requestImmediateLoad:function(t=!0){this.checkLoadState()!==y.COMPLETE_STATE&&this.checkLoadState()!==y.IN_PROGRESS_STATE&&0!==this.url_.length&&(this.setCache(t),this.setLoadState(y.IN_PROGRESS_STATE),this.buffer_=this.url_)},set_buffer__:function(){new E(this).loadScript(this.buffer_,function(t){null===t?this.setLoadState(y.FAILED_STATE):(this.setLoadState(y.COMPLETE_STATE),this.initialize__(t))}.bind(this))},getContext:function(t){try{const e=["initialize","prepareEvents","eventsProcessed","shutdown"];this.getUserDefinedFields().forEach(function(t){switch(t.getAccessType()){case y.inputOnly:e.push(t.getName());break;case y.inputOutput:e.push("set_"+t.getName())}}),t+="\n;var "+e.join(",")+";",t+="\n["+e.join(",")+"];";const i=this.getGlobal(),n=M(i,t),o={};for(let t=0;t<e.length;++t)o[e[t]]=n[t];return o}catch(t){return this.setError("while evaluating script source",t),{}}},getGlobal:function(){function t(t){const e=M.createX3DFromString(String(t)),i=e.getRootNodes();if(E.addFieldInterest(e.isLive()),e.setLive(E.getValue()),e.setPrivate(m.getPrivate()),e.setExecutionContext(m),i.length&&i[0])return D.add(i[0].getValue(),this);throw new Error("SFNode.new: invalid argument, must be 'string' is 'undefined'.")}const M=this.getBrowser(),m=this.getExecutionContext(),E=this.isLive();t.prototype=r.SFNode.prototype;const w={NULL:{value:null},FALSE:{value:!1},TRUE:{value:!0},print:{value:function(){M.println.apply(M,arguments)}},trace:{value:function(){M.println.apply(M,arguments)}},Browser:{value:M},X3DConstants:{value:y},X3DBrowser:{value:s},X3DExecutionContext:{value:h},X3DScene:{value:f},ComponentInfo:{value:a},ComponentInfoArray:{value:c},ProfileInfo:{value:u},ProfileInfoArray:{value:l},UnitInfo:{value:d},UnitInfoArray:{value:p},ExternProtoDeclarationArray:{value:_},ProtoDeclarationArray:{value:F},X3DExternProtoDeclaration:{value:v},X3DProtoDeclaration:{value:S},RouteArray:{value:g},X3DRoute:{value:x},X3DFieldDefinition:{value:e},FieldDefinitionArray:{value:i},X3DField:{value:n},X3DArrayField:{value:o},SFColor:{value:r.SFColor},SFColorRGBA:{value:r.SFColorRGBA},SFImage:{value:r.SFImage},SFMatrix3d:{value:r.SFMatrix3d},SFMatrix3f:{value:r.SFMatrix3f},SFMatrix4d:{value:r.SFMatrix4d},SFMatrix4f:{value:r.SFMatrix4f},SFNode:{value:t},SFRotation:{value:r.SFRotation},SFVec2d:{value:r.SFVec2d},SFVec2f:{value:r.SFVec2f},SFVec3d:{value:r.SFVec3d},SFVec3f:{value:r.SFVec3f},SFVec4d:{value:r.SFVec4d},SFVec4f:{value:r.SFVec4f},VrmlMatrix:{value:r.VrmlMatrix},MFBool:{value:r.MFBool},MFColor:{value:r.MFColor},MFColorRGBA:{value:r.MFColorRGBA},MFDouble:{value:r.MFDouble},MFFloat:{value:r.MFFloat},MFImage:{value:r.MFImage},MFInt32:{value:r.MFInt32},MFMatrix3d:{value:r.MFMatrix3d},MFMatrix3f:{value:r.MFMatrix3f},MFMatrix4d:{value:r.MFMatrix4d},MFMatrix4f:{value:r.MFMatrix4f},MFNode:{value:r.MFNode},MFRotation:{value:r.MFRotation},MFString:{value:r.MFString},MFTime:{value:r.MFTime},MFVec2d:{value:r.MFVec2d},MFVec2f:{value:r.MFVec2f},MFVec3d:{value:r.MFVec3d},MFVec3f:{value:r.MFVec3f},MFVec4d:{value:r.MFVec4d},MFVec4f:{value:r.MFVec4f}};return this.getUserDefinedFields().forEach(function(t){const e=t.getName();t.getAccessType()!==y.inputOnly&&(e in w||(w[e]={get:t.valueOf.bind(t),set:t.setValue.bind(t)}),t.getAccessType()===y.inputOutput&&(w[e+"_changed"]={get:t.valueOf.bind(t),set:t.setValue.bind(t)}))}),Object.create(Object.prototype,w)},processOutstandingEvents:function(){this.getUserDefinedFields().forEach(function(e){if(!(e.getModificationTime()<=this.pauseTime))switch(e.getAccessType()){case y.inputOnly:{const i=this.context[e.getName()];t.isFunction(i)&&this.set_field__(e,i);break}case y.inputOutput:{const i=this.context["set_"+e.getName()];t.isFunction(i)&&this.set_field__(e,i);break}}},this)},initialize__:function(t){this.context=this.getContext(t),this.isLive().addInterest("set_live__",this),this.set_live__()},set_live__:function(){if(this.context)if(this.isLive().getValue()){if(!this.initialized){if(this.initialized=!0,t.isFunction(this.context.initialize)){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.initialize()}catch(t){this.setError("in function 'initialize'",t)}t.getScriptStack().pop()}t.isFunction(this.context.shutdown)&&t(window).on("unload",this.shutdown__.bind(this))}t.isFunction(this.context.prepareEvents)&&this.getBrowser().prepareEvents().addInterest("prepareEvents__",this),t.isFunction(this.context.eventsProcessed)&&this.addInterest("eventsProcessed__",this),this.getUserDefinedFields().forEach(function(e){switch(e.getAccessType()){case y.inputOnly:{const i=this.context[e.getName()];t.isFunction(i)&&e.addInterest("set_field__",this,i);break}case y.inputOutput:{const i=this.context["set_"+e.getName()];t.isFunction(i)&&e.addInterest("set_field__",this,i);break}}},this),this.processOutstandingEvents()}else this.context.prepareEvents&&this.getBrowser().prepareEvents().removeInterest("prepareEvents__",this),this.context.eventsProcessed&&this.removeInterest("eventsProcessed__",this),this.getUserDefinedFields().forEach(function(t){switch(t.getAccessType()){case y.inputOnly:case y.inputOutput:t.removeInterest("set_field__",this)}},this),this.initialized&&(this.pauseTime=performance.now())},prepareEvents__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.prepareEvents(t.getCurrentTime()),t.addBrowserEvent()}catch(t){this.setError("in function 'prepareEvents'",t)}t.getScriptStack().pop()},set_field__:function(t,e){const i=this.getBrowser();t.setTainted(!0),i.getScriptStack().push(this);try{e(t.valueOf(),i.getCurrentTime())}catch(e){this.setError("in function '"+t.getName()+"'",e)}i.getScriptStack().pop(),t.setTainted(!1)},eventsProcessed__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.eventsProcessed()}catch(t){this.setError("in function 'eventsProcessed'",t)}t.getScriptStack().pop()},shutdown__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.shutdown()}catch(t){this.setError("in function 'shutdown'",t)}t.getScriptStack().pop()},setError:function(t,e){console.error("JavaScript Error in Script '"+this.getName()+"', "+t+"\nworld url is '"+this.getExecutionContext().getWorldURL()+"':"),console.error(e)}}),w}),define(["x_ite/Components","x_ite/Components/Scripting/Script","x_ite/Components/Scripting/X3DScriptNode"],function(t,e,i){"use strict";t.addComponent({name:"Scripting",types:{Script:e},abstractTypes:{X3DScriptNode:i}})})}();
1
+ !function(){var module={},exports,process;const define=X3D.define,require=X3D.require;define("x_ite/Browser/Scripting/evaluate",[],function(){return function(){with(arguments[0])return eval(arguments[1])}}),define("x_ite/Components/Scripting/X3DScriptNode",["x_ite/Components/Core/X3DChildNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){t.call(this,n),e.call(this,n),this.addType(i.X3DScriptNode)}return n.prototype=Object.assign(Object.create(t.prototype),e.prototype,{constructor:n}),n}),define("x_ite/Components/Scripting/Script",["jquery","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Basic/X3DField","x_ite/Basic/X3DArrayField","x_ite/Fields","x_ite/Browser/X3DBrowser","x_ite/Configuration/ComponentInfo","x_ite/Configuration/ComponentInfoArray","x_ite/Configuration/ProfileInfo","x_ite/Configuration/ProfileInfoArray","x_ite/Configuration/UnitInfo","x_ite/Configuration/UnitInfoArray","x_ite/Execution/X3DExecutionContext","x_ite/Execution/X3DScene","x_ite/Prototype/ExternProtoDeclarationArray","x_ite/Prototype/ProtoDeclarationArray","x_ite/Prototype/X3DExternProtoDeclaration","x_ite/Prototype/X3DProtoDeclaration","x_ite/Routing/RouteArray","x_ite/Routing/X3DRoute","x_ite/Browser/Scripting/evaluate","x_ite/Components/Scripting/X3DScriptNode","x_ite/InputOutput/FileLoader","x_ite/Bits/X3DConstants","x_ite/Fields/SFNodeCache"],function(t,e,i,n,o,r,s,a,c,u,l,p,d,h,f,_,F,v,g,S,x,M,m,E,y,D){function w(t){m.call(this,t),this.addChildObjects("buffer",new r.MFString),this.addType(y.Script),this.pauseTime=0}return w.prototype=Object.assign(Object.create(m.prototype),{constructor:w,fieldDefinitions:new i([new e(y.inputOutput,"metadata",new r.SFNode),new e(y.inputOutput,"url",new r.MFString),new e(y.inputOutput,"autoRefresh",new r.SFTime),new e(y.inputOutput,"autoRefreshTimeLimit",new r.SFTime(3600)),new e(y.initializeOnly,"directOutput",new r.SFBool),new e(y.initializeOnly,"mustEvaluate",new r.SFBool)]),getTypeName:function(){return"Script"},getComponentName:function(){return"Scripting"},getContainerField:function(){return"children"},initialize:function(){m.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.buffer_.addInterest("set_buffer__",this),this.getUserDefinedFields().forEach(function(t){t.setModificationTime(0)}),this.set_url__()},set_url__:function(){this.setLoadState(y.NOT_STARTED_STATE),this.requestImmediateLoad()},getExtendedEventHandling:function(){return!1},hasUserDefinedFields:function(){return!0},getSourceText:function(){return this.url_},requestImmediateLoad:function(t=!0){this.checkLoadState()!==y.COMPLETE_STATE&&this.checkLoadState()!==y.IN_PROGRESS_STATE&&0!==this.url_.length&&(this.setCache(t),this.setLoadState(y.IN_PROGRESS_STATE),this.buffer_=this.url_)},set_buffer__:function(){new E(this).loadScript(this.buffer_,function(t){null===t?this.setLoadState(y.FAILED_STATE):(this.setLoadState(y.COMPLETE_STATE),this.initialize__(t))}.bind(this))},getContext:function(t){try{const e=["initialize","prepareEvents","eventsProcessed","shutdown"];this.getUserDefinedFields().forEach(function(t){switch(t.getAccessType()){case y.inputOnly:e.push(t.getName());break;case y.inputOutput:e.push("set_"+t.getName())}}),t+="\n;var "+e.join(",")+";",t+="\n["+e.join(",")+"];",this.global=this.getGlobal();const i=this.evaluate(t),n={};for(let t=0;t<e.length;++t)n[e[t]]=i[t];return n}catch(t){return this.setError("while evaluating script source",t),{}}},evaluate:function(t){return M(this.global,t)},getGlobal:function(){function t(t){const e=M.createX3DFromString(String(t)),i=e.getRootNodes();if(E.addFieldInterest(e.isLive()),e.setLive(E.getValue()),e.setPrivate(m.getPrivate()),e.setExecutionContext(m),i.length&&i[0])return D.add(i[0].getValue(),this);throw new Error("SFNode.new: invalid argument, must be 'string' is 'undefined'.")}const M=this.getBrowser(),m=this.getExecutionContext(),E=this.isLive();t.prototype=r.SFNode.prototype;const w={NULL:{value:null},FALSE:{value:!1},TRUE:{value:!0},print:{value:function(){M.println.apply(M,arguments)}},trace:{value:function(){M.println.apply(M,arguments)}},Browser:{value:M},X3DConstants:{value:y},X3DBrowser:{value:s},X3DExecutionContext:{value:h},X3DScene:{value:f},ComponentInfo:{value:a},ComponentInfoArray:{value:c},ProfileInfo:{value:u},ProfileInfoArray:{value:l},UnitInfo:{value:p},UnitInfoArray:{value:d},ExternProtoDeclarationArray:{value:_},ProtoDeclarationArray:{value:F},X3DExternProtoDeclaration:{value:v},X3DProtoDeclaration:{value:g},RouteArray:{value:S},X3DRoute:{value:x},X3DFieldDefinition:{value:e},FieldDefinitionArray:{value:i},X3DField:{value:n},X3DArrayField:{value:o},SFColor:{value:r.SFColor},SFColorRGBA:{value:r.SFColorRGBA},SFImage:{value:r.SFImage},SFMatrix3d:{value:r.SFMatrix3d},SFMatrix3f:{value:r.SFMatrix3f},SFMatrix4d:{value:r.SFMatrix4d},SFMatrix4f:{value:r.SFMatrix4f},SFNode:{value:t},SFRotation:{value:r.SFRotation},SFVec2d:{value:r.SFVec2d},SFVec2f:{value:r.SFVec2f},SFVec3d:{value:r.SFVec3d},SFVec3f:{value:r.SFVec3f},SFVec4d:{value:r.SFVec4d},SFVec4f:{value:r.SFVec4f},VrmlMatrix:{value:r.VrmlMatrix},MFBool:{value:r.MFBool},MFColor:{value:r.MFColor},MFColorRGBA:{value:r.MFColorRGBA},MFDouble:{value:r.MFDouble},MFFloat:{value:r.MFFloat},MFImage:{value:r.MFImage},MFInt32:{value:r.MFInt32},MFMatrix3d:{value:r.MFMatrix3d},MFMatrix3f:{value:r.MFMatrix3f},MFMatrix4d:{value:r.MFMatrix4d},MFMatrix4f:{value:r.MFMatrix4f},MFNode:{value:r.MFNode},MFRotation:{value:r.MFRotation},MFString:{value:r.MFString},MFTime:{value:r.MFTime},MFVec2d:{value:r.MFVec2d},MFVec2f:{value:r.MFVec2f},MFVec3d:{value:r.MFVec3d},MFVec3f:{value:r.MFVec3f},MFVec4d:{value:r.MFVec4d},MFVec4f:{value:r.MFVec4f}};return this.getUserDefinedFields().forEach(function(t){const e=t.getName();t.getAccessType()!==y.inputOnly&&(e in w||(w[e]={get:t.valueOf.bind(t),set:t.setValue.bind(t)}),t.getAccessType()===y.inputOutput&&(w[e+"_changed"]={get:t.valueOf.bind(t),set:t.setValue.bind(t)}))}),Object.create(Object.prototype,w)},processOutstandingEvents:function(){this.getUserDefinedFields().forEach(function(e){if(!(e.getModificationTime()<=this.pauseTime))switch(e.getAccessType()){case y.inputOnly:{const i=this.context[e.getName()];t.isFunction(i)&&this.set_field__(e,i);break}case y.inputOutput:{const i=this.context["set_"+e.getName()];t.isFunction(i)&&this.set_field__(e,i);break}}},this)},initialize__:function(t){this.context=this.getContext(t),this.isLive().addInterest("set_live__",this),this.set_live__()},set_live__:function(){if(this.context)if(this.isLive().getValue()){if(!this.initialized){if(this.initialized=!0,t.isFunction(this.context.initialize)){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.initialize()}catch(t){this.setError("in function 'initialize'",t)}t.getScriptStack().pop()}t.isFunction(this.context.shutdown)&&t(window).on("unload",this.shutdown__.bind(this))}t.isFunction(this.context.prepareEvents)&&this.getBrowser().prepareEvents().addInterest("prepareEvents__",this),t.isFunction(this.context.eventsProcessed)&&this.addInterest("eventsProcessed__",this),this.getUserDefinedFields().forEach(function(e){switch(e.getAccessType()){case y.inputOnly:{const i=this.context[e.getName()];t.isFunction(i)&&e.addInterest("set_field__",this,i);break}case y.inputOutput:{const i=this.context["set_"+e.getName()];t.isFunction(i)&&e.addInterest("set_field__",this,i);break}}},this),this.processOutstandingEvents()}else this.context.prepareEvents&&this.getBrowser().prepareEvents().removeInterest("prepareEvents__",this),this.context.eventsProcessed&&this.removeInterest("eventsProcessed__",this),this.getUserDefinedFields().forEach(function(t){switch(t.getAccessType()){case y.inputOnly:case y.inputOutput:t.removeInterest("set_field__",this)}},this),this.initialized&&(this.pauseTime=performance.now())},prepareEvents__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.prepareEvents(t.getCurrentTime()),t.addBrowserEvent()}catch(t){this.setError("in function 'prepareEvents'",t)}t.getScriptStack().pop()},set_field__:function(t,e){const i=this.getBrowser();t.setTainted(!0),i.getScriptStack().push(this);try{e(t.valueOf(),i.getCurrentTime())}catch(e){this.setError("in function '"+t.getName()+"'",e)}i.getScriptStack().pop(),t.setTainted(!1)},eventsProcessed__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.eventsProcessed()}catch(t){this.setError("in function 'eventsProcessed'",t)}t.getScriptStack().pop()},shutdown__:function(){const t=this.getBrowser();t.getScriptStack().push(this);try{this.context.shutdown()}catch(t){this.setError("in function 'shutdown'",t)}t.getScriptStack().pop()},setError:function(t,e){console.error("JavaScript Error in Script '"+this.getName()+"', "+t+"\nworld url is '"+this.getExecutionContext().getWorldURL()+"':"),console.error(e)}}),w}),define(require.getComponentUrl("scripting"),["x_ite/Components","x_ite/Components/Scripting/Script","x_ite/Components/Scripting/X3DScriptNode"],function(t,e,i){"use strict";t.addComponent({name:"Scripting",types:{Script:e},abstractTypes:{X3DScriptNode:i}})})}();
@@ -1,9 +1,11 @@
1
- (function () {
1
+ (function ()
2
+ {
3
+ // Undefine global variables.
4
+ var module = { }, exports, process;
2
5
 
3
- var
4
- define = X3D .define,
5
- require = X3D .require,
6
- module = { };
6
+ const
7
+ define = X3D .define,
8
+ require = X3D .require;
7
9
  /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
8
10
  *******************************************************************************
9
11
  *
@@ -10007,7 +10009,7 @@ function (Fields,
10007
10009
  ******************************************************************************/
10008
10010
 
10009
10011
 
10010
- define ([
10012
+ define (require .getComponentUrl ("texturing-3d"), [
10011
10013
  "x_ite/Components",
10012
10014
  "x_ite/Components/Texturing3D/ComposedTexture3D",
10013
10015
  "x_ite/Components/Texturing3D/ImageTexture3D",
@@ -10051,4 +10053,4 @@ function (Components,
10051
10053
 
10052
10054
 
10053
10055
 
10054
- }());
10056
+ })();