x_ite 11.5.10 → 11.5.12
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/README.md +4 -4
- package/dist/X3DUOM.xml +2 -0
- package/dist/assets/components/AnnotationComponent.js +2 -378
- package/dist/assets/components/AnnotationComponent.min.js +2 -2
- package/dist/assets/components/CADGeometryComponent.js +2 -378
- package/dist/assets/components/CADGeometryComponent.min.js +2 -2
- package/dist/assets/components/CubeMapTexturingComponent.js +7 -336
- package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
- package/dist/assets/components/DISComponent.js +2 -331
- package/dist/assets/components/DISComponent.min.js +2 -2
- package/dist/assets/components/EventUtilitiesComponent.js +2 -472
- package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
- package/dist/assets/components/Geometry2DComponent.js +2 -707
- package/dist/assets/components/Geometry2DComponent.min.js +2 -2
- package/dist/assets/components/GeospatialComponent.js +4 -897
- package/dist/assets/components/GeospatialComponent.min.js +2 -2
- package/dist/assets/components/HAnimComponent.js +83 -337
- package/dist/assets/components/HAnimComponent.min.js +2 -2
- package/dist/assets/components/KeyDeviceSensorComponent.js +2 -237
- package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -2
- package/dist/assets/components/LayoutComponent.js +2 -425
- package/dist/assets/components/LayoutComponent.min.js +2 -2
- package/dist/assets/components/NURBSComponent.js +3 -896
- package/dist/assets/components/NURBSComponent.min.js +2 -2
- package/dist/assets/components/ParticleSystemsComponent.js +26 -732
- package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
- package/dist/assets/components/PickingComponent.js +2 -566
- package/dist/assets/components/PickingComponent.min.js +2 -2
- package/dist/assets/components/RigidBodyPhysicsComponent.js +2 -942
- package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -2
- package/dist/assets/components/ScriptingComponent.js +2 -190
- package/dist/assets/components/ScriptingComponent.min.js +2 -2
- package/dist/assets/components/TextComponent.js +2 -379
- package/dist/assets/components/TextComponent.min.js +2 -2
- package/dist/assets/components/TextureProjectionComponent.js +8 -196
- package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
- package/dist/assets/components/Texturing3DComponent.js +3569 -4133
- package/dist/assets/components/Texturing3DComponent.min.js +2 -2
- package/dist/assets/components/VolumeRenderingComponent.js +11 -906
- package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
- package/dist/assets/components/WebXRComponent.js +5 -145
- package/dist/assets/components/WebXRComponent.min.js +2 -2
- package/dist/assets/components/X_ITEComponent.js +273 -901
- package/dist/assets/components/X_ITEComponent.min.js +2 -2
- package/dist/assets/fonts/PT_Sans/OFL.txt +94 -94
- package/dist/assets/lib/draco_decoder_gltf.js +1 -1
- package/dist/assets/lib/libktx.js +1 -1
- package/dist/assets/lib/libktx.wasm +0 -0
- package/dist/assets/lib/woff2_decoder.js +1 -1
- package/dist/example.html +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +50500 -70043
- package/dist/x_ite.min.js +2 -2
- package/dist/x_ite.min.mjs +2 -2
- package/dist/x_ite.mjs +50447 -69990
- package/dist/x_ite.zip +0 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* X_ITE v11.5.
|
|
2
|
-
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.5.
|
|
1
|
+
/* X_ITE v11.5.12 */
|
|
2
|
+
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.5.12")];
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ "use strict";
|
|
5
5
|
/******/ var __webpack_modules__ = ({
|
|
@@ -79,64 +79,17 @@ const external_X_ITE_X3D_Namespace_namespaceObject = __X_ITE_X3D__ .Namespace;
|
|
|
79
79
|
var external_X_ITE_X3D_Namespace_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Namespace_namespaceObject);
|
|
80
80
|
;// ./src/x_ite/Browser/CubeMapTexturing/Panorama1.fs.js
|
|
81
81
|
const __default__ = /* glsl */ `
|
|
82
|
-
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
|
|
82
|
+
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.,uv.y,uv.x);else if(face==1)xyz=vec3(-1.,uv.y,-uv.x);else if(face==2)xyz=vec3(uv.x,uv.y,-1.);else if(face==3)xyz=vec3(-uv.x,uv.y,1.);else if(face==4)xyz=vec3(uv.y,-1.,uv.x);else xyz=vec3(-uv.y,1.,uv.x);return xyz;}vec2 dirToUV(const in vec3 dir){return vec2(.5+.5*atan(dir.z,dir.x)/M_PI,1.-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.);}`
|
|
83
83
|
;
|
|
84
84
|
|
|
85
85
|
/* harmony default export */ const Panorama1_fs = (external_X_ITE_X3D_Namespace_default().add ("Panorama1.fs", __default__));
|
|
86
86
|
;// ./src/x_ite/Browser/CubeMapTexturing/Panorama2.fs.js
|
|
87
87
|
const Panorama2_fs_default_ = /* glsl */ `#version 300 es
|
|
88
|
-
precision 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
|
|
88
|
+
precision 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.,uv.y,uv.x);case 1:return vec3(-1.,uv.y,-uv.x);case 2:return vec3(uv.x,uv.y,-1.);case 3:return vec3(-uv.x,uv.y,1.);case 4:return vec3(uv.y,-1.,uv.x);default:return vec3(-uv.y,1.,uv.x);}}vec2 dirToUV(const in vec3 dir){return vec2(.5+.5*atan(dir.z,dir.x)/M_PI,1.-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.);}`
|
|
89
89
|
;
|
|
90
90
|
|
|
91
91
|
/* harmony default export */ const Panorama2_fs = (external_X_ITE_X3D_Namespace_default().add ("Panorama2.fs", Panorama2_fs_default_));
|
|
92
92
|
;// ./src/x_ite/Browser/CubeMapTexturing/X3DCubeMapTexturingContext.js
|
|
93
|
-
/*******************************************************************************
|
|
94
|
-
*
|
|
95
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
96
|
-
*
|
|
97
|
-
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
98
|
-
*
|
|
99
|
-
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
100
|
-
*
|
|
101
|
-
* The copyright notice above does not evidence any actual of intended
|
|
102
|
-
* publication of such source code, and is an unpublished work by create3000.
|
|
103
|
-
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
104
|
-
* create3000.
|
|
105
|
-
*
|
|
106
|
-
* No permission is granted to copy, distribute, or create derivative works from
|
|
107
|
-
* the contents of this software, in whole or in part, without the prior written
|
|
108
|
-
* permission of create3000.
|
|
109
|
-
*
|
|
110
|
-
* NON-MILITARY USE ONLY
|
|
111
|
-
*
|
|
112
|
-
* All create3000 software are effectively free software with a non-military use
|
|
113
|
-
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
114
|
-
* source in any way you please with the exception anything that uses it must be
|
|
115
|
-
* marked to indicate is contains 'non-military use only' components.
|
|
116
|
-
*
|
|
117
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
118
|
-
*
|
|
119
|
-
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
120
|
-
*
|
|
121
|
-
* This file is part of the X_ITE Project.
|
|
122
|
-
*
|
|
123
|
-
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
124
|
-
* terms of the GNU General Public License version 3 only, as published by the
|
|
125
|
-
* Free Software Foundation.
|
|
126
|
-
*
|
|
127
|
-
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
128
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
129
|
-
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
130
|
-
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
131
|
-
*
|
|
132
|
-
* You should have received a copy of the GNU General Public License version 3
|
|
133
|
-
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
134
|
-
* copy of the GPLv3 License.
|
|
135
|
-
*
|
|
136
|
-
* For Silvio, Joy and Adi.
|
|
137
|
-
*
|
|
138
|
-
******************************************************************************/
|
|
139
|
-
|
|
140
93
|
|
|
141
94
|
|
|
142
95
|
|
|
@@ -176,53 +129,6 @@ var external_X_ITE_X3D_X3DSingleTextureNode_default = /*#__PURE__*/__webpack_req
|
|
|
176
129
|
const external_X_ITE_X3D_X3DConstants_namespaceObject = __X_ITE_X3D__ .X3DConstants;
|
|
177
130
|
var external_X_ITE_X3D_X3DConstants_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DConstants_namespaceObject);
|
|
178
131
|
;// ./src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js
|
|
179
|
-
/*******************************************************************************
|
|
180
|
-
*
|
|
181
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
182
|
-
*
|
|
183
|
-
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
184
|
-
*
|
|
185
|
-
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
186
|
-
*
|
|
187
|
-
* The copyright notice above does not evidence any actual of intended
|
|
188
|
-
* publication of such source code, and is an unpublished work by create3000.
|
|
189
|
-
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
190
|
-
* create3000.
|
|
191
|
-
*
|
|
192
|
-
* No permission is granted to copy, distribute, or create derivative works from
|
|
193
|
-
* the contents of this software, in whole or in part, without the prior written
|
|
194
|
-
* permission of create3000.
|
|
195
|
-
*
|
|
196
|
-
* NON-MILITARY USE ONLY
|
|
197
|
-
*
|
|
198
|
-
* All create3000 software are effectively free software with a non-military use
|
|
199
|
-
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
200
|
-
* source in any way you please with the exception anything that uses it must be
|
|
201
|
-
* marked to indicate is contains 'non-military use only' components.
|
|
202
|
-
*
|
|
203
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
204
|
-
*
|
|
205
|
-
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
206
|
-
*
|
|
207
|
-
* This file is part of the X_ITE Project.
|
|
208
|
-
*
|
|
209
|
-
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
210
|
-
* terms of the GNU General Public License version 3 only, as published by the
|
|
211
|
-
* Free Software Foundation.
|
|
212
|
-
*
|
|
213
|
-
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
214
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
215
|
-
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
216
|
-
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
217
|
-
*
|
|
218
|
-
* You should have received a copy of the GNU General Public License version 3
|
|
219
|
-
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
220
|
-
* copy of the GPLv3 License.
|
|
221
|
-
*
|
|
222
|
-
* For Silvio, Joy and Adi.
|
|
223
|
-
*
|
|
224
|
-
******************************************************************************/
|
|
225
|
-
|
|
226
132
|
|
|
227
133
|
|
|
228
134
|
|
|
@@ -315,7 +221,7 @@ Object .assign (Object .setPrototypeOf (X3DEnvironmentTextureNode .prototype, (e
|
|
|
315
221
|
},
|
|
316
222
|
setShaderUniforms (gl, shaderObject, renderObject, channel = shaderObject .x3d_Texture [0])
|
|
317
223
|
{
|
|
318
|
-
const textureUnit = this .getBrowser () .
|
|
224
|
+
const textureUnit = this .getBrowser () .getTextureUnit ();
|
|
319
225
|
|
|
320
226
|
gl .activeTexture (gl .TEXTURE0 + textureUnit);
|
|
321
227
|
gl .bindTexture (gl .TEXTURE_CUBE_MAP, this .getTexture ());
|
|
@@ -336,53 +242,6 @@ var external_X_ITE_X3D_X3DCast_default = /*#__PURE__*/__webpack_require__.n(exte
|
|
|
336
242
|
const external_X_ITE_X3D_BitSet_namespaceObject = __X_ITE_X3D__ .BitSet;
|
|
337
243
|
var external_X_ITE_X3D_BitSet_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_BitSet_namespaceObject);
|
|
338
244
|
;// ./src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js
|
|
339
|
-
/*******************************************************************************
|
|
340
|
-
*
|
|
341
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
342
|
-
*
|
|
343
|
-
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
344
|
-
*
|
|
345
|
-
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
346
|
-
*
|
|
347
|
-
* The copyright notice above does not evidence any actual of intended
|
|
348
|
-
* publication of such source code, and is an unpublished work by create3000.
|
|
349
|
-
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
350
|
-
* create3000.
|
|
351
|
-
*
|
|
352
|
-
* No permission is granted to copy, distribute, or create derivative works from
|
|
353
|
-
* the contents of this software, in whole or in part, without the prior written
|
|
354
|
-
* permission of create3000.
|
|
355
|
-
*
|
|
356
|
-
* NON-MILITARY USE ONLY
|
|
357
|
-
*
|
|
358
|
-
* All create3000 software are effectively free software with a non-military use
|
|
359
|
-
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
360
|
-
* source in any way you please with the exception anything that uses it must be
|
|
361
|
-
* marked to indicate is contains 'non-military use only' components.
|
|
362
|
-
*
|
|
363
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
364
|
-
*
|
|
365
|
-
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
366
|
-
*
|
|
367
|
-
* This file is part of the X_ITE Project.
|
|
368
|
-
*
|
|
369
|
-
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
370
|
-
* terms of the GNU General Public License version 3 only, as published by the
|
|
371
|
-
* Free Software Foundation.
|
|
372
|
-
*
|
|
373
|
-
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
374
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
375
|
-
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
376
|
-
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
377
|
-
*
|
|
378
|
-
* You should have received a copy of the GNU General Public License version 3
|
|
379
|
-
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
380
|
-
* copy of the GPLv3 License.
|
|
381
|
-
*
|
|
382
|
-
* For Silvio, Joy and Adi.
|
|
383
|
-
*
|
|
384
|
-
******************************************************************************/
|
|
385
|
-
|
|
386
245
|
|
|
387
246
|
|
|
388
247
|
|
|
@@ -595,53 +454,6 @@ var external_X_ITE_X3D_X3DRenderObject_default = /*#__PURE__*/__webpack_require_
|
|
|
595
454
|
const external_X_ITE_X3D_TraverseType_namespaceObject = __X_ITE_X3D__ .TraverseType;
|
|
596
455
|
var external_X_ITE_X3D_TraverseType_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_TraverseType_namespaceObject);
|
|
597
456
|
;// ./src/x_ite/Rendering/DependentRenderer.js
|
|
598
|
-
/*******************************************************************************
|
|
599
|
-
*
|
|
600
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
601
|
-
*
|
|
602
|
-
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
603
|
-
*
|
|
604
|
-
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
605
|
-
*
|
|
606
|
-
* The copyright notice above does not evidence any actual of intended
|
|
607
|
-
* publication of such source code, and is an unpublished work by create3000.
|
|
608
|
-
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
609
|
-
* create3000.
|
|
610
|
-
*
|
|
611
|
-
* No permission is granted to copy, distribute, or create derivative works from
|
|
612
|
-
* the contents of this software, in whole or in part, without the prior written
|
|
613
|
-
* permission of create3000.
|
|
614
|
-
*
|
|
615
|
-
* NON-MILITARY USE ONLY
|
|
616
|
-
*
|
|
617
|
-
* All create3000 software are effectively free software with a non-military use
|
|
618
|
-
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
619
|
-
* source in any way you please with the exception anything that uses it must be
|
|
620
|
-
* marked to indicate is contains 'non-military use only' components.
|
|
621
|
-
*
|
|
622
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
623
|
-
*
|
|
624
|
-
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
625
|
-
*
|
|
626
|
-
* This file is part of the X_ITE Project.
|
|
627
|
-
*
|
|
628
|
-
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
629
|
-
* terms of the GNU General Public License version 3 only, as published by the
|
|
630
|
-
* Free Software Foundation.
|
|
631
|
-
*
|
|
632
|
-
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
633
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
634
|
-
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
635
|
-
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
636
|
-
*
|
|
637
|
-
* You should have received a copy of the GNU General Public License version 3
|
|
638
|
-
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
639
|
-
* copy of the GPLv3 License.
|
|
640
|
-
*
|
|
641
|
-
* For Silvio, Joy and Adi.
|
|
642
|
-
*
|
|
643
|
-
******************************************************************************/
|
|
644
|
-
|
|
645
457
|
|
|
646
458
|
|
|
647
459
|
|
|
@@ -769,53 +581,6 @@ var external_X_ITE_X3D_Matrix4_default = /*#__PURE__*/__webpack_require__.n(exte
|
|
|
769
581
|
const external_X_ITE_X3D_Algorithm_namespaceObject = __X_ITE_X3D__ .Algorithm;
|
|
770
582
|
var external_X_ITE_X3D_Algorithm_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Algorithm_namespaceObject);
|
|
771
583
|
;// ./src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js
|
|
772
|
-
/*******************************************************************************
|
|
773
|
-
*
|
|
774
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
775
|
-
*
|
|
776
|
-
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
777
|
-
*
|
|
778
|
-
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
779
|
-
*
|
|
780
|
-
* The copyright notice above does not evidence any actual of intended
|
|
781
|
-
* publication of such source code, and is an unpublished work by create3000.
|
|
782
|
-
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
783
|
-
* create3000.
|
|
784
|
-
*
|
|
785
|
-
* No permission is granted to copy, distribute, or create derivative works from
|
|
786
|
-
* the contents of this software, in whole or in part, without the prior written
|
|
787
|
-
* permission of create3000.
|
|
788
|
-
*
|
|
789
|
-
* NON-MILITARY USE ONLY
|
|
790
|
-
*
|
|
791
|
-
* All create3000 software are effectively free software with a non-military use
|
|
792
|
-
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
793
|
-
* source in any way you please with the exception anything that uses it must be
|
|
794
|
-
* marked to indicate is contains 'non-military use only' components.
|
|
795
|
-
*
|
|
796
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
797
|
-
*
|
|
798
|
-
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
799
|
-
*
|
|
800
|
-
* This file is part of the X_ITE Project.
|
|
801
|
-
*
|
|
802
|
-
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
803
|
-
* terms of the GNU General Public License version 3 only, as published by the
|
|
804
|
-
* Free Software Foundation.
|
|
805
|
-
*
|
|
806
|
-
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
807
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
808
|
-
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
809
|
-
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
810
|
-
*
|
|
811
|
-
* You should have received a copy of the GNU General Public License version 3
|
|
812
|
-
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
813
|
-
* copy of the GPLv3 License.
|
|
814
|
-
*
|
|
815
|
-
* For Silvio, Joy and Adi.
|
|
816
|
-
*
|
|
817
|
-
******************************************************************************/
|
|
818
|
-
|
|
819
584
|
|
|
820
585
|
|
|
821
586
|
|
|
@@ -883,7 +648,7 @@ Object .assign (Object .setPrototypeOf (GeneratedCubeMapTexture .prototype, Cube
|
|
|
883
648
|
// Properties
|
|
884
649
|
|
|
885
650
|
this .viewport = new (external_X_ITE_X3D_Vector4_default()) (0, 0, size, size);
|
|
886
|
-
this .frameBuffer = new (external_X_ITE_X3D_TextureBuffer_default()) (this .getBrowser (), size, size);
|
|
651
|
+
this .frameBuffer = new (external_X_ITE_X3D_TextureBuffer_default()) ({ browser: this .getBrowser (), width: size, height: size });
|
|
887
652
|
|
|
888
653
|
this .setSize (size);
|
|
889
654
|
}
|
|
@@ -1066,53 +831,6 @@ const external_X_ITE_X3D_DEVELOPMENT_namespaceObject = __X_ITE_X3D__ .DEVELOPMEN
|
|
|
1066
831
|
var external_X_ITE_X3D_DEVELOPMENT_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_DEVELOPMENT_namespaceObject);
|
|
1067
832
|
;// ./src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js
|
|
1068
833
|
/* provided dependency */ var $ = __webpack_require__(254);
|
|
1069
|
-
/*******************************************************************************
|
|
1070
|
-
*
|
|
1071
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1072
|
-
*
|
|
1073
|
-
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
1074
|
-
*
|
|
1075
|
-
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1076
|
-
*
|
|
1077
|
-
* The copyright notice above does not evidence any actual of intended
|
|
1078
|
-
* publication of such source code, and is an unpublished work by create3000.
|
|
1079
|
-
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1080
|
-
* create3000.
|
|
1081
|
-
*
|
|
1082
|
-
* No permission is granted to copy, distribute, or create derivative works from
|
|
1083
|
-
* the contents of this software, in whole or in part, without the prior written
|
|
1084
|
-
* permission of create3000.
|
|
1085
|
-
*
|
|
1086
|
-
* NON-MILITARY USE ONLY
|
|
1087
|
-
*
|
|
1088
|
-
* All create3000 software are effectively free software with a non-military use
|
|
1089
|
-
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1090
|
-
* source in any way you please with the exception anything that uses it must be
|
|
1091
|
-
* marked to indicate is contains 'non-military use only' components.
|
|
1092
|
-
*
|
|
1093
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1094
|
-
*
|
|
1095
|
-
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
1096
|
-
*
|
|
1097
|
-
* This file is part of the X_ITE Project.
|
|
1098
|
-
*
|
|
1099
|
-
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1100
|
-
* terms of the GNU General Public License version 3 only, as published by the
|
|
1101
|
-
* Free Software Foundation.
|
|
1102
|
-
*
|
|
1103
|
-
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1104
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1105
|
-
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1106
|
-
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1107
|
-
*
|
|
1108
|
-
* You should have received a copy of the GNU General Public License version 3
|
|
1109
|
-
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
1110
|
-
* copy of the GPLv3 License.
|
|
1111
|
-
*
|
|
1112
|
-
* For Silvio, Joy and Adi.
|
|
1113
|
-
*
|
|
1114
|
-
******************************************************************************/
|
|
1115
|
-
|
|
1116
834
|
|
|
1117
835
|
|
|
1118
836
|
|
|
@@ -1364,7 +1082,7 @@ Object .assign (Object .setPrototypeOf (ImageCubeMapTexture .prototype, CubeMapT
|
|
|
1364
1082
|
gl = browser .getContext (),
|
|
1365
1083
|
shaderNode = browser .getPanoramaShader (),
|
|
1366
1084
|
framebuffer = gl .createFramebuffer (),
|
|
1367
|
-
textureUnit = browser .
|
|
1085
|
+
textureUnit = browser .getTextureUnit (),
|
|
1368
1086
|
size = Math .floor (height / 2),
|
|
1369
1087
|
data = new Uint8Array (size * size * 4);
|
|
1370
1088
|
|
|
@@ -1458,53 +1176,6 @@ const ImageCubeMapTexture_default_ = ImageCubeMapTexture;
|
|
|
1458
1176
|
|
|
1459
1177
|
/* harmony default export */ const CubeMapTexturing_ImageCubeMapTexture = (external_X_ITE_X3D_Namespace_default().add ("ImageCubeMapTexture", ImageCubeMapTexture_default_));
|
|
1460
1178
|
;// ./src/assets/components/CubeMapTexturingComponent.js
|
|
1461
|
-
/*******************************************************************************
|
|
1462
|
-
*
|
|
1463
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1464
|
-
*
|
|
1465
|
-
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
1466
|
-
*
|
|
1467
|
-
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1468
|
-
*
|
|
1469
|
-
* The copyright notice above does not evidence any actual of intended
|
|
1470
|
-
* publication of such source code, and is an unpublished work by create3000.
|
|
1471
|
-
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1472
|
-
* create3000.
|
|
1473
|
-
*
|
|
1474
|
-
* No permission is granted to copy, distribute, or create derivative works from
|
|
1475
|
-
* the contents of this software, in whole or in part, without the prior written
|
|
1476
|
-
* permission of create3000.
|
|
1477
|
-
*
|
|
1478
|
-
* NON-MILITARY USE ONLY
|
|
1479
|
-
*
|
|
1480
|
-
* All create3000 software are effectively free software with a non-military use
|
|
1481
|
-
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1482
|
-
* source in any way you please with the exception anything that uses it must be
|
|
1483
|
-
* marked to indicate is contains 'non-military use only' components.
|
|
1484
|
-
*
|
|
1485
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1486
|
-
*
|
|
1487
|
-
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
1488
|
-
*
|
|
1489
|
-
* This file is part of the X_ITE Project.
|
|
1490
|
-
*
|
|
1491
|
-
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1492
|
-
* terms of the GNU General Public License version 3 only, as published by the
|
|
1493
|
-
* Free Software Foundation.
|
|
1494
|
-
*
|
|
1495
|
-
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1496
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1497
|
-
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1498
|
-
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1499
|
-
*
|
|
1500
|
-
* You should have received a copy of the GNU General Public License version 3
|
|
1501
|
-
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
1502
|
-
* copy of the GPLv3 License.
|
|
1503
|
-
*
|
|
1504
|
-
* For Silvio, Joy and Adi.
|
|
1505
|
-
*
|
|
1506
|
-
******************************************************************************/
|
|
1507
|
-
|
|
1508
1179
|
|
|
1509
1180
|
|
|
1510
1181
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v11.5.
|
|
2
|
-
const e=window[Symbol.for("X_ITE.X3D-11.5.10")];(()=>{var t={254:t=>{t.exports=e.jquery}},r={};function i(e){var s=r[e];if(void 0!==s)return s.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const s=e.Components;var a=i.n(s);const n=e.Namespace;var o=i.n(n);const u=o().add("Panorama1.fs","\nprecision 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);}"),h=o().add("Panorama2.fs","#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);}"),d=Symbol();function c(){}Object.assign(c.prototype,{getPanoramaShader(){return this[d]??=this.createShader("Panorama","FullScreen","data:x-shader/x-fragment,"+["",u,h][this.getContext().getVersion()],[],["x3d_PanoramaTexture","x3d_CurrentFace"])}});const T=c,p=o().add("X3DCubeMapTexturingContext",T),x=e.Fields;var g=i.n(x);const l=e.X3DFieldDefinition;var _=i.n(l);const f=e.FieldDefinitionArray;var m=i.n(f);const E=e.X3DNode;var w=i.n(E);const b=e.X3DSingleTextureNode;var v=i.n(b);const R=e.X3DConstants;var M=i.n(R);function C(e){v().call(this,e),this.addType(M().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,this.levels=0}Object.assign(Object.setPrototypeOf(C.prototype,v().prototype),{getTarget(){return this.target},getTextureType:()=>4,getTargets(){return this.targets},getSize(){return this.size},setSize(e){this.size=e,this.levels=Math.floor(Math.log2(Math.max(e,1)))},getLevels(){return this.levels},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(){v().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 s=this.getBrowser().getTextureCubeUnit();e.activeTexture(e.TEXTURE0+s),e.bindTexture(e.TEXTURE_CUBE_MAP,this.getTexture()),e.uniform1i(i.textureCube,s)}}),Object.defineProperties(C,w().getStaticProperties("X3DEnvironmentTextureNode","CubeMapTexturing",1));const y=C,S=o().add("X3DEnvironmentTextureNode",y),U=e.X3DCast;var P=i.n(U);const A=e.BitSet;var O=i.n(A);function I(e){S.call(this,e),this.addType(M().ComposedCubeMapTexture),this.addChildObjects(M().outputOnly,"update",new(g().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(O())}Object.assign(Object.setPrototypeOf(I.prototype,S.prototype),{initialize(){S.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]=P()(M().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===M().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 s=t[i];if(e.bindTexture(e.TEXTURE_2D,s.getTexture()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s.getTexture(),0),e.bindTexture(this.getTarget(),this.getTexture()),1===s.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.setMipMaps(t.every((e=>e.canMipMaps()))),this.updateTextureParameters()}else this.clearTexture()}}),Object.defineProperties(I,{...w().getStaticProperties("ComposedCubeMapTexture","CubeMapTexturing",1,"texture","3.1"),fieldDefinitions:{value:new(m())([new(_())(M().inputOutput,"metadata",new(g().SFNode)),new(_())(M().inputOutput,"description",new(g().SFString)),new(_())(M().inputOutput,"frontTexture",new(g().SFNode)),new(_())(M().inputOutput,"backTexture",new(g().SFNode)),new(_())(M().inputOutput,"leftTexture",new(g().SFNode)),new(_())(M().inputOutput,"rightTexture",new(g().SFNode)),new(_())(M().inputOutput,"topTexture",new(g().SFNode)),new(_())(M().inputOutput,"bottomTexture",new(g().SFNode)),new(_())(M().initializeOnly,"textureProperties",new(g().SFNode))]),enumerable:!0}});for(let e=0;e<6;++e)I.prototype[`set_loadState${e}__`]=function(e,t){this.set_loadState__(e,t)};const F=I,D=o().add("ComposedCubeMapTexture",F),B=e.X3DBaseNode;var N=i.n(B);const L=e.X3DRenderObject;var X=i.n(L);const z=e.TraverseType;var V=i.n(z);function j(e,t,r){N().call(this,e),X().call(this,e),this.renderObject=t,this.node=r,this.framebuffers=[]}Object.assign(Object.setPrototypeOf(j.prototype,N().prototype),X().prototype,{initialize(){N().prototype.initialize.call(this),X().prototype.initialize.call(this)},isIndependent:()=>!1,getNode(){return this.node},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()},getViewpointStack(){return this.renderObject.getViewpointStack()},getLightContainer(){return this.renderObject.getLights()[this.lightIndex++]},getFramebuffers(){return this.framebuffers},setFramebuffer(e){this.framebuffers[0]=e},render(e,t,r){switch(e){case V().COLLISION:case V().SHADOW:X().prototype.render.call(this,e,t,r);break;case V().DISPLAY:this.lightIndex=0,X().prototype.render.call(this,e,t,r);for(const e of this.renderObject.getLights())e.modelViewMatrix.pop()}}});for(const e of Object.keys(j.prototype))Object.defineProperty(j.prototype,e,{enumerable:!1});const G=j,k=o().add("DependentRenderer",G),Y=e.TextureBuffer;var W=i.n(Y);const H=e.Camera;var $=i.n(H);const Z=e.ViewVolume;var K=i.n(Z);const q=e.Rotation4;var J=i.n(q);const Q=e.Vector3;var ee=i.n(Q);const te=e.Vector4;var re=i.n(te);const ie=e.Matrix4;var se=i.n(ie);const ae=e.Algorithm;var ne=i.n(ae);function oe(e){S.call(this,e),this.addType(M().GeneratedCubeMapTexture),this.dependentRenderers=new WeakMap,this.projectionMatrix=new(se()),this.modelMatrix=new(se()),this.viewVolume=new(K())}Object.assign(Object.setPrototypeOf(oe.prototype,S.prototype),{initialize(){S.prototype.initialize.call(this),this._size.addInterest("set_size__",this),this.set_size__()},set_size__(){const e=this.getBrowser().getContext(),t=e.getVersion()>=2?this._size.getValue():ne().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(re())(0,0,t,t),this.frameBuffer=new(W())(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(J())(ee().zAxis,new(ee())(0,0,-1)),new(J())(ee().zAxis,new(ee())(0,0,1)),new(J())(ee().zAxis,new(ee())(1,0,0)),new(J())(ee().zAxis,new(ee())(-1,0,0)),new(J())(ee().zAxis,new(ee())(0,-1,0)),new(J())(ee().zAxis,new(ee())(0,1,0))],t=[new(ee())(-1,-1,1),new(ee())(-1,-1,1),new(ee())(-1,-1,1),new(ee())(-1,-1,1),new(ee())(1,1,1),new(ee())(1,1,1)],r=new(se());return function(i){if(!this.dependentRenderers.has(i)){const e=new k(this.getExecutionContext(),i,this);e.setup(),this.dependentRenderers.set(i,e)}const s=this.dependentRenderers.get(i),a=this.getBrowser(),n=i.getLayer(),o=a.getContext(),u=s.getBackground(),h=s.getNavigationInfo(),d=s.getViewpoint(),c=a.getHeadlight(),T=h._headlight.getValue(),p=d.getNearDistance(h),x=d.getFarDistance(h),g=$().perspective(ne().radians(90),p,x,1,1,this.projectionMatrix),l=this.frameBuffer.getWidth(),_=this.frameBuffer.getHeight();this.setTransparent(u.isTransparent()),s.setFramebuffer(this.frameBuffer),s.getViewVolumes().push(this.viewVolume.set(g,this.viewport,this.viewport)),s.getProjectionMatrix().push(g),o.bindTexture(this.getTarget(),this.getTexture());for(let i=0;i<6;++i)o.clear(o.COLOR_BUFFER_BIT),s.getCameraSpaceMatrix().push(this.modelMatrix),s.getCameraSpaceMatrix().rotate(e[i]),s.getCameraSpaceMatrix().scale(t[i]),s.getViewMatrix().push(r.assign(s.getCameraSpaceMatrix().get()).inverse()),s.getModelViewMatrix().push(r),T&&(c.modelViewMatrix.push(r),c.modelViewMatrix.multLeft(d.getCameraSpaceMatrix())),n.traverse(V().DISPLAY,s),T&&c.modelViewMatrix.pop(),s.getModelViewMatrix().pop(),s.getCameraSpaceMatrix().pop(),s.getViewMatrix().pop(),o.bindTexture(this.getTarget(),this.getTexture()),o.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,l,_);this.updateTextureParameters(),s.getProjectionMatrix().pop(),s.getViewVolumes().pop(),"NEXT_FRAME_ONLY"===this._update.getValue()&&(this._update="NONE")}})(),setShaderUniforms:(()=>{const e=new Float32Array(16);return function(t,r,i,s){S.prototype.setShaderUniforms.call(this,t,r,i,s),i.getNode()===this&&t.uniformMatrix4fv(r.x3d_ModelViewMatrix,!1,e)}})()}),Object.defineProperties(oe,{...w().getStaticProperties("GeneratedCubeMapTexture","CubeMapTexturing",3,"texture","3.0"),fieldDefinitions:{value:new(m())([new(_())(M().inputOutput,"metadata",new(g().SFNode)),new(_())(M().inputOutput,"description",new(g().SFString)),new(_())(M().inputOutput,"update",new(g().SFString)("NONE")),new(_())(M().initializeOnly,"size",new(g().SFInt32)(128)),new(_())(M().initializeOnly,"textureProperties",new(g().SFNode))]),enumerable:!0}});const ue=oe,he=o().add("GeneratedCubeMapTexture",ue),de=e.X3DUrlObject;var ce=i.n(de);const Te=e.Vector2;var pe=i.n(Te);const xe=e.DEVELOPMENT;var ge=i.n(xe),le=i(254);const _e=new Uint8Array([255,255,255,255]);function fe(e){S.call(this,e),ce().call(this,e),this.addType(M().ImageCubeMapTexture),this.image=le("<img></img>"),this.urlStack=new(g().MFString)}Object.assign(Object.setPrototypeOf(fe.prototype,S.prototype),ce().prototype,{initialize(){S.prototype.initialize.call(this),ce().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,_e);this.image.on("load",this.setImage.bind(this)).on("abort error",this.setError.bind(this)).attr("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(M().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.setMipMaps(!1),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),this.setMipMaps(!0),"data:"!==this.URL.protocol&&(this.getCache()||this.URL.searchParams.set("_",Date.now())),this.image.attr("src",this.URL))},setError(e){"data:"!==this.URL.protocol&&console.warn(`Error loading image '${decodeURI(this.URL)}':`,e.type),this.loadNext()},setKTXTexture(e){if(e.target!==this.getTarget())return this.setError({type:"Invalid KTX texture target, must be 'TEXTURE_CUBE_MAP'."});ge()&&"data:"!==this.URL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.URL)}'.`);try{this.setTexture(e),this.setTransparent(!1),this.setSize(e.baseWidth),this.updateTextureParameters(),this.setLoadState(M().COMPLETE_STATE)}catch(e){this.setError({type:e.message})}},setImage(){ge()&&"data:"!==this.URL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.URL)}'.`);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]),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.imageToCubeMap(t,this.image.prop("width"),this.image.prop("height"),!1),this.setLoadState(M().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:(()=>{const e=[new(pe())(1,1),new(pe())(3,1),new(pe())(0,1),new(pe())(2,1),new(pe())(1,0),new(pe())(1,2)];return function(t,r,i){const s=this.getBrowser().getContext(),a=s.createFramebuffer(),n=Math.floor(r/4),o=Math.floor(i/3),u=new Uint8Array(n*o*4);s.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)s.texImage2D(this.getTargets()[e],0,s.RGBA,n,o,0,s.RGBA,s.UNSIGNED_BYTE,null);s.bindFramebuffer(s.FRAMEBUFFER,a),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0);let h=!1;s.bindTexture(this.getTarget(),this.getTexture());for(let t=0;t<6;++t)s.copyTexSubImage2D(this.getTargets()[t],0,0,0,e[t].x*n,e[t].y*o,n,o),h||(s.readPixels(e[t].x*n,e[t].y*o,n,o,s.RGBA,s.UNSIGNED_BYTE,u),h=this.isImageTransparent(u));s.deleteFramebuffer(a),s.deleteTexture(t),this.setTransparent(h),this.setSize(n)}})(),panoramaToCubeMap(e,t,r){const i=this.getBrowser(),s=i.getContext(),a=i.getPanoramaShader(),n=s.createFramebuffer(),o=i.getTextureCubeUnit(),u=Math.floor(r/2),h=new Uint8Array(u*u*4);s.bindTexture(s.TEXTURE_2D,e),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.MIRRORED_REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.MIRRORED_REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)s.texImage2D(this.getTargets()[e],0,s.RGBA,u,u,0,s.RGBA,s.UNSIGNED_BYTE,null);s.useProgram(a.getProgram()),s.activeTexture(s.TEXTURE0+o),s.bindTexture(s.TEXTURE_2D,e),s.uniform1i(a.x3d_PanoramaTexture,o),s.bindFramebuffer(s.FRAMEBUFFER,n),s.viewport(0,0,u,u),s.scissor(0,0,u,u),s.disable(s.DEPTH_TEST),s.enable(s.CULL_FACE),s.frontFace(s.CCW),s.clearColor(0,0,0,0),s.bindVertexArray(i.getFullscreenVertexArrayObject());let d=!1;for(let e=0;e<6;++e)s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,this.getTargets()[e],this.getTexture(),0),s.clear(s.COLOR_BUFFER_BIT),s.uniform1i(a.x3d_CurrentFace,e),s.drawArrays(s.TRIANGLES,0,6),d||(s.readPixels(0,0,u,u,s.RGBA,s.UNSIGNED_BYTE,h),d=this.isImageTransparent(h));s.enable(s.DEPTH_TEST),s.deleteFramebuffer(n),s.deleteTexture(e),i.resetTextureUnits(),this.setTransparent(d),this.setSize(u)},dispose(){ce().prototype.dispose.call(this),S.prototype.dispose.call(this)}}),Object.defineProperties(fe,{...w().getStaticProperties("ImageCubeMapTexture","CubeMapTexturing",2,"texture","3.0"),fieldDefinitions:{value:new(m())([new(_())(M().inputOutput,"metadata",new(g().SFNode)),new(_())(M().inputOutput,"description",new(g().SFString)),new(_())(M().inputOutput,"load",new(g().SFBool)(!0)),new(_())(M().inputOutput,"url",new(g().MFString)),new(_())(M().inputOutput,"autoRefresh",new(g().SFTime)(0)),new(_())(M().inputOutput,"autoRefreshTimeLimit",new(g().SFTime)(3600)),new(_())(M().initializeOnly,"textureProperties",new(g().SFNode))]),enumerable:!0}});const me=fe,Ee=o().add("ImageCubeMapTexture",me);a().add({name:"CubeMapTexturing",concreteNodes:[D,he,Ee],abstractNodes:[S],browserContext:p});o().add("CubeMapTexturingComponent",undefined)})();
|
|
1
|
+
/* X_ITE v11.5.12 */
|
|
2
|
+
const e=window[Symbol.for("X_ITE.X3D-11.5.12")];(()=>{var t={254:t=>{t.exports=e.jquery}},r={};function i(e){var s=r[e];if(void 0!==s)return s.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const s=e.Components;var a=i.n(s);const n=e.Namespace;var o=i.n(n);const u=o().add("Panorama1.fs","\nprecision 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.,uv.y,uv.x);else if(face==1)xyz=vec3(-1.,uv.y,-uv.x);else if(face==2)xyz=vec3(uv.x,uv.y,-1.);else if(face==3)xyz=vec3(-uv.x,uv.y,1.);else if(face==4)xyz=vec3(uv.y,-1.,uv.x);else xyz=vec3(-uv.y,1.,uv.x);return xyz;}vec2 dirToUV(const in vec3 dir){return vec2(.5+.5*atan(dir.z,dir.x)/M_PI,1.-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.);}"),h=o().add("Panorama2.fs","#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.,uv.y,uv.x);case 1:return vec3(-1.,uv.y,-uv.x);case 2:return vec3(uv.x,uv.y,-1.);case 3:return vec3(-uv.x,uv.y,1.);case 4:return vec3(uv.y,-1.,uv.x);default:return vec3(-uv.y,1.,uv.x);}}vec2 dirToUV(const in vec3 dir){return vec2(.5+.5*atan(dir.z,dir.x)/M_PI,1.-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.);}"),d=Symbol();function c(){}Object.assign(c.prototype,{getPanoramaShader(){return this[d]??=this.createShader("Panorama","FullScreen","data:x-shader/x-fragment,"+["",u,h][this.getContext().getVersion()],[],["x3d_PanoramaTexture","x3d_CurrentFace"])}});const T=c,p=o().add("X3DCubeMapTexturingContext",T),x=e.Fields;var g=i.n(x);const l=e.X3DFieldDefinition;var _=i.n(l);const f=e.FieldDefinitionArray;var m=i.n(f);const E=e.X3DNode;var w=i.n(E);const b=e.X3DSingleTextureNode;var v=i.n(b);const R=e.X3DConstants;var M=i.n(R);function C(e){v().call(this,e),this.addType(M().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,this.levels=0}Object.assign(Object.setPrototypeOf(C.prototype,v().prototype),{getTarget(){return this.target},getTextureType:()=>4,getTargets(){return this.targets},getSize(){return this.size},setSize(e){this.size=e,this.levels=Math.floor(Math.log2(Math.max(e,1)))},getLevels(){return this.levels},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(){v().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 s=this.getBrowser().getTextureUnit();e.activeTexture(e.TEXTURE0+s),e.bindTexture(e.TEXTURE_CUBE_MAP,this.getTexture()),e.uniform1i(i.textureCube,s)}}),Object.defineProperties(C,w().getStaticProperties("X3DEnvironmentTextureNode","CubeMapTexturing",1));const y=C,S=o().add("X3DEnvironmentTextureNode",y),U=e.X3DCast;var P=i.n(U);const A=e.BitSet;var O=i.n(A);function I(e){S.call(this,e),this.addType(M().ComposedCubeMapTexture),this.addChildObjects(M().outputOnly,"update",new(g().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(O())}Object.assign(Object.setPrototypeOf(I.prototype,S.prototype),{initialize(){S.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]=P()(M().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===M().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 s=t[i];if(e.bindTexture(e.TEXTURE_2D,s.getTexture()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s.getTexture(),0),e.bindTexture(this.getTarget(),this.getTexture()),1===s.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.setMipMaps(t.every(e=>e.canMipMaps())),this.updateTextureParameters()}else this.clearTexture()}}),Object.defineProperties(I,{...w().getStaticProperties("ComposedCubeMapTexture","CubeMapTexturing",1,"texture","3.1"),fieldDefinitions:{value:new(m())([new(_())(M().inputOutput,"metadata",new(g().SFNode)),new(_())(M().inputOutput,"description",new(g().SFString)),new(_())(M().inputOutput,"frontTexture",new(g().SFNode)),new(_())(M().inputOutput,"backTexture",new(g().SFNode)),new(_())(M().inputOutput,"leftTexture",new(g().SFNode)),new(_())(M().inputOutput,"rightTexture",new(g().SFNode)),new(_())(M().inputOutput,"topTexture",new(g().SFNode)),new(_())(M().inputOutput,"bottomTexture",new(g().SFNode)),new(_())(M().initializeOnly,"textureProperties",new(g().SFNode))]),enumerable:!0}});for(let e=0;e<6;++e)I.prototype[`set_loadState${e}__`]=function(e,t){this.set_loadState__(e,t)};const F=I,D=o().add("ComposedCubeMapTexture",F),B=e.X3DBaseNode;var N=i.n(B);const L=e.X3DRenderObject;var X=i.n(L);const z=e.TraverseType;var V=i.n(z);function j(e,t,r){N().call(this,e),X().call(this,e),this.renderObject=t,this.node=r,this.framebuffers=[]}Object.assign(Object.setPrototypeOf(j.prototype,N().prototype),X().prototype,{initialize(){N().prototype.initialize.call(this),X().prototype.initialize.call(this)},isIndependent:()=>!1,getNode(){return this.node},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()},getViewpointStack(){return this.renderObject.getViewpointStack()},getLightContainer(){return this.renderObject.getLights()[this.lightIndex++]},getFramebuffers(){return this.framebuffers},setFramebuffer(e){this.framebuffers[0]=e},render(e,t,r){switch(e){case V().COLLISION:case V().SHADOW:X().prototype.render.call(this,e,t,r);break;case V().DISPLAY:this.lightIndex=0,X().prototype.render.call(this,e,t,r);for(const e of this.renderObject.getLights())e.modelViewMatrix.pop()}}});for(const e of Object.keys(j.prototype))Object.defineProperty(j.prototype,e,{enumerable:!1});const G=j,k=o().add("DependentRenderer",G),Y=e.TextureBuffer;var W=i.n(Y);const H=e.Camera;var $=i.n(H);const Z=e.ViewVolume;var K=i.n(Z);const q=e.Rotation4;var J=i.n(q);const Q=e.Vector3;var ee=i.n(Q);const te=e.Vector4;var re=i.n(te);const ie=e.Matrix4;var se=i.n(ie);const ae=e.Algorithm;var ne=i.n(ae);function oe(e){S.call(this,e),this.addType(M().GeneratedCubeMapTexture),this.dependentRenderers=new WeakMap,this.projectionMatrix=new(se()),this.modelMatrix=new(se()),this.viewVolume=new(K())}Object.assign(Object.setPrototypeOf(oe.prototype,S.prototype),{initialize(){S.prototype.initialize.call(this),this._size.addInterest("set_size__",this),this.set_size__()},set_size__(){const e=this.getBrowser().getContext(),t=e.getVersion()>=2?this._size.getValue():ne().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(re())(0,0,t,t),this.frameBuffer=new(W())({browser:this.getBrowser(),width:t,height: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(J())(ee().zAxis,new(ee())(0,0,-1)),new(J())(ee().zAxis,new(ee())(0,0,1)),new(J())(ee().zAxis,new(ee())(1,0,0)),new(J())(ee().zAxis,new(ee())(-1,0,0)),new(J())(ee().zAxis,new(ee())(0,-1,0)),new(J())(ee().zAxis,new(ee())(0,1,0))],t=[new(ee())(-1,-1,1),new(ee())(-1,-1,1),new(ee())(-1,-1,1),new(ee())(-1,-1,1),new(ee())(1,1,1),new(ee())(1,1,1)],r=new(se());return function(i){if(!this.dependentRenderers.has(i)){const e=new k(this.getExecutionContext(),i,this);e.setup(),this.dependentRenderers.set(i,e)}const s=this.dependentRenderers.get(i),a=this.getBrowser(),n=i.getLayer(),o=a.getContext(),u=s.getBackground(),h=s.getNavigationInfo(),d=s.getViewpoint(),c=a.getHeadlight(),T=h._headlight.getValue(),p=d.getNearDistance(h),x=d.getFarDistance(h),g=$().perspective(ne().radians(90),p,x,1,1,this.projectionMatrix),l=this.frameBuffer.getWidth(),_=this.frameBuffer.getHeight();this.setTransparent(u.isTransparent()),s.setFramebuffer(this.frameBuffer),s.getViewVolumes().push(this.viewVolume.set(g,this.viewport,this.viewport)),s.getProjectionMatrix().push(g),o.bindTexture(this.getTarget(),this.getTexture());for(let i=0;i<6;++i)o.clear(o.COLOR_BUFFER_BIT),s.getCameraSpaceMatrix().push(this.modelMatrix),s.getCameraSpaceMatrix().rotate(e[i]),s.getCameraSpaceMatrix().scale(t[i]),s.getViewMatrix().push(r.assign(s.getCameraSpaceMatrix().get()).inverse()),s.getModelViewMatrix().push(r),T&&(c.modelViewMatrix.push(r),c.modelViewMatrix.multLeft(d.getCameraSpaceMatrix())),n.traverse(V().DISPLAY,s),T&&c.modelViewMatrix.pop(),s.getModelViewMatrix().pop(),s.getCameraSpaceMatrix().pop(),s.getViewMatrix().pop(),o.bindTexture(this.getTarget(),this.getTexture()),o.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,l,_);this.updateTextureParameters(),s.getProjectionMatrix().pop(),s.getViewVolumes().pop(),"NEXT_FRAME_ONLY"===this._update.getValue()&&(this._update="NONE")}})(),setShaderUniforms:(()=>{const e=new Float32Array(16);return function(t,r,i,s){S.prototype.setShaderUniforms.call(this,t,r,i,s),i.getNode()===this&&t.uniformMatrix4fv(r.x3d_ModelViewMatrix,!1,e)}})()}),Object.defineProperties(oe,{...w().getStaticProperties("GeneratedCubeMapTexture","CubeMapTexturing",3,"texture","3.0"),fieldDefinitions:{value:new(m())([new(_())(M().inputOutput,"metadata",new(g().SFNode)),new(_())(M().inputOutput,"description",new(g().SFString)),new(_())(M().inputOutput,"update",new(g().SFString)("NONE")),new(_())(M().initializeOnly,"size",new(g().SFInt32)(128)),new(_())(M().initializeOnly,"textureProperties",new(g().SFNode))]),enumerable:!0}});const ue=oe,he=o().add("GeneratedCubeMapTexture",ue),de=e.X3DUrlObject;var ce=i.n(de);const Te=e.Vector2;var pe=i.n(Te);const xe=e.DEVELOPMENT;var ge=i.n(xe),le=i(254);const _e=new Uint8Array([255,255,255,255]);function fe(e){S.call(this,e),ce().call(this,e),this.addType(M().ImageCubeMapTexture),this.image=le("<img></img>"),this.urlStack=new(g().MFString)}Object.assign(Object.setPrototypeOf(fe.prototype,S.prototype),ce().prototype,{initialize(){S.prototype.initialize.call(this),ce().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,_e);this.image.on("load",this.setImage.bind(this)).on("abort error",this.setError.bind(this)).attr("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(M().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.setMipMaps(!1),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),this.setMipMaps(!0),"data:"!==this.URL.protocol&&(this.getCache()||this.URL.searchParams.set("_",Date.now())),this.image.attr("src",this.URL))},setError(e){"data:"!==this.URL.protocol&&console.warn(`Error loading image '${decodeURI(this.URL)}':`,e.type),this.loadNext()},setKTXTexture(e){if(e.target!==this.getTarget())return this.setError({type:"Invalid KTX texture target, must be 'TEXTURE_CUBE_MAP'."});ge()&&"data:"!==this.URL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.URL)}'.`);try{this.setTexture(e),this.setTransparent(!1),this.setSize(e.baseWidth),this.updateTextureParameters(),this.setLoadState(M().COMPLETE_STATE)}catch(e){this.setError({type:e.message})}},setImage(){ge()&&"data:"!==this.URL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.URL)}'.`);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]),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.imageToCubeMap(t,this.image.prop("width"),this.image.prop("height"),!1),this.setLoadState(M().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:(()=>{const e=[new(pe())(1,1),new(pe())(3,1),new(pe())(0,1),new(pe())(2,1),new(pe())(1,0),new(pe())(1,2)];return function(t,r,i){const s=this.getBrowser().getContext(),a=s.createFramebuffer(),n=Math.floor(r/4),o=Math.floor(i/3),u=new Uint8Array(n*o*4);s.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)s.texImage2D(this.getTargets()[e],0,s.RGBA,n,o,0,s.RGBA,s.UNSIGNED_BYTE,null);s.bindFramebuffer(s.FRAMEBUFFER,a),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0);let h=!1;s.bindTexture(this.getTarget(),this.getTexture());for(let t=0;t<6;++t)s.copyTexSubImage2D(this.getTargets()[t],0,0,0,e[t].x*n,e[t].y*o,n,o),h||(s.readPixels(e[t].x*n,e[t].y*o,n,o,s.RGBA,s.UNSIGNED_BYTE,u),h=this.isImageTransparent(u));s.deleteFramebuffer(a),s.deleteTexture(t),this.setTransparent(h),this.setSize(n)}})(),panoramaToCubeMap(e,t,r){const i=this.getBrowser(),s=i.getContext(),a=i.getPanoramaShader(),n=s.createFramebuffer(),o=i.getTextureUnit(),u=Math.floor(r/2),h=new Uint8Array(u*u*4);s.bindTexture(s.TEXTURE_2D,e),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.MIRRORED_REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.MIRRORED_REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)s.texImage2D(this.getTargets()[e],0,s.RGBA,u,u,0,s.RGBA,s.UNSIGNED_BYTE,null);s.useProgram(a.getProgram()),s.activeTexture(s.TEXTURE0+o),s.bindTexture(s.TEXTURE_2D,e),s.uniform1i(a.x3d_PanoramaTexture,o),s.bindFramebuffer(s.FRAMEBUFFER,n),s.viewport(0,0,u,u),s.scissor(0,0,u,u),s.disable(s.DEPTH_TEST),s.enable(s.CULL_FACE),s.frontFace(s.CCW),s.clearColor(0,0,0,0),s.bindVertexArray(i.getFullscreenVertexArrayObject());let d=!1;for(let e=0;e<6;++e)s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,this.getTargets()[e],this.getTexture(),0),s.clear(s.COLOR_BUFFER_BIT),s.uniform1i(a.x3d_CurrentFace,e),s.drawArrays(s.TRIANGLES,0,6),d||(s.readPixels(0,0,u,u,s.RGBA,s.UNSIGNED_BYTE,h),d=this.isImageTransparent(h));s.enable(s.DEPTH_TEST),s.deleteFramebuffer(n),s.deleteTexture(e),i.resetTextureUnits(),this.setTransparent(d),this.setSize(u)},dispose(){ce().prototype.dispose.call(this),S.prototype.dispose.call(this)}}),Object.defineProperties(fe,{...w().getStaticProperties("ImageCubeMapTexture","CubeMapTexturing",2,"texture","3.0"),fieldDefinitions:{value:new(m())([new(_())(M().inputOutput,"metadata",new(g().SFNode)),new(_())(M().inputOutput,"description",new(g().SFString)),new(_())(M().inputOutput,"load",new(g().SFBool)(!0)),new(_())(M().inputOutput,"url",new(g().MFString)),new(_())(M().inputOutput,"autoRefresh",new(g().SFTime)(0)),new(_())(M().inputOutput,"autoRefreshTimeLimit",new(g().SFTime)(3600)),new(_())(M().initializeOnly,"textureProperties",new(g().SFNode))]),enumerable:!0}});const me=fe,Ee=o().add("ImageCubeMapTexture",me);a().add({name:"CubeMapTexturing",concreteNodes:[D,he,Ee],abstractNodes:[S],browserContext:p});o().add("CubeMapTexturingComponent",undefined)})();
|