x_ite 14.2.0 → 15.0.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 (54) hide show
  1. package/README.md +5 -5
  2. package/dist/assets/components/AnnotationComponent.js +2 -2
  3. package/dist/assets/components/AnnotationComponent.min.js +2 -2
  4. package/dist/assets/components/CADGeometryComponent.js +2 -2
  5. package/dist/assets/components/CADGeometryComponent.min.js +2 -2
  6. package/dist/assets/components/CubeMapTexturingComponent.js +2 -2
  7. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
  8. package/dist/assets/components/DISComponent.js +2 -2
  9. package/dist/assets/components/DISComponent.min.js +2 -2
  10. package/dist/assets/components/EventUtilitiesComponent.js +2 -2
  11. package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
  12. package/dist/assets/components/Geometry2DComponent.js +2 -2
  13. package/dist/assets/components/Geometry2DComponent.min.js +2 -2
  14. package/dist/assets/components/Geometry3DComponent.js +2 -2
  15. package/dist/assets/components/Geometry3DComponent.min.js +2 -2
  16. package/dist/assets/components/GeospatialComponent.js +2 -2
  17. package/dist/assets/components/GeospatialComponent.min.js +2 -2
  18. package/dist/assets/components/HAnimComponent.js +2 -2
  19. package/dist/assets/components/HAnimComponent.min.js +2 -2
  20. package/dist/assets/components/KeyDeviceSensorComponent.js +2 -2
  21. package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -2
  22. package/dist/assets/components/LayoutComponent.js +63 -47
  23. package/dist/assets/components/LayoutComponent.min.js +2 -2
  24. package/dist/assets/components/NURBSComponent.js +2 -2
  25. package/dist/assets/components/NURBSComponent.min.js +2 -2
  26. package/dist/assets/components/ParticleSystemsComponent.js +2 -2
  27. package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
  28. package/dist/assets/components/PickingComponent.js +4 -4
  29. package/dist/assets/components/PickingComponent.min.js +2 -2
  30. package/dist/assets/components/RigidBodyPhysicsComponent.js +2 -2
  31. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -2
  32. package/dist/assets/components/ScriptingComponent.js +4 -4
  33. package/dist/assets/components/ScriptingComponent.min.js +2 -2
  34. package/dist/assets/components/TextComponent.js +164 -84
  35. package/dist/assets/components/TextComponent.min.js +2 -2
  36. package/dist/assets/components/TextureProjectionComponent.js +2 -2
  37. package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
  38. package/dist/assets/components/Texturing3DComponent.js +12 -12
  39. package/dist/assets/components/Texturing3DComponent.min.js +2 -2
  40. package/dist/assets/components/VolumeRenderingComponent.js +2 -2
  41. package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
  42. package/dist/assets/components/WebXRComponent.js +2 -2
  43. package/dist/assets/components/WebXRComponent.min.js +2 -2
  44. package/dist/assets/components/X_ITEComponent.js +2 -2
  45. package/dist/assets/components/X_ITEComponent.min.js +2 -2
  46. package/dist/example.html +1 -1
  47. package/dist/x_ite.css +1 -1
  48. package/dist/x_ite.d.ts +116 -61
  49. package/dist/x_ite.js +747 -967
  50. package/dist/x_ite.min.js +2 -2
  51. package/dist/x_ite.min.mjs +2 -2
  52. package/dist/x_ite.mjs +746 -967
  53. package/dist/x_ite.zip +0 -0
  54. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
- /* X_ITE v14.2.0 */
2
- const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-14.2.0")];
1
+ /* X_ITE v15.0.1 */
2
+ const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-15.0.1")];
3
3
  /******/ (() => { // webpackBootstrap
4
4
  /******/ "use strict";
5
5
  /******/ // The require scope
@@ -247,7 +247,7 @@ Object .assign (Object .setPrototypeOf (Layout .prototype, Layout_X3DLayoutNode
247
247
  pixelSize: new (external_X_ITE_X3D_Vector2_default()) (),
248
248
  translation: new (external_X_ITE_X3D_Vector3_default()) (),
249
249
  offset: new (external_X_ITE_X3D_Vector3_default()) (),
250
- scale: new (external_X_ITE_X3D_Vector3_default()) (1),
250
+ scale: new (external_X_ITE_X3D_Vector3_default()) (),
251
251
  currentTranslation: new (external_X_ITE_X3D_Vector3_default()) (),
252
252
  currentRotation: new (external_X_ITE_X3D_Rotation4_default()) (),
253
253
  currentScale: new (external_X_ITE_X3D_Vector3_default()) (),
@@ -973,8 +973,6 @@ var external_X_ITE_X3D_PixelTexture_default = /*#__PURE__*/__webpack_require__.n
973
973
  ;// external "__X_ITE_X3D__ .Box3"
974
974
  const external_X_ITE_X3D_Box3_namespaceObject = __X_ITE_X3D__ .Box3;
975
975
  var external_X_ITE_X3D_Box3_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Box3_namespaceObject);
976
- ;// external "__X_ITE_X3D__ .Algorithm"
977
- const external_X_ITE_X3D_Algorithm_namespaceObject = __X_ITE_X3D__ .Algorithm;
978
976
  ;// ./src/x_ite/Browser/Layout/ScreenText.js
979
977
 
980
978
 
@@ -983,21 +981,20 @@ const external_X_ITE_X3D_Algorithm_namespaceObject = __X_ITE_X3D__ .Algorithm;
983
981
 
984
982
 
985
983
 
986
-
987
984
  function ScreenText (text, fontStyle)
988
985
  {
989
986
  external_X_ITE_X3D_X3DTextGeometry_default().call (this, text, fontStyle);
990
987
 
991
988
  text .setTransparent (true);
992
989
 
990
+ // Private properties
991
+
993
992
  this .textureNode = new (external_X_ITE_X3D_PixelTexture_default()) (text .getExecutionContext ());
994
993
  this .context = document .createElement ("canvas") .getContext ("2d", { willReadFrequently: true });
995
994
  this .matrix = new (external_X_ITE_X3D_Matrix4_default()) ();
996
995
 
997
996
  this .textureNode ._textureProperties = fontStyle .getBrowser () .getScreenTextureProperties ();
998
997
  this .textureNode .setup ();
999
-
1000
- this .getBrowser () .getRenderingProperties () ._ContentScale .addInterest ("build", this);
1001
998
  }
1002
999
 
1003
1000
  Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X3D_X3DTextGeometry_default()).prototype),
@@ -1010,20 +1007,21 @@ Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X
1010
1007
  {
1011
1008
  return this .textureNode;
1012
1009
  },
1013
- update: (() =>
1010
+ configure: (() =>
1014
1011
  {
1015
1012
  const
1016
1013
  min = new (external_X_ITE_X3D_Vector3_default()) (),
1017
- max = new (external_X_ITE_X3D_Vector3_default()) (1, 1, 0);
1014
+ max = new (external_X_ITE_X3D_Vector3_default()) ();
1018
1015
 
1019
1016
  return function ()
1020
1017
  {
1021
- external_X_ITE_X3D_X3DTextGeometry_default().prototype .update .call (this);
1018
+ external_X_ITE_X3D_X3DTextGeometry_default().prototype .configure .call (this);
1022
1019
 
1023
1020
  const
1024
- fontStyle = this .getFontStyle (),
1025
- text = this .getText (),
1026
- offset = 1; // For antialiasing border on bottom and right side
1021
+ fontStyle = this .getFontStyle (),
1022
+ text = this .getText (),
1023
+ contentScale = fontStyle .getContentScale (),
1024
+ offset = 1; // For antialiasing border on bottom and right side
1027
1025
 
1028
1026
  text ._textBounds .x = Math .ceil (text ._textBounds .x) + offset;
1029
1027
  text ._textBounds .y = Math .ceil (text ._textBounds .y) + offset;
@@ -1067,17 +1065,30 @@ Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X
1067
1065
  break;
1068
1066
  }
1069
1067
 
1070
- text ._origin .x = min .x;
1071
- text ._origin .y = max .y;
1072
-
1073
1068
  this .getBBox () .setExtents (min, max);
1069
+
1070
+ this .matrix .assign ((external_X_ITE_X3D_Matrix4_default()).ZERO);
1071
+
1072
+ // Scale origin, text and line bounds by contentScale.
1073
+
1074
+ text ._origin .x = min .x / contentScale;
1075
+ text ._origin .y = max .y / contentScale;
1076
+
1077
+ text ._textBounds .x /= contentScale;
1078
+ text ._textBounds .y /= contentScale;
1079
+
1080
+ for (const lineBound of text ._lineBounds)
1081
+ {
1082
+ lineBound .x /= contentScale;
1083
+ lineBound .y /= contentScale;
1084
+ }
1074
1085
  };
1075
1086
  })(),
1076
1087
  build: (() =>
1077
1088
  {
1078
1089
  const
1079
1090
  min = new (external_X_ITE_X3D_Vector3_default()) (),
1080
- max = new (external_X_ITE_X3D_Vector3_default()) (1, 1, 0);
1091
+ max = new (external_X_ITE_X3D_Vector3_default()) ();
1081
1092
 
1082
1093
  return function ()
1083
1094
  {
@@ -1089,7 +1100,6 @@ Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X
1089
1100
  return;
1090
1101
 
1091
1102
  const
1092
- browser = this .getBrowser (),
1093
1103
  text = this .getText (),
1094
1104
  glyphs = this .getGlyphs (),
1095
1105
  minorAlignment = this .getMinorAlignment (),
@@ -1101,7 +1111,7 @@ Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X
1101
1111
  texCoordArray = text .getTexCoords (),
1102
1112
  normalArray = text .getNormals (),
1103
1113
  vertexArray = text .getVertices (),
1104
- contentScale = browser .getRenderingProperty ("ContentScale"),
1114
+ contentScale = fontStyle .getContentScale (),
1105
1115
  canvas = this .context .canvas,
1106
1116
  cx = this .context;
1107
1117
 
@@ -1113,6 +1123,13 @@ Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X
1113
1123
 
1114
1124
  this .getBBox () .getExtents (min, max);
1115
1125
 
1126
+ texCoordArray .push (0, 0, 0, 1,
1127
+ 1, 0, 0, 1,
1128
+ 1, 1, 0, 1,
1129
+ 0, 0, 0, 1,
1130
+ 1, 1, 0, 1,
1131
+ 0, 1, 0, 1);
1132
+
1116
1133
  normalArray .push (0, 0, 1,
1117
1134
  0, 0, 1,
1118
1135
  0, 0, 1,
@@ -1129,27 +1146,13 @@ Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X
1129
1146
 
1130
1147
  // Generate texture.
1131
1148
 
1132
- const
1133
- width = text ._textBounds .x,
1134
- height = text ._textBounds .y;
1149
+ const [width, height] = text ._textBounds;
1135
1150
 
1136
1151
  // Scale canvas.
1137
1152
 
1138
1153
  canvas .width = width * contentScale;
1139
1154
  canvas .height = height * contentScale;
1140
1155
 
1141
- const
1142
- w = width / canvas .width,
1143
- h = height / canvas .height,
1144
- y = 1 - h;
1145
-
1146
- texCoordArray .push (0, y, 0, 1,
1147
- w, y, 0, 1,
1148
- w, 1, 0, 1,
1149
- 0, y, 0, 1,
1150
- w, 1, 0, 1,
1151
- 0, 1, 0, 1);
1152
-
1153
1156
  // Setup canvas.
1154
1157
 
1155
1158
  cx .fillStyle = "rgba(255,255,255,0)";
@@ -1164,17 +1167,20 @@ Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X
1164
1167
 
1165
1168
  if (fontStyle ._horizontal .getValue ())
1166
1169
  {
1167
- for (let l = 0, length = glyphs .length; l < length; ++ l)
1170
+ const numLines = glyphs .length;
1171
+
1172
+ for (let l = 0; l < numLines; ++ l)
1168
1173
  {
1169
1174
  const
1170
1175
  line = glyphs [l],
1171
1176
  translation = translations [l],
1172
1177
  charSpacing = charSpacings [l],
1173
- scale = scales [l];
1178
+ scale = scales [l],
1179
+ numGlyphs = line .length;
1174
1180
 
1175
1181
  let advanceWidth = 0;
1176
1182
 
1177
- for (let g = 0, gl = line .length; g < gl; ++ g)
1183
+ for (let g = 0; g < numGlyphs; ++ g)
1178
1184
  {
1179
1185
  const
1180
1186
  glyph = line [g],
@@ -1266,10 +1272,8 @@ Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X
1266
1272
 
1267
1273
  cx .beginPath ();
1268
1274
 
1269
- for (let i = 0, cl = commands .length; i < cl; ++ i)
1275
+ for (const command of commands)
1270
1276
  {
1271
- const command = commands [i];
1272
-
1273
1277
  switch (command .type)
1274
1278
  {
1275
1279
  case "M": // Start
@@ -1318,22 +1322,33 @@ Object .assign (Object .setPrototypeOf (ScreenText .prototype, (external_X_ITE_X
1318
1322
  },
1319
1323
  traverseBefore: (() =>
1320
1324
  {
1321
- const bbox = new (external_X_ITE_X3D_Box3_default()) ();
1325
+ const
1326
+ bbox = new (external_X_ITE_X3D_Box3_default()) (),
1327
+ matrix = new (external_X_ITE_X3D_Matrix4_default()) ();
1322
1328
 
1323
- return function (type, renderObject)
1329
+ return function (type, renderObject, shapeNode)
1324
1330
  {
1325
- this .getBrowser () .getScreenScaleMatrix (renderObject, this .matrix, 1, true);
1331
+ this .getBrowser () .getScreenScaleMatrix (renderObject, matrix, 1, true);
1326
1332
 
1327
1333
  const modelViewMatrix = renderObject .getModelViewMatrix ();
1328
1334
 
1329
1335
  modelViewMatrix .push ();
1330
- modelViewMatrix .multLeft (this .matrix);
1336
+ modelViewMatrix .multLeft (matrix);
1337
+
1338
+ if (matrix .equals (this .matrix))
1339
+ return;
1340
+
1341
+ this .matrix .assign (matrix);
1331
1342
 
1332
1343
  // Update Text bbox.
1333
1344
 
1334
1345
  bbox .assign (this .getBBox ()) .multRight (this .matrix);
1335
1346
 
1336
1347
  this .getText () .setBBox (bbox);
1348
+
1349
+ // Immediately update X3DShapeNode bbox.
1350
+
1351
+ shapeNode .set_bbox__ ();
1337
1352
  };
1338
1353
  })(),
1339
1354
  traverseAfter (type, renderObject)
@@ -1368,6 +1383,7 @@ Object .assign (Object .setPrototypeOf (ScreenFontStyle .prototype, (external_X_
1368
1383
  {
1369
1384
  external_X_ITE_X3D_X3DFontStyleNode_default().prototype .initialize .call (this);
1370
1385
 
1386
+ // Trigger requestRebuild of text geometry when ContentScale changes.
1371
1387
  this .getBrowser () .getRenderingProperties () ._ContentScale .addInterest ("addNodeEvent", this);
1372
1388
  },
1373
1389
  createTextGeometry (text)
@@ -1376,7 +1392,7 @@ Object .assign (Object .setPrototypeOf (ScreenFontStyle .prototype, (external_X_
1376
1392
  },
1377
1393
  getScale ()
1378
1394
  {
1379
- return this ._pointSize .getValue () * this .getBrowser () .getRenderingProperty ("PixelsPerPoint");
1395
+ return this ._pointSize .getValue () * this .getBrowser () .getRenderingProperty ("PixelsPerPoint") * this .getContentScale ();
1380
1396
  },
1381
1397
  getContentScale ()
1382
1398
  {
@@ -1437,7 +1453,7 @@ function ScreenGroup (executionContext)
1437
1453
  if (executionContext .getOuterNode () instanceof (external_X_ITE_X3D_X3DProtoDeclaration_default()))
1438
1454
  this .matrix = new (external_X_ITE_X3D_Matrix4_default()) ();
1439
1455
  else
1440
- this .matrix = new (external_X_ITE_X3D_Matrix4_default()) (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0);
1456
+ this .matrix = new (external_X_ITE_X3D_Matrix4_default()) (0);
1441
1457
  }
1442
1458
 
1443
1459
  Object .assign (Object .setPrototypeOf (ScreenGroup .prototype, (external_X_ITE_X3D_X3DGroupingNode_default()).prototype),
@@ -1,2 +1,2 @@
1
- /* X_ITE v14.2.0 */
2
- const t=window[Symbol.for("X_ITE.X3D-14.2.0")];(()=>{var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const i=t.Components;var s=e.n(i);const n=t.TextureProperties;var o=e.n(n);const a=t.Vector3;var r=e.n(a);const h=t.Matrix4;var l=e.n(h);const u=t.ViewVolume;var c=e.n(u);const d=t.Namespace;var g=e.n(d);const p=Symbol();function y(){}Object.assign(y.prototype,{getScreenTextureProperties(){return this[p]??=(()=>{const t=new(o())(this.getPrivateScene());return t._boundaryModeS="CLAMP_TO_EDGE",t._boundaryModeT="CLAMP_TO_EDGE",t._boundaryModeR="CLAMP_TO_EDGE",t._minificationFilter="NEAREST_PIXEL",t._magnificationFilter="NEAREST_PIXEL",t._generateMipMaps=!1,t._textureCompression="DEFAULT",t.setup(),t})()},getScreenScaleMatrix:(()=>{const t=new(r()),e=new(r()),i=new(l());return function(s,n,o,a){const h=s.getModelViewMatrix().get(),l=s.getProjectionMatrix().get(),u=s.getViewVolume().getViewport();s.getViewpoint().getScreenScale(h.origin,u,t);const d=h.xAxis.normalize().multiply(t.x*o),g=h.yAxis.normalize().multiply(t.y*o),p=h.zAxis.normalize().multiply(t.x*o);i.set(...d,0,...g,0,...p,0,h[12],h[13],h[14],1),a&&(c().projectPoint(r().ZERO,i,l,u,e),e.x=Math.round(e.x),e.y=Math.round(e.y),c().unProjectPoint(e.x,e.y,e.z,i,l,u,e),e.z=0,i.translate(e)),n.assign(h).inverse().multLeft(i)}})()});const f=y,x=g().add("X3DLayoutContext",f),w=t.Fields;var _=e.n(w);const S=t.X3DFieldDefinition;var M=e.n(S);const O=t.FieldDefinitionArray;var z=e.n(O);const b=t.X3DNode;var X=e.n(b);const m=t.X3DChildNode;var v=e.n(m);const F=t.X3DConstants;var N=e.n(F);function U(t){v().call(this,t),this.addType(N().X3DLayoutNode)}Object.setPrototypeOf(U.prototype,v().prototype),Object.defineProperties(U,X().getStaticProperties("X3DLayoutNode","Layout",1));const P=U,T=g().add("X3DLayoutNode",P),B=t.Vector2;var Y=e.n(B);const L=t.Rotation4;var C=e.n(L);let E=0;const D=E++,R=E++,I=E++,V=E++,A=E++,j=E++,k=E++,G=E++,W=E++,H=E++;function q(t){T.call(this,t),this.addType(N().Layout),this.alignX=R,this.alignY=R,this.offsetUnitX=j,this.offsetUnitY=j,this.offsetX=0,this.offsetY=0,this.sizeUnitX=j,this.sizeUnitY=j,this.sizeX=1,this.sizeY=1,this.scaleModeX=W,this.scaleModeY=W,this.parent=null,this.rectangleCenter=new(Y()),this.rectangleSize=new(Y()),this.matrix=new(l())}Object.assign(Object.setPrototypeOf(q.prototype,T.prototype),{viewportPixel:new(Y()),pixelSize:new(Y()),translation:new(r()),offset:new(r()),scale:new(r())(1),currentTranslation:new(r()),currentRotation:new(C()),currentScale:new(r()),modelViewMatrix:new(l()),initialize(){T.prototype.initialize.call(this),this._align.addInterest("set_align__",this),this._offsetUnits.addInterest("set_offsetUnits__",this),this._offset.addInterest("set_offset__",this),this._sizeUnits.addInterest("set_sizeUnits__",this),this._size.addInterest("set_size__",this),this._scaleMode.addInterest("set_scaleMode__",this),this.set_align__(),this.set_offsetUnits__(),this.set_offset__(),this.set_sizeUnits__(),this.set_size__(),this.set_scaleMode__()},set_align__(){this._align.length>0?"LEFT"===this._align[0]?this.alignX=D:"RIGHT"===this._align[0]?this.alignX=I:this.alignX=R:this.alignX=R,this._align.length>1?"BOTTOM"===this._align[1]?this.alignY=V:"TOP"===this._align[1]?this.alignY=A:this.alignY=R:this.alignY=R},set_offsetUnits__(){this._offsetUnits.length>0?("FRACTION"===this._offsetUnits[0]?this.offsetUnitX=k:"PIXEL"===this._offsetUnits[0]?this.offsetUnitX=G:this.offsetUnitX=j,this._offsetUnits.length>1?"FRACTION"===this._offsetUnits[1]?this.offsetUnitY=k:"PIXEL"===this._offsetUnits[1]?this.offsetUnitY=G:this.offsetUnitY=j:this.offsetUnitY=this.offsetUnitX):(this.offsetUnitX=j,this.offsetUnitY=j)},set_offset__(){this._offset.length>0?(this.offsetX=this._offset[0],this._offset.length>1?this.offsetY=this._offset[1]:this.offsetY=offsetX):(this.offsetX=0,this.offsetY=0)},set_sizeUnits__(){this._sizeUnits.length>0?("FRACTION"===this._sizeUnits[0]?this.sizeUnitX=k:"PIXEL"===this._sizeUnits[0]?this.sizeUnitX=G:this.sizeUnitX=j,this._sizeUnits.length>1?"FRACTION"===this._sizeUnits[1]?this.sizeUnitY=k:"PIXEL"===this._sizeUnits[1]?this.sizeUnitY=G:this.sizeUnitY=j:this.sizeUnitY=this.sizeUnitX):(this.sizeUnitX=j,this.sizeUnitY=j)},set_size__(){this._size.length>0?(this.sizeX=this._size[0],this._size.length>1?this.sizeY=this._size[1]:this.sizeY=this.sizeX):(this.sizeX=0,this.sizeY=0)},set_scaleMode__(){this._scaleMode.length>0?("FRACTION"===this._scaleMode[0]?this.scaleModeX=k:"PIXEL"===this._scaleMode[0]?this.scaleModeX=G:"STRETCH"===this._scaleMode[0]?this.scaleModeX=H:this.scaleModeX=W,this._scaleMode.length>1?"FRACTION"===this._scaleMode[1]?this.scaleModeY=k:"PIXEL"===this._scaleMode[1]?this.scaleModeY=G:"STRETCH"===this._scaleMode[1]?this.scaleModeY=H:this.scaleModeY=W:this.scaleModeY=this.scaleModeX):(this.scaleModeX=W,this.scaleModeY=W)},getRectangleCenter(){return this.rectangleCenter},getRectangleSize(){return this.rectangleSize},getAlignX(){return this.alignX},getAlignY(){return this.alignY},getOffsetUnitX(){return this.offsetUnitX===j?this.parent?this.parent.getOffsetUnitX():k:this.offsetUnitX},getOffsetUnitY(){return this.offsetUnitY===j?this.parent?this.parent.getOffsetUnitY():k:this.offsetUnitY},getOffsetX(){return this.offsetX},getOffsetY(){return this.offsetY},getSizeUnitX(){return this.sizeUnitX===j?this.parent?this.parent.getSizeUnitX():k:this.sizeUnitX},getSizeUnitY(){return this.sizeUnitY===j?this.parent?this.parent.getSizeUnitY():k:this.sizeUnitY},getSizeX(){return this.sizeX},getSizeY(){return this.sizeY},getScaleModeX(){return this.parent?this.scaleModeX:this.scaleModeX===W?k:this.scaleModeX},getScaleModeY(){return this.parent?this.scaleModeY:this.scaleModeY===W?k:this.scaleModeY},transform(t,e){const i=this.parent=e.getParentLayout(),s=this.getBrowser().getRenderingProperty("ContentScale"),n=this.matrix,o=e.getNavigationInfo(),a=e.getViewpoint(),r=a.getNearDistance(o),h=e.getViewVolume().getViewport(),l=a.getViewportSize(h,r),u=this.viewportPixel,c=this.pixelSize,d=i?i.getRectangleSize():l,g=this.rectangleSize,p=this.rectangleCenter;switch(u.set(h[2],h[3]).divide(s),c.assign(l).divVec(u),this.getSizeUnitX()){case k:g.x=this.sizeX*d.x;break;case G:g.x=this.sizeX*c.x}switch(this.getSizeUnitY()){case k:g.y=this.sizeY*d.y;break;case G:g.y=this.sizeY*c.y}const y=this.translation.set(0);switch(this.getAlignX()){case D:y.x=-(d.x-g.x)/2;break;case R:this.getSizeUnitX()===G&&1&u.x&&(y.x=-c.x/2);break;case I:y.x=(d.x-g.x)/2}switch(this.getAlignY()){case V:y.y=-(d.y-g.y)/2;break;case R:this.getSizeUnitX()===G&&1&u.y&&(y.y=-c.y/2);break;case A:y.y=(d.y-g.y)/2}const f=this.offset.set(0);switch(this.getOffsetUnitX()){case k:f.x=this.offsetX*d.x;break;case G:f.x=this.offsetX*l.x/u.x}switch(this.getOffsetUnitY()){case k:f.y=this.offsetY*d.y;break;case G:f.y=this.offsetY*l.y/u.y}const x=this.scale.set(1),w=this.currentTranslation,_=this.currentRotation,S=this.currentScale;switch(e.getModelViewMatrix().get().get(w,_,S),this.getScaleModeX()){case W:x.x=S.x;break;case k:x.x=g.x;break;case H:break;case G:x.x=l.x/u.x}switch(this.getScaleModeY()){case W:x.y=S.y;break;case k:x.y=g.y;break;case H:break;case G:x.y=l.y/u.y}return this.getScaleModeX()===H?this.getScaleModeY()===H?g.x>g.y?(x.x=g.x,x.y=x.x):(x.y=g.y,x.x=x.y):x.x=x.y:this.getScaleModeY()===H&&(x.y=x.x),p.assign(y.add(f)),n.set(w,_),n.translate(y),n.scale(x),n}}),Object.defineProperties(q,{...X().getStaticProperties("Layout","Layout",1,"layout","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"align",new(_().MFString)("CENTER","CENTER")),new(M())(N().inputOutput,"offsetUnits",new(_().MFString)("WORLD","WORLD")),new(M())(N().inputOutput,"offset",new(_().MFFloat)(0,0)),new(M())(N().inputOutput,"sizeUnits",new(_().MFString)("WORLD","WORLD")),new(M())(N().inputOutput,"size",new(_().MFFloat)(1,1)),new(M())(N().inputOutput,"scaleMode",new(_().MFString)("NONE","NONE"))]),enumerable:!0}});const K=q,Z=g().add("Layout",K),Q=t.X3DGroupingNode;var J=e.n(Q);const $=t.X3DCast;var tt=e.n($);function et(t){J().call(this,t),this.addType(N().LayoutGroup),this.setCollisionObject(!1),this.matrix=new(l()),this.modelViewMatrix=new(l()),this.screenMatrix=new(l())}Object.assign(Object.setPrototypeOf(et.prototype,J().prototype),{initialize(){J().prototype.initialize.call(this),this._viewport.addInterest("set_viewport__",this),this._layout.addInterest("set_layout__",this),this.set_viewport__(),this.set_layout__()},set_viewport__(){this.viewportNode=tt()(N().X3DViewportNode,this._viewport)},set_layout__(){this.layoutNode=tt()(N().X3DLayoutNode,this._layout)},set_collisionObjects__(){},getBBox(t,e){return this.isDefaultBBoxSize()?this.getSubBBox(t,e).multRight(this.getMatrix()):t.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getMatrix(){return this.layoutNode?this.matrix.assign(this.modelViewMatrix).inverse().multLeft(this.screenMatrix):this.matrix.identity()},traverse(t,e){if(this.viewportNode?.push(),this.layoutNode){const i=e.getModelViewMatrix();this.modelViewMatrix.assign(i.get()),this.screenMatrix.assign(this.layoutNode.transform(t,e)),i.push(this.screenMatrix),e.getLayouts().push(this.layoutNode),J().prototype.traverse.call(this,t,e),e.getLayouts().pop(),i.pop()}else J().prototype.traverse.call(this,t,e);this.viewportNode?.pop()}}),Object.defineProperties(et,{...X().getStaticProperties("LayoutGroup","Layout",1,"children","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"layout",new(_().SFNode)),new(M())(N().inputOutput,"viewport",new(_().SFNode)),new(M())(N().inputOutput,"visible",new(_().SFBool)(!0)),new(M())(N().inputOutput,"bboxDisplay",new(_().SFBool)),new(M())(N().initializeOnly,"bboxSize",new(_().SFVec3f)(-1,-1,-1)),new(M())(N().initializeOnly,"bboxCenter",new(_().SFVec3f)),new(M())(N().inputOnly,"addChildren",new(_().MFNode)),new(M())(N().inputOnly,"removeChildren",new(_().MFNode)),new(M())(N().inputOutput,"children",new(_().MFNode))]),enumerable:!0}});const it=et,st=g().add("LayoutGroup",it),nt=t.X3DLayerNode;var ot=e.n(nt);const at=t.OrthoViewpoint;var rt=e.n(at);function ht(t){ot().call(this,t,new(rt())(t),new st(t)),this.addType(N().LayoutLayer)}Object.assign(Object.setPrototypeOf(ht.prototype,ot().prototype),{initialize(){const t=this.getGroup();this._layout.addFieldInterest(t._layout),t._layout=this._layout,ot().prototype.initialize.call(this)}}),Object.defineProperties(ht,{...X().getStaticProperties("LayoutLayer","Layout",1,"layers","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"pickable",new(_().SFBool)(!0)),new(M())(N().inputOutput,"objectType",new(_().MFString)("ALL")),new(M())(N().inputOutput,"pointerEvents",new(_().SFBool)(!0)),new(M())(N().inputOutput,"visible",new(_().SFBool)(!0)),new(M())(N().inputOutput,"layout",new(_().SFNode)),new(M())(N().inputOutput,"viewport",new(_().SFNode)),new(M())(N().inputOnly,"addChildren",new(_().MFNode)),new(M())(N().inputOnly,"removeChildren",new(_().MFNode)),new(M())(N().inputOutput,"children",new(_().MFNode))]),enumerable:!0}});const lt=ht,ut=g().add("LayoutLayer",lt),ct=t.X3DFontStyleNode;var dt=e.n(ct);const gt=t.X3DTextGeometry;var pt=e.n(gt);const yt=t.TextAlignment;var ft=e.n(yt);const xt=t.PixelTexture;var wt=e.n(xt);const _t=t.Box3;var St=e.n(_t);t.Algorithm;function Mt(t,e){pt().call(this,t,e),t.setTransparent(!0),this.textureNode=new(wt())(t.getExecutionContext()),this.context=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}),this.matrix=new(l()),this.textureNode._textureProperties=e.getBrowser().getScreenTextureProperties(),this.textureNode.setup(),this.getBrowser().getRenderingProperties()._ContentScale.addInterest("build",this)}Object.assign(Object.setPrototypeOf(Mt.prototype,pt().prototype),{getMatrix(){return this.matrix},getTextureNode(){return this.textureNode},update:(()=>{const t=new(r()),e=new(r())(1,1,0);return function(){pt().prototype.update.call(this);const i=this.getFontStyle(),s=this.getText();switch(s._textBounds.x=Math.ceil(s._textBounds.x)+1,s._textBounds.y=Math.ceil(s._textBounds.y)+1,this.getBBox().getExtents(t,e),t.x-=1,t.y-=1,i.getMajorAlignment()){case ft().BEGIN:case ft().FIRST:t.x=Math.floor(t.x),e.x=t.x+s._textBounds.x;break;case ft().MIDDLE:t.x=Math.round(t.x),e.x=t.x+s._textBounds.x;break;case ft().END:e.x=Math.ceil(e.x),t.x=e.x-s._textBounds.x}switch(i.getMinorAlignment()){case ft().BEGIN:case ft().FIRST:e.y=Math.ceil(e.y),t.y=e.y-s._textBounds.y;break;case ft().MIDDLE:e.y=Math.round(e.y),t.y=e.y-s._textBounds.y;break;case ft().END:t.y=Math.floor(t.y),e.y=t.y+s._textBounds.y}s._origin.x=t.x,s._origin.y=e.y,this.getBBox().setExtents(t,e)}})(),build:(()=>{const t=new(r()),e=new(r())(1,1,0);return function(){const i=this.getFontStyle(),s=i.getFont();if(!s)return;const n=this.getBrowser(),o=this.getText(),a=this.getGlyphs(),r=this.getMinorAlignment(),h=this.getTranslations(),l=this.getCharSpacings(),u=this.getScales(),c=i.getScale(),d=c/s.unitsPerEm,g=o.getTexCoords(),p=o.getNormals(),y=o.getVertices(),f=n.getRenderingProperty("ContentScale"),x=this.context.canvas,w=this.context;o.getMultiTexCoords().push(g),this.getBBox().getExtents(t,e),p.push(0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1),y.push(t.x,t.y,0,1,e.x,t.y,0,1,e.x,e.y,0,1,t.x,t.y,0,1,e.x,e.y,0,1,t.x,e.y,0,1);const _=o._textBounds.x,S=o._textBounds.y;x.width=_*f,x.height=S*f;const M=_/x.width,O=1-S/x.height;if(g.push(0,O,0,1,M,O,0,1,M,1,0,1,0,O,0,1,M,1,0,1,0,1,0,1),w.fillStyle="rgba(255,255,255,0)",w.fillRect(0,0,x.width,x.height),w.fillStyle="rgba(255,255,255,1)",w.save(),w.translate(0,x.height),w.scale(1,-1),i._horizontal.getValue())for(let i=0,n=a.length;i<n;++i){const n=a[i],o=h[i],g=l[i],p=u[i];let y=0;for(let i=0,a=n.length;i<a;++i){const a=n[i],h=r.x+o.x+y*p+i*g-t.x,l=r.y+o.y-e.y;w.save(),w.translate(h,-l),w.scale(p,1),this.drawGlyph(w,s,a,c),w.restore();let u=0;i+1<n.length&&(u=s.getKerningValue(a,n[i+1])),y+=(a.advanceWidth+u)*d}}else{const n=i._leftToRight.getValue(),d=i._topToBottom.getValue(),g=n?0:o._string.length-1,p=n?o._string.length:-1,y=n?1:-1;for(let i=g,n=0;i!==p;i+=y){const o=a[i],g=o.length,p=d?0:g-1,y=d?g:-1,f=d?1:-1,x=l[i],_=u[i];for(let i=p;i!==y;i+=f,++n){const a=h[n],l=d?i:g-i-1,u=r.x+a.x-t.x,p=r.y+a.y*_-l*x-e.y;w.save(),w.translate(u,-p),w.scale(1,_),this.drawGlyph(w,s,o[i],c),w.restore()}}}w.restore();const z=w.getImageData(0,0,x.width,x.height);z?this.textureNode.setTextureData(x.width,x.height,!0,!0,new Uint8Array(z.data.buffer)):this.textureNode.clear()}})(),drawGlyph(t,e,i,s){const n=i.getPath(0,0,s),o=n.commands;t.beginPath();for(let e=0,i=o.length;e<i;++e){const i=o[e];switch(i.type){case"M":t.moveTo(i.x,i.y);continue;case"Z":t.closePath();continue;case"L":t.lineTo(i.x,i.y);continue;case"Q":t.quadraticCurveTo(i.x1,i.y1,i.x,i.y);continue;case"C":t.bezierCurveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y);continue}}n.fill&&t.fill(),n.stroke&&(t.lineWidth=n.strokeWidth,t.stroke())},getGlyphExtents(t,e,i,s,n){const o=t.unitsPerEm;s.set((e.xMin||0)/o,(e.yMin||0)/o,0),n.set((e.xMax||0)/o,(e.yMax||0)/o,0)},traverseBefore:(()=>{const t=new(St());return function(e,i){this.getBrowser().getScreenScaleMatrix(i,this.matrix,1,!0);const s=i.getModelViewMatrix();s.push(),s.multLeft(this.matrix),t.assign(this.getBBox()).multRight(this.matrix),this.getText().setBBox(t)}})(),traverseAfter(t,e){e.getModelViewMatrix().pop()}});const Ot=Mt,zt=g().add("ScreenText",Ot);function bt(t){dt().call(this,t),this.addType(N().ScreenFontStyle)}Object.assign(Object.setPrototypeOf(bt.prototype,dt().prototype),{initialize(){dt().prototype.initialize.call(this),this.getBrowser().getRenderingProperties()._ContentScale.addInterest("addNodeEvent",this)},createTextGeometry(t){return new zt(t,this)},getScale(){return this._pointSize.getValue()*this.getBrowser().getRenderingProperty("PixelsPerPoint")},getContentScale(){return this.getBrowser().getRenderingProperty("ContentScale")}}),Object.defineProperties(bt,{...X().getStaticProperties("ScreenFontStyle","Layout",2,"fontStyle","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"language",new(_().SFString)),new(M())(N().inputOutput,"family",new(_().MFString)("SERIF")),new(M())(N().inputOutput,"style",new(_().SFString)("PLAIN")),new(M())(N().inputOutput,"pointSize",new(_().SFFloat)(12)),new(M())(N().inputOutput,"spacing",new(_().SFFloat)(1)),new(M())(N().inputOutput,"horizontal",new(_().SFBool)(!0)),new(M())(N().inputOutput,"leftToRight",new(_().SFBool)(!0)),new(M())(N().inputOutput,"topToBottom",new(_().SFBool)(!0)),new(M())(N().inputOutput,"justify",new(_().MFString)("BEGIN"))]),enumerable:!0}});const Xt=bt,mt=g().add("ScreenFontStyle",Xt),vt=t.TraverseType;var Ft=e.n(vt);const Nt=t.X3DProtoDeclaration;var Ut=e.n(Nt);function Pt(t){J().call(this,t),this.addType(N().ScreenGroup),t.getOuterNode()instanceof Ut()?this.matrix=new(l()):this.matrix=new(l())(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}Object.assign(Object.setPrototypeOf(Pt.prototype,J().prototype),{getBBox(t,e){return this.isDefaultBBoxSize()?this.getSubBBox(t,e).multRight(this.matrix):t.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getMatrix(){return this.matrix},traverse(t,e){switch(t){case Ft().CAMERA:case Ft().PICKING:case Ft().DEPTH:case Ft().SHADOW:break;default:{const t=this.getBrowser();t.getScreenScaleMatrix(e,this.matrix,t.getRenderingProperty("ContentScale"),!1);break}}const i=e.getModelViewMatrix();i.push(),i.multLeft(this.matrix),J().prototype.traverse.call(this,t,e),i.pop()}}),Object.defineProperties(Pt,{...X().getStaticProperties("ScreenGroup","Layout",2,"children","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"visible",new(_().SFBool)(!0)),new(M())(N().inputOutput,"bboxDisplay",new(_().SFBool)),new(M())(N().initializeOnly,"bboxSize",new(_().SFVec3f)(-1,-1,-1)),new(M())(N().initializeOnly,"bboxCenter",new(_().SFVec3f)),new(M())(N().inputOnly,"addChildren",new(_().MFNode)),new(M())(N().inputOnly,"removeChildren",new(_().MFNode)),new(M())(N().inputOutput,"children",new(_().MFNode))]),enumerable:!0}});const Tt=Pt,Bt=g().add("ScreenGroup",Tt);s().add({name:"Layout",concreteNodes:[Z,st,ut,mt,Bt],abstractNodes:[T],browserContext:x});g().add("LayoutComponent",void 0)})();
1
+ /* X_ITE v15.0.1 */
2
+ const t=window[Symbol.for("X_ITE.X3D-15.0.1")];(()=>{var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const i=t.Components;var s=e.n(i);const n=t.TextureProperties;var o=e.n(n);const a=t.Vector3;var r=e.n(a);const h=t.Matrix4;var l=e.n(h);const c=t.ViewVolume;var u=e.n(c);const g=t.Namespace;var d=e.n(g);const p=Symbol();function y(){}Object.assign(y.prototype,{getScreenTextureProperties(){return this[p]??=(()=>{const t=new(o())(this.getPrivateScene());return t._boundaryModeS="CLAMP_TO_EDGE",t._boundaryModeT="CLAMP_TO_EDGE",t._boundaryModeR="CLAMP_TO_EDGE",t._minificationFilter="NEAREST_PIXEL",t._magnificationFilter="NEAREST_PIXEL",t._generateMipMaps=!1,t._textureCompression="DEFAULT",t.setup(),t})()},getScreenScaleMatrix:(()=>{const t=new(r()),e=new(r()),i=new(l());return function(s,n,o,a){const h=s.getModelViewMatrix().get(),l=s.getProjectionMatrix().get(),c=s.getViewVolume().getViewport();s.getViewpoint().getScreenScale(h.origin,c,t);const g=h.xAxis.normalize().multiply(t.x*o),d=h.yAxis.normalize().multiply(t.y*o),p=h.zAxis.normalize().multiply(t.x*o);i.set(...g,0,...d,0,...p,0,h[12],h[13],h[14],1),a&&(u().projectPoint(r().ZERO,i,l,c,e),e.x=Math.round(e.x),e.y=Math.round(e.y),u().unProjectPoint(e.x,e.y,e.z,i,l,c,e),e.z=0,i.translate(e)),n.assign(h).inverse().multLeft(i)}})()});const f=y,x=d().add("X3DLayoutContext",f),w=t.Fields;var _=e.n(w);const S=t.X3DFieldDefinition;var M=e.n(S);const O=t.FieldDefinitionArray;var z=e.n(O);const b=t.X3DNode;var X=e.n(b);const m=t.X3DChildNode;var v=e.n(m);const F=t.X3DConstants;var N=e.n(F);function U(t){v().call(this,t),this.addType(N().X3DLayoutNode)}Object.setPrototypeOf(U.prototype,v().prototype),Object.defineProperties(U,X().getStaticProperties("X3DLayoutNode","Layout",1));const T=U,P=d().add("X3DLayoutNode",T),B=t.Vector2;var Y=e.n(B);const L=t.Rotation4;var C=e.n(L);let E=0;const D=E++,R=E++,V=E++,I=E++,A=E++,j=E++,k=E++,G=E++,W=E++,H=E++;function q(t){P.call(this,t),this.addType(N().Layout),this.alignX=R,this.alignY=R,this.offsetUnitX=j,this.offsetUnitY=j,this.offsetX=0,this.offsetY=0,this.sizeUnitX=j,this.sizeUnitY=j,this.sizeX=1,this.sizeY=1,this.scaleModeX=W,this.scaleModeY=W,this.parent=null,this.rectangleCenter=new(Y()),this.rectangleSize=new(Y()),this.matrix=new(l())}Object.assign(Object.setPrototypeOf(q.prototype,P.prototype),{viewportPixel:new(Y()),pixelSize:new(Y()),translation:new(r()),offset:new(r()),scale:new(r()),currentTranslation:new(r()),currentRotation:new(C()),currentScale:new(r()),modelViewMatrix:new(l()),initialize(){P.prototype.initialize.call(this),this._align.addInterest("set_align__",this),this._offsetUnits.addInterest("set_offsetUnits__",this),this._offset.addInterest("set_offset__",this),this._sizeUnits.addInterest("set_sizeUnits__",this),this._size.addInterest("set_size__",this),this._scaleMode.addInterest("set_scaleMode__",this),this.set_align__(),this.set_offsetUnits__(),this.set_offset__(),this.set_sizeUnits__(),this.set_size__(),this.set_scaleMode__()},set_align__(){this._align.length>0?"LEFT"===this._align[0]?this.alignX=D:"RIGHT"===this._align[0]?this.alignX=V:this.alignX=R:this.alignX=R,this._align.length>1?"BOTTOM"===this._align[1]?this.alignY=I:"TOP"===this._align[1]?this.alignY=A:this.alignY=R:this.alignY=R},set_offsetUnits__(){this._offsetUnits.length>0?("FRACTION"===this._offsetUnits[0]?this.offsetUnitX=k:"PIXEL"===this._offsetUnits[0]?this.offsetUnitX=G:this.offsetUnitX=j,this._offsetUnits.length>1?"FRACTION"===this._offsetUnits[1]?this.offsetUnitY=k:"PIXEL"===this._offsetUnits[1]?this.offsetUnitY=G:this.offsetUnitY=j:this.offsetUnitY=this.offsetUnitX):(this.offsetUnitX=j,this.offsetUnitY=j)},set_offset__(){this._offset.length>0?(this.offsetX=this._offset[0],this._offset.length>1?this.offsetY=this._offset[1]:this.offsetY=offsetX):(this.offsetX=0,this.offsetY=0)},set_sizeUnits__(){this._sizeUnits.length>0?("FRACTION"===this._sizeUnits[0]?this.sizeUnitX=k:"PIXEL"===this._sizeUnits[0]?this.sizeUnitX=G:this.sizeUnitX=j,this._sizeUnits.length>1?"FRACTION"===this._sizeUnits[1]?this.sizeUnitY=k:"PIXEL"===this._sizeUnits[1]?this.sizeUnitY=G:this.sizeUnitY=j:this.sizeUnitY=this.sizeUnitX):(this.sizeUnitX=j,this.sizeUnitY=j)},set_size__(){this._size.length>0?(this.sizeX=this._size[0],this._size.length>1?this.sizeY=this._size[1]:this.sizeY=this.sizeX):(this.sizeX=0,this.sizeY=0)},set_scaleMode__(){this._scaleMode.length>0?("FRACTION"===this._scaleMode[0]?this.scaleModeX=k:"PIXEL"===this._scaleMode[0]?this.scaleModeX=G:"STRETCH"===this._scaleMode[0]?this.scaleModeX=H:this.scaleModeX=W,this._scaleMode.length>1?"FRACTION"===this._scaleMode[1]?this.scaleModeY=k:"PIXEL"===this._scaleMode[1]?this.scaleModeY=G:"STRETCH"===this._scaleMode[1]?this.scaleModeY=H:this.scaleModeY=W:this.scaleModeY=this.scaleModeX):(this.scaleModeX=W,this.scaleModeY=W)},getRectangleCenter(){return this.rectangleCenter},getRectangleSize(){return this.rectangleSize},getAlignX(){return this.alignX},getAlignY(){return this.alignY},getOffsetUnitX(){return this.offsetUnitX===j?this.parent?this.parent.getOffsetUnitX():k:this.offsetUnitX},getOffsetUnitY(){return this.offsetUnitY===j?this.parent?this.parent.getOffsetUnitY():k:this.offsetUnitY},getOffsetX(){return this.offsetX},getOffsetY(){return this.offsetY},getSizeUnitX(){return this.sizeUnitX===j?this.parent?this.parent.getSizeUnitX():k:this.sizeUnitX},getSizeUnitY(){return this.sizeUnitY===j?this.parent?this.parent.getSizeUnitY():k:this.sizeUnitY},getSizeX(){return this.sizeX},getSizeY(){return this.sizeY},getScaleModeX(){return this.parent?this.scaleModeX:this.scaleModeX===W?k:this.scaleModeX},getScaleModeY(){return this.parent?this.scaleModeY:this.scaleModeY===W?k:this.scaleModeY},transform(t,e){const i=this.parent=e.getParentLayout(),s=this.getBrowser().getRenderingProperty("ContentScale"),n=this.matrix,o=e.getNavigationInfo(),a=e.getViewpoint(),r=a.getNearDistance(o),h=e.getViewVolume().getViewport(),l=a.getViewportSize(h,r),c=this.viewportPixel,u=this.pixelSize,g=i?i.getRectangleSize():l,d=this.rectangleSize,p=this.rectangleCenter;switch(c.set(h[2],h[3]).divide(s),u.assign(l).divVec(c),this.getSizeUnitX()){case k:d.x=this.sizeX*g.x;break;case G:d.x=this.sizeX*u.x}switch(this.getSizeUnitY()){case k:d.y=this.sizeY*g.y;break;case G:d.y=this.sizeY*u.y}const y=this.translation.set(0);switch(this.getAlignX()){case D:y.x=-(g.x-d.x)/2;break;case R:this.getSizeUnitX()===G&&1&c.x&&(y.x=-u.x/2);break;case V:y.x=(g.x-d.x)/2}switch(this.getAlignY()){case I:y.y=-(g.y-d.y)/2;break;case R:this.getSizeUnitX()===G&&1&c.y&&(y.y=-u.y/2);break;case A:y.y=(g.y-d.y)/2}const f=this.offset.set(0);switch(this.getOffsetUnitX()){case k:f.x=this.offsetX*g.x;break;case G:f.x=this.offsetX*l.x/c.x}switch(this.getOffsetUnitY()){case k:f.y=this.offsetY*g.y;break;case G:f.y=this.offsetY*l.y/c.y}const x=this.scale.set(1),w=this.currentTranslation,_=this.currentRotation,S=this.currentScale;switch(e.getModelViewMatrix().get().get(w,_,S),this.getScaleModeX()){case W:x.x=S.x;break;case k:x.x=d.x;break;case H:break;case G:x.x=l.x/c.x}switch(this.getScaleModeY()){case W:x.y=S.y;break;case k:x.y=d.y;break;case H:break;case G:x.y=l.y/c.y}return this.getScaleModeX()===H?this.getScaleModeY()===H?d.x>d.y?(x.x=d.x,x.y=x.x):(x.y=d.y,x.x=x.y):x.x=x.y:this.getScaleModeY()===H&&(x.y=x.x),p.assign(y.add(f)),n.set(w,_),n.translate(y),n.scale(x),n}}),Object.defineProperties(q,{...X().getStaticProperties("Layout","Layout",1,"layout","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"align",new(_().MFString)("CENTER","CENTER")),new(M())(N().inputOutput,"offsetUnits",new(_().MFString)("WORLD","WORLD")),new(M())(N().inputOutput,"offset",new(_().MFFloat)(0,0)),new(M())(N().inputOutput,"sizeUnits",new(_().MFString)("WORLD","WORLD")),new(M())(N().inputOutput,"size",new(_().MFFloat)(1,1)),new(M())(N().inputOutput,"scaleMode",new(_().MFString)("NONE","NONE"))]),enumerable:!0}});const Z=q,K=d().add("Layout",Z),Q=t.X3DGroupingNode;var J=e.n(Q);const $=t.X3DCast;var tt=e.n($);function et(t){J().call(this,t),this.addType(N().LayoutGroup),this.setCollisionObject(!1),this.matrix=new(l()),this.modelViewMatrix=new(l()),this.screenMatrix=new(l())}Object.assign(Object.setPrototypeOf(et.prototype,J().prototype),{initialize(){J().prototype.initialize.call(this),this._viewport.addInterest("set_viewport__",this),this._layout.addInterest("set_layout__",this),this.set_viewport__(),this.set_layout__()},set_viewport__(){this.viewportNode=tt()(N().X3DViewportNode,this._viewport)},set_layout__(){this.layoutNode=tt()(N().X3DLayoutNode,this._layout)},set_collisionObjects__(){},getBBox(t,e){return this.isDefaultBBoxSize()?this.getSubBBox(t,e).multRight(this.getMatrix()):t.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getMatrix(){return this.layoutNode?this.matrix.assign(this.modelViewMatrix).inverse().multLeft(this.screenMatrix):this.matrix.identity()},traverse(t,e){if(this.viewportNode?.push(),this.layoutNode){const i=e.getModelViewMatrix();this.modelViewMatrix.assign(i.get()),this.screenMatrix.assign(this.layoutNode.transform(t,e)),i.push(this.screenMatrix),e.getLayouts().push(this.layoutNode),J().prototype.traverse.call(this,t,e),e.getLayouts().pop(),i.pop()}else J().prototype.traverse.call(this,t,e);this.viewportNode?.pop()}}),Object.defineProperties(et,{...X().getStaticProperties("LayoutGroup","Layout",1,"children","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"layout",new(_().SFNode)),new(M())(N().inputOutput,"viewport",new(_().SFNode)),new(M())(N().inputOutput,"visible",new(_().SFBool)(!0)),new(M())(N().inputOutput,"bboxDisplay",new(_().SFBool)),new(M())(N().initializeOnly,"bboxSize",new(_().SFVec3f)(-1,-1,-1)),new(M())(N().initializeOnly,"bboxCenter",new(_().SFVec3f)),new(M())(N().inputOnly,"addChildren",new(_().MFNode)),new(M())(N().inputOnly,"removeChildren",new(_().MFNode)),new(M())(N().inputOutput,"children",new(_().MFNode))]),enumerable:!0}});const it=et,st=d().add("LayoutGroup",it),nt=t.X3DLayerNode;var ot=e.n(nt);const at=t.OrthoViewpoint;var rt=e.n(at);function ht(t){ot().call(this,t,new(rt())(t),new st(t)),this.addType(N().LayoutLayer)}Object.assign(Object.setPrototypeOf(ht.prototype,ot().prototype),{initialize(){const t=this.getGroup();this._layout.addFieldInterest(t._layout),t._layout=this._layout,ot().prototype.initialize.call(this)}}),Object.defineProperties(ht,{...X().getStaticProperties("LayoutLayer","Layout",1,"layers","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"pickable",new(_().SFBool)(!0)),new(M())(N().inputOutput,"objectType",new(_().MFString)("ALL")),new(M())(N().inputOutput,"pointerEvents",new(_().SFBool)(!0)),new(M())(N().inputOutput,"visible",new(_().SFBool)(!0)),new(M())(N().inputOutput,"layout",new(_().SFNode)),new(M())(N().inputOutput,"viewport",new(_().SFNode)),new(M())(N().inputOnly,"addChildren",new(_().MFNode)),new(M())(N().inputOnly,"removeChildren",new(_().MFNode)),new(M())(N().inputOutput,"children",new(_().MFNode))]),enumerable:!0}});const lt=ht,ct=d().add("LayoutLayer",lt),ut=t.X3DFontStyleNode;var gt=e.n(ut);const dt=t.X3DTextGeometry;var pt=e.n(dt);const yt=t.TextAlignment;var ft=e.n(yt);const xt=t.PixelTexture;var wt=e.n(xt);const _t=t.Box3;var St=e.n(_t);function Mt(t,e){pt().call(this,t,e),t.setTransparent(!0),this.textureNode=new(wt())(t.getExecutionContext()),this.context=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}),this.matrix=new(l()),this.textureNode._textureProperties=e.getBrowser().getScreenTextureProperties(),this.textureNode.setup()}Object.assign(Object.setPrototypeOf(Mt.prototype,pt().prototype),{getMatrix(){return this.matrix},getTextureNode(){return this.textureNode},configure:(()=>{const t=new(r()),e=new(r());return function(){pt().prototype.configure.call(this);const i=this.getFontStyle(),s=this.getText(),n=i.getContentScale();switch(s._textBounds.x=Math.ceil(s._textBounds.x)+1,s._textBounds.y=Math.ceil(s._textBounds.y)+1,this.getBBox().getExtents(t,e),t.x-=1,t.y-=1,i.getMajorAlignment()){case ft().BEGIN:case ft().FIRST:t.x=Math.floor(t.x),e.x=t.x+s._textBounds.x;break;case ft().MIDDLE:t.x=Math.round(t.x),e.x=t.x+s._textBounds.x;break;case ft().END:e.x=Math.ceil(e.x),t.x=e.x-s._textBounds.x}switch(i.getMinorAlignment()){case ft().BEGIN:case ft().FIRST:e.y=Math.ceil(e.y),t.y=e.y-s._textBounds.y;break;case ft().MIDDLE:e.y=Math.round(e.y),t.y=e.y-s._textBounds.y;break;case ft().END:t.y=Math.floor(t.y),e.y=t.y+s._textBounds.y}this.getBBox().setExtents(t,e),this.matrix.assign(l().ZERO),s._origin.x=t.x/n,s._origin.y=e.y/n,s._textBounds.x/=n,s._textBounds.y/=n;for(const t of s._lineBounds)t.x/=n,t.y/=n}})(),build:(()=>{const t=new(r()),e=new(r());return function(){const i=this.getFontStyle(),s=i.getFont();if(!s)return;const n=this.getText(),o=this.getGlyphs(),a=this.getMinorAlignment(),r=this.getTranslations(),h=this.getCharSpacings(),l=this.getScales(),c=i.getScale(),u=c/s.unitsPerEm,g=n.getTexCoords(),d=n.getNormals(),p=n.getVertices(),y=i.getContentScale(),f=this.context.canvas,x=this.context;n.getMultiTexCoords().push(g),this.getBBox().getExtents(t,e),g.push(0,0,0,1,1,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,1,0,1),d.push(0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1),p.push(t.x,t.y,0,1,e.x,t.y,0,1,e.x,e.y,0,1,t.x,t.y,0,1,e.x,e.y,0,1,t.x,e.y,0,1);const[w,_]=n._textBounds;if(f.width=w*y,f.height=_*y,x.fillStyle="rgba(255,255,255,0)",x.fillRect(0,0,f.width,f.height),x.fillStyle="rgba(255,255,255,1)",x.save(),x.translate(0,f.height),x.scale(1,-1),i._horizontal.getValue()){const i=o.length;for(let n=0;n<i;++n){const i=o[n],g=r[n],d=h[n],p=l[n],y=i.length;let f=0;for(let n=0;n<y;++n){const o=i[n],r=a.x+g.x+f*p+n*d-t.x,h=a.y+g.y-e.y;x.save(),x.translate(r,-h),x.scale(p,1),this.drawGlyph(x,s,o,c),x.restore();let l=0;n+1<i.length&&(l=s.getKerningValue(o,i[n+1])),f+=(o.advanceWidth+l)*u}}}else{const u=i._leftToRight.getValue(),g=i._topToBottom.getValue(),d=u?0:n._string.length-1,p=u?n._string.length:-1,y=u?1:-1;for(let i=d,n=0;i!==p;i+=y){const u=o[i],d=u.length,p=g?0:d-1,y=g?d:-1,f=g?1:-1,w=h[i],_=l[i];for(let i=p;i!==y;i+=f,++n){const o=r[n],h=g?i:d-i-1,l=a.x+o.x-t.x,p=a.y+o.y*_-h*w-e.y;x.save(),x.translate(l,-p),x.scale(1,_),this.drawGlyph(x,s,u[i],c),x.restore()}}}x.restore();const S=x.getImageData(0,0,f.width,f.height);S?this.textureNode.setTextureData(f.width,f.height,!0,!0,new Uint8Array(S.data.buffer)):this.textureNode.clear()}})(),drawGlyph(t,e,i,s){const n=i.getPath(0,0,s),o=n.commands;t.beginPath();for(const e of o)switch(e.type){case"M":t.moveTo(e.x,e.y);continue;case"Z":t.closePath();continue;case"L":t.lineTo(e.x,e.y);continue;case"Q":t.quadraticCurveTo(e.x1,e.y1,e.x,e.y);continue;case"C":t.bezierCurveTo(e.x1,e.y1,e.x2,e.y2,e.x,e.y);continue}n.fill&&t.fill(),n.stroke&&(t.lineWidth=n.strokeWidth,t.stroke())},getGlyphExtents(t,e,i,s,n){const o=t.unitsPerEm;s.set((e.xMin||0)/o,(e.yMin||0)/o,0),n.set((e.xMax||0)/o,(e.yMax||0)/o,0)},traverseBefore:(()=>{const t=new(St()),e=new(l());return function(i,s,n){this.getBrowser().getScreenScaleMatrix(s,e,1,!0);const o=s.getModelViewMatrix();o.push(),o.multLeft(e),e.equals(this.matrix)||(this.matrix.assign(e),t.assign(this.getBBox()).multRight(this.matrix),this.getText().setBBox(t),n.set_bbox__())}})(),traverseAfter(t,e){e.getModelViewMatrix().pop()}});const Ot=Mt,zt=d().add("ScreenText",Ot);function bt(t){gt().call(this,t),this.addType(N().ScreenFontStyle)}Object.assign(Object.setPrototypeOf(bt.prototype,gt().prototype),{initialize(){gt().prototype.initialize.call(this),this.getBrowser().getRenderingProperties()._ContentScale.addInterest("addNodeEvent",this)},createTextGeometry(t){return new zt(t,this)},getScale(){return this._pointSize.getValue()*this.getBrowser().getRenderingProperty("PixelsPerPoint")*this.getContentScale()},getContentScale(){return this.getBrowser().getRenderingProperty("ContentScale")}}),Object.defineProperties(bt,{...X().getStaticProperties("ScreenFontStyle","Layout",2,"fontStyle","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"language",new(_().SFString)),new(M())(N().inputOutput,"family",new(_().MFString)("SERIF")),new(M())(N().inputOutput,"style",new(_().SFString)("PLAIN")),new(M())(N().inputOutput,"pointSize",new(_().SFFloat)(12)),new(M())(N().inputOutput,"spacing",new(_().SFFloat)(1)),new(M())(N().inputOutput,"horizontal",new(_().SFBool)(!0)),new(M())(N().inputOutput,"leftToRight",new(_().SFBool)(!0)),new(M())(N().inputOutput,"topToBottom",new(_().SFBool)(!0)),new(M())(N().inputOutput,"justify",new(_().MFString)("BEGIN"))]),enumerable:!0}});const Xt=bt,mt=d().add("ScreenFontStyle",Xt),vt=t.TraverseType;var Ft=e.n(vt);const Nt=t.X3DProtoDeclaration;var Ut=e.n(Nt);function Tt(t){J().call(this,t),this.addType(N().ScreenGroup),t.getOuterNode()instanceof Ut()?this.matrix=new(l()):this.matrix=new(l())(0)}Object.assign(Object.setPrototypeOf(Tt.prototype,J().prototype),{getBBox(t,e){return this.isDefaultBBoxSize()?this.getSubBBox(t,e).multRight(this.matrix):t.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getMatrix(){return this.matrix},traverse(t,e){switch(t){case Ft().CAMERA:case Ft().PICKING:case Ft().DEPTH:case Ft().SHADOW:break;default:{const t=this.getBrowser();t.getScreenScaleMatrix(e,this.matrix,t.getRenderingProperty("ContentScale"),!1);break}}const i=e.getModelViewMatrix();i.push(),i.multLeft(this.matrix),J().prototype.traverse.call(this,t,e),i.pop()}}),Object.defineProperties(Tt,{...X().getStaticProperties("ScreenGroup","Layout",2,"children","3.2"),fieldDefinitions:{value:new(z())([new(M())(N().inputOutput,"metadata",new(_().SFNode)),new(M())(N().inputOutput,"visible",new(_().SFBool)(!0)),new(M())(N().inputOutput,"bboxDisplay",new(_().SFBool)),new(M())(N().initializeOnly,"bboxSize",new(_().SFVec3f)(-1,-1,-1)),new(M())(N().initializeOnly,"bboxCenter",new(_().SFVec3f)),new(M())(N().inputOnly,"addChildren",new(_().MFNode)),new(M())(N().inputOnly,"removeChildren",new(_().MFNode)),new(M())(N().inputOutput,"children",new(_().MFNode))]),enumerable:!0}});const Pt=Tt,Bt=d().add("ScreenGroup",Pt);s().add({name:"Layout",concreteNodes:[K,st,ct,mt,Bt],abstractNodes:[P],browserContext:x});d().add("LayoutComponent",void 0)})();
@@ -1,5 +1,5 @@
1
- /* X_ITE v14.2.0 */
2
- const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-14.2.0")];
1
+ /* X_ITE v15.0.1 */
2
+ const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-15.0.1")];
3
3
  /******/ (() => { // webpackBootstrap
4
4
  /******/ "use strict";
5
5
  /******/ // The require scope