x_ite 9.0.2 → 9.0.3
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.
- package/dist/assets/components/Annotation.js +33 -33
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +34 -34
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +99 -105
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +92 -47
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +34 -34
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +45 -45
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +90 -76
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +171 -149
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +18 -16
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +44 -44
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +68 -173
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +112 -97
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +106 -102
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +214 -125
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +43 -43
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +34 -33
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjection.js +48 -48
- package/dist/assets/components/TextureProjection.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +60 -64
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +66 -66
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +12 -12
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +1034 -818
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.min.mjs +1 -1
- package/dist/x_ite.mjs +1034 -818
- package/dist/x_ite.zip +0 -0
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* X_ITE v9.0.
|
|
1
|
+
/* X_ITE v9.0.3 */(() => { // webpackBootstrap
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
5
|
/***/ 355:
|
|
6
6
|
/***/ ((module) => {
|
|
7
7
|
|
|
8
|
-
module.exports = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
8
|
+
module.exports = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("lib/jquery");
|
|
9
9
|
|
|
10
10
|
/***/ })
|
|
11
11
|
|
|
@@ -73,10 +73,10 @@ var __webpack_exports__ = {};
|
|
|
73
73
|
// UNUSED EXPORTS: default
|
|
74
74
|
|
|
75
75
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
|
|
76
|
-
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
76
|
+
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Components");
|
|
77
77
|
var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
|
|
78
78
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
|
|
79
|
-
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
79
|
+
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Namespace");
|
|
80
80
|
var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
|
|
81
81
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/CubeMapTexturing/Panorama1.fs.js
|
|
82
82
|
const __default__ = /* glsl */ `precision highp float;precision highp int;precision highp sampler2D;const float M_PI=3.1415926535897932384626433832795;varying vec2 texCoord;uniform sampler2D x3d_PanoramaTexture;uniform int x3d_CurrentFace;vec3 uvToXYZ(const in int face,const in vec2 uv){vec3 xyz;if(face==0)xyz=vec3(1.0,uv.y,uv.x);else if(face==1)xyz=vec3(-1.0,uv.y,-uv.x);else if(face==2)xyz=vec3(uv.x,uv.y,-1.0);else if(face==3)xyz=vec3(-uv.x,uv.y,1.0);else if(face==4)xyz=vec3(uv.y,-1.0,uv.x);else xyz=vec3(-uv.y,1.0,uv.x);return xyz;}vec2 dirToUV(const in vec3 dir){return vec2(0.5+0.5*atan(dir.z,dir.x)/M_PI,1.0-acos(dir.y)/M_PI);}vec3 panoramaToCubeMap(const in int face,const in vec2 texCoord){vec3 scan=uvToXYZ(face,texCoord);vec3 direction=normalize(scan);vec2 src=dirToUV(direction);return texture2D(x3d_PanoramaTexture,src).rgb;}void main(){gl_FragColor=vec4(panoramaToCubeMap(x3d_CurrentFace,texCoord),1.0);}`
|
|
@@ -164,19 +164,19 @@ const X3DCubeMapTexturingContext_default_ = X3DCubeMapTexturingContext;
|
|
|
164
164
|
Namespace_default().add ("X3DCubeMapTexturingContext", "x_ite/Browser/CubeMapTexturing/X3DCubeMapTexturingContext", X3DCubeMapTexturingContext_default_);
|
|
165
165
|
/* harmony default export */ const CubeMapTexturing_X3DCubeMapTexturingContext = (X3DCubeMapTexturingContext_default_);
|
|
166
166
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
|
|
167
|
-
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
167
|
+
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Fields");
|
|
168
168
|
var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
|
|
169
169
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
|
|
170
|
-
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
170
|
+
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Base/X3DFieldDefinition");
|
|
171
171
|
var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
|
|
172
172
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
|
|
173
|
-
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
173
|
+
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Base/FieldDefinitionArray");
|
|
174
174
|
var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
|
|
175
175
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Texturing/X3DSingleTextureNode\")"
|
|
176
|
-
const X3DSingleTextureNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
176
|
+
const X3DSingleTextureNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Components/Texturing/X3DSingleTextureNode");
|
|
177
177
|
var X3DSingleTextureNode_default = /*#__PURE__*/__webpack_require__.n(X3DSingleTextureNode_namespaceObject);
|
|
178
178
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
|
|
179
|
-
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
179
|
+
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Base/X3DConstants");
|
|
180
180
|
var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
|
|
181
181
|
;// CONCATENATED MODULE: ./src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js
|
|
182
182
|
/*******************************************************************************
|
|
@@ -320,9 +320,9 @@ Object .defineProperties (X3DEnvironmentTextureNode,
|
|
|
320
320
|
value: "X3DEnvironmentTextureNode",
|
|
321
321
|
enumerable: true,
|
|
322
322
|
},
|
|
323
|
-
|
|
323
|
+
componentInfo:
|
|
324
324
|
{
|
|
325
|
-
value: "CubeMapTexturing",
|
|
325
|
+
value: Object .freeze ({ name: "CubeMapTexturing", level: 1 }),
|
|
326
326
|
enumerable: true,
|
|
327
327
|
},
|
|
328
328
|
});
|
|
@@ -333,10 +333,10 @@ const X3DEnvironmentTextureNode_default_ = X3DEnvironmentTextureNode;
|
|
|
333
333
|
Namespace_default().add ("X3DEnvironmentTextureNode", "x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode", X3DEnvironmentTextureNode_default_);
|
|
334
334
|
/* harmony default export */ const CubeMapTexturing_X3DEnvironmentTextureNode = (X3DEnvironmentTextureNode_default_);
|
|
335
335
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
|
|
336
|
-
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
336
|
+
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Base/X3DCast");
|
|
337
337
|
var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
|
|
338
338
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Utility/BitSet\")"
|
|
339
|
-
const BitSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
339
|
+
const BitSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("standard/Utility/BitSet");
|
|
340
340
|
var BitSet_default = /*#__PURE__*/__webpack_require__.n(BitSet_namespaceObject);
|
|
341
341
|
;// CONCATENATED MODULE: ./src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js
|
|
342
342
|
/*******************************************************************************
|
|
@@ -400,7 +400,11 @@ function ComposedCubeMapTexture (executionContext)
|
|
|
400
400
|
|
|
401
401
|
this .addType ((X3DConstants_default()).ComposedCubeMapTexture);
|
|
402
402
|
|
|
403
|
-
|
|
403
|
+
this .addChildObjects ((X3DConstants_default()).inputOutput, "update", new (Fields_default()).SFTime ());
|
|
404
|
+
|
|
405
|
+
// Legacy
|
|
406
|
+
|
|
407
|
+
if (executionContext .getSpecificationVersion () <= 3.3)
|
|
404
408
|
{
|
|
405
409
|
this .addAlias ("front", this ._frontTexture);
|
|
406
410
|
this .addAlias ("back", this ._backTexture);
|
|
@@ -410,7 +414,7 @@ function ComposedCubeMapTexture (executionContext)
|
|
|
410
414
|
this .addAlias ("bottom", this ._bottomTexture);
|
|
411
415
|
}
|
|
412
416
|
|
|
413
|
-
|
|
417
|
+
// Private properties
|
|
414
418
|
|
|
415
419
|
this .textureNodes = [null, null, null, null, null, null];
|
|
416
420
|
this .textureBits = new (BitSet_default()) ();
|
|
@@ -538,7 +542,7 @@ Object .assign (Object .setPrototypeOf (ComposedCubeMapTexture .prototype, CubeM
|
|
|
538
542
|
gl .copyTexSubImage2D (this .getTargets () [i], 0, 0, size - y - 1, 0, y, size, 1);
|
|
539
543
|
}
|
|
540
544
|
}
|
|
541
|
-
|
|
545
|
+
|
|
542
546
|
this .setTransparent (textureNodes .some (textureNode => textureNode .isTransparent ()));
|
|
543
547
|
this .setLinear (textureNodes .some (textureNode => textureNode .isLinear ()));
|
|
544
548
|
this .updateTextureParameters ();
|
|
@@ -557,9 +561,9 @@ Object .defineProperties (ComposedCubeMapTexture,
|
|
|
557
561
|
value: "ComposedCubeMapTexture",
|
|
558
562
|
enumerable: true,
|
|
559
563
|
},
|
|
560
|
-
|
|
564
|
+
componentInfo:
|
|
561
565
|
{
|
|
562
|
-
value: "CubeMapTexturing",
|
|
566
|
+
value: Object .freeze ({ name: "CubeMapTexturing", level: 1 }),
|
|
563
567
|
enumerable: true,
|
|
564
568
|
},
|
|
565
569
|
containerField:
|
|
@@ -569,7 +573,7 @@ Object .defineProperties (ComposedCubeMapTexture,
|
|
|
569
573
|
},
|
|
570
574
|
specificationRange:
|
|
571
575
|
{
|
|
572
|
-
value: Object .freeze (
|
|
576
|
+
value: Object .freeze ({ from: "3.1", to: "Infinity" }),
|
|
573
577
|
enumerable: true,
|
|
574
578
|
},
|
|
575
579
|
fieldDefinitions:
|
|
@@ -603,13 +607,13 @@ const ComposedCubeMapTexture_default_ = ComposedCubeMapTexture;
|
|
|
603
607
|
Namespace_default().add ("ComposedCubeMapTexture", "x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture", ComposedCubeMapTexture_default_);
|
|
604
608
|
/* harmony default export */ const CubeMapTexturing_ComposedCubeMapTexture = (ComposedCubeMapTexture_default_);
|
|
605
609
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DBaseNode\")"
|
|
606
|
-
const X3DBaseNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
610
|
+
const X3DBaseNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Base/X3DBaseNode");
|
|
607
611
|
var X3DBaseNode_default = /*#__PURE__*/__webpack_require__.n(X3DBaseNode_namespaceObject);
|
|
608
612
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/X3DRenderObject\")"
|
|
609
|
-
const X3DRenderObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
613
|
+
const X3DRenderObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Rendering/X3DRenderObject");
|
|
610
614
|
var X3DRenderObject_default = /*#__PURE__*/__webpack_require__.n(X3DRenderObject_namespaceObject);
|
|
611
615
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/TraverseType\")"
|
|
612
|
-
const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
616
|
+
const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Rendering/TraverseType");
|
|
613
617
|
var TraverseType_default = /*#__PURE__*/__webpack_require__.n(TraverseType_namespaceObject);
|
|
614
618
|
;// CONCATENATED MODULE: ./src/x_ite/Rendering/DependentRenderer.js
|
|
615
619
|
/*******************************************************************************
|
|
@@ -749,28 +753,28 @@ const DependentRenderer_default_ = DependentRenderer;
|
|
|
749
753
|
Namespace_default().add ("DependentRenderer", "x_ite/Rendering/DependentRenderer", DependentRenderer_default_);
|
|
750
754
|
/* harmony default export */ const Rendering_DependentRenderer = (DependentRenderer_default_);
|
|
751
755
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/TextureBuffer\")"
|
|
752
|
-
const TextureBuffer_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
756
|
+
const TextureBuffer_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Rendering/TextureBuffer");
|
|
753
757
|
var TextureBuffer_default = /*#__PURE__*/__webpack_require__.n(TextureBuffer_namespaceObject);
|
|
754
758
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Camera\")"
|
|
755
|
-
const Camera_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
759
|
+
const Camera_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("standard/Math/Geometry/Camera");
|
|
756
760
|
var Camera_default = /*#__PURE__*/__webpack_require__.n(Camera_namespaceObject);
|
|
757
761
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/ViewVolume\")"
|
|
758
|
-
const ViewVolume_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
762
|
+
const ViewVolume_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("standard/Math/Geometry/ViewVolume");
|
|
759
763
|
var ViewVolume_default = /*#__PURE__*/__webpack_require__.n(ViewVolume_namespaceObject);
|
|
760
764
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Rotation4\")"
|
|
761
|
-
const Rotation4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
765
|
+
const Rotation4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("standard/Math/Numbers/Rotation4");
|
|
762
766
|
var Rotation4_default = /*#__PURE__*/__webpack_require__.n(Rotation4_namespaceObject);
|
|
763
767
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
|
|
764
|
-
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
768
|
+
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("standard/Math/Numbers/Vector3");
|
|
765
769
|
var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
|
|
766
770
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector4\")"
|
|
767
|
-
const Vector4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
771
|
+
const Vector4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("standard/Math/Numbers/Vector4");
|
|
768
772
|
var Vector4_default = /*#__PURE__*/__webpack_require__.n(Vector4_namespaceObject);
|
|
769
773
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix4\")"
|
|
770
|
-
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
774
|
+
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("standard/Math/Numbers/Matrix4");
|
|
771
775
|
var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
|
|
772
776
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithm\")"
|
|
773
|
-
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
777
|
+
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("standard/Math/Algorithm");
|
|
774
778
|
var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceObject);
|
|
775
779
|
;// CONCATENATED MODULE: ./src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js
|
|
776
780
|
/*******************************************************************************
|
|
@@ -1041,9 +1045,9 @@ Object .defineProperties (GeneratedCubeMapTexture,
|
|
|
1041
1045
|
value: "GeneratedCubeMapTexture",
|
|
1042
1046
|
enumerable: true,
|
|
1043
1047
|
},
|
|
1044
|
-
|
|
1048
|
+
componentInfo:
|
|
1045
1049
|
{
|
|
1046
|
-
value: "CubeMapTexturing",
|
|
1050
|
+
value: Object .freeze ({ name: "CubeMapTexturing", level: 3 }),
|
|
1047
1051
|
enumerable: true,
|
|
1048
1052
|
},
|
|
1049
1053
|
containerField:
|
|
@@ -1053,7 +1057,7 @@ Object .defineProperties (GeneratedCubeMapTexture,
|
|
|
1053
1057
|
},
|
|
1054
1058
|
specificationRange:
|
|
1055
1059
|
{
|
|
1056
|
-
value: Object .freeze (
|
|
1060
|
+
value: Object .freeze ({ from: "3.0", to: "Infinity" }),
|
|
1057
1061
|
enumerable: true,
|
|
1058
1062
|
},
|
|
1059
1063
|
fieldDefinitions:
|
|
@@ -1075,13 +1079,13 @@ const GeneratedCubeMapTexture_default_ = GeneratedCubeMapTexture;
|
|
|
1075
1079
|
Namespace_default().add ("GeneratedCubeMapTexture", "x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture", GeneratedCubeMapTexture_default_);
|
|
1076
1080
|
/* harmony default export */ const CubeMapTexturing_GeneratedCubeMapTexture = (GeneratedCubeMapTexture_default_);
|
|
1077
1081
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Networking/X3DUrlObject\")"
|
|
1078
|
-
const X3DUrlObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
1082
|
+
const X3DUrlObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/Components/Networking/X3DUrlObject");
|
|
1079
1083
|
var X3DUrlObject_default = /*#__PURE__*/__webpack_require__.n(X3DUrlObject_namespaceObject);
|
|
1080
1084
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector2\")"
|
|
1081
|
-
const Vector2_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
1085
|
+
const Vector2_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("standard/Math/Numbers/Vector2");
|
|
1082
1086
|
var Vector2_default = /*#__PURE__*/__webpack_require__.n(Vector2_namespaceObject);
|
|
1083
1087
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/DEVELOPMENT\")"
|
|
1084
|
-
const DEVELOPMENT_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.
|
|
1088
|
+
const DEVELOPMENT_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.3")] .require ("x_ite/DEVELOPMENT");
|
|
1085
1089
|
var DEVELOPMENT_default = /*#__PURE__*/__webpack_require__.n(DEVELOPMENT_namespaceObject);
|
|
1086
1090
|
;// CONCATENATED MODULE: ./src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js
|
|
1087
1091
|
/* provided dependency */ var $ = __webpack_require__(355);
|
|
@@ -1141,7 +1145,6 @@ var DEVELOPMENT_default = /*#__PURE__*/__webpack_require__.n(DEVELOPMENT_namespa
|
|
|
1141
1145
|
|
|
1142
1146
|
|
|
1143
1147
|
|
|
1144
|
-
|
|
1145
1148
|
const defaultData = new Uint8Array ([ 255, 255, 255, 255 ]);
|
|
1146
1149
|
|
|
1147
1150
|
function ImageCubeMapTexture (executionContext)
|
|
@@ -1152,7 +1155,6 @@ function ImageCubeMapTexture (executionContext)
|
|
|
1152
1155
|
this .addType ((X3DConstants_default()).ImageCubeMapTexture);
|
|
1153
1156
|
|
|
1154
1157
|
this .image = $("<img></img>");
|
|
1155
|
-
this .canvas = $("<canvas></canvas>");
|
|
1156
1158
|
this .urlStack = new (Fields_default()).MFString ();
|
|
1157
1159
|
}
|
|
1158
1160
|
|
|
@@ -1203,18 +1205,12 @@ Object .assign (Object .setPrototypeOf (ImageCubeMapTexture .prototype, CubeMapT
|
|
|
1203
1205
|
|
|
1204
1206
|
this .URL = new URL (this .urlStack .shift (), this .getExecutionContext () .getBaseURL ());
|
|
1205
1207
|
|
|
1206
|
-
if (this .URL .
|
|
1207
|
-
{
|
|
1208
|
-
if (!this .getCache ())
|
|
1209
|
-
this .URL .searchParams .set ("_", Date .now ());
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
if (this .URL .pathname .match (/\.ktx2?(?:\.gz)?$/))
|
|
1208
|
+
if (this .URL .pathname .match (/\.ktx2?(?:\.gz)?$/) || this .URL .href .match (/^data:image\/ktx2[;,]/))
|
|
1213
1209
|
{
|
|
1214
1210
|
this .setLinear (true);
|
|
1215
1211
|
|
|
1216
1212
|
this .getBrowser () .getKTXDecoder ()
|
|
1217
|
-
.then (decoder => decoder .loadKTXFromURL (this .URL))
|
|
1213
|
+
.then (decoder => decoder .loadKTXFromURL (this .URL, this .getCache ()))
|
|
1218
1214
|
.then (texture => this .setKTXTexture (texture))
|
|
1219
1215
|
.catch (error => this .setError ({ type: error .message }));
|
|
1220
1216
|
}
|
|
@@ -1222,6 +1218,12 @@ Object .assign (Object .setPrototypeOf (ImageCubeMapTexture .prototype, CubeMapT
|
|
|
1222
1218
|
{
|
|
1223
1219
|
this .setLinear (false);
|
|
1224
1220
|
|
|
1221
|
+
if (this .URL .protocol !== "data:")
|
|
1222
|
+
{
|
|
1223
|
+
if (!this .getCache ())
|
|
1224
|
+
this .URL .searchParams .set ("_", Date .now ());
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1225
1227
|
this .image .attr ("src", this .URL .href);
|
|
1226
1228
|
}
|
|
1227
1229
|
},
|
|
@@ -1247,9 +1249,7 @@ Object .assign (Object .setPrototypeOf (ImageCubeMapTexture .prototype, CubeMapT
|
|
|
1247
1249
|
{
|
|
1248
1250
|
this .setTexture (texture);
|
|
1249
1251
|
this .setTransparent (false);
|
|
1250
|
-
this .setLevels (texture .levels);
|
|
1251
1252
|
this .setSize (texture .baseWidth);
|
|
1252
|
-
this .setGenerateMipMaps (false);
|
|
1253
1253
|
this .updateTextureParameters ();
|
|
1254
1254
|
|
|
1255
1255
|
this .setLoadState ((X3DConstants_default()).COMPLETE_STATE);
|
|
@@ -1270,16 +1270,16 @@ Object .assign (Object .setPrototypeOf (ImageCubeMapTexture .prototype, CubeMapT
|
|
|
1270
1270
|
|
|
1271
1271
|
try
|
|
1272
1272
|
{
|
|
1273
|
-
|
|
1273
|
+
// Create texture.
|
|
1274
1274
|
|
|
1275
|
-
|
|
1276
|
-
this .
|
|
1275
|
+
const
|
|
1276
|
+
gl = this .getBrowser () .getContext (),
|
|
1277
|
+
texture = gl .createTexture ();
|
|
1277
1278
|
|
|
1278
|
-
|
|
1279
|
-
|
|
1279
|
+
gl .bindTexture (gl .TEXTURE_2D, texture);
|
|
1280
|
+
gl .texImage2D (gl .TEXTURE_2D, 0, gl .RGBA, gl .RGBA, gl .UNSIGNED_BYTE, this .image [0]);
|
|
1280
1281
|
|
|
1281
|
-
this .
|
|
1282
|
-
this .updateTextureParameters ();
|
|
1282
|
+
this .imageToCubeMap (texture, this .image .prop ("width"), this .image .prop ("height"), false);
|
|
1283
1283
|
|
|
1284
1284
|
// Update load state.
|
|
1285
1285
|
|
|
@@ -1291,6 +1291,18 @@ Object .assign (Object .setPrototypeOf (ImageCubeMapTexture .prototype, CubeMapT
|
|
|
1291
1291
|
this .setError ({ type: error .message });
|
|
1292
1292
|
}
|
|
1293
1293
|
},
|
|
1294
|
+
imageToCubeMap (texture, width, height)
|
|
1295
|
+
{
|
|
1296
|
+
const aspectRatio = width / height;
|
|
1297
|
+
|
|
1298
|
+
if (Math .abs (aspectRatio - 4/3) < 0.01)
|
|
1299
|
+
this .skyBoxToCubeMap (texture, width, height);
|
|
1300
|
+
|
|
1301
|
+
if (Math .abs (aspectRatio - 2/1) < 0.01)
|
|
1302
|
+
this .panoramaToCubeMap (texture, width, height);
|
|
1303
|
+
|
|
1304
|
+
this .updateTextureParameters ();
|
|
1305
|
+
},
|
|
1294
1306
|
skyBoxToCubeMap: (function ()
|
|
1295
1307
|
{
|
|
1296
1308
|
const offsets = [
|
|
@@ -1310,44 +1322,26 @@ Object .assign (Object .setPrototypeOf (ImageCubeMapTexture .prototype, CubeMapT
|
|
|
1310
1322
|
// | b |
|
|
1311
1323
|
// -----
|
|
1312
1324
|
|
|
1313
|
-
return function ()
|
|
1325
|
+
return function (skyBoxTexture, width, height)
|
|
1314
1326
|
{
|
|
1315
1327
|
const
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
width = image .width,
|
|
1322
|
-
height = image .height,
|
|
1323
|
-
width1_4 = Math .floor (width / 4),
|
|
1324
|
-
height1_3 = Math .floor (height / 3);
|
|
1325
|
-
|
|
1326
|
-
// Scale image.
|
|
1327
|
-
|
|
1328
|
-
if (!Algorithm_default().isPowerOfTwo (width1_4) || !Algorithm_default().isPowerOfTwo (height1_3) || width1_4 * 4 !== width || height1_3 * 3 !== height)
|
|
1329
|
-
{
|
|
1330
|
-
width1_4 = Algorithm_default().nextPowerOfTwo (width1_4);
|
|
1331
|
-
height1_3 = Algorithm_default().nextPowerOfTwo (height1_3);
|
|
1332
|
-
width = width1_4 * 4;
|
|
1333
|
-
height = height1_3 * 3;
|
|
1328
|
+
gl = this .getBrowser () .getContext (),
|
|
1329
|
+
framebuffer = gl .createFramebuffer (),
|
|
1330
|
+
width1_4 = width / 4,
|
|
1331
|
+
height1_3 = height / 3,
|
|
1332
|
+
data = new Uint8Array (width1_4 * height1_3 * 4);
|
|
1334
1333
|
|
|
1335
|
-
|
|
1336
|
-
canvas .height = height;
|
|
1334
|
+
// Init cube map texture.
|
|
1337
1335
|
|
|
1338
|
-
|
|
1339
|
-
}
|
|
1340
|
-
else
|
|
1341
|
-
{
|
|
1342
|
-
canvas .width = width;
|
|
1343
|
-
canvas .height = height;
|
|
1336
|
+
gl .bindTexture (this .getTarget (), this .getTexture ());
|
|
1344
1337
|
|
|
1345
|
-
|
|
1346
|
-
|
|
1338
|
+
for (let i = 0; i < 6; ++ i)
|
|
1339
|
+
gl .texImage2D (this .getTargets () [i], 0, gl .RGBA, width1_4, height1_3, 0, gl .RGBA, gl .UNSIGNED_BYTE, null);
|
|
1347
1340
|
|
|
1348
1341
|
// Extract images.
|
|
1349
1342
|
|
|
1350
|
-
|
|
1343
|
+
gl .bindFramebuffer (gl .FRAMEBUFFER, framebuffer);
|
|
1344
|
+
gl .framebufferTexture2D (gl .FRAMEBUFFER, gl .COLOR_ATTACHMENT0, gl .TEXTURE_2D, skyBoxTexture, 0);
|
|
1351
1345
|
|
|
1352
1346
|
let transparent = false;
|
|
1353
1347
|
|
|
@@ -1355,43 +1349,43 @@ Object .assign (Object .setPrototypeOf (ImageCubeMapTexture .prototype, CubeMapT
|
|
|
1355
1349
|
|
|
1356
1350
|
for (let i = 0; i < 6; ++ i)
|
|
1357
1351
|
{
|
|
1358
|
-
|
|
1352
|
+
gl .copyTexSubImage2D (this .getTargets () [i], 0, 0, 0, offsets [i] .x * width1_4, offsets [i] .y * height1_3, width1_4, height1_3);
|
|
1359
1353
|
|
|
1360
1354
|
// Determine image alpha.
|
|
1361
1355
|
|
|
1362
1356
|
if (!transparent)
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
// Transfer image.
|
|
1357
|
+
{
|
|
1358
|
+
gl .readPixels (offsets [i] .x * width1_4, offsets [i] .y * height1_3, width1_4, height1_3, gl .RGBA, gl .UNSIGNED_BYTE, data);
|
|
1366
1359
|
|
|
1367
|
-
|
|
1360
|
+
transparent = this .isImageTransparent (data);
|
|
1361
|
+
}
|
|
1368
1362
|
}
|
|
1369
1363
|
|
|
1364
|
+
gl .deleteFramebuffer (framebuffer);
|
|
1365
|
+
gl .deleteTexture (skyBoxTexture);
|
|
1366
|
+
|
|
1370
1367
|
// Update size and transparent field.
|
|
1371
1368
|
|
|
1372
1369
|
this .setTransparent (transparent);
|
|
1373
1370
|
this .setSize (width1_4);
|
|
1374
1371
|
};
|
|
1375
1372
|
})(),
|
|
1376
|
-
panoramaToCubeMap ()
|
|
1373
|
+
panoramaToCubeMap (panoramaTexture, width, height)
|
|
1377
1374
|
{
|
|
1378
1375
|
// Mercator Projection
|
|
1379
1376
|
|
|
1380
1377
|
const
|
|
1381
|
-
browser
|
|
1382
|
-
gl
|
|
1383
|
-
shaderNode
|
|
1384
|
-
framebuffer
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
data = new Uint8Array (size * size * 4);
|
|
1378
|
+
browser = this .getBrowser (),
|
|
1379
|
+
gl = browser .getContext (),
|
|
1380
|
+
shaderNode = browser .getPanoramaShader (),
|
|
1381
|
+
framebuffer = gl .createFramebuffer (),
|
|
1382
|
+
textureUnit = browser .getTextureCubeUnit (),
|
|
1383
|
+
size = height / 2,
|
|
1384
|
+
data = new Uint8Array (size * size * 4);
|
|
1389
1385
|
|
|
1390
|
-
//
|
|
1386
|
+
// Adjust panorama texture.
|
|
1391
1387
|
|
|
1392
1388
|
gl .bindTexture (gl .TEXTURE_2D, panoramaTexture);
|
|
1393
|
-
gl .texImage2D (gl .TEXTURE_2D, 0, gl .RGBA, gl .RGBA, gl .UNSIGNED_BYTE, this .image [0]);
|
|
1394
|
-
|
|
1395
1389
|
gl .texParameteri (gl .TEXTURE_2D, gl .TEXTURE_WRAP_S, gl .MIRRORED_REPEAT);
|
|
1396
1390
|
gl .texParameteri (gl .TEXTURE_2D, gl .TEXTURE_WRAP_T, gl .MIRRORED_REPEAT);
|
|
1397
1391
|
gl .texParameteri (gl .TEXTURE_2D, gl .TEXTURE_MIN_FILTER, gl .LINEAR);
|
|
@@ -1462,9 +1456,9 @@ Object .defineProperties (ImageCubeMapTexture,
|
|
|
1462
1456
|
value: "ImageCubeMapTexture",
|
|
1463
1457
|
enumerable: true,
|
|
1464
1458
|
},
|
|
1465
|
-
|
|
1459
|
+
componentInfo:
|
|
1466
1460
|
{
|
|
1467
|
-
value: "CubeMapTexturing",
|
|
1461
|
+
value: Object .freeze ({ name: "CubeMapTexturing", level: 2 }),
|
|
1468
1462
|
enumerable: true,
|
|
1469
1463
|
},
|
|
1470
1464
|
containerField:
|
|
@@ -1474,7 +1468,7 @@ Object .defineProperties (ImageCubeMapTexture,
|
|
|
1474
1468
|
},
|
|
1475
1469
|
specificationRange:
|
|
1476
1470
|
{
|
|
1477
|
-
value: Object .freeze (
|
|
1471
|
+
value: Object .freeze ({ from: "3.0", to: "Infinity" }),
|
|
1478
1472
|
enumerable: true,
|
|
1479
1473
|
},
|
|
1480
1474
|
fieldDefinitions:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/* X_ITE v9.0.2 */(()=>{"use strict";var e={355:e=>{e.exports=window[Symbol.for("X_ITE.X3D-9.0.2")].require("lib/jquery")}},t={};function r(i){var a=t[i];if(void 0!==a)return a.exports;var n=t[i]={exports:{}};return e[i](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Components");var t=r.n(e);const i=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Namespace");var a=r.n(i);const n="precision highp float;precision highp int;precision highp sampler2D;const float M_PI=3.1415926535897932384626433832795;varying vec2 texCoord;uniform sampler2D x3d_PanoramaTexture;uniform int x3d_CurrentFace;vec3 uvToXYZ(const in int face,const in vec2 uv){vec3 xyz;if(face==0)xyz=vec3(1.0,uv.y,uv.x);else if(face==1)xyz=vec3(-1.0,uv.y,-uv.x);else if(face==2)xyz=vec3(uv.x,uv.y,-1.0);else if(face==3)xyz=vec3(-uv.x,uv.y,1.0);else if(face==4)xyz=vec3(uv.y,-1.0,uv.x);else xyz=vec3(-uv.y,1.0,uv.x);return xyz;}vec2 dirToUV(const in vec3 dir){return vec2(0.5+0.5*atan(dir.z,dir.x)/M_PI,1.0-acos(dir.y)/M_PI);}vec3 panoramaToCubeMap(const in int face,const in vec2 texCoord){vec3 scan=uvToXYZ(face,texCoord);vec3 direction=normalize(scan);vec2 src=dirToUV(direction);return texture2D(x3d_PanoramaTexture,src).rgb;}void main(){gl_FragColor=vec4(panoramaToCubeMap(x3d_CurrentFace,texCoord),1.0);}";a().add("Panorama1.fs","x_ite/Browser/CubeMapTexturing/Panorama1.fs",n);const s=n,o="#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;const float M_PI=3.1415926535897932384626433832795;in vec2 texCoord;out vec4 x3d_FragColor;uniform sampler2D x3d_PanoramaTexture;uniform int x3d_CurrentFace;vec3 uvToXYZ(const in int face,const in vec2 uv){switch(face){case 0:return vec3(1.0,uv.y,uv.x);case 1:return vec3(-1.0,uv.y,-uv.x);case 2:return vec3(uv.x,uv.y,-1.0);case 3:return vec3(-uv.x,uv.y,1.0);case 4:return vec3(uv.y,-1.0,uv.x);default:return vec3(-uv.y,1.0,uv.x);}}vec2 dirToUV(const in vec3 dir){return vec2(0.5+0.5*atan(dir.z,dir.x)/M_PI,1.0-acos(dir.y)/M_PI);}vec3 panoramaToCubeMap(const in int face,const in vec2 texCoord){vec3 scan=uvToXYZ(face,texCoord);vec3 direction=normalize(scan);vec2 src=dirToUV(direction);return texture(x3d_PanoramaTexture,src).rgb;}void main(){x3d_FragColor=vec4(panoramaToCubeMap(x3d_CurrentFace,texCoord),1.0);}";a().add("Panorama2.fs","x_ite/Browser/CubeMapTexturing/Panorama2.fs",o);const u=o,d=Symbol();function h(){}Object.assign(h.prototype,{getPanoramaShader(){return this[d]?this[d]:this[d]=this.createShader("Panorama","FullScreen","data:x-shader/x-fragment,"+["",s,u][this.getContext().getVersion()],[],["x3d_PanoramaTexture","x3d_CurrentFace"])}});const c=h;a().add("X3DCubeMapTexturingContext","x_ite/Browser/CubeMapTexturing/X3DCubeMapTexturingContext",c);const p=c,x=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Fields");var T=r.n(x);const l=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Base/X3DFieldDefinition");var g=r.n(l);const m=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Base/FieldDefinitionArray");var _=r.n(m);const f=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Components/Texturing/X3DSingleTextureNode");var w=r.n(f);const b=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Base/X3DConstants");var E=r.n(b);function v(e){w().call(this,e),this.addType(E().X3DEnvironmentTextureNode);const t=this.getBrowser().getContext();this.target=t.TEXTURE_CUBE_MAP,this.targets=[t.TEXTURE_CUBE_MAP_POSITIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_Y,t.TEXTURE_CUBE_MAP_NEGATIVE_Y],this.size=1}Object.assign(Object.setPrototypeOf(v.prototype,w().prototype),{getTarget(){return this.target},getTextureType:()=>4,getTargets(){return this.targets},getSize(){return this.size},setSize(e){this.size=e},clearTexture:(()=>{const e=new Uint8Array([255,255,255,255]);return function(){const t=this.getBrowser().getContext();t.bindTexture(this.getTarget(),this.getTexture());for(const r of this.getTargets())t.texImage2D(r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,e);this.setSize(1),this.setTransparent(!1),this.updateTextureParameters()}})(),updateTextureParameters(){w().prototype.updateTextureParameters.call(this,this.target,this._textureProperties.getValue(),this.texturePropertiesNode,this.size,this.size,!1,!1,!1)},setShaderUniforms(e,t,r,i=t.x3d_Texture[0]){const a=this.getBrowser().getTextureCubeUnit();e.activeTexture(e.TEXTURE0+a),e.bindTexture(e.TEXTURE_CUBE_MAP,this.getTexture()),e.uniform1i(i.textureCube,a)}}),Object.defineProperties(v,{typeName:{value:"X3DEnvironmentTextureNode",enumerable:!0},componentName:{value:"CubeMapTexturing",enumerable:!0}});const y=v;a().add("X3DEnvironmentTextureNode","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode",y);const C=y,M=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Base/X3DCast");var S=r.n(M);const I=window[Symbol.for("X_ITE.X3D-9.0.2")].require("standard/Utility/BitSet");var R=r.n(I);function X(e){C.call(this,e),this.addType(E().ComposedCubeMapTexture),e.getSpecificationVersion()<4&&(this.addAlias("front",this._frontTexture),this.addAlias("back",this._backTexture),this.addAlias("left",this._leftTexture),this.addAlias("right",this._rightTexture),this.addAlias("top",this._topTexture),this.addAlias("bottom",this._bottomTexture)),this.addChildObjects(E().inputOutput,"update",new(T().SFTime)),this.textureNodes=[null,null,null,null,null,null],this.textureBits=new(R())}Object.assign(Object.setPrototypeOf(X.prototype,C.prototype),{initialize(){C.prototype.initialize.call(this);const e=this.getBrowser().getContext();this.frameBuffer=e.createFramebuffer(),this.clearTexture(),this._frontTexture.addInterest("set_texture__",this,0),this._backTexture.addInterest("set_texture__",this,1),this._leftTexture.addInterest("set_texture__",this,2),this._rightTexture.addInterest("set_texture__",this,3),this._topTexture.addInterest("set_texture__",this,5),this._bottomTexture.addInterest("set_texture__",this,4),this._update.addInterest("update",this),this.set_texture__(0,this._frontTexture),this.set_texture__(1,this._backTexture),this.set_texture__(2,this._leftTexture),this.set_texture__(3,this._rightTexture),this.set_texture__(4,this._topTexture),this.set_texture__(5,this._bottomTexture)},set_texture__(e,t){let r=this.textureNodes[e];r?.removeInterest(`set_loadState${e}__`,this),r=this.textureNodes[e]=S()(E().X3DTexture2DNode,t),r?.addInterest(`set_loadState${e}__`,this,e,r),this.set_loadState__(e,r)},set_loadState__(e,t){this.setTextureBit(e,t?.checkLoadState()),this._update.addEvent()},setTextureBit(e,t){this.textureBits.set(e,t===E().COMPLETE_STATE)},isComplete(){if(63!=+this.textureBits)return!1;const e=this.textureNodes,t=e[0].getWidth();for(const r of e){if(r.getWidth()!==t)return!1;if(r.getHeight()!==t)return!1}return!0},update(){if(this.isComplete()){const e=this.getBrowser().getContext(),t=this.textureNodes,r=t[0].getWidth();if(r!==this.getSize()){const t=new Uint8Array(r*r*4);e.bindTexture(this.getTarget(),this.getTexture());for(let i=0;i<6;++i)e.texImage2D(this.getTargets()[i],0,e.RGBA,r,r,0,e.RGBA,e.UNSIGNED_BYTE,t);this.setSize(r),this.updateTextureParameters()}e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer);for(let i=0;i<6;++i){const a=t[i];if(e.bindTexture(e.TEXTURE_2D,a.getTexture()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.getTexture(),0),e.bindTexture(this.getTarget(),this.getTexture()),1===a.getTextureType())e.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,r,r);else for(let t=0;t<r;++t)e.copyTexSubImage2D(this.getTargets()[i],0,0,r-t-1,0,t,r,1)}this.setTransparent(t.some((e=>e.isTransparent()))),this.setLinear(t.some((e=>e.isLinear()))),this.updateTextureParameters()}else this.clearTexture()}}),Object.defineProperties(X,{typeName:{value:"ComposedCubeMapTexture",enumerable:!0},componentName:{value:"CubeMapTexturing",enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze(["3.1","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(_())([new(g())(E().inputOutput,"metadata",new(T().SFNode)),new(g())(E().inputOutput,"description",new(T().SFString)),new(g())(E().inputOutput,"frontTexture",new(T().SFNode)),new(g())(E().inputOutput,"backTexture",new(T().SFNode)),new(g())(E().inputOutput,"leftTexture",new(T().SFNode)),new(g())(E().inputOutput,"rightTexture",new(T().SFNode)),new(g())(E().inputOutput,"topTexture",new(T().SFNode)),new(g())(E().inputOutput,"bottomTexture",new(T().SFNode)),new(g())(E().initializeOnly,"textureProperties",new(T().SFNode))]),enumerable:!0}});for(let e=0;e<6;++e)X.prototype[`set_loadState${e}__`]=function(e,t){this.set_loadState__(e,t)};const D=X;a().add("ComposedCubeMapTexture","x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture",D);const O=D,N=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Base/X3DBaseNode");var P=r.n(N);const U=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Rendering/X3DRenderObject");var B=r.n(U);const A=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Rendering/TraverseType");var F=r.n(A);function z(e){P().call(this,e),B().call(this,e),this.renderObject=null}Object.assign(Object.setPrototypeOf(z.prototype,P().prototype),B().prototype,{initialize(){P().prototype.initialize.call(this),B().prototype.initialize.call(this)},isIndependent:()=>!1,setRenderer(e){this.renderObject=e},getLayer(){return this.renderObject.getLayer()},getBackground(){return this.renderObject.getBackground()},getFog(){return this.renderObject.getFog()},getNavigationInfo(){return this.renderObject.getNavigationInfo()},getViewpoint(){return this.renderObject.getViewpoint()},getLightContainer(){return this.renderObject.getLights()[this.lightIndex++]},render(e,t,r){switch(e){case F().COLLISION:case F().SHADOW:B().prototype.render.call(this,e,t,r);break;case F().DISPLAY:this.lightIndex=0,B().prototype.render.call(this,e,t,r);for(const e of this.renderObject.getLights())e.modelViewMatrix.pop()}}});for(const e of Object.keys(z.prototype))Object.defineProperty(z.prototype,e,{enumerable:!1});const L=z;a().add("DependentRenderer","x_ite/Rendering/DependentRenderer",L);const V=L,j=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Rendering/TextureBuffer");var G=r.n(j);const q=window[Symbol.for("X_ITE.X3D-9.0.2")].require("standard/Math/Geometry/Camera");var k=r.n(q);const Y=window[Symbol.for("X_ITE.X3D-9.0.2")].require("standard/Math/Geometry/ViewVolume");var W=r.n(Y);const H=window[Symbol.for("X_ITE.X3D-9.0.2")].require("standard/Math/Numbers/Rotation4");var $=r.n(H);const Z=window[Symbol.for("X_ITE.X3D-9.0.2")].require("standard/Math/Numbers/Vector3");var K=r.n(Z);const J=window[Symbol.for("X_ITE.X3D-9.0.2")].require("standard/Math/Numbers/Vector4");var Q=r.n(J);const ee=window[Symbol.for("X_ITE.X3D-9.0.2")].require("standard/Math/Numbers/Matrix4");var te=r.n(ee);const re=window[Symbol.for("X_ITE.X3D-9.0.2")].require("standard/Math/Algorithm");var ie=r.n(re);function ae(e){C.call(this,e),this.addType(E().GeneratedCubeMapTexture),this.dependentRenderer=new V(e),this.projectionMatrix=new(te()),this.modelMatrix=new(te()),this.viewVolume=new(W())}Object.assign(Object.setPrototypeOf(ae.prototype,C.prototype),{initialize(){C.prototype.initialize.call(this),this._size.addInterest("set_size__",this),this.dependentRenderer.setup(),this.set_size__()},set_size__(){const e=this.getBrowser().getContext(),t=e.getVersion()>=2?this._size.getValue():ie().nextPowerOfTwo(this._size.getValue());if(t>0){const r=new Uint8Array(t*t*4);e.bindTexture(this.getTarget(),this.getTexture());for(const i of this.getTargets())e.texImage2D(i,0,e.RGBA,t,t,0,e.RGBA,e.UNSIGNED_BYTE,r);this.updateTextureParameters(),this.viewport=new(Q())(0,0,t,t),this.frameBuffer=new(G())(this.getBrowser(),t,t),this.setSize(t)}else this.frameBuffer=null,this.setSize(0)},traverse(e,t){"NONE"!==this._update.getValue()&&t.isIndependent()&&this.frameBuffer&&(t.getGeneratedCubeMapTextures().push(this),this.modelMatrix.assign(t.getModelViewMatrix().get()).multRight(t.getCameraSpaceMatrix().get()))},renderTexture:(()=>{const e=[new($())(K().zAxis,new(K())(0,0,-1)),new($())(K().zAxis,new(K())(0,0,1)),new($())(K().zAxis,new(K())(1,0,0)),new($())(K().zAxis,new(K())(-1,0,0)),new($())(K().zAxis,new(K())(0,-1,0)),new($())(K().zAxis,new(K())(0,1,0))],t=[new(K())(-1,-1,1),new(K())(-1,-1,1),new(K())(-1,-1,1),new(K())(-1,-1,1),new(K())(1,1,1),new(K())(1,1,1)],r=new(te());return function(i){this.dependentRenderer.setRenderer(i);const a=this.dependentRenderer,n=this.getBrowser(),s=i.getLayer(),o=n.getContext(),u=a.getBackground(),d=a.getNavigationInfo(),h=a.getViewpoint(),c=n.getHeadlight(),p=d._headlight.getValue(),x=d.getNearValue(),T=d.getFarValue(h),l=k().perspective(ie().radians(90),x,T,1,1,this.projectionMatrix),g=this.frameBuffer.getWidth(),m=this.frameBuffer.getHeight();this.setTransparent(u.isTransparent()),this.frameBuffer.bind(),a.getViewVolumes().push(this.viewVolume.set(l,this.viewport,this.viewport)),a.getProjectionMatrix().pushMatrix(l),o.bindTexture(this.getTarget(),this.getTexture());for(let i=0;i<6;++i)o.clear(o.COLOR_BUFFER_BIT),a.getCameraSpaceMatrix().pushMatrix(this.modelMatrix),a.getCameraSpaceMatrix().rotate(e[i]),a.getCameraSpaceMatrix().scale(t[i]),a.getViewMatrix().pushMatrix(r.assign(a.getCameraSpaceMatrix().get()).inverse()),a.getModelViewMatrix().pushMatrix(r),p&&(c.modelViewMatrix.pushMatrix(r),c.modelViewMatrix.multLeft(h.getCameraSpaceMatrix())),s.traverse(F().DISPLAY,a),p&&c.modelViewMatrix.pop(),a.getModelViewMatrix().pop(),a.getCameraSpaceMatrix().pop(),a.getViewMatrix().pop(),o.bindTexture(this.getTarget(),this.getTexture()),o.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,g,m);this.updateTextureParameters(),a.getProjectionMatrix().pop(),a.getViewVolumes().pop(),"NEXT_FRAME_ONLY"===this._update.getValue()&&(this._update="NONE")}})(),setShaderUniforms:(()=>{const e=new Float32Array(16);return function(t,r,i,a){C.prototype.setShaderUniforms.call(this,t,r,i,a),i===this.dependentRenderer&&t.uniformMatrix4fv(r.x3d_ModelViewMatrix,!1,e)}})()}),Object.defineProperties(ae,{typeName:{value:"GeneratedCubeMapTexture",enumerable:!0},componentName:{value:"CubeMapTexturing",enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(_())([new(g())(E().inputOutput,"metadata",new(T().SFNode)),new(g())(E().inputOutput,"description",new(T().SFString)),new(g())(E().inputOutput,"update",new(T().SFString)("NONE")),new(g())(E().initializeOnly,"size",new(T().SFInt32)(128)),new(g())(E().initializeOnly,"textureProperties",new(T().SFNode))]),enumerable:!0}});const ne=ae;a().add("GeneratedCubeMapTexture","x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture",ne);const se=ne,oe=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/Components/Networking/X3DUrlObject");var ue=r.n(oe);const de=window[Symbol.for("X_ITE.X3D-9.0.2")].require("standard/Math/Numbers/Vector2");var he=r.n(de);const ce=window[Symbol.for("X_ITE.X3D-9.0.2")].require("x_ite/DEVELOPMENT");var pe=r.n(ce),xe=r(355);const Te=new Uint8Array([255,255,255,255]);function le(e){C.call(this,e),ue().call(this,e),this.addType(E().ImageCubeMapTexture),this.image=xe("<img></img>"),this.canvas=xe("<canvas></canvas>"),this.urlStack=new(T().MFString)}Object.assign(Object.setPrototypeOf(le.prototype,C.prototype),ue().prototype,{initialize(){C.prototype.initialize.call(this),ue().prototype.initialize.call(this);const e=this.getBrowser().getContext();e.bindTexture(this.getTarget(),this.getTexture());for(let t=0;t<6;++t)e.texImage2D(this.getTargets()[t],0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,Te);this.image.on("load",this.setImage.bind(this)),this.image.on("abort error",this.setError.bind(this)),this.image.prop("crossOrigin","Anonymous"),this.requestImmediateLoad().catch(Function.prototype)},unloadData(){this.clearTexture()},loadData(){this.urlStack.setValue(this._url),this.loadNext()},loadNext(){if(0===this.urlStack.length)return this.clearTexture(),void this.setLoadState(E().FAILED_STATE);this.URL=new URL(this.urlStack.shift(),this.getExecutionContext().getBaseURL()),"data:"!==this.URL.protocol&&(this.getCache()||this.URL.searchParams.set("_",Date.now())),this.URL.pathname.match(/\.ktx2?(?:\.gz)?$/)?(this.setLinear(!0),this.getBrowser().getKTXDecoder().then((e=>e.loadKTXFromURL(this.URL))).then((e=>this.setKTXTexture(e))).catch((e=>this.setError({type:e.message})))):(this.setLinear(!1),this.image.attr("src",this.URL.href))},setError(e){"data:"!==this.URL.protocol&&console.warn(`Error loading image '${decodeURI(this.URL.href)}'`,e.type),this.loadNext()},setKTXTexture(e){if(e.target!==this.getTarget())return this.setError({type:"Invalid KTX texture target, must be 'TEXTURE_CUBE_MAP'."});pe()&&"data:"!==this.URL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.URL.href)}'`);try{this.setTexture(e),this.setTransparent(!1),this.setLevels(e.levels),this.setSize(e.baseWidth),this.setGenerateMipMaps(!1),this.updateTextureParameters(),this.setLoadState(E().COMPLETE_STATE)}catch(e){this.setError({type:e.message})}},setImage(){pe()&&"data:"!==this.URL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.URL.href)}'`);try{const e=this.image.prop("width")/this.image.prop("height");Math.abs(e-4/3)<.01&&this.skyBoxToCubeMap(),Math.abs(e-2)<.01&&this.panoramaToCubeMap(),this.setGenerateMipMaps(!0),this.updateTextureParameters(),this.setLoadState(E().COMPLETE_STATE)}catch(e){this.setError({type:e.message})}},skyBoxToCubeMap:function(){const e=[new(he())(1,1),new(he())(3,1),new(he())(0,1),new(he())(2,1),new(he())(1,0),new(he())(1,2)];return function(){const t=this.image[0],r=this.canvas[0],i=r.getContext("2d",{willReadFrequently:!0});let a=t.width,n=t.height,s=Math.floor(a/4),o=Math.floor(n/3);ie().isPowerOfTwo(s)&&ie().isPowerOfTwo(o)&&4*s===a&&3*o===n?(r.width=a,r.height=n,i.drawImage(t,0,0)):(s=ie().nextPowerOfTwo(s),o=ie().nextPowerOfTwo(o),a=4*s,n=3*o,r.width=a,r.height=n,i.drawImage(t,0,0,t.width,t.height,0,0,a,n));const u=this.getBrowser().getContext();let d=!1;u.bindTexture(this.getTarget(),this.getTexture());for(let t=0;t<6;++t){const r=i.getImageData(e[t].x*s,e[t].y*o,s,o).data;d||(d=this.isImageTransparent(r)),u.texImage2D(this.getTargets()[t],0,u.RGBA,s,o,!1,u.RGBA,u.UNSIGNED_BYTE,new Uint8Array(r.buffer))}this.setTransparent(d),this.setSize(s)}}(),panoramaToCubeMap(){const e=this.getBrowser(),t=e.getContext(),r=e.getPanoramaShader(),i=t.createFramebuffer(),a=t.createTexture(),n=e.getTextureCubeUnit(),s=this.image.prop("height")/2,o=new Uint8Array(s*s*4);t.bindTexture(t.TEXTURE_2D,a),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.image[0]),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.MIRRORED_REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.MIRRORED_REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)t.texImage2D(this.getTargets()[e],0,t.RGBA,s,s,0,t.RGBA,t.UNSIGNED_BYTE,null);t.useProgram(r.getProgram()),t.activeTexture(t.TEXTURE0+n),t.bindTexture(t.TEXTURE_2D,a),t.uniform1i(r.x3d_PanoramaTexture,n),t.bindFramebuffer(t.FRAMEBUFFER,i),t.viewport(0,0,s,s),t.disable(t.DEPTH_TEST),t.enable(t.CULL_FACE),t.frontFace(t.CCW),t.clearColor(0,0,0,0),t.bindVertexArray(e.getFullscreenVertexArrayObject());let u=!1;for(let e=0;e<6;++e)t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,this.getTargets()[e],this.getTexture(),0),t.clear(t.COLOR_BUFFER_BIT),t.uniform1i(r.x3d_CurrentFace,e),t.drawArrays(t.TRIANGLES,0,6),u||(t.readPixels(0,0,s,s,t.RGBA,t.UNSIGNED_BYTE,o),u=this.isImageTransparent(o));t.enable(t.DEPTH_TEST),t.deleteFramebuffer(i),t.deleteTexture(a),e.resetTextureUnits(),this.setTransparent(u),this.setSize(s)},dispose(){ue().prototype.dispose.call(this),C.prototype.dispose.call(this)}}),Object.defineProperties(le,{typeName:{value:"ImageCubeMapTexture",enumerable:!0},componentName:{value:"CubeMapTexturing",enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(_())([new(g())(E().inputOutput,"metadata",new(T().SFNode)),new(g())(E().inputOutput,"description",new(T().SFString)),new(g())(E().inputOutput,"load",new(T().SFBool)(!0)),new(g())(E().inputOutput,"url",new(T().MFString)),new(g())(E().inputOutput,"autoRefresh",new(T().SFTime)),new(g())(E().inputOutput,"autoRefreshTimeLimit",new(T().SFTime)(3600)),new(g())(E().initializeOnly,"textureProperties",new(T().SFNode))]),enumerable:!0}});const ge=le;a().add("ImageCubeMapTexture","x_ite/Components/CubeMapTexturing/ImageCubeMapTexture",ge);const me=ge;t().add({name:"CubeMapTexturing",concreteNodes:[O,se,me],abstractNodes:[C],browserContext:p});const _e=void 0;a().add("CubeMapTexturing","assets/components/CubeMapTexturing",_e)})()})();
|
|
1
|
+
/* X_ITE v9.0.3 */(()=>{"use strict";var e={355:e=>{e.exports=window[Symbol.for("X_ITE.X3D-9.0.3")].require("lib/jquery")}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Components");var t=r.n(e);const i=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Namespace");var n=r.n(i);const a="precision highp float;precision highp int;precision highp sampler2D;const float M_PI=3.1415926535897932384626433832795;varying vec2 texCoord;uniform sampler2D x3d_PanoramaTexture;uniform int x3d_CurrentFace;vec3 uvToXYZ(const in int face,const in vec2 uv){vec3 xyz;if(face==0)xyz=vec3(1.0,uv.y,uv.x);else if(face==1)xyz=vec3(-1.0,uv.y,-uv.x);else if(face==2)xyz=vec3(uv.x,uv.y,-1.0);else if(face==3)xyz=vec3(-uv.x,uv.y,1.0);else if(face==4)xyz=vec3(uv.y,-1.0,uv.x);else xyz=vec3(-uv.y,1.0,uv.x);return xyz;}vec2 dirToUV(const in vec3 dir){return vec2(0.5+0.5*atan(dir.z,dir.x)/M_PI,1.0-acos(dir.y)/M_PI);}vec3 panoramaToCubeMap(const in int face,const in vec2 texCoord){vec3 scan=uvToXYZ(face,texCoord);vec3 direction=normalize(scan);vec2 src=dirToUV(direction);return texture2D(x3d_PanoramaTexture,src).rgb;}void main(){gl_FragColor=vec4(panoramaToCubeMap(x3d_CurrentFace,texCoord),1.0);}";n().add("Panorama1.fs","x_ite/Browser/CubeMapTexturing/Panorama1.fs",a);const s=a,o="#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;const float M_PI=3.1415926535897932384626433832795;in vec2 texCoord;out vec4 x3d_FragColor;uniform sampler2D x3d_PanoramaTexture;uniform int x3d_CurrentFace;vec3 uvToXYZ(const in int face,const in vec2 uv){switch(face){case 0:return vec3(1.0,uv.y,uv.x);case 1:return vec3(-1.0,uv.y,-uv.x);case 2:return vec3(uv.x,uv.y,-1.0);case 3:return vec3(-uv.x,uv.y,1.0);case 4:return vec3(uv.y,-1.0,uv.x);default:return vec3(-uv.y,1.0,uv.x);}}vec2 dirToUV(const in vec3 dir){return vec2(0.5+0.5*atan(dir.z,dir.x)/M_PI,1.0-acos(dir.y)/M_PI);}vec3 panoramaToCubeMap(const in int face,const in vec2 texCoord){vec3 scan=uvToXYZ(face,texCoord);vec3 direction=normalize(scan);vec2 src=dirToUV(direction);return texture(x3d_PanoramaTexture,src).rgb;}void main(){x3d_FragColor=vec4(panoramaToCubeMap(x3d_CurrentFace,texCoord),1.0);}";n().add("Panorama2.fs","x_ite/Browser/CubeMapTexturing/Panorama2.fs",o);const u=o,d=Symbol();function h(){}Object.assign(h.prototype,{getPanoramaShader(){return this[d]?this[d]:this[d]=this.createShader("Panorama","FullScreen","data:x-shader/x-fragment,"+["",s,u][this.getContext().getVersion()],[],["x3d_PanoramaTexture","x3d_CurrentFace"])}});const c=h;n().add("X3DCubeMapTexturingContext","x_ite/Browser/CubeMapTexturing/X3DCubeMapTexturingContext",c);const T=c,x=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Fields");var p=r.n(x);const l=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Base/X3DFieldDefinition");var g=r.n(l);const m=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Base/FieldDefinitionArray");var _=r.n(m);const f=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Components/Texturing/X3DSingleTextureNode");var b=r.n(f);const w=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Base/X3DConstants");var E=r.n(w);function v(e){b().call(this,e),this.addType(E().X3DEnvironmentTextureNode);const t=this.getBrowser().getContext();this.target=t.TEXTURE_CUBE_MAP,this.targets=[t.TEXTURE_CUBE_MAP_POSITIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_Y,t.TEXTURE_CUBE_MAP_NEGATIVE_Y],this.size=1}Object.assign(Object.setPrototypeOf(v.prototype,b().prototype),{getTarget(){return this.target},getTextureType:()=>4,getTargets(){return this.targets},getSize(){return this.size},setSize(e){this.size=e},clearTexture:(()=>{const e=new Uint8Array([255,255,255,255]);return function(){const t=this.getBrowser().getContext();t.bindTexture(this.getTarget(),this.getTexture());for(const r of this.getTargets())t.texImage2D(r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,e);this.setSize(1),this.setTransparent(!1),this.updateTextureParameters()}})(),updateTextureParameters(){b().prototype.updateTextureParameters.call(this,this.target,this._textureProperties.getValue(),this.texturePropertiesNode,this.size,this.size,!1,!1,!1)},setShaderUniforms(e,t,r,i=t.x3d_Texture[0]){const n=this.getBrowser().getTextureCubeUnit();e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_CUBE_MAP,this.getTexture()),e.uniform1i(i.textureCube,n)}}),Object.defineProperties(v,{typeName:{value:"X3DEnvironmentTextureNode",enumerable:!0},componentInfo:{value:Object.freeze({name:"CubeMapTexturing",level:1}),enumerable:!0}});const y=v;n().add("X3DEnvironmentTextureNode","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode",y);const C=y,S=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Base/X3DCast");var M=r.n(S);const R=window[Symbol.for("X_ITE.X3D-9.0.3")].require("standard/Utility/BitSet");var I=r.n(R);function D(e){C.call(this,e),this.addType(E().ComposedCubeMapTexture),this.addChildObjects(E().inputOutput,"update",new(p().SFTime)),e.getSpecificationVersion()<=3.3&&(this.addAlias("front",this._frontTexture),this.addAlias("back",this._backTexture),this.addAlias("left",this._leftTexture),this.addAlias("right",this._rightTexture),this.addAlias("top",this._topTexture),this.addAlias("bottom",this._bottomTexture)),this.textureNodes=[null,null,null,null,null,null],this.textureBits=new(I())}Object.assign(Object.setPrototypeOf(D.prototype,C.prototype),{initialize(){C.prototype.initialize.call(this);const e=this.getBrowser().getContext();this.frameBuffer=e.createFramebuffer(),this.clearTexture(),this._frontTexture.addInterest("set_texture__",this,0),this._backTexture.addInterest("set_texture__",this,1),this._leftTexture.addInterest("set_texture__",this,2),this._rightTexture.addInterest("set_texture__",this,3),this._topTexture.addInterest("set_texture__",this,5),this._bottomTexture.addInterest("set_texture__",this,4),this._update.addInterest("update",this),this.set_texture__(0,this._frontTexture),this.set_texture__(1,this._backTexture),this.set_texture__(2,this._leftTexture),this.set_texture__(3,this._rightTexture),this.set_texture__(4,this._topTexture),this.set_texture__(5,this._bottomTexture)},set_texture__(e,t){let r=this.textureNodes[e];r?.removeInterest(`set_loadState${e}__`,this),r=this.textureNodes[e]=M()(E().X3DTexture2DNode,t),r?.addInterest(`set_loadState${e}__`,this,e,r),this.set_loadState__(e,r)},set_loadState__(e,t){this.setTextureBit(e,t?.checkLoadState()),this._update.addEvent()},setTextureBit(e,t){this.textureBits.set(e,t===E().COMPLETE_STATE)},isComplete(){if(63!=+this.textureBits)return!1;const e=this.textureNodes,t=e[0].getWidth();for(const r of e){if(r.getWidth()!==t)return!1;if(r.getHeight()!==t)return!1}return!0},update(){if(this.isComplete()){const e=this.getBrowser().getContext(),t=this.textureNodes,r=t[0].getWidth();if(r!==this.getSize()){const t=new Uint8Array(r*r*4);e.bindTexture(this.getTarget(),this.getTexture());for(let i=0;i<6;++i)e.texImage2D(this.getTargets()[i],0,e.RGBA,r,r,0,e.RGBA,e.UNSIGNED_BYTE,t);this.setSize(r),this.updateTextureParameters()}e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer);for(let i=0;i<6;++i){const n=t[i];if(e.bindTexture(e.TEXTURE_2D,n.getTexture()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n.getTexture(),0),e.bindTexture(this.getTarget(),this.getTexture()),1===n.getTextureType())e.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,r,r);else for(let t=0;t<r;++t)e.copyTexSubImage2D(this.getTargets()[i],0,0,r-t-1,0,t,r,1)}this.setTransparent(t.some((e=>e.isTransparent()))),this.setLinear(t.some((e=>e.isLinear()))),this.updateTextureParameters()}else this.clearTexture()}}),Object.defineProperties(D,{typeName:{value:"ComposedCubeMapTexture",enumerable:!0},componentInfo:{value:Object.freeze({name:"CubeMapTexturing",level:1}),enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.1",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(_())([new(g())(E().inputOutput,"metadata",new(p().SFNode)),new(g())(E().inputOutput,"description",new(p().SFString)),new(g())(E().inputOutput,"frontTexture",new(p().SFNode)),new(g())(E().inputOutput,"backTexture",new(p().SFNode)),new(g())(E().inputOutput,"leftTexture",new(p().SFNode)),new(g())(E().inputOutput,"rightTexture",new(p().SFNode)),new(g())(E().inputOutput,"topTexture",new(p().SFNode)),new(g())(E().inputOutput,"bottomTexture",new(p().SFNode)),new(g())(E().initializeOnly,"textureProperties",new(p().SFNode))]),enumerable:!0}});for(let e=0;e<6;++e)D.prototype[`set_loadState${e}__`]=function(e,t){this.set_loadState__(e,t)};const X=D;n().add("ComposedCubeMapTexture","x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture",X);const O=X,U=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Base/X3DBaseNode");var B=r.n(U);const A=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Rendering/X3DRenderObject");var N=r.n(A);const F=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Rendering/TraverseType");var P=r.n(F);function z(e){B().call(this,e),N().call(this,e),this.renderObject=null}Object.assign(Object.setPrototypeOf(z.prototype,B().prototype),N().prototype,{initialize(){B().prototype.initialize.call(this),N().prototype.initialize.call(this)},isIndependent:()=>!1,setRenderer(e){this.renderObject=e},getLayer(){return this.renderObject.getLayer()},getBackground(){return this.renderObject.getBackground()},getFog(){return this.renderObject.getFog()},getNavigationInfo(){return this.renderObject.getNavigationInfo()},getViewpoint(){return this.renderObject.getViewpoint()},getLightContainer(){return this.renderObject.getLights()[this.lightIndex++]},render(e,t,r){switch(e){case P().COLLISION:case P().SHADOW:N().prototype.render.call(this,e,t,r);break;case P().DISPLAY:this.lightIndex=0,N().prototype.render.call(this,e,t,r);for(const e of this.renderObject.getLights())e.modelViewMatrix.pop()}}});for(const e of Object.keys(z.prototype))Object.defineProperty(z.prototype,e,{enumerable:!1});const L=z;n().add("DependentRenderer","x_ite/Rendering/DependentRenderer",L);const V=L,j=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Rendering/TextureBuffer");var G=r.n(j);const q=window[Symbol.for("X_ITE.X3D-9.0.3")].require("standard/Math/Geometry/Camera");var k=r.n(q);const Y=window[Symbol.for("X_ITE.X3D-9.0.3")].require("standard/Math/Geometry/ViewVolume");var H=r.n(Y);const W=window[Symbol.for("X_ITE.X3D-9.0.3")].require("standard/Math/Numbers/Rotation4");var $=r.n(W);const Z=window[Symbol.for("X_ITE.X3D-9.0.3")].require("standard/Math/Numbers/Vector3");var K=r.n(Z);const J=window[Symbol.for("X_ITE.X3D-9.0.3")].require("standard/Math/Numbers/Vector4");var Q=r.n(J);const ee=window[Symbol.for("X_ITE.X3D-9.0.3")].require("standard/Math/Numbers/Matrix4");var te=r.n(ee);const re=window[Symbol.for("X_ITE.X3D-9.0.3")].require("standard/Math/Algorithm");var ie=r.n(re);function ne(e){C.call(this,e),this.addType(E().GeneratedCubeMapTexture),this.dependentRenderer=new V(e),this.projectionMatrix=new(te()),this.modelMatrix=new(te()),this.viewVolume=new(H())}Object.assign(Object.setPrototypeOf(ne.prototype,C.prototype),{initialize(){C.prototype.initialize.call(this),this._size.addInterest("set_size__",this),this.dependentRenderer.setup(),this.set_size__()},set_size__(){const e=this.getBrowser().getContext(),t=e.getVersion()>=2?this._size.getValue():ie().nextPowerOfTwo(this._size.getValue());if(t>0){const r=new Uint8Array(t*t*4);e.bindTexture(this.getTarget(),this.getTexture());for(const i of this.getTargets())e.texImage2D(i,0,e.RGBA,t,t,0,e.RGBA,e.UNSIGNED_BYTE,r);this.updateTextureParameters(),this.viewport=new(Q())(0,0,t,t),this.frameBuffer=new(G())(this.getBrowser(),t,t),this.setSize(t)}else this.frameBuffer=null,this.setSize(0)},traverse(e,t){"NONE"!==this._update.getValue()&&t.isIndependent()&&this.frameBuffer&&(t.getGeneratedCubeMapTextures().push(this),this.modelMatrix.assign(t.getModelViewMatrix().get()).multRight(t.getCameraSpaceMatrix().get()))},renderTexture:(()=>{const e=[new($())(K().zAxis,new(K())(0,0,-1)),new($())(K().zAxis,new(K())(0,0,1)),new($())(K().zAxis,new(K())(1,0,0)),new($())(K().zAxis,new(K())(-1,0,0)),new($())(K().zAxis,new(K())(0,-1,0)),new($())(K().zAxis,new(K())(0,1,0))],t=[new(K())(-1,-1,1),new(K())(-1,-1,1),new(K())(-1,-1,1),new(K())(-1,-1,1),new(K())(1,1,1),new(K())(1,1,1)],r=new(te());return function(i){this.dependentRenderer.setRenderer(i);const n=this.dependentRenderer,a=this.getBrowser(),s=i.getLayer(),o=a.getContext(),u=n.getBackground(),d=n.getNavigationInfo(),h=n.getViewpoint(),c=a.getHeadlight(),T=d._headlight.getValue(),x=d.getNearValue(),p=d.getFarValue(h),l=k().perspective(ie().radians(90),x,p,1,1,this.projectionMatrix),g=this.frameBuffer.getWidth(),m=this.frameBuffer.getHeight();this.setTransparent(u.isTransparent()),this.frameBuffer.bind(),n.getViewVolumes().push(this.viewVolume.set(l,this.viewport,this.viewport)),n.getProjectionMatrix().pushMatrix(l),o.bindTexture(this.getTarget(),this.getTexture());for(let i=0;i<6;++i)o.clear(o.COLOR_BUFFER_BIT),n.getCameraSpaceMatrix().pushMatrix(this.modelMatrix),n.getCameraSpaceMatrix().rotate(e[i]),n.getCameraSpaceMatrix().scale(t[i]),n.getViewMatrix().pushMatrix(r.assign(n.getCameraSpaceMatrix().get()).inverse()),n.getModelViewMatrix().pushMatrix(r),T&&(c.modelViewMatrix.pushMatrix(r),c.modelViewMatrix.multLeft(h.getCameraSpaceMatrix())),s.traverse(P().DISPLAY,n),T&&c.modelViewMatrix.pop(),n.getModelViewMatrix().pop(),n.getCameraSpaceMatrix().pop(),n.getViewMatrix().pop(),o.bindTexture(this.getTarget(),this.getTexture()),o.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,g,m);this.updateTextureParameters(),n.getProjectionMatrix().pop(),n.getViewVolumes().pop(),"NEXT_FRAME_ONLY"===this._update.getValue()&&(this._update="NONE")}})(),setShaderUniforms:(()=>{const e=new Float32Array(16);return function(t,r,i,n){C.prototype.setShaderUniforms.call(this,t,r,i,n),i===this.dependentRenderer&&t.uniformMatrix4fv(r.x3d_ModelViewMatrix,!1,e)}})()}),Object.defineProperties(ne,{typeName:{value:"GeneratedCubeMapTexture",enumerable:!0},componentInfo:{value:Object.freeze({name:"CubeMapTexturing",level:3}),enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(_())([new(g())(E().inputOutput,"metadata",new(p().SFNode)),new(g())(E().inputOutput,"description",new(p().SFString)),new(g())(E().inputOutput,"update",new(p().SFString)("NONE")),new(g())(E().initializeOnly,"size",new(p().SFInt32)(128)),new(g())(E().initializeOnly,"textureProperties",new(p().SFNode))]),enumerable:!0}});const ae=ne;n().add("GeneratedCubeMapTexture","x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture",ae);const se=ae,oe=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/Components/Networking/X3DUrlObject");var ue=r.n(oe);const de=window[Symbol.for("X_ITE.X3D-9.0.3")].require("standard/Math/Numbers/Vector2");var he=r.n(de);const ce=window[Symbol.for("X_ITE.X3D-9.0.3")].require("x_ite/DEVELOPMENT");var Te=r.n(ce),xe=r(355);const pe=new Uint8Array([255,255,255,255]);function le(e){C.call(this,e),ue().call(this,e),this.addType(E().ImageCubeMapTexture),this.image=xe("<img></img>"),this.urlStack=new(p().MFString)}Object.assign(Object.setPrototypeOf(le.prototype,C.prototype),ue().prototype,{initialize(){C.prototype.initialize.call(this),ue().prototype.initialize.call(this);const e=this.getBrowser().getContext();e.bindTexture(this.getTarget(),this.getTexture());for(let t=0;t<6;++t)e.texImage2D(this.getTargets()[t],0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,pe);this.image.on("load",this.setImage.bind(this)),this.image.on("abort error",this.setError.bind(this)),this.image.prop("crossOrigin","Anonymous"),this.requestImmediateLoad().catch(Function.prototype)},unloadData(){this.clearTexture()},loadData(){this.urlStack.setValue(this._url),this.loadNext()},loadNext(){if(0===this.urlStack.length)return this.clearTexture(),void this.setLoadState(E().FAILED_STATE);this.URL=new URL(this.urlStack.shift(),this.getExecutionContext().getBaseURL()),this.URL.pathname.match(/\.ktx2?(?:\.gz)?$/)||this.URL.href.match(/^data:image\/ktx2[;,]/)?(this.setLinear(!0),this.getBrowser().getKTXDecoder().then((e=>e.loadKTXFromURL(this.URL,this.getCache()))).then((e=>this.setKTXTexture(e))).catch((e=>this.setError({type:e.message})))):(this.setLinear(!1),"data:"!==this.URL.protocol&&(this.getCache()||this.URL.searchParams.set("_",Date.now())),this.image.attr("src",this.URL.href))},setError(e){"data:"!==this.URL.protocol&&console.warn(`Error loading image '${decodeURI(this.URL.href)}'`,e.type),this.loadNext()},setKTXTexture(e){if(e.target!==this.getTarget())return this.setError({type:"Invalid KTX texture target, must be 'TEXTURE_CUBE_MAP'."});Te()&&"data:"!==this.URL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.URL.href)}'`);try{this.setTexture(e),this.setTransparent(!1),this.setSize(e.baseWidth),this.updateTextureParameters(),this.setLoadState(E().COMPLETE_STATE)}catch(e){this.setError({type:e.message})}},setImage(){Te()&&"data:"!==this.URL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.URL.href)}'`);try{const e=this.getBrowser().getContext(),t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.image[0]),this.imageToCubeMap(t,this.image.prop("width"),this.image.prop("height"),!1),this.setLoadState(E().COMPLETE_STATE)}catch(e){this.setError({type:e.message})}},imageToCubeMap(e,t,r){const i=t/r;Math.abs(i-4/3)<.01&&this.skyBoxToCubeMap(e,t,r),Math.abs(i-2)<.01&&this.panoramaToCubeMap(e,t,r),this.updateTextureParameters()},skyBoxToCubeMap:function(){const e=[new(he())(1,1),new(he())(3,1),new(he())(0,1),new(he())(2,1),new(he())(1,0),new(he())(1,2)];return function(t,r,i){const n=this.getBrowser().getContext(),a=n.createFramebuffer(),s=r/4,o=i/3,u=new Uint8Array(s*o*4);n.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)n.texImage2D(this.getTargets()[e],0,n.RGBA,s,o,0,n.RGBA,n.UNSIGNED_BYTE,null);n.bindFramebuffer(n.FRAMEBUFFER,a),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0);let d=!1;n.bindTexture(this.getTarget(),this.getTexture());for(let t=0;t<6;++t)n.copyTexSubImage2D(this.getTargets()[t],0,0,0,e[t].x*s,e[t].y*o,s,o),d||(n.readPixels(e[t].x*s,e[t].y*o,s,o,n.RGBA,n.UNSIGNED_BYTE,u),d=this.isImageTransparent(u));n.deleteFramebuffer(a),n.deleteTexture(t),this.setTransparent(d),this.setSize(s)}}(),panoramaToCubeMap(e,t,r){const i=this.getBrowser(),n=i.getContext(),a=i.getPanoramaShader(),s=n.createFramebuffer(),o=i.getTextureCubeUnit(),u=r/2,d=new Uint8Array(u*u*4);n.bindTexture(n.TEXTURE_2D,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.MIRRORED_REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.MIRRORED_REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)n.texImage2D(this.getTargets()[e],0,n.RGBA,u,u,0,n.RGBA,n.UNSIGNED_BYTE,null);n.useProgram(a.getProgram()),n.activeTexture(n.TEXTURE0+o),n.bindTexture(n.TEXTURE_2D,e),n.uniform1i(a.x3d_PanoramaTexture,o),n.bindFramebuffer(n.FRAMEBUFFER,s),n.viewport(0,0,u,u),n.disable(n.DEPTH_TEST),n.enable(n.CULL_FACE),n.frontFace(n.CCW),n.clearColor(0,0,0,0),n.bindVertexArray(i.getFullscreenVertexArrayObject());let h=!1;for(let e=0;e<6;++e)n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,this.getTargets()[e],this.getTexture(),0),n.clear(n.COLOR_BUFFER_BIT),n.uniform1i(a.x3d_CurrentFace,e),n.drawArrays(n.TRIANGLES,0,6),h||(n.readPixels(0,0,u,u,n.RGBA,n.UNSIGNED_BYTE,d),h=this.isImageTransparent(d));n.enable(n.DEPTH_TEST),n.deleteFramebuffer(s),n.deleteTexture(e),i.resetTextureUnits(),this.setTransparent(h),this.setSize(u)},dispose(){ue().prototype.dispose.call(this),C.prototype.dispose.call(this)}}),Object.defineProperties(le,{typeName:{value:"ImageCubeMapTexture",enumerable:!0},componentInfo:{value:Object.freeze({name:"CubeMapTexturing",level:2}),enumerable:!0},containerField:{value:"texture",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(_())([new(g())(E().inputOutput,"metadata",new(p().SFNode)),new(g())(E().inputOutput,"description",new(p().SFString)),new(g())(E().inputOutput,"load",new(p().SFBool)(!0)),new(g())(E().inputOutput,"url",new(p().MFString)),new(g())(E().inputOutput,"autoRefresh",new(p().SFTime)),new(g())(E().inputOutput,"autoRefreshTimeLimit",new(p().SFTime)(3600)),new(g())(E().initializeOnly,"textureProperties",new(p().SFNode))]),enumerable:!0}});const ge=le;n().add("ImageCubeMapTexture","x_ite/Components/CubeMapTexturing/ImageCubeMapTexture",ge);const me=ge;t().add({name:"CubeMapTexturing",concreteNodes:[O,se,me],abstractNodes:[C],browserContext:T});const _e=void 0;n().add("CubeMapTexturing","assets/components/CubeMapTexturing",_e)})()})();
|