x_ite 11.2.0 → 11.2.2
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/assets/components/AnnotationComponent.js +2 -2
- package/dist/assets/components/AnnotationComponent.min.js +2 -2
- package/dist/assets/components/CADGeometryComponent.js +2 -2
- package/dist/assets/components/CADGeometryComponent.min.js +2 -2
- package/dist/assets/components/CubeMapTexturingComponent.js +2 -2
- package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
- package/dist/assets/components/DISComponent.js +2 -2
- package/dist/assets/components/DISComponent.min.js +2 -2
- package/dist/assets/components/EventUtilitiesComponent.js +2 -2
- package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
- package/dist/assets/components/Geometry2DComponent.js +2 -2
- package/dist/assets/components/Geometry2DComponent.min.js +2 -2
- package/dist/assets/components/GeospatialComponent.js +2 -2
- package/dist/assets/components/GeospatialComponent.min.js +2 -2
- package/dist/assets/components/HAnimComponent.js +2 -2
- package/dist/assets/components/HAnimComponent.min.js +2 -2
- package/dist/assets/components/KeyDeviceSensorComponent.js +2 -2
- package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -2
- package/dist/assets/components/LayoutComponent.js +3 -3
- package/dist/assets/components/LayoutComponent.min.js +2 -2
- package/dist/assets/components/NURBSComponent.js +2 -2
- package/dist/assets/components/NURBSComponent.min.js +2 -2
- package/dist/assets/components/ParticleSystemsComponent.js +2 -2
- package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
- package/dist/assets/components/PickingComponent.js +2 -2
- package/dist/assets/components/PickingComponent.min.js +2 -2
- package/dist/assets/components/RigidBodyPhysicsComponent.js +2 -2
- package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -2
- package/dist/assets/components/ScriptingComponent.js +2 -2
- package/dist/assets/components/ScriptingComponent.min.js +2 -2
- package/dist/assets/components/TextComponent.js +19 -19
- package/dist/assets/components/TextComponent.min.js +2 -2
- package/dist/assets/components/TextureProjectionComponent.js +26 -16
- package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
- package/dist/assets/components/Texturing3DComponent.js +111 -111
- package/dist/assets/components/Texturing3DComponent.min.js +2 -2
- package/dist/assets/components/VolumeRenderingComponent.js +15 -4
- package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
- package/dist/assets/components/WebXRComponent.js +88 -60
- package/dist/assets/components/WebXRComponent.min.js +2 -2
- package/dist/assets/components/X_ITEComponent.js +2 -2
- package/dist/assets/components/X_ITEComponent.min.js +2 -2
- package/dist/assets/images/XR.svg +4 -34
- package/dist/example.html +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +55240 -55198
- package/dist/x_ite.min.js +2 -2
- package/dist/x_ite.min.mjs +2 -2
- package/dist/x_ite.mjs +55461 -55419
- package/dist/x_ite.zip +0 -0
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* X_ITE v11.2.
|
|
2
|
-
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.2.
|
|
1
|
+
/* X_ITE v11.2.2 */
|
|
2
|
+
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.2.2")];
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ "use strict";
|
|
5
5
|
/******/ // The require scope
|
|
@@ -169,6 +169,7 @@ Object .assign (ScreenPoint .prototype,
|
|
|
169
169
|
const
|
|
170
170
|
projectionMatrixArray = new Float32Array ((external_X_ITE_X3D_Matrix4_default()).Identity),
|
|
171
171
|
modelViewMatrixArray = new Float32Array ((external_X_ITE_X3D_Matrix4_default()).Identity),
|
|
172
|
+
identity = new Float32Array ((external_X_ITE_X3D_Matrix4_default()).Identity),
|
|
172
173
|
screenMatrix = new (external_X_ITE_X3D_Matrix4_default()) (),
|
|
173
174
|
clipPlanes = [ ];
|
|
174
175
|
|
|
@@ -223,6 +224,7 @@ Object .assign (ScreenPoint .prototype,
|
|
|
223
224
|
|
|
224
225
|
gl .uniformMatrix4fv (shaderNode .x3d_ProjectionMatrix, false, projectionMatrixArray);
|
|
225
226
|
gl .uniformMatrix4fv (shaderNode .x3d_ModelViewMatrix, false, modelViewMatrixArray);
|
|
227
|
+
gl .uniformMatrix4fv (shaderNode .x3d_EyeMatrix, false, identity);
|
|
226
228
|
gl .uniform3f (shaderNode .x3d_EmissiveColor, 0, 0, 0);
|
|
227
229
|
gl .uniform1f (shaderNode .x3d_Transparency, circle);
|
|
228
230
|
|
|
@@ -244,6 +246,7 @@ Object .assign (ScreenPoint .prototype,
|
|
|
244
246
|
|
|
245
247
|
gl .uniformMatrix4fv (shaderNode .x3d_ProjectionMatrix, false, projectionMatrixArray);
|
|
246
248
|
gl .uniformMatrix4fv (shaderNode .x3d_ModelViewMatrix, false, modelViewMatrixArray);
|
|
249
|
+
gl .uniformMatrix4fv (shaderNode .x3d_EyeMatrix, false, identity);
|
|
247
250
|
gl .uniform3f (shaderNode .x3d_EmissiveColor, ... color);
|
|
248
251
|
gl .uniform1f (shaderNode .x3d_Transparency, transparency);
|
|
249
252
|
|
|
@@ -382,7 +385,9 @@ Object .assign ((external_X_ITE_X3D_X3DFlyViewer_default()).prototype,
|
|
|
382
385
|
return;
|
|
383
386
|
}
|
|
384
387
|
|
|
385
|
-
const
|
|
388
|
+
const
|
|
389
|
+
button0 = gamepad .buttons [0] .pressed,
|
|
390
|
+
button1 = gamepad .buttons [1] .pressed;
|
|
386
391
|
|
|
387
392
|
if (button1)
|
|
388
393
|
{
|
|
@@ -399,7 +404,8 @@ Object .assign ((external_X_ITE_X3D_X3DFlyViewer_default()).prototype,
|
|
|
399
404
|
{
|
|
400
405
|
axis
|
|
401
406
|
.set (gamepad .axes [2], 0, gamepad .axes [3])
|
|
402
|
-
.multVec (GAMEPAD_SPEED_FACTOR)
|
|
407
|
+
.multVec (GAMEPAD_SPEED_FACTOR)
|
|
408
|
+
.multiply (button0 ? 2 : 1);
|
|
403
409
|
|
|
404
410
|
// Moving average.
|
|
405
411
|
this .direction .add (axis) .divide (2);
|
|
@@ -500,6 +506,10 @@ function X3DWebXRContext ()
|
|
|
500
506
|
|
|
501
507
|
Object .assign (X3DWebXRContext .prototype,
|
|
502
508
|
{
|
|
509
|
+
getPose ()
|
|
510
|
+
{
|
|
511
|
+
return this [_pose];
|
|
512
|
+
},
|
|
503
513
|
async initXRSession ()
|
|
504
514
|
{
|
|
505
515
|
return external_X_ITE_X3D_Lock_default().acquire (`X3DWebXRContext.session-${this .getId ()}`, async () =>
|
|
@@ -517,11 +527,11 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
517
527
|
// WebXR Emulator: must bind default framebuffer, to get xr emulator working.
|
|
518
528
|
gl .bindFramebuffer (gl .FRAMEBUFFER, null);
|
|
519
529
|
|
|
520
|
-
this .cameraEvents () .addInterest ("
|
|
521
|
-
this .finishedEvents () .addInterest ("
|
|
522
|
-
this .endEvents () .addInterest ("
|
|
530
|
+
this .cameraEvents () .addInterest ("xrUpdatePose", this);
|
|
531
|
+
this .finishedEvents () .addInterest ("xrUpdatePointers", this);
|
|
532
|
+
this .endEvents () .addInterest ("xrEndFrame", this);
|
|
523
533
|
|
|
524
|
-
session .addEventListener ("inputsourceschange", event => this .
|
|
534
|
+
session .addEventListener ("inputsourceschange", event => this .xrUpdateInputSources (event));
|
|
525
535
|
session .addEventListener ("end", () => this .stopXRSession ());
|
|
526
536
|
|
|
527
537
|
this [_referenceSpace] = referenceSpace;
|
|
@@ -538,10 +548,16 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
538
548
|
views: [ ],
|
|
539
549
|
};
|
|
540
550
|
|
|
541
|
-
this .
|
|
551
|
+
this .xrUpdateBaseLayer ({ }, session);
|
|
542
552
|
this .setSession (session);
|
|
543
553
|
this .removeHit (this .getHit ());
|
|
544
554
|
|
|
555
|
+
// Rendering Properties
|
|
556
|
+
|
|
557
|
+
this .getRenderingProperties () ._ContentScale .addInterest ("xrContentScale", this);
|
|
558
|
+
|
|
559
|
+
this .getRenderingProperties () ._XRSession = true;
|
|
560
|
+
|
|
545
561
|
// session .addEventListener ("select", event =>
|
|
546
562
|
// {
|
|
547
563
|
// const { inputSource, frame } = event;
|
|
@@ -561,9 +577,9 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
561
577
|
|
|
562
578
|
await this .getSession () .end () .catch (Function .prototype);
|
|
563
579
|
|
|
564
|
-
this .cameraEvents () .removeInterest ("
|
|
565
|
-
this .finishedEvents () .removeInterest ("
|
|
566
|
-
this .endEvents () .removeInterest ("
|
|
580
|
+
this .cameraEvents () .removeInterest ("xrUpdatePose", this);
|
|
581
|
+
this .finishedEvents () .removeInterest ("xrUpdatePointers", this);
|
|
582
|
+
this .endEvents () .removeInterest ("xrEndFrame", this);
|
|
567
583
|
|
|
568
584
|
this .setSession (window);
|
|
569
585
|
this .setDefaultFramebuffer (null);
|
|
@@ -578,13 +594,19 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
578
594
|
this [_inputRay] = null;
|
|
579
595
|
this [_inputPoint] = null;
|
|
580
596
|
this [_frame] = null;
|
|
597
|
+
|
|
598
|
+
// Rendering Properties
|
|
599
|
+
|
|
600
|
+
this .getRenderingProperties () ._ContentScale .removeInterest ("xrContentScale", this);
|
|
601
|
+
|
|
602
|
+
this .getRenderingProperties () ._XRSession = false;
|
|
581
603
|
});
|
|
582
604
|
},
|
|
583
|
-
|
|
605
|
+
xrContentScale ()
|
|
584
606
|
{
|
|
585
|
-
this .
|
|
607
|
+
this .xrUpdateBaseLayer ();
|
|
586
608
|
},
|
|
587
|
-
|
|
609
|
+
xrUpdateBaseLayer (options = { }, session = this .getSession ())
|
|
588
610
|
{
|
|
589
611
|
if (session === window)
|
|
590
612
|
return;
|
|
@@ -604,7 +626,31 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
604
626
|
|
|
605
627
|
this .setDefaultFramebuffer (baseLayer .framebuffer);
|
|
606
628
|
},
|
|
607
|
-
|
|
629
|
+
xrUpdateNearFarPlanes: (function ()
|
|
630
|
+
{
|
|
631
|
+
const nearFarPlanes = { };
|
|
632
|
+
|
|
633
|
+
return function ()
|
|
634
|
+
{
|
|
635
|
+
const
|
|
636
|
+
navigationInfoNode = this .getActiveNavigationInfo (),
|
|
637
|
+
viewpointNode = this .getActiveViewpoint ();
|
|
638
|
+
|
|
639
|
+
if (viewpointNode)
|
|
640
|
+
{
|
|
641
|
+
nearFarPlanes .depthNear = viewpointNode .getNearDistance (navigationInfoNode);
|
|
642
|
+
nearFarPlanes .depthFar = viewpointNode .getFarDistance (navigationInfoNode);
|
|
643
|
+
}
|
|
644
|
+
else
|
|
645
|
+
{
|
|
646
|
+
nearFarPlanes .depthNear = 0.1;
|
|
647
|
+
nearFarPlanes .depthFar = 10_000;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
this .getSession () .updateRenderState (nearFarPlanes);
|
|
651
|
+
};
|
|
652
|
+
})(),
|
|
653
|
+
xrUpdateInputSources (event)
|
|
608
654
|
{
|
|
609
655
|
for (const inputSource of event .added)
|
|
610
656
|
{
|
|
@@ -634,7 +680,7 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
634
680
|
this [_inputSources] .delete (inputSource);
|
|
635
681
|
}
|
|
636
682
|
},
|
|
637
|
-
|
|
683
|
+
xrFrame (frame)
|
|
638
684
|
{
|
|
639
685
|
if (!frame)
|
|
640
686
|
return;
|
|
@@ -649,16 +695,9 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
649
695
|
if (emulator)
|
|
650
696
|
this .getCanvas () .css (this .getXREmulatorCSS ());
|
|
651
697
|
|
|
652
|
-
//
|
|
653
|
-
|
|
654
|
-
// const
|
|
655
|
-
// navigationInfoNode = this .getActiveNavigationInfo (),
|
|
656
|
-
// viewpointNode = this .getActiveViewpoint ();
|
|
698
|
+
// Projection matrix
|
|
657
699
|
|
|
658
|
-
|
|
659
|
-
// depthNear: viewpointNode .getNearDistance (navigationInfoNode), // 0.1
|
|
660
|
-
// depthFar: viewpointNode .getFarDistance (navigationInfoNode), // 10_000
|
|
661
|
-
// });
|
|
700
|
+
this .xrUpdateNearFarPlanes ();
|
|
662
701
|
|
|
663
702
|
// Navigation
|
|
664
703
|
|
|
@@ -669,6 +708,9 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
669
708
|
if (!active)
|
|
670
709
|
continue;
|
|
671
710
|
|
|
711
|
+
if (!gamepad)
|
|
712
|
+
continue;
|
|
713
|
+
|
|
672
714
|
if (gamepad .axes .length < 4)
|
|
673
715
|
continue;
|
|
674
716
|
|
|
@@ -681,28 +723,17 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
681
723
|
|
|
682
724
|
this .addBrowserEvent ();
|
|
683
725
|
},
|
|
684
|
-
|
|
685
|
-
{
|
|
686
|
-
return this [_pose];
|
|
687
|
-
},
|
|
688
|
-
updatePose ()
|
|
726
|
+
xrUpdatePose ()
|
|
689
727
|
{
|
|
690
728
|
// Get matrices from views.
|
|
691
729
|
|
|
692
730
|
const
|
|
693
|
-
originalPose
|
|
694
|
-
pose
|
|
695
|
-
viewpointNode = this .getActiveViewpoint ();
|
|
731
|
+
originalPose = this [_frame] .getViewerPose (this [_referenceSpace]),
|
|
732
|
+
pose = this [_pose];
|
|
696
733
|
|
|
697
734
|
pose .cameraSpaceMatrix .assign (originalPose .transform .matrix);
|
|
698
735
|
pose .viewMatrix .assign (originalPose .transform .inverse .matrix);
|
|
699
736
|
|
|
700
|
-
if (viewpointNode)
|
|
701
|
-
{
|
|
702
|
-
pose .cameraSpaceMatrix .multRight (viewpointNode .getCameraSpaceMatrix ());
|
|
703
|
-
pose .viewMatrix .multLeft (viewpointNode .getViewMatrix ());
|
|
704
|
-
}
|
|
705
|
-
|
|
706
737
|
let v = 0;
|
|
707
738
|
|
|
708
739
|
for (const originalView of originalPose .views)
|
|
@@ -727,12 +758,6 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
727
758
|
view .cameraSpaceMatrix .assign (originalView .transform .matrix);
|
|
728
759
|
view .viewMatrix .assign (originalView .transform .inverse .matrix);
|
|
729
760
|
|
|
730
|
-
if (viewpointNode)
|
|
731
|
-
{
|
|
732
|
-
view .cameraSpaceMatrix .multRight (viewpointNode .getCameraSpaceMatrix ());
|
|
733
|
-
view .viewMatrix .multLeft (viewpointNode .getViewMatrix ());
|
|
734
|
-
}
|
|
735
|
-
|
|
736
761
|
view .matrix .assign (pose .cameraSpaceMatrix) .multRight (view .viewMatrix);
|
|
737
762
|
view .inverse .assign (view .cameraSpaceMatrix) .multRight (pose .viewMatrix);
|
|
738
763
|
|
|
@@ -742,7 +767,7 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
742
767
|
pose .views .length = v;
|
|
743
768
|
this .getFramebuffers () .length = v;
|
|
744
769
|
},
|
|
745
|
-
|
|
770
|
+
xrUpdatePointers: (function ()
|
|
746
771
|
{
|
|
747
772
|
const
|
|
748
773
|
blue = new (external_X_ITE_X3D_Color3_default()) (0.5, 0.75, 1),
|
|
@@ -758,9 +783,8 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
758
783
|
return function ()
|
|
759
784
|
{
|
|
760
785
|
const
|
|
761
|
-
viewport
|
|
762
|
-
pose
|
|
763
|
-
viewpointNode = this .getActiveViewpoint ();
|
|
786
|
+
viewport = this .getViewport () .getValue (),
|
|
787
|
+
pose = this [_pose];
|
|
764
788
|
|
|
765
789
|
// Get target ray matrices from input sources.
|
|
766
790
|
|
|
@@ -777,12 +801,6 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
777
801
|
|
|
778
802
|
matrix .assign (targetRayPose .transform .matrix);
|
|
779
803
|
inverse .assign (targetRayPose .transform .inverse .matrix);
|
|
780
|
-
|
|
781
|
-
if (viewpointNode)
|
|
782
|
-
{
|
|
783
|
-
matrix .multRight (viewpointNode .getCameraSpaceMatrix ());
|
|
784
|
-
inverse .multLeft (viewpointNode .getViewMatrix ());
|
|
785
|
-
}
|
|
786
804
|
}
|
|
787
805
|
|
|
788
806
|
// Test for hits.
|
|
@@ -798,7 +816,7 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
798
816
|
|
|
799
817
|
// Make a vibration puls if there is a sensor hit.
|
|
800
818
|
|
|
801
|
-
this .
|
|
819
|
+
this .xrSensorHitPulse (hit, gamepad);
|
|
802
820
|
|
|
803
821
|
// Update matrices and determine pointer position.
|
|
804
822
|
|
|
@@ -866,6 +884,16 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
866
884
|
|
|
867
885
|
// Draw input source rays.
|
|
868
886
|
|
|
887
|
+
// switch (this .getSession () .visibilityState)
|
|
888
|
+
// {
|
|
889
|
+
// case "visible-blurred":
|
|
890
|
+
// case "hidden":
|
|
891
|
+
// return;
|
|
892
|
+
|
|
893
|
+
// default:
|
|
894
|
+
// break;
|
|
895
|
+
// }
|
|
896
|
+
|
|
869
897
|
for (const [i, { viewMatrix, projectionMatrix }] of pose .views .entries ())
|
|
870
898
|
{
|
|
871
899
|
const frameBuffer = this .getFramebuffers () [i];
|
|
@@ -890,7 +918,7 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
890
918
|
inputRayMatrix .multVecMatrix (hitPoint .assign (hit .originalPoint));
|
|
891
919
|
|
|
892
920
|
// Make ray shorter if track point is very close.
|
|
893
|
-
if (hitPoint .distance (fromPoint) < toPoint .distance (fromPoint))
|
|
921
|
+
if (hit .id && hitPoint .distance (fromPoint) < toPoint .distance (fromPoint))
|
|
894
922
|
toPoint .assign (hitPoint);
|
|
895
923
|
|
|
896
924
|
if (fromPoint .z > 0 || toPoint .z > 0)
|
|
@@ -924,14 +952,14 @@ Object .assign (X3DWebXRContext .prototype,
|
|
|
924
952
|
}
|
|
925
953
|
};
|
|
926
954
|
})(),
|
|
927
|
-
|
|
955
|
+
xrEndFrame ()
|
|
928
956
|
{
|
|
929
957
|
const gl = this .getContext ();
|
|
930
958
|
|
|
931
959
|
// WebXR Emulator and polyfill: bind to null, to prevent changes.
|
|
932
960
|
gl .bindVertexArray (null);
|
|
933
961
|
},
|
|
934
|
-
|
|
962
|
+
xrSensorHitPulse (hit, gamepad)
|
|
935
963
|
{
|
|
936
964
|
if (hit .sensors .size)
|
|
937
965
|
{
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v11.2.
|
|
2
|
-
const e=window[Symbol.for("X_ITE.X3D-11.2.0")];(()=>{var t={n:e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const i=e.Components;var s=t.n(i);const r=e.ScreenLine;var n=t.n(r);const a=e.GeometryContext;var o=t.n(a);const c=e.AlphaMode;var h=t.n(c);const u=e.VertexArray;var l=t.n(u);const d=e.Layer;var m=t.n(d);const f=e.Matrix4;var p=t.n(f);const g=e.Namespace;var x=t.n(g);function w(e){const t=e.getContext();this.browser=e,this.vertexArrayObject=new(l())(t),this.circleVertexBuffer=t.createBuffer(),this.circleGeometryContext=new(o())({renderObject:new(m())(e.getPrivateScene()),alphaMode:h().BLEND,geometryType:1}),this.circleGeometryContext.renderObject.setup();const i=e.getCircle2DOptions().getGeometry().getVertices();this.circleNumVertices=i.length/4,t.bindBuffer(t.ARRAY_BUFFER,this.circleVertexBuffer),t.bufferData(t.ARRAY_BUFFER,i.getValue(),t.STATIC_DRAW),this.diskVertexBuffer=t.createBuffer(),this.diskGeometryContext=new(o())({renderObject:this.circleGeometryContext.renderObject,alphaMode:h().BLEND,geometryType:3});const s=e.getDisk2DOptions().getDiskVertices();this.diskNumVertices=s.length/4,t.bindBuffer(t.ARRAY_BUFFER,this.diskVertexBuffer),t.bufferData(t.ARRAY_BUFFER,s.getValue(),t.STATIC_DRAW)}Object.assign(w.prototype,{display:(()=>{const e=new Float32Array(p().Identity),t=new Float32Array(p().Identity),i=new(p()),s=[];return function(r,n,a,o,c,h,u){const l=this.browser,d=l.getContext(),m=l.getViewport();u.bind(),d.viewport(...m),d.scissor(...m);const f=r*Math.abs(c.origin.z),p=c.xAxis.normalize().multiply(f),g=c.yAxis.normalize().multiply(f),x=c.zAxis.normalize().multiply(f);i.set(...p,0,...g,0,...x,0,...c.origin,1),e.set(h),t.set(i),d.depthMask(!1),d.disable(d.DEPTH_TEST),d.enable(d.BLEND),d.disable(d.CULL_FACE);{const i=l.getDefaultMaterial().getShader(this.circleGeometryContext);i.enable(d),i.setClipPlanes(d,s),d.uniformMatrix4fv(i.x3d_ProjectionMatrix,!1,e),d.uniformMatrix4fv(i.x3d_ModelViewMatrix,!1,t),d.uniform3f(i.x3d_EmissiveColor,0,0,0),d.uniform1f(i.x3d_Transparency,o),this.vertexArrayObject.enable(i.getProgram())&&i.enableVertexAttribute(d,this.circleVertexBuffer,0,0),d.drawArrays(d.LINES,0,this.circleNumVertices)}{const i=l.getDefaultMaterial().getShader(this.diskGeometryContext);i.enable(d),i.setClipPlanes(d,s),d.uniformMatrix4fv(i.x3d_ProjectionMatrix,!1,e),d.uniformMatrix4fv(i.x3d_ModelViewMatrix,!1,t),d.uniform3f(i.x3d_EmissiveColor,...n),d.uniform1f(i.x3d_Transparency,a),this.vertexArrayObject.enable(i.getProgram())&&i.enableVertexAttribute(d,this.diskVertexBuffer,0,0),d.drawArrays(d.TRIANGLES,0,this.diskNumVertices)}d.depthMask(!0),d.enable(d.DEPTH_TEST),d.disable(d.BLEND)}})(),dispose(){const e=this.browser.getContext();e.deleteBuffer(this.diskVertexBuffer),this.diskVertexArrayObject.dispose(e)}});const b=w,v=x().add("ScreenPoint",b),y=e.ViewVolume;var M=t.n(y);const S=e.Color3;var V=t.n(S);const R=e.Vector3;var C=t.n(R);const A=e.Rotation4;var E=t.n(A);const P=e.Lock;var F=t.n(P);const j=e.ExamineViewer;var B=t.n(j);Object.assign(B().prototype,{gamepads(e){const t=e.find((({axes:e})=>e[2]||e[3]));if(!t)return void(e.action&&(e.action=!1,this.disconnect()));const i=t.buttons[0].pressed,s=t.buttons[1].pressed;e.button0===i&&e.button1===s||(e.button0=i,e.button1=s,this.disconnect());const r=60/this.getBrowser().currentFrameRate;e.action=!0,i?this.zoom(.005*t.axes[3]*r,Math.sign(-t.axes[3])):s?(this.startPan(0,0),this.pan(5*-t.axes[2]*r,5*t.axes[3]*r)):(this.startRotate(0,0),this.rotate(10*-t.axes[2]*r,10*t.axes[3]*r))}});const D=e.X3DFlyViewer;var L=t.n(D);const O=new(C())(300,300,400);Object.assign(L().prototype,{gamepads:function(){const e=new(C());return function(t){const i=t.find((({axes:e})=>e[2]||e[3]));if(!i)return void(this.startTime=Date.now());i.buttons[1].pressed?(e.set(i.axes[2],-i.axes[3],0).multVec(O),this.direction.add(e).divide(2),this.pan()):(e.set(i.axes[2],0,i.axes[3]).multVec(O),this.direction.add(e).divide(2),this.fly())}}()});const _=e.X3DViewer;var X=t.n(_);Object.assign(X().prototype,{gamepads(){}});const T=Symbol(),I=Symbol(),N=Symbol(),k=Symbol(),z=Symbol(),G=Symbol(),H=Symbol(),W=Symbol();function U(){this[H]=[]}Object.assign(U.prototype,{async initXRSession(){return F().acquire(`X3DWebXRContext.session-${this.getId()}`,(async()=>{if(this.getSession()!==window)return;const e=this.getContext(),t=this.getBrowserOption("XRSessionMode").toLowerCase().replaceAll("_","-"),i=(await e.makeXRCompatible(),await navigator.xr.requestSession(t)),s=await i.requestReferenceSpace("local");e.bindFramebuffer(e.FRAMEBUFFER,null),this.cameraEvents().addInterest("updatePose",this),this.finishedEvents().addInterest("updatePointers",this),this.endEvents().addInterest("endFrame",this),i.addEventListener("inputsourceschange",(e=>this.updateInputSources(e))),i.addEventListener("end",(()=>this.stopXRSession())),this[T]=s,this[k]=new Set,this[z]=new(n())(this,4,2,.9),this[G]=new v(this),Object.assign(this[H],{action:!0}),this[N]={cameraSpaceMatrix:new(p()),viewMatrix:new(p()),views:[]},this.updateBaseLayer({},i),this.setSession(i),this.removeHit(this.getHit())}))},stopXRSession(){return F().acquire(`X3DWebXRContext.session-${this.getId()}`,(async()=>{if(this.getSession()!==window){await this.getSession().end().catch(Function.prototype),this.cameraEvents().removeInterest("updatePose",this),this.finishedEvents().removeInterest("updatePointers",this),this.endEvents().removeInterest("endFrame",this),this.setSession(window),this.setDefaultFramebuffer(null);for(const{hit:e}of this[k])this.removeHit(e);this[T]=null,this[I]=null,this[N]=null,this[k]=null,this[z]=null,this[G]=null,this[W]=null}}))},setFramebufferScaleFactor(e){this.updateBaseLayer({framebufferScaleFactor:e})},updateBaseLayer(e={},t=this.getSession()){if(t===window)return;const i=new XRWebGLLayer(t,this.getContext(),Object.assign({antialias:!1,alpha:!0,depth:!1,ignoreDepthValues:!0,framebufferScaleFactor:this.getRenderingProperty("ContentScale")},e));this[I]=i,t.updateRenderState({baseLayer:i}),this.setDefaultFramebuffer(i.framebuffer)},updateInputSources(e){for(const t of e.added)this[k].add(Object.assign(t,{active:!1,matrix:new(p()),inverse:new(p()),hit:Object.assign(this.getHit().copy(),{button:!1,pressed:!1,pulse:!0,poseViewMatrix:new(p()),originalPoint:new(C()),originalNormal:new(C())})})),t.gamepad&&(t.gamepad.hit=t.hit);for(const t of e.removed)this.removeHit(t.hit),this[k].delete(t)},setFrame(e){if(!e)return;this[W]=e;!this.getCanvas().parent().is(this.getSurface())&&this.getCanvas().css(this.getXREmulatorCSS()),this[H].length=0;for(const{active:e,gamepad:t}of this[k])e&&(t.axes.length<4||this[H].push(t));this.getViewer().gamepads(this[H]),this.addBrowserEvent()},getPose(){return this[N]},updatePose(){const e=this[W].getViewerPose(this[T]),t=this[N],i=this.getActiveViewpoint();t.cameraSpaceMatrix.assign(e.transform.matrix),t.viewMatrix.assign(e.transform.inverse.matrix),i&&(t.cameraSpaceMatrix.multRight(i.getCameraSpaceMatrix()),t.viewMatrix.multLeft(i.getViewMatrix()));let s=0;for(const r of e.views){const{x:e,y:n,width:a,height:o}=this[I].getViewport(r);if(!a)continue;this.reshapeFramebuffer(s,0|e,0|n,0|a,0|o);const c=t.views[s]??={projectionMatrix:new(p()),cameraSpaceMatrix:new(p()),viewMatrix:new(p()),matrix:new(p()),inverse:new(p())};c.projectionMatrix.assign(r.projectionMatrix),c.cameraSpaceMatrix.assign(r.transform.matrix),c.viewMatrix.assign(r.transform.inverse.matrix),i&&(c.cameraSpaceMatrix.multRight(i.getCameraSpaceMatrix()),c.viewMatrix.multLeft(i.getViewMatrix())),c.matrix.assign(t.cameraSpaceMatrix).multRight(c.viewMatrix),c.inverse.assign(c.cameraSpaceMatrix).multRight(t.viewMatrix),++s}t.views.length=s,this.getFramebuffers().length=s},updatePointers:function(){const e=new(V())(.5,.75,1),t=new(p()),i=new(C())(0,0,-.5),s=new(C()),r=new(C()),n=new(C()),a=new(E());return function(){const o=this.getViewport().getValue(),c=this[N],h=this.getActiveViewpoint();for(const e of this[k]){const{targetRaySpace:t,matrix:i,inverse:s}=e,r=this[W].getPose(t,this[T]);e.active=!!r,r&&(i.assign(r.transform.matrix),s.assign(r.transform.inverse.matrix),h&&(i.multRight(h.getCameraSpaceMatrix()),s.multLeft(h.getViewMatrix())))}for(const e of this[k]){const{active:i,gamepad:s,matrix:r,hit:n}=e;if(!i)continue;if(this.touch(o[2]/2,o[3]/2,n,e),this.sensorHitPulse(n,s),!n.id)continue;const a=c.views[0].projectionMatrix;n.pressed||n.poseViewMatrix.assign(c.viewMatrix),t.assign(r).multRight(n.poseViewMatrix);for(const e of n.sensors.values())e.projectionMatrix.assign(a),e.modelViewMatrix.multRight(t);M().projectPoint(n.point,t,a,o,n.pointer),n.originalPoint.assign(n.point),n.originalNormal.assign(n.normal),n.ray.multLineMatrix(t),t.multVecMatrix(n.point),t.submatrix.inverse().multMatrixVec(n.normal)}for(const{active:e,gamepad:t,hit:i}of this[k]){if(!e)continue;const s=t?.buttons[0];s?.pressed?i.button||(i.button=!0,i.pressed||=this.buttonPressEvent(0,0,i)):(i.button=!1,i.pressed&&(i.pressed=!1,this.buttonReleaseEvent(i))),this.motionNotifyEvent(0,0,i)}for(const[h,{viewMatrix:u,projectionMatrix:l}]of c.views.entries()){const c=this.getFramebuffers()[h];for(const{active:h,gamepad:d,matrix:m,hit:f}of this[k]){if(!h)continue;const p=d?.buttons.some((e=>e.pressed)),g=p?e:V().White;if(t.assign(m).multRight(u),t.multVecMatrix(s.assign(C().Zero)),t.multVecMatrix(r.assign(i)),t.multVecMatrix(n.assign(f.originalPoint)),n.distance(s)<r.distance(s)&&r.assign(n),s.z>0||r.z>0)continue;if(M().projectPointMatrix(s,l,o,s),M().projectPointMatrix(r,l,o,r),s.z=0,r.z=0,this[z].setColor(g).display(s,r,c),!f.id)continue;const x=p?.005:.007;t.assign(m).multRight(u).translate(f.originalPoint).rotate(a.setFromToVec(C().zAxis,f.originalNormal)),this[G].display(x,g,.3,.8,t,l,c)}}}}(),endFrame(){this.getContext().bindVertexArray(null)},sensorHitPulse(e,t){e.sensors.size?e.pulse&&(t?.hapticActuators?.[0]?.pulse(.25,10),e.pulse=!1):e.pulse=!0}});const q=U,Y=x().add("X3DWebXRContext",q);s().add({name:"WebXR",concreteNodes:[],abstractNodes:[],browserContext:Y});x().add("WebXRComponent",undefined)})();
|
|
1
|
+
/* X_ITE v11.2.2 */
|
|
2
|
+
const e=window[Symbol.for("X_ITE.X3D-11.2.2")];(()=>{var t={n:e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const i=e.Components;var s=t.n(i);const r=e.ScreenLine;var n=t.n(r);const a=e.GeometryContext;var o=t.n(a);const c=e.AlphaMode;var h=t.n(c);const d=e.VertexArray;var l=t.n(d);const u=e.Layer;var x=t.n(u);const p=e.Matrix4;var m=t.n(p);const f=e.Namespace;var g=t.n(f);function v(e){const t=e.getContext();this.browser=e,this.vertexArrayObject=new(l())(t),this.circleVertexBuffer=t.createBuffer(),this.circleGeometryContext=new(o())({renderObject:new(x())(e.getPrivateScene()),alphaMode:h().BLEND,geometryType:1}),this.circleGeometryContext.renderObject.setup();const i=e.getCircle2DOptions().getGeometry().getVertices();this.circleNumVertices=i.length/4,t.bindBuffer(t.ARRAY_BUFFER,this.circleVertexBuffer),t.bufferData(t.ARRAY_BUFFER,i.getValue(),t.STATIC_DRAW),this.diskVertexBuffer=t.createBuffer(),this.diskGeometryContext=new(o())({renderObject:this.circleGeometryContext.renderObject,alphaMode:h().BLEND,geometryType:3});const s=e.getDisk2DOptions().getDiskVertices();this.diskNumVertices=s.length/4,t.bindBuffer(t.ARRAY_BUFFER,this.diskVertexBuffer),t.bufferData(t.ARRAY_BUFFER,s.getValue(),t.STATIC_DRAW)}Object.assign(v.prototype,{display:(()=>{const e=new Float32Array(m().Identity),t=new Float32Array(m().Identity),i=new Float32Array(m().Identity),s=new(m()),r=[];return function(n,a,o,c,h,d,l){const u=this.browser,x=u.getContext(),p=u.getViewport();l.bind(),x.viewport(...p),x.scissor(...p);const m=n*Math.abs(h.origin.z),f=h.xAxis.normalize().multiply(m),g=h.yAxis.normalize().multiply(m),v=h.zAxis.normalize().multiply(m);s.set(...f,0,...g,0,...v,0,...h.origin,1),e.set(d),t.set(s),x.depthMask(!1),x.disable(x.DEPTH_TEST),x.enable(x.BLEND),x.disable(x.CULL_FACE);{const s=u.getDefaultMaterial().getShader(this.circleGeometryContext);s.enable(x),s.setClipPlanes(x,r),x.uniformMatrix4fv(s.x3d_ProjectionMatrix,!1,e),x.uniformMatrix4fv(s.x3d_ModelViewMatrix,!1,t),x.uniformMatrix4fv(s.x3d_EyeMatrix,!1,i),x.uniform3f(s.x3d_EmissiveColor,0,0,0),x.uniform1f(s.x3d_Transparency,c),this.vertexArrayObject.enable(s.getProgram())&&s.enableVertexAttribute(x,this.circleVertexBuffer,0,0),x.drawArrays(x.LINES,0,this.circleNumVertices)}{const s=u.getDefaultMaterial().getShader(this.diskGeometryContext);s.enable(x),s.setClipPlanes(x,r),x.uniformMatrix4fv(s.x3d_ProjectionMatrix,!1,e),x.uniformMatrix4fv(s.x3d_ModelViewMatrix,!1,t),x.uniformMatrix4fv(s.x3d_EyeMatrix,!1,i),x.uniform3f(s.x3d_EmissiveColor,...a),x.uniform1f(s.x3d_Transparency,o),this.vertexArrayObject.enable(s.getProgram())&&s.enableVertexAttribute(x,this.diskVertexBuffer,0,0),x.drawArrays(x.TRIANGLES,0,this.diskNumVertices)}x.depthMask(!0),x.enable(x.DEPTH_TEST),x.disable(x.BLEND)}})(),dispose(){const e=this.browser.getContext();e.deleteBuffer(this.diskVertexBuffer),this.diskVertexArrayObject.dispose(e)}});const w=v,b=g().add("ScreenPoint",w),y=e.ViewVolume;var M=t.n(y);const S=e.Color3;var R=t.n(S);const V=e.Vector3;var C=t.n(V);const E=e.Rotation4;var P=t.n(E);const A=e.Lock;var F=t.n(A);const j=e.ExamineViewer;var D=t.n(j);Object.assign(D().prototype,{gamepads(e){const t=e.find((({axes:e})=>e[2]||e[3]));if(!t)return void(e.action&&(e.action=!1,this.disconnect()));const i=t.buttons[0].pressed,s=t.buttons[1].pressed;e.button0===i&&e.button1===s||(e.button0=i,e.button1=s,this.disconnect());const r=60/this.getBrowser().currentFrameRate;e.action=!0,i?this.zoom(.005*t.axes[3]*r,Math.sign(-t.axes[3])):s?(this.startPan(0,0),this.pan(5*-t.axes[2]*r,5*t.axes[3]*r)):(this.startRotate(0,0),this.rotate(10*-t.axes[2]*r,10*t.axes[3]*r))}});const B=e.X3DFlyViewer;var _=t.n(B);const N=new(C())(300,300,400);Object.assign(_().prototype,{gamepads:function(){const e=new(C());return function(t){const i=t.find((({axes:e})=>e[2]||e[3]));if(!i)return void(this.startTime=Date.now());const s=i.buttons[0].pressed;i.buttons[1].pressed?(e.set(i.axes[2],-i.axes[3],0).multVec(N),this.direction.add(e).divide(2),this.pan()):(e.set(i.axes[2],0,i.axes[3]).multVec(N).multiply(s?2:1),this.direction.add(e).divide(2),this.fly())}}()});const O=e.X3DViewer;var I=t.n(O);Object.assign(I().prototype,{gamepads(){}});const L=Symbol(),X=Symbol(),U=Symbol(),T=Symbol(),k=Symbol(),z=Symbol(),G=Symbol(),H=Symbol();function W(){this[G]=[]}Object.assign(W.prototype,{getPose(){return this[U]},async initXRSession(){return F().acquire(`X3DWebXRContext.session-${this.getId()}`,(async()=>{if(this.getSession()!==window)return;const e=this.getContext(),t=this.getBrowserOption("XRSessionMode").toLowerCase().replaceAll("_","-"),i=(await e.makeXRCompatible(),await navigator.xr.requestSession(t)),s=await i.requestReferenceSpace("local");e.bindFramebuffer(e.FRAMEBUFFER,null),this.cameraEvents().addInterest("xrUpdatePose",this),this.finishedEvents().addInterest("xrUpdatePointers",this),this.endEvents().addInterest("xrEndFrame",this),i.addEventListener("inputsourceschange",(e=>this.xrUpdateInputSources(e))),i.addEventListener("end",(()=>this.stopXRSession())),this[L]=s,this[T]=new Set,this[k]=new(n())(this,4,2,.9),this[z]=new b(this),Object.assign(this[G],{action:!0}),this[U]={cameraSpaceMatrix:new(m()),viewMatrix:new(m()),views:[]},this.xrUpdateBaseLayer({},i),this.setSession(i),this.removeHit(this.getHit()),this.getRenderingProperties()._ContentScale.addInterest("xrContentScale",this),this.getRenderingProperties()._XRSession=!0}))},stopXRSession(){return F().acquire(`X3DWebXRContext.session-${this.getId()}`,(async()=>{if(this.getSession()!==window){await this.getSession().end().catch(Function.prototype),this.cameraEvents().removeInterest("xrUpdatePose",this),this.finishedEvents().removeInterest("xrUpdatePointers",this),this.endEvents().removeInterest("xrEndFrame",this),this.setSession(window),this.setDefaultFramebuffer(null);for(const{hit:e}of this[T])this.removeHit(e);this[L]=null,this[X]=null,this[U]=null,this[T]=null,this[k]=null,this[z]=null,this[H]=null,this.getRenderingProperties()._ContentScale.removeInterest("xrContentScale",this),this.getRenderingProperties()._XRSession=!1}}))},xrContentScale(){this.xrUpdateBaseLayer()},xrUpdateBaseLayer(e={},t=this.getSession()){if(t===window)return;const i=new XRWebGLLayer(t,this.getContext(),Object.assign({antialias:!1,alpha:!0,depth:!1,ignoreDepthValues:!0,framebufferScaleFactor:this.getRenderingProperty("ContentScale")},e));this[X]=i,t.updateRenderState({baseLayer:i}),this.setDefaultFramebuffer(i.framebuffer)},xrUpdateNearFarPlanes:function(){const e={};return function(){const t=this.getActiveNavigationInfo(),i=this.getActiveViewpoint();i?(e.depthNear=i.getNearDistance(t),e.depthFar=i.getFarDistance(t)):(e.depthNear=.1,e.depthFar=1e4),this.getSession().updateRenderState(e)}}(),xrUpdateInputSources(e){for(const t of e.added)this[T].add(Object.assign(t,{active:!1,matrix:new(m()),inverse:new(m()),hit:Object.assign(this.getHit().copy(),{button:!1,pressed:!1,pulse:!0,poseViewMatrix:new(m()),originalPoint:new(C()),originalNormal:new(C())})})),t.gamepad&&(t.gamepad.hit=t.hit);for(const t of e.removed)this.removeHit(t.hit),this[T].delete(t)},xrFrame(e){if(!e)return;this[H]=e;!this.getCanvas().parent().is(this.getSurface())&&this.getCanvas().css(this.getXREmulatorCSS()),this.xrUpdateNearFarPlanes(),this[G].length=0;for(const{active:e,gamepad:t}of this[T])e&&t&&(t.axes.length<4||this[G].push(t));this.getViewer().gamepads(this[G]),this.addBrowserEvent()},xrUpdatePose(){const e=this[H].getViewerPose(this[L]),t=this[U];t.cameraSpaceMatrix.assign(e.transform.matrix),t.viewMatrix.assign(e.transform.inverse.matrix);let i=0;for(const s of e.views){const{x:e,y:r,width:n,height:a}=this[X].getViewport(s);if(!n)continue;this.reshapeFramebuffer(i,0|e,0|r,0|n,0|a);const o=t.views[i]??={projectionMatrix:new(m()),cameraSpaceMatrix:new(m()),viewMatrix:new(m()),matrix:new(m()),inverse:new(m())};o.projectionMatrix.assign(s.projectionMatrix),o.cameraSpaceMatrix.assign(s.transform.matrix),o.viewMatrix.assign(s.transform.inverse.matrix),o.matrix.assign(t.cameraSpaceMatrix).multRight(o.viewMatrix),o.inverse.assign(o.cameraSpaceMatrix).multRight(t.viewMatrix),++i}t.views.length=i,this.getFramebuffers().length=i},xrUpdatePointers:function(){const e=new(R())(.5,.75,1),t=new(m()),i=new(C())(0,0,-.5),s=new(C()),r=new(C()),n=new(C()),a=new(P());return function(){const o=this.getViewport().getValue(),c=this[U];for(const e of this[T]){const{targetRaySpace:t,matrix:i,inverse:s}=e,r=this[H].getPose(t,this[L]);e.active=!!r,r&&(i.assign(r.transform.matrix),s.assign(r.transform.inverse.matrix))}for(const e of this[T]){const{active:i,gamepad:s,matrix:r,hit:n}=e;if(!i)continue;if(this.touch(o[2]/2,o[3]/2,n,e),this.xrSensorHitPulse(n,s),!n.id)continue;const a=c.views[0].projectionMatrix;n.pressed||n.poseViewMatrix.assign(c.viewMatrix),t.assign(r).multRight(n.poseViewMatrix);for(const e of n.sensors.values())e.projectionMatrix.assign(a),e.modelViewMatrix.multRight(t);M().projectPoint(n.point,t,a,o,n.pointer),n.originalPoint.assign(n.point),n.originalNormal.assign(n.normal),n.ray.multLineMatrix(t),t.multVecMatrix(n.point),t.submatrix.inverse().multMatrixVec(n.normal)}for(const{active:e,gamepad:t,hit:i}of this[T]){if(!e)continue;const s=t?.buttons[0];s?.pressed?i.button||(i.button=!0,i.pressed||=this.buttonPressEvent(0,0,i)):(i.button=!1,i.pressed&&(i.pressed=!1,this.buttonReleaseEvent(i))),this.motionNotifyEvent(0,0,i)}for(const[h,{viewMatrix:d,projectionMatrix:l}]of c.views.entries()){const c=this.getFramebuffers()[h];for(const{active:h,gamepad:u,matrix:x,hit:p}of this[T]){if(!h)continue;const m=u?.buttons.some((e=>e.pressed)),f=m?e:R().White;if(t.assign(x).multRight(d),t.multVecMatrix(s.assign(C().Zero)),t.multVecMatrix(r.assign(i)),t.multVecMatrix(n.assign(p.originalPoint)),p.id&&n.distance(s)<r.distance(s)&&r.assign(n),s.z>0||r.z>0)continue;if(M().projectPointMatrix(s,l,o,s),M().projectPointMatrix(r,l,o,r),s.z=0,r.z=0,this[k].setColor(f).display(s,r,c),!p.id)continue;const g=m?.005:.007;t.assign(x).multRight(d).translate(p.originalPoint).rotate(a.setFromToVec(C().zAxis,p.originalNormal)),this[z].display(g,f,.3,.8,t,l,c)}}}}(),xrEndFrame(){this.getContext().bindVertexArray(null)},xrSensorHitPulse(e,t){e.sensors.size?e.pulse&&(t?.hapticActuators?.[0]?.pulse(.25,10),e.pulse=!1):e.pulse=!0}});const q=W,Y=g().add("X3DWebXRContext",q);s().add({name:"WebXR",concreteNodes:[],abstractNodes:[],browserContext:Y});g().add("WebXRComponent",undefined)})();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* X_ITE v11.2.
|
|
2
|
-
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.2.
|
|
1
|
+
/* X_ITE v11.2.2 */
|
|
2
|
+
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.2.2")];
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ "use strict";
|
|
5
5
|
/******/ // The require scope
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v11.2.
|
|
2
|
-
const e=window[Symbol.for("X_ITE.X3D-11.2.0")];(()=>{var t={n:e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const s=e.Components;var i=t.n(s);const n=e.Fields;var r=t.n(n);const o=e.X3DFieldDefinition;var a=t.n(o);const u=e.FieldDefinitionArray;var _=t.n(u);const h=e.X3DNode;var c=t.n(h);const d=e.X3DConstants;var l=t.n(d);const p=e.BitSet;var T=t.n(p);const S=e.Namespace;var x=t.n(S);function f(e){c().call(this,e),this.addType(l().X3DMaterialExtensionNode),this.textureBits=new(T())}Object.assign(Object.setPrototypeOf(f.prototype,c().prototype),{setTexture(e,t){e*=4,this.textureBits.remove(e,15),this.textureBits.add(e,t?.getTextureBits()??0)},getTextureBits(){return this.textureBits}}),Object.defineProperties(f,c().getStaticProperties("X3DMaterialExtensionNode","X_ITE",1));const E=f,g=x().add("X3DMaterialExtensionNode",E),O=e.X3DCast;var N=t.n(O);let m=0;const A={ANISOTROPY_MATERIAL_EXTENSION:m++,CLEARCOAT_MATERIAL_EXTENSION:m++,DIFFUSE_TRANSMISSION_EXTENSION:m++,DISPERSION_MATERIAL_EXTENSION:m++,EMISSIVE_STRENGTH_MATERIAL_EXTENSION:m++,IOR_MATERIAL_EXTENSION:m++,IRIDESCENCE_MATERIAL_EXTENSION:m++,SHEEN_MATERIAL_EXTENSION:m++,SPECULAR_MATERIAL_EXTENSION:m++,TRANSMISSION_MATERIAL_EXTENSION:m++,UNLIT_MATERIAL_EXTENSION:m++,VOLUME_MATERIAL_EXTENSION:m++},I=x().add("ExtensionKeys",A);function w(e){g.call(this,e),this.addType(l().AnisotropyMaterialExtension),this._anisotropyRotation.setUnit("angle"),this.anisotropyArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(w.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._anisotropyStrength.addInterest("set_anisotropyStrength__",this),this._anisotropyRotation.addInterest("set_anisotropyRotation__",this),this._anisotropyTexture.addInterest("set_anisotropyTexture__",this),this.set_anisotropyStrength__(),this.set_anisotropyRotation__(),this.set_anisotropyTexture__()},set_anisotropyStrength__(){this.anisotropyArray[2]=Math.max(this._anisotropyStrength.getValue(),0)},set_anisotropyRotation__(){const e=this._anisotropyRotation.getValue();this.anisotropyArray[0]=Math.cos(e),this.anisotropyArray[1]=Math.sin(e)},set_anisotropyTexture__(){this.anisotropyTextureNode=N()(l().X3DSingleTextureNode,this._anisotropyTexture),this.setTexture(0,this.anisotropyTextureNode)},getExtensionKey:()=>I.ANISOTROPY_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_ANISOTROPY_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.anisotropyTextureNode?.getShaderOptions(e,"ANISOTROPY",!0))},setShaderUniforms(e,t,s,i,n){e.uniform3fv(t.x3d_AnisotropyEXT,this.anisotropyArray),this.anisotropyTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_AnisotropyTextureEXT,this._anisotropyTextureMapping.getValue(),i,n)}}),Object.defineProperties(w,{...c().getStaticProperties("AnisotropyMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"anisotropyStrength",new(r().SFFloat)),new(a())(l().inputOutput,"anisotropyRotation",new(r().SFFloat)),new(a())(l().inputOutput,"anisotropyTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"anisotropyTexture",new(r().SFNode))]),enumerable:!0}});const y=w,C=x().add("AnisotropyMaterialExtension",y),R=e.X3DAppearanceChildNode;var M=t.n(R);function F(e){M().call(this,e),this.addType(l().BlendMode),this.factorTypes=new Map,this.equationTypes=new Map}Object.assign(Object.setPrototypeOf(F.prototype,M().prototype),{initialize(){M().prototype.initialize.call(this);const e=this.getBrowser().getContext(),t=e.getExtension("EXT_blend_minmax");this.factorTypes.set("ZERO",e.ZERO),this.factorTypes.set("ONE",e.ONE),this.factorTypes.set("SRC_COLOR",e.SRC_COLOR),this.factorTypes.set("ONE_MINUS_SRC_COLOR",e.ONE_MINUS_SRC_COLOR),this.factorTypes.set("DST_COLOR",e.DST_COLOR),this.factorTypes.set("ONE_MINUS_DST_COLOR",e.ONE_MINUS_DST_COLOR),this.factorTypes.set("SRC_ALPHA",e.SRC_ALPHA),this.factorTypes.set("ONE_MINUS_SRC_ALPHA",e.ONE_MINUS_SRC_ALPHA),this.factorTypes.set("DST_ALPHA",e.DST_ALPHA),this.factorTypes.set("ONE_MINUS_DST_ALPHA",e.ONE_MINUS_DST_ALPHA),this.factorTypes.set("SRC_ALPHA_SATURATE",e.SRC_ALPHA_SATURATE),this.factorTypes.set("CONSTANT_COLOR",e.CONSTANT_COLOR),this.factorTypes.set("ONE_MINUS_CONSTANT_COLOR",e.ONE_MINUS_CONSTANT_COLOR),this.factorTypes.set("CONSTANT_ALPHA",e.CONSTANT_ALPHA),this.factorTypes.set("ONE_MINUS_CONSTANT_ALPHA",e.ONE_MINUS_CONSTANT_ALPHA),this.equationTypes.set("FUNC_ADD",e.FUNC_ADD),this.equationTypes.set("FUNC_SUBTRACT",e.FUNC_SUBTRACT),this.equationTypes.set("FUNC_REVERSE_SUBTRACT",e.FUNC_REVERSE_SUBTRACT),this.equationTypes.set("MIN",e.MIN||t&&t.MIN_EXT),this.equationTypes.set("MAX",e.MAX||t&&t.MAX_EXT),this._sourceColorFactor.addInterest("set_sourceColorFactor__",this),this._sourceAlphaFactor.addInterest("set_sourceAlphaFactor__",this),this._destinationColorFactor.addInterest("set_destinationColorFactor__",this),this._destinationAlphaFactor.addInterest("set_destinationAlphaFactor__",this),this._colorEquation.addInterest("set_colorEquation__",this),this._alphaEquation.addInterest("set_alphaEquation__",this),this.set_sourceColorFactor__(),this.set_sourceAlphaFactor__(),this.set_destinationColorFactor__(),this.set_destinationAlphaFactor__(),this.set_colorEquation__(),this.set_alphaEquation__()},set_sourceColorFactor__(){this.sourceColorFactorType=this.factorTypes.get(this._sourceColorFactor.getValue())??this.factorTypes.get("SRC_ALPHA")},set_sourceAlphaFactor__(){this.sourceAlphaFactorType=this.factorTypes.get(this._sourceAlphaFactor.getValue())??this.factorTypes.get("ONE")},set_destinationColorFactor__(){this.destinationColorFactorType=this.factorTypes.get(this._destinationColorFactor.getValue())??this.factorTypes.get("ONE_MINUS_SRC_ALPHA")},set_destinationAlphaFactor__(){this.destinationAlphaFactorType=this.factorTypes.get(this._destinationAlphaFactor.getValue())??this.factorTypes.get("ONE_MINUS_SRC_ALPHA")},set_colorEquation__(){this.colorEquationType=this.equationTypes.get(this._colorEquation.getValue())??this.equationTypes.get("FUNC_ADD")},set_alphaEquation__(){this.alphaEquationType=this.equationTypes.get(this._alphaEquation.getValue())??this.equationTypes.get("FUNC_ADD")},enable(e){const t=this._blendColor.getValue();e.blendColor(t.r,t.g,t.b,t.a),e.blendFuncSeparate(this.sourceColorFactorType,this.destinationColorFactorType,this.sourceAlphaFactorType,this.destinationAlphaFactorType),e.blendEquationSeparate(this.colorEquationType,this.alphaEquationType)},disable(e){e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD)}}),Object.defineProperties(F,{...c().getStaticProperties("BlendMode","X_ITE",1,"blendMode","3.3"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"blendColor",new(r().SFColorRGBA)),new(a())(l().inputOutput,"sourceColorFactor",new(r().SFString)("SRC_ALPHA")),new(a())(l().inputOutput,"sourceAlphaFactor",new(r().SFString)("ONE")),new(a())(l().inputOutput,"destinationColorFactor",new(r().SFString)("ONE_MINUS_SRC_ALPHA")),new(a())(l().inputOutput,"destinationAlphaFactor",new(r().SFString)("ONE_MINUS_SRC_ALPHA")),new(a())(l().inputOutput,"colorEquation",new(r().SFString)("FUNC_ADD")),new(a())(l().inputOutput,"alphaEquation",new(r().SFString)("FUNC_ADD"))]),enumerable:!0}});const X=F,D=x().add("BlendMode",X),L=e.Algorithm;var b=t.n(L);function U(e){g.call(this,e),this.addType(l().ClearcoatMaterialExtension)}Object.assign(Object.setPrototypeOf(U.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._clearcoat.addInterest("set_clearcoat__",this),this._clearcoatTexture.addInterest("set_clearcoatTexture__",this),this._clearcoatRoughness.addInterest("set_clearcoatRoughness__",this),this._clearcoatRoughnessTexture.addInterest("set_clearcoatRoughnessTexture__",this),this._clearcoatNormalTexture.addInterest("set_clearcoatNormalTexture__",this),this.set_clearcoat__(),this.set_clearcoatTexture__(),this.set_clearcoatRoughness__(),this.set_clearcoatRoughnessTexture__(),this.set_clearcoatNormalTexture__()},set_clearcoat__(){this.clearcoat=Math.max(this._clearcoat.getValue(),0)},set_clearcoatTexture__(){this.clearcoatTextureNode=N()(l().X3DSingleTextureNode,this._clearcoatTexture),this.setTexture(0,this.clearcoatTextureNode)},set_clearcoatRoughness__(){this.clearcoatRoughness=b().clamp(this._clearcoatRoughness.getValue(),0,1)},set_clearcoatRoughnessTexture__(){this.clearcoatRoughnessTextureNode=N()(l().X3DSingleTextureNode,this._clearcoatRoughnessTexture),this.setTexture(1,this.clearcoatRoughnessTextureNode)},set_clearcoatNormalTexture__(){this.clearcoatNormalTextureNode=N()(l().X3DSingleTextureNode,this._clearcoatNormalTexture),this.setTexture(2,this.clearcoatNormalTextureNode)},getExtensionKey:()=>I.CLEARCOAT_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_CLEARCOAT_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.clearcoatTextureNode?.getShaderOptions(e,"CLEARCOAT",!0),this.clearcoatRoughnessTextureNode?.getShaderOptions(e,"CLEARCOAT_ROUGHNESS",!0),this.clearcoatNormalTextureNode?.getShaderOptions(e,"CLEARCOAT_NORMAL",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_ClearcoatEXT,this.clearcoat),e.uniform1f(t.x3d_ClearcoatRoughnessEXT,this.clearcoatRoughness),+this.getTextureBits()&&(this.clearcoatTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ClearcoatTextureEXT,this._clearcoatTextureMapping.getValue(),i,n),this.clearcoatRoughnessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ClearcoatRoughnessTextureEXT,this._clearcoatRoughnessTextureMapping.getValue(),i,n),this.clearcoatNormalTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ClearcoatNormalTextureEXT,this._clearcoatNormalTextureMapping.getValue(),i,n))}}),Object.defineProperties(U,{...c().getStaticProperties("ClearcoatMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"clearcoat",new(r().SFFloat)),new(a())(l().inputOutput,"clearcoatTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"clearcoatTexture",new(r().SFNode)),new(a())(l().inputOutput,"clearcoatRoughness",new(r().SFFloat)),new(a())(l().inputOutput,"clearcoatRoughnessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"clearcoatRoughnessTexture",new(r().SFNode)),new(a())(l().inputOutput,"clearcoatNormalTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"clearcoatNormalTexture",new(r().SFNode))]),enumerable:!0}});const P=U,V=x().add("ClearcoatMaterialExtension",P);function v(e){M().call(this,e),this.addType(l().DepthMode),this.addAlias("depthFunc",this._depthFunction)}Object.assign(Object.setPrototypeOf(v.prototype,M().prototype),{initialize(){M().prototype.initialize.call(this),this._depthFunction.addInterest("set_depthFunction__",this),this.set_depthFunction__()},set_depthFunction__:function(){const e=new Map([["NEVER","NEVER"],["LESS","LESS"],["EQUAL","EQUAL"],["LESS_EQUAL","LEQUAL"],["GREATER","GREATER"],["NOT_EQUAL","NOTEQUAL"],["GREATER_EQUAL","GEQUAL"],["ALWAYS","ALWAYS"]]);return function(){const t=this.getBrowser().getContext();this.depthFunction=t[e.get(this._depthFunction.getValue())??"LEQUAL"]}}(),enable(e){this.depthTest=e.isEnabled(e.DEPTH_TEST),this.depthWriteMask=e.getParameter(e.DEPTH_WRITEMASK),e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(...this._polygonOffset),this._depthTest.getValue()?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),e.depthFunc(this.depthFunction),e.depthRange(...this._depthRange.getValue()),e.depthMask(this._depthMask.getValue())},disable(e){e.disable(e.POLYGON_OFFSET_FILL),this.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.depthRange(0,1),e.depthMask(this.depthWriteMask)}}),Object.defineProperties(v,{...c().getStaticProperties("DepthMode","X_ITE",1,"depthMode","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"polygonOffset",new(r().SFVec2f)),new(a())(l().inputOutput,"depthRange",new(r().SFVec2f)(0,1)),new(a())(l().inputOutput,"depthTest",new(r().SFBool)(!0)),new(a())(l().inputOutput,"depthFunction",new(r().SFString)("LESS_EQUAL")),new(a())(l().inputOutput,"depthMask",new(r().SFBool)(!0))]),enumerable:!0}});const B=v,k=x().add("DepthMode",B);function j(e){g.call(this,e),this.addType(l().DiffuseTransmissionMaterialExtension),this.diffuseTransmissionColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(j.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._diffuseTransmission.addInterest("set_diffuseTransmission__",this),this._diffuseTransmissionTexture.addInterest("set_diffuseTransmissionTexture__",this),this._diffuseTransmissionColor.addInterest("set_diffuseTransmissionColor__",this),this._diffuseTransmissionColorTexture.addInterest("set_diffuseTransmissionColorTexture__",this),this.set_diffuseTransmission__(),this.set_diffuseTransmissionTexture__(),this.set_diffuseTransmissionColor__(),this.set_diffuseTransmissionColorTexture__()},set_diffuseTransmission__(){this.diffuseTransmission=Math.max(this._diffuseTransmission.getValue(),0)},set_diffuseTransmissionTexture__(){this.diffuseTransmissionTextureNode=N()(l().X3DSingleTextureNode,this._diffuseTransmissionTexture),this.setTexture(0,this.diffuseTransmissionTextureNode)},set_diffuseTransmissionColor__(){this.diffuseTransmissionColorArray.set(this._diffuseTransmissionColor.getValue())},set_diffuseTransmissionColorTexture__(){this.diffuseTransmissionColorTextureNode=N()(l().X3DSingleTextureNode,this._diffuseTransmissionColorTexture),this.setTexture(1,this.diffuseTransmissionColorTextureNode)},getExtensionKey:()=>I.DIFFUSE_TRANSMISSION_EXTENSION,getShaderOptions(e){e.push("X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.diffuseTransmissionTextureNode?.getShaderOptions(e,"DIFFUSE_TRANSMISSION",!0),this.diffuseTransmissionColorTextureNode?.getShaderOptions(e,"DIFFUSE_TRANSMISSION_COLOR",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_DiffuseTransmissionEXT,this.diffuseTransmission),e.uniform3fv(t.x3d_DiffuseTransmissionColorEXT,this.diffuseTransmissionColorArray),+this.getTextureBits()&&(this.diffuseTransmissionTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_DiffuseTransmissionTextureEXT,this._diffuseTransmissionTextureMapping.getValue(),i,n),this.diffuseTransmissionColorTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_DiffuseTransmissionColorTextureEXT,this._diffuseTransmissionColorTextureMapping.getValue(),i,n))}}),Object.defineProperties(j,{...c().getStaticProperties("DiffuseTransmissionMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"diffuseTransmission",new(r().SFFloat)),new(a())(l().inputOutput,"diffuseTransmissionTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"diffuseTransmissionTexture",new(r().SFNode)),new(a())(l().inputOutput,"diffuseTransmissionColor",new(r().SFColor)(1,1,1)),new(a())(l().inputOutput,"diffuseTransmissionColorTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"diffuseTransmissionColorTexture",new(r().SFNode))]),enumerable:!0}});const H=j,G=x().add("DiffuseTransmissionMaterialExtension",H);function z(e){g.call(this,e),this.addType(l().DispersionMaterialExtension)}Object.assign(Object.setPrototypeOf(z.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._dispersion.addInterest("set_dispersion__",this),this.set_dispersion__()},set_dispersion__(){this.dispersion=Math.max(this._dispersion.getValue(),0)},getExtensionKey:()=>I.DISPERSION_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_DISPERSION_MATERIAL_EXT")},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_DispersionEXT,this.dispersion)}}),Object.defineProperties(z,{...c().getStaticProperties("DispersionMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"dispersion",new(r().SFFloat))]),enumerable:!0}});const q=z,K=x().add("DispersionMaterialExtension",q);function Y(e){g.call(this,e),this.addType(l().EmissiveStrengthMaterialExtension)}Object.assign(Object.setPrototypeOf(Y.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._emissiveStrength.addInterest("set_emissiveStrength__",this),this.set_emissiveStrength__()},set_emissiveStrength__(){this.emissiveStrength=Math.max(this._emissiveStrength.getValue(),0)},getExtensionKey:()=>I.EMISSIVE_STRENGTH_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_EMISSIVE_STRENGTH_MATERIAL_EXT")},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_EmissiveStrengthEXT,this.emissiveStrength)}}),Object.defineProperties(Y,{...c().getStaticProperties("EmissiveStrengthMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"emissiveStrength",new(r().SFFloat)(1))]),enumerable:!0}});const Q=Y,W=x().add("EmissiveStrengthMaterialExtension",Q),$=e.X3DShapeNode;var Z=t.n($);const J=e.TraverseType;var ee=t.n(J);const te=e.VertexArray;var se=t.n(te);const ie=e.Matrix4;var ne=t.n(ie);const re=e.Box3;var oe=t.n(re);function ae(e){Z().call(this,e),this.addType(l().InstancedShape),this.addChildObjects(l().outputOnly,"matrices",new(r().SFTime)),this._translations.setUnit("length"),this._centers.setUnit("length"),this.numInstances=0,this.instancesStride=25*Float32Array.BYTES_PER_ELEMENT,this.matrixOffset=0,this.normalMatrixOffset=16*Float32Array.BYTES_PER_ELEMENT,this.matrices=[]}Object.assign(Object.setPrototypeOf(ae.prototype,Z().prototype),{initialize(){Z().prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();e.getContext().getVersion()<2||(this.instances=Object.assign(t.createBuffer(),{vertexArrayObject:new(se())(t),thickLinesVertexArrayObject:new(se())(t)}),this._translations.addInterest("set_transform__",this),this._rotations.addInterest("set_transform__",this),this._scales.addInterest("set_transform__",this),this._scaleOrientations.addInterest("set_transform__",this),this._centers.addInterest("set_transform__",this),this._matrices.addInterest("set_matrices__",this),this.set_transform__())},getShapeKey:()=>3,getNumInstances(){return this.numInstances},getInstances(){return this.instances},set_bbox__:function(){const e=new(oe());return function(){if(this._bboxSize.getValue().equals(this.getDefaultBBoxSize()))if(this.getGeometry()){this.bbox.set();const t=this.getGeometry().getBBox();for(const s of this.matrices)this.bbox.add(e.assign(t).multRight(s))}else this.bbox.set();else this.bbox.set(this._bboxSize.getValue(),this._bboxCenter.getValue());this.getBBoxSize().assign(this.bbox.size),this.getBBoxCenter().assign(this.bbox.center)}}(),set_transform__(){this._matrices=this.getBrowser().getCurrentTime()},set_matrices__(){const e=this.getBrowser().getContext(),t=this._translations,s=this._rotations,i=this._scales,n=this._scaleOrientations,r=this._centers,o=t.length,a=s.length,u=i.length,_=n.length,h=r.length,c=Math.max(o,a,u,_,h),d=this.instancesStride/Float32Array.BYTES_PER_ELEMENT,l=this.instancesStride*c,p=new Float32Array(l);this.numInstances=c;for(let e=0,l=0;e<c;++e,l+=d){const c=this.matrices[e]??=new(ne());c.set(o?t[Math.min(e,o-1)].getValue():null,a?s[Math.min(e,a-1)].getValue():null,u?i[Math.min(e,u-1)].getValue():null,_?n[Math.min(e,_-1)].getValue():null,h?r[Math.min(e,h-1)].getValue():null),p.set(c,l),p.set(c.submatrix.transpose().inverse(),l+16)}this.matrices.length=c,e.bindBuffer(e.ARRAY_BUFFER,this.instances),e.bufferData(e.ARRAY_BUFFER,p,e.DYNAMIC_DRAW),this.set_bbox__()},set_geometry__(){Z().prototype.set_geometry__.call(this),this.getGeometry()?delete this.traverse:this.traverse=Function.prototype,this.set_transform__()},intersectsBox(e,t,s){},traverse(e,t){if(this.numInstances){switch(e){case ee().POINTER:this._pointerEvents.getValue()&&t.addPointingShape(this);break;case ee().PICKING:break;case ee().COLLISION:t.addCollisionShape(this);break;case ee().SHADOW:this._castShadow.getValue()&&t.addShadowShape(this);break;case ee().DISPLAY:t.addDisplayShape(this)&&this.getAppearance().traverse(e,t)}this.getGeometry().traverse(e,t)}},displaySimple(e,t,s){this.getGeometry().displaySimpleInstanced(e,s,this)},display(e,t){this.getGeometry().displayInstanced(e,t,this)}}),Object.defineProperties(ae,{...c().getStaticProperties("InstancedShape","X_ITE",1,"children","2.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"translations",new(r().MFVec3f)),new(a())(l().inputOutput,"rotations",new(r().MFRotation)),new(a())(l().inputOutput,"scales",new(r().MFVec3f)),new(a())(l().inputOutput,"scaleOrientations",new(r().MFRotation)),new(a())(l().inputOutput,"centers",new(r().MFVec3f)),new(a())(l().inputOutput,"pointerEvents",new(r().SFBool)(!0)),new(a())(l().inputOutput,"castShadow",new(r().SFBool)(!0)),new(a())(l().inputOutput,"visible",new(r().SFBool)(!0)),new(a())(l().inputOutput,"bboxDisplay",new(r().SFBool)),new(a())(l().initializeOnly,"bboxSize",new(r().SFVec3f)(-1,-1,-1)),new(a())(l().initializeOnly,"bboxCenter",new(r().SFVec3f)),new(a())(l().inputOutput,"appearance",new(r().SFNode)),new(a())(l().inputOutput,"geometry",new(r().SFNode))]),enumerable:!0}});const ue=ae,_e=x().add("InstancedShape",ue);function he(e){g.call(this,e),this.addType(l().IORMaterialExtension)}Object.assign(Object.setPrototypeOf(he.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._indexOfRefraction.addInterest("set_indexOfRefraction__",this),this.set_indexOfRefraction__()},set_indexOfRefraction__(){this.indexOfRefraction=Math.max(this._indexOfRefraction.getValue(),1)},getExtensionKey:()=>I.IOR_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_IOR_MATERIAL_EXT")},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_IorEXT,this.indexOfRefraction)}}),Object.defineProperties(he,{...c().getStaticProperties("IORMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"indexOfRefraction",new(r().SFFloat)(1.5))]),enumerable:!0}});const ce=he,de=x().add("IORMaterialExtension",ce);function le(e){g.call(this,e),this.addType(l().IridescenceMaterialExtension)}Object.assign(Object.setPrototypeOf(le.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._iridescence.addInterest("set_iridescence__",this),this._iridescenceTexture.addInterest("set_iridescenceTexture__",this),this._iridescenceIndexOfRefraction.addInterest("set_iridescenceIndexOfRefraction__",this),this._iridescenceThicknessMinimum.addInterest("set_iridescenceThicknessMinimum__",this),this._iridescenceThicknessMaximum.addInterest("set_iridescenceThicknessMaximum__",this),this._iridescenceThicknessTexture.addInterest("set_iridescenceThicknessTexture__",this),this.set_iridescence__(),this.set_iridescenceTexture__(),this.set_iridescenceIndexOfRefraction__(),this.set_iridescenceThicknessMinimum__(),this.set_iridescenceThicknessMaximum__(),this.set_iridescenceThicknessTexture__()},set_iridescence__(){this.iridescence=Math.max(this._iridescence.getValue(),0)},set_iridescenceTexture__(){this.iridescenceTextureNode=N()(l().X3DSingleTextureNode,this._iridescenceTexture),this.setTexture(0,this.iridescenceTextureNode)},set_iridescenceIndexOfRefraction__(){this.iridescenceIndexOfRefraction=Math.max(this._iridescenceIndexOfRefraction.getValue(),1)},set_iridescenceThicknessMinimum__(){this.iridescenceThicknessMinimum=Math.max(this._iridescenceThicknessMinimum.getValue(),0)},set_iridescenceThicknessMaximum__(){this.iridescenceThicknessMaximum=Math.max(this._iridescenceThicknessMaximum.getValue(),0)},set_iridescenceThicknessTexture__(){this.iridescenceThicknessTextureNode=N()(l().X3DSingleTextureNode,this._iridescenceThicknessTexture),this.setTexture(1,this.iridescenceThicknessTextureNode)},getExtensionKey:()=>I.IRIDESCENCE_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_IRIDESCENCE_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.iridescenceTextureNode?.getShaderOptions(e,"IRIDESCENCE",!0),this.iridescenceThicknessTextureNode?.getShaderOptions(e,"IRIDESCENCE_THICKNESS",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_IridescenceEXT,this.iridescence),e.uniform1f(t.x3d_IridescenceIndexOfRefractionEXT,this.iridescenceIndexOfRefraction),e.uniform1f(t.x3d_IridescenceThicknessMinimumEXT,this.iridescenceThicknessMinimum),e.uniform1f(t.x3d_IridescenceThicknessMaximumEXT,this.iridescenceThicknessMaximum),+this.getTextureBits()&&(this.iridescenceTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_IridescenceTextureEXT,this._iridescenceTextureMapping.getValue(),i,n),this.iridescenceThicknessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_IridescenceThicknessTextureEXT,this._iridescenceThicknessTextureMapping.getValue(),i,n))}}),Object.defineProperties(le,{...c().getStaticProperties("IridescenceMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"iridescence",new(r().SFFloat)),new(a())(l().inputOutput,"iridescenceTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"iridescenceTexture",new(r().SFNode)),new(a())(l().inputOutput,"iridescenceIndexOfRefraction",new(r().SFFloat)(1.3)),new(a())(l().inputOutput,"iridescenceThicknessMinimum",new(r().SFFloat)(100)),new(a())(l().inputOutput,"iridescenceThicknessMaximum",new(r().SFFloat)(400)),new(a())(l().inputOutput,"iridescenceThicknessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"iridescenceThicknessTexture",new(r().SFNode))]),enumerable:!0}});const pe=le,Te=x().add("IridescenceMaterialExtension",pe);function Se(e){g.call(this,e),this.addType(l().SheenMaterialExtension),this.sheenColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Se.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this.getBrowser().getLibraryTexture("lut_charlie.png"),this.getBrowser().getLibraryTexture("lut_sheen_E.png"),this._sheenColor.addInterest("set_sheenColor__",this),this._sheenColorTexture.addInterest("set_sheenColorTexture__",this),this._sheenRoughness.addInterest("set_sheenRoughness__",this),this._sheenRoughnessTexture.addInterest("set_sheenRoughnessTexture__",this),this.set_sheenColor__(),this.set_sheenColorTexture__(),this.set_sheenRoughness__(),this.set_sheenRoughnessTexture__()},set_sheenColor__(){this.sheenColorArray.set(this._sheenColor.getValue())},set_sheenColorTexture__(){this.sheenColorTextureNode=N()(l().X3DSingleTextureNode,this._sheenColorTexture),this.setTexture(0,this.sheenColorTextureNode)},set_sheenRoughness__(){this.sheenRoughness=b().clamp(this._sheenRoughness.getValue(),0,1)},set_sheenRoughnessTexture__(){this.sheenRoughnessTextureNode=N()(l().X3DSingleTextureNode,this._sheenRoughnessTexture),this.setTexture(1,this.sheenRoughnessTextureNode)},getExtensionKey:()=>I.SHEEN_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_SHEEN_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.sheenColorTextureNode?.getShaderOptions(e,"SHEEN_COLOR",!0),this.sheenRoughnessTextureNode?.getShaderOptions(e,"SHEEN_ROUGHNESS",!0))},setShaderUniforms(e,t,s,i,n){e.uniform3fv(t.x3d_SheenColorEXT,this.sheenColorArray),e.uniform1f(t.x3d_SheenRoughnessEXT,this.sheenRoughness);const r=this.getBrowser(),o=r.getLibraryTexture("lut_sheen_E.png"),a=r.getTexture2DUnit();e.activeTexture(e.TEXTURE0+a),e.bindTexture(e.TEXTURE_2D,o.getTexture()),e.uniform1i(t.x3d_SheenELUTTextureEXT,a),+this.getTextureBits()&&(this.sheenColorTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SheenColorTextureEXT,this._sheenColorTextureMapping.getValue(),i,n),this.sheenRoughnessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SheenRoughnessTextureEXT,this._sheenRoughnessTextureMapping.getValue(),i,n))}}),Object.defineProperties(Se,{...c().getStaticProperties("SheenMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"sheenColor",new(r().SFColor)),new(a())(l().inputOutput,"sheenColorTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"sheenColorTexture",new(r().SFNode)),new(a())(l().inputOutput,"sheenRoughness",new(r().SFFloat)),new(a())(l().inputOutput,"sheenRoughnessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"sheenRoughnessTexture",new(r().SFNode))]),enumerable:!0}});const xe=Se,fe=x().add("SheenMaterialExtension",xe),Ee=e.X3DOneSidedMaterialNode;var ge=t.n(Ee);function Oe(e){console.warn("SpecularGlossinessMaterial is depreciated, please use PhysicalMaterial instead."),ge().call(this,e),this.addType(l().SpecularGlossinessMaterial),this.materialKey="4/",this.diffuseColorArray=new Float32Array(3),this.specularColorArray=new Float32Array(3),this.extensionNodes=[]}Object.assign(Object.setPrototypeOf(Oe.prototype,ge().prototype),{initialize(){ge().prototype.initialize.call(this),this._diffuseColor.addInterest("set_diffuseColor__",this),this._diffuseTexture.addInterest("set_diffuseTexture__",this),this._diffuseTexture.addInterest("set_transparent__",this),this._specularColor.addInterest("set_specularColor__",this),this._glossiness.addInterest("set_glossiness__",this),this._specularGlossinessTexture.addInterest("set_specularGlossinessTexture__",this),this._occlusionStrength.addInterest("set_occlusionStrength__",this),this._occlusionTexture.addInterest("set_occlusionTexture__",this),this._extensions.addInterest("set_extensions__",this),this.set_diffuseColor__(),this.set_diffuseTexture__(),this.set_specularColor__(),this.set_glossiness__(),this.set_specularGlossinessTexture__(),this.set_occlusionStrength__(),this.set_occlusionTexture__(),this.set_extensions__(),this.set_transparent__()},getMaterialKey(){return this.materialKey},getTextureIndices:(()=>{let e=0;const t={DIFFUSE_TEXTURE:e++,SPECULAR_GLOSSINESS_TEXTURE:e++,EMISSIVE_TEXTURE:e++,OCCLUSION_TEXTURE:e++,NORMAL_TEXTURE:e++};return function(){return t}})(),getBaseTexture(){return this.diffuseTextureNode},set_diffuseColor__(){this.diffuseColorArray.set(this._diffuseColor.getValue())},set_diffuseTexture__(){const e=this.getTextureIndices().DIFFUSE_TEXTURE;this.diffuseTextureNode&&(this.diffuseTextureNode._transparent.removeInterest("set_transparent__",this),this.diffuseTextureNode._linear.removeInterest(`setTexture${e}`,this)),this.diffuseTextureNode=N()(l().X3DSingleTextureNode,this._diffuseTexture),this.diffuseTextureNode&&(this.diffuseTextureNode._transparent.addInterest("set_transparent__",this),this.diffuseTextureNode._linear.addInterest(`setTexture${e}`,this,e,this.diffuseTextureNode)),this.setTexture(e,this.diffuseTextureNode)},set_specularColor__(){this.specularColorArray.set(this._specularColor.getValue())},set_glossiness__(){this.glossiness=b().clamp(this._glossiness.getValue(),0,1)},set_specularGlossinessTexture__(){this.specularGlossinessTextureNode=N()(l().X3DSingleTextureNode,this._specularGlossinessTexture),this.setTexture(this.getTextureIndices().SPECULAR_GLOSSINESS_TEXTURE,this.specularGlossinessTextureNode)},set_occlusionStrength__(){this.occlusionStrength=b().clamp(this._occlusionStrength.getValue(),0,1)},set_occlusionTexture__(){this.occlusionTextureNode=N()(l().X3DSingleTextureNode,this._occlusionTexture),this.setTexture(this.getTextureIndices().OCCLUSION_TEXTURE,this.occlusionTextureNode)},set_transparent__(){this.setTransparent(this.getTransparency()||this.diffuseTextureNode?.isTransparent())},set_extensions__(){const e=this.extensionNodes;for(const t of e)t.removeInterest("set_extensionsKey__",this);e.length=0;for(const t of this._extensions){const s=N()(l().X3DMaterialExtensionNode,t);s&&e.push(s)}e.sort(((e,t)=>e.getExtensionKey()-t.getExtensionKey()));for(const t of e)t.addInterest("set_extensionsKey__",this);this.setTransmission(e.some((e=>e.getType().includes(l().TransmissionMaterialExtension)))),this.set_extensionsKey__()},set_extensionsKey__(){const e=this.extensionNodes.map((e=>`${e.getExtensionKey().toString(16)}${e.getTextureBits().toString(16)}`)).join("");this.materialKey=`[4.${e}]`},createShader(e,t,s){const i=this.getBrowser(),n=this.getShaderOptions(t,s);for(const e of this.extensionNodes)e.getShaderOptions(n);n.push("X3D_PHYSICAL_MATERIAL","X3D_MATERIAL_SPECULAR_GLOSSINESS"),+this.getTextureBits()&&(this.diffuseTextureNode?.getShaderOptions(n,"DIFFUSE"),this.specularGlossinessTextureNode?.getShaderOptions(n,"SPECULAR_GLOSSINESS"),this.occlusionTextureNode?.getShaderOptions(n,"OCCLUSION"));const r=i.createShader("SpecularGlossiness","Default","Physical",n);return i.getShaders().set(e,r),r},setShaderUniforms(e,t,s,i,n){ge().prototype.setShaderUniforms.call(this,e,t,s,i,n);for(const r of this.extensionNodes)r.setShaderUniforms(e,t,s,i,n);e.uniform3fv(t.x3d_DiffuseColor,this.diffuseColorArray),e.uniform3fv(t.x3d_SpecularColor,this.specularColorArray),e.uniform1f(t.x3d_Glossiness,this.glossiness),+this.getTextureBits()&&(this.diffuseTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_DiffuseTexture,this._diffuseTextureMapping.getValue(),i,n),this.specularGlossinessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SpecularGlossinessTexture,this._specularGlossinessTextureMapping.getValue(),i,n),this.occlusionTextureNode&&e.uniform1f(t.x3d_OcclusionStrength,this.occlusionStrength),this.occlusionTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_OcclusionTexture,this._occlusionTextureMapping.getValue(),i,n))}}),Object.defineProperties(Oe,{...c().getStaticProperties("SpecularGlossinessMaterial","X_ITE",1,"material","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"diffuseColor",new(r().SFColor)(1,1,1)),new(a())(l().inputOutput,"diffuseTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"diffuseTexture",new(r().SFNode)),new(a())(l().inputOutput,"specularColor",new(r().SFColor)(1,1,1)),new(a())(l().inputOutput,"glossiness",new(r().SFFloat)(1)),new(a())(l().inputOutput,"specularGlossinessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"specularGlossinessTexture",new(r().SFNode)),new(a())(l().inputOutput,"emissiveColor",new(r().SFColor)),new(a())(l().inputOutput,"emissiveTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"emissiveTexture",new(r().SFNode)),new(a())(l().inputOutput,"occlusionStrength",new(r().SFFloat)(1)),new(a())(l().inputOutput,"occlusionTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"occlusionTexture",new(r().SFNode)),new(a())(l().inputOutput,"normalScale",new(r().SFFloat)(1)),new(a())(l().inputOutput,"normalTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"normalTexture",new(r().SFNode)),new(a())(l().inputOutput,"transparency",new(r().SFFloat)),new(a())(l().inputOutput,"extensions",new(r().MFNode))]),enumerable:!0}});for(const e of Object.values(Oe.prototype.getTextureIndices()))Oe.prototype[`setTexture${e}`]=function(e,t){this.setTexture(e,t)};const Ne=Oe,me=x().add("SpecularGlossinessMaterial",Ne);function Ae(e){g.call(this,e),this.addType(l().SpecularMaterialExtension),this.specularColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Ae.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._specular.addInterest("set_specular__",this),this._specularTexture.addInterest("set_specularTexture__",this),this._specularColor.addInterest("set_specularColor__",this),this._specularColorTexture.addInterest("set_specularColorTexture__",this),this.set_specular__(),this.set_specularTexture__(),this.set_specularColor__(),this.set_specularColorTexture__()},set_specular__(){this.specular=Math.max(this._specular.getValue(),0)},set_specularTexture__(){this.specularTextureNode=N()(l().X3DSingleTextureNode,this._specularTexture),this.setTexture(0,this.specularTextureNode)},set_specularColor__(){this.specularColorArray.set(this._specularColor.getValue())},set_specularColorTexture__(){this.specularColorTextureNode=N()(l().X3DSingleTextureNode,this._specularColorTexture),this.setTexture(1,this.specularColorTextureNode)},getExtensionKey:()=>I.SPECULAR_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_SPECULAR_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.specularTextureNode?.getShaderOptions(e,"SPECULAR",!0),this.specularColorTextureNode?.getShaderOptions(e,"SPECULAR_COLOR",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_SpecularEXT,this.specular),e.uniform3fv(t.x3d_SpecularColorEXT,this.specularColorArray),+this.getTextureBits()&&(this.specularTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SpecularTextureEXT,this._specularTextureMapping.getValue(),i,n),this.specularColorTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SpecularColorTextureEXT,this._specularColorTextureMapping.getValue(),i,n))}}),Object.defineProperties(Ae,{...c().getStaticProperties("SpecularMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"specular",new(r().SFFloat)(1)),new(a())(l().inputOutput,"specularTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"specularTexture",new(r().SFNode)),new(a())(l().inputOutput,"specularColor",new(r().SFColor)(1,1,1)),new(a())(l().inputOutput,"specularColorTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"specularColorTexture",new(r().SFNode))]),enumerable:!0}});const Ie=Ae,we=x().add("SpecularMaterialExtension",Ie);function ye(e){g.call(this,e),this.addType(l().TransmissionMaterialExtension)}Object.assign(Object.setPrototypeOf(ye.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._transmission.addInterest("set_transmission__",this),this._transmissionTexture.addInterest("set_transmissionTexture__",this),this.set_transmission__(),this.set_transmissionTexture__()},set_transmission__(){this.transmission=Math.max(this._transmission.getValue(),0)},set_transmissionTexture__(){this.transmissionTextureNode=N()(l().X3DSingleTextureNode,this._transmissionTexture),this.setTexture(0,this.transmissionTextureNode)},getExtensionKey:()=>I.TRANSMISSION_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_TRANSMISSION_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.transmissionTextureNode?.getShaderOptions(e,"TRANSMISSION",!0))},setShaderUniforms:function(){const e=new Float32Array(16);return function(t,s,i,n,r){const o=this.getBrowser();if(t.uniform1f(s.x3d_TransmissionEXT,this.transmission),i.isTransmission()){var a=o.getDefaultTexture2D(),u=o.getDefaultTexture2DUnit();t.uniformMatrix4fv(s.x3d_ModelViewMatrix,!1,e),t.uniform2i(s.x3d_TransmissionFramebufferSizeEXT,1,1)}else{var _=o.getTransmissionBuffer();a=_.getColorTexture(),u=o.getTexture2DUnit();t.uniform2i(s.x3d_TransmissionFramebufferSizeEXT,_.getWidth(),_.getHeight())}t.activeTexture(t.TEXTURE0+u),t.bindTexture(t.TEXTURE_2D,a),t.uniform1i(s.x3d_TransmissionFramebufferSamplerEXT,u),+this.getTextureBits()&&this.transmissionTextureNode?.setNamedShaderUniforms(t,s,i,s.x3d_TransmissionTextureEXT,this._transmissionTextureMapping.getValue(),n,r)}}()}),Object.defineProperties(ye,{...c().getStaticProperties("TransmissionMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"transmission",new(r().SFFloat)),new(a())(l().inputOutput,"transmissionTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"transmissionTexture",new(r().SFNode))]),enumerable:!0}});const Ce=ye,Re=x().add("TransmissionMaterialExtension",Ce);function Me(e){g.call(this,e),this.addType(l().VolumeMaterialExtension),this._thickness.setUnit("length"),this._attenuationDistance.setUnit("length"),this.attenuationColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Me.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._thickness.addInterest("set_thickness__",this),this._thicknessTexture.addInterest("set_thicknessTexture__",this),this._attenuationDistance.addInterest("set_attenuationDistance__",this),this._attenuationColor.addInterest("set_attenuationColor__",this),this.set_thickness__(),this.set_thicknessTexture__(),this.set_attenuationDistance__(),this.set_attenuationColor__()},set_thickness__(){this.thickness=Math.max(this._thickness.getValue(),0)},set_thicknessTexture__(){this.thicknessTextureNode=N()(l().X3DSingleTextureNode,this._thicknessTexture),this.setTexture(0,this.thicknessTextureNode)},set_attenuationDistance__(){this.attenuationDistance=Math.max(this._attenuationDistance.getValue(),0)},set_attenuationColor__(){this.attenuationColorArray.set(this._attenuationColor.getValue())},getExtensionKey:()=>I.VOLUME_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_VOLUME_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.thicknessTextureNode?.getShaderOptions(e,"THICKNESS",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_ThicknessEXT,this.thickness),e.uniform1f(t.x3d_AttenuationDistanceEXT,this.attenuationDistance),e.uniform3fv(t.x3d_AttenuationColorEXT,this.attenuationColorArray),+this.getTextureBits()&&this.thicknessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ThicknessTextureEXT,this._thicknessTextureMapping.getValue(),i,n)}}),Object.defineProperties(Me,{...c().getStaticProperties("VolumeMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"thickness",new(r().SFFloat)),new(a())(l().inputOutput,"thicknessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"thicknessTexture",new(r().SFNode)),new(a())(l().inputOutput,"attenuationDistance",new(r().SFFloat)(1e6)),new(a())(l().inputOutput,"attenuationColor",new(r().SFColor)(1,1,1))]),enumerable:!0}});const Fe=Me,Xe=x().add("VolumeMaterialExtension",Fe);i().add({name:"X_ITE",concreteNodes:[C,D,V,k,G,K,W,_e,de,Te,fe,me,we,Re,Xe],abstractNodes:[g]});x().add("X_ITEComponent",undefined)})();
|
|
1
|
+
/* X_ITE v11.2.2 */
|
|
2
|
+
const e=window[Symbol.for("X_ITE.X3D-11.2.2")];(()=>{var t={n:e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const s=e.Components;var i=t.n(s);const n=e.Fields;var r=t.n(n);const o=e.X3DFieldDefinition;var a=t.n(o);const u=e.FieldDefinitionArray;var _=t.n(u);const h=e.X3DNode;var c=t.n(h);const d=e.X3DConstants;var l=t.n(d);const p=e.BitSet;var T=t.n(p);const S=e.Namespace;var x=t.n(S);function f(e){c().call(this,e),this.addType(l().X3DMaterialExtensionNode),this.textureBits=new(T())}Object.assign(Object.setPrototypeOf(f.prototype,c().prototype),{setTexture(e,t){e*=4,this.textureBits.remove(e,15),this.textureBits.add(e,t?.getTextureBits()??0)},getTextureBits(){return this.textureBits}}),Object.defineProperties(f,c().getStaticProperties("X3DMaterialExtensionNode","X_ITE",1));const E=f,g=x().add("X3DMaterialExtensionNode",E),O=e.X3DCast;var N=t.n(O);let m=0;const A={ANISOTROPY_MATERIAL_EXTENSION:m++,CLEARCOAT_MATERIAL_EXTENSION:m++,DIFFUSE_TRANSMISSION_EXTENSION:m++,DISPERSION_MATERIAL_EXTENSION:m++,EMISSIVE_STRENGTH_MATERIAL_EXTENSION:m++,IOR_MATERIAL_EXTENSION:m++,IRIDESCENCE_MATERIAL_EXTENSION:m++,SHEEN_MATERIAL_EXTENSION:m++,SPECULAR_MATERIAL_EXTENSION:m++,TRANSMISSION_MATERIAL_EXTENSION:m++,UNLIT_MATERIAL_EXTENSION:m++,VOLUME_MATERIAL_EXTENSION:m++},I=x().add("ExtensionKeys",A);function w(e){g.call(this,e),this.addType(l().AnisotropyMaterialExtension),this._anisotropyRotation.setUnit("angle"),this.anisotropyArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(w.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._anisotropyStrength.addInterest("set_anisotropyStrength__",this),this._anisotropyRotation.addInterest("set_anisotropyRotation__",this),this._anisotropyTexture.addInterest("set_anisotropyTexture__",this),this.set_anisotropyStrength__(),this.set_anisotropyRotation__(),this.set_anisotropyTexture__()},set_anisotropyStrength__(){this.anisotropyArray[2]=Math.max(this._anisotropyStrength.getValue(),0)},set_anisotropyRotation__(){const e=this._anisotropyRotation.getValue();this.anisotropyArray[0]=Math.cos(e),this.anisotropyArray[1]=Math.sin(e)},set_anisotropyTexture__(){this.anisotropyTextureNode=N()(l().X3DSingleTextureNode,this._anisotropyTexture),this.setTexture(0,this.anisotropyTextureNode)},getExtensionKey:()=>I.ANISOTROPY_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_ANISOTROPY_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.anisotropyTextureNode?.getShaderOptions(e,"ANISOTROPY",!0))},setShaderUniforms(e,t,s,i,n){e.uniform3fv(t.x3d_AnisotropyEXT,this.anisotropyArray),this.anisotropyTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_AnisotropyTextureEXT,this._anisotropyTextureMapping.getValue(),i,n)}}),Object.defineProperties(w,{...c().getStaticProperties("AnisotropyMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"anisotropyStrength",new(r().SFFloat)),new(a())(l().inputOutput,"anisotropyRotation",new(r().SFFloat)),new(a())(l().inputOutput,"anisotropyTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"anisotropyTexture",new(r().SFNode))]),enumerable:!0}});const y=w,C=x().add("AnisotropyMaterialExtension",y),R=e.X3DAppearanceChildNode;var M=t.n(R);function F(e){M().call(this,e),this.addType(l().BlendMode),this.factorTypes=new Map,this.equationTypes=new Map}Object.assign(Object.setPrototypeOf(F.prototype,M().prototype),{initialize(){M().prototype.initialize.call(this);const e=this.getBrowser().getContext(),t=e.getExtension("EXT_blend_minmax");this.factorTypes.set("ZERO",e.ZERO),this.factorTypes.set("ONE",e.ONE),this.factorTypes.set("SRC_COLOR",e.SRC_COLOR),this.factorTypes.set("ONE_MINUS_SRC_COLOR",e.ONE_MINUS_SRC_COLOR),this.factorTypes.set("DST_COLOR",e.DST_COLOR),this.factorTypes.set("ONE_MINUS_DST_COLOR",e.ONE_MINUS_DST_COLOR),this.factorTypes.set("SRC_ALPHA",e.SRC_ALPHA),this.factorTypes.set("ONE_MINUS_SRC_ALPHA",e.ONE_MINUS_SRC_ALPHA),this.factorTypes.set("DST_ALPHA",e.DST_ALPHA),this.factorTypes.set("ONE_MINUS_DST_ALPHA",e.ONE_MINUS_DST_ALPHA),this.factorTypes.set("SRC_ALPHA_SATURATE",e.SRC_ALPHA_SATURATE),this.factorTypes.set("CONSTANT_COLOR",e.CONSTANT_COLOR),this.factorTypes.set("ONE_MINUS_CONSTANT_COLOR",e.ONE_MINUS_CONSTANT_COLOR),this.factorTypes.set("CONSTANT_ALPHA",e.CONSTANT_ALPHA),this.factorTypes.set("ONE_MINUS_CONSTANT_ALPHA",e.ONE_MINUS_CONSTANT_ALPHA),this.equationTypes.set("FUNC_ADD",e.FUNC_ADD),this.equationTypes.set("FUNC_SUBTRACT",e.FUNC_SUBTRACT),this.equationTypes.set("FUNC_REVERSE_SUBTRACT",e.FUNC_REVERSE_SUBTRACT),this.equationTypes.set("MIN",e.MIN||t&&t.MIN_EXT),this.equationTypes.set("MAX",e.MAX||t&&t.MAX_EXT),this._sourceColorFactor.addInterest("set_sourceColorFactor__",this),this._sourceAlphaFactor.addInterest("set_sourceAlphaFactor__",this),this._destinationColorFactor.addInterest("set_destinationColorFactor__",this),this._destinationAlphaFactor.addInterest("set_destinationAlphaFactor__",this),this._colorEquation.addInterest("set_colorEquation__",this),this._alphaEquation.addInterest("set_alphaEquation__",this),this.set_sourceColorFactor__(),this.set_sourceAlphaFactor__(),this.set_destinationColorFactor__(),this.set_destinationAlphaFactor__(),this.set_colorEquation__(),this.set_alphaEquation__()},set_sourceColorFactor__(){this.sourceColorFactorType=this.factorTypes.get(this._sourceColorFactor.getValue())??this.factorTypes.get("SRC_ALPHA")},set_sourceAlphaFactor__(){this.sourceAlphaFactorType=this.factorTypes.get(this._sourceAlphaFactor.getValue())??this.factorTypes.get("ONE")},set_destinationColorFactor__(){this.destinationColorFactorType=this.factorTypes.get(this._destinationColorFactor.getValue())??this.factorTypes.get("ONE_MINUS_SRC_ALPHA")},set_destinationAlphaFactor__(){this.destinationAlphaFactorType=this.factorTypes.get(this._destinationAlphaFactor.getValue())??this.factorTypes.get("ONE_MINUS_SRC_ALPHA")},set_colorEquation__(){this.colorEquationType=this.equationTypes.get(this._colorEquation.getValue())??this.equationTypes.get("FUNC_ADD")},set_alphaEquation__(){this.alphaEquationType=this.equationTypes.get(this._alphaEquation.getValue())??this.equationTypes.get("FUNC_ADD")},enable(e){const t=this._blendColor.getValue();e.blendColor(t.r,t.g,t.b,t.a),e.blendFuncSeparate(this.sourceColorFactorType,this.destinationColorFactorType,this.sourceAlphaFactorType,this.destinationAlphaFactorType),e.blendEquationSeparate(this.colorEquationType,this.alphaEquationType)},disable(e){e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD)}}),Object.defineProperties(F,{...c().getStaticProperties("BlendMode","X_ITE",1,"blendMode","3.3"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"blendColor",new(r().SFColorRGBA)),new(a())(l().inputOutput,"sourceColorFactor",new(r().SFString)("SRC_ALPHA")),new(a())(l().inputOutput,"sourceAlphaFactor",new(r().SFString)("ONE")),new(a())(l().inputOutput,"destinationColorFactor",new(r().SFString)("ONE_MINUS_SRC_ALPHA")),new(a())(l().inputOutput,"destinationAlphaFactor",new(r().SFString)("ONE_MINUS_SRC_ALPHA")),new(a())(l().inputOutput,"colorEquation",new(r().SFString)("FUNC_ADD")),new(a())(l().inputOutput,"alphaEquation",new(r().SFString)("FUNC_ADD"))]),enumerable:!0}});const X=F,D=x().add("BlendMode",X),L=e.Algorithm;var b=t.n(L);function U(e){g.call(this,e),this.addType(l().ClearcoatMaterialExtension)}Object.assign(Object.setPrototypeOf(U.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._clearcoat.addInterest("set_clearcoat__",this),this._clearcoatTexture.addInterest("set_clearcoatTexture__",this),this._clearcoatRoughness.addInterest("set_clearcoatRoughness__",this),this._clearcoatRoughnessTexture.addInterest("set_clearcoatRoughnessTexture__",this),this._clearcoatNormalTexture.addInterest("set_clearcoatNormalTexture__",this),this.set_clearcoat__(),this.set_clearcoatTexture__(),this.set_clearcoatRoughness__(),this.set_clearcoatRoughnessTexture__(),this.set_clearcoatNormalTexture__()},set_clearcoat__(){this.clearcoat=Math.max(this._clearcoat.getValue(),0)},set_clearcoatTexture__(){this.clearcoatTextureNode=N()(l().X3DSingleTextureNode,this._clearcoatTexture),this.setTexture(0,this.clearcoatTextureNode)},set_clearcoatRoughness__(){this.clearcoatRoughness=b().clamp(this._clearcoatRoughness.getValue(),0,1)},set_clearcoatRoughnessTexture__(){this.clearcoatRoughnessTextureNode=N()(l().X3DSingleTextureNode,this._clearcoatRoughnessTexture),this.setTexture(1,this.clearcoatRoughnessTextureNode)},set_clearcoatNormalTexture__(){this.clearcoatNormalTextureNode=N()(l().X3DSingleTextureNode,this._clearcoatNormalTexture),this.setTexture(2,this.clearcoatNormalTextureNode)},getExtensionKey:()=>I.CLEARCOAT_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_CLEARCOAT_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.clearcoatTextureNode?.getShaderOptions(e,"CLEARCOAT",!0),this.clearcoatRoughnessTextureNode?.getShaderOptions(e,"CLEARCOAT_ROUGHNESS",!0),this.clearcoatNormalTextureNode?.getShaderOptions(e,"CLEARCOAT_NORMAL",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_ClearcoatEXT,this.clearcoat),e.uniform1f(t.x3d_ClearcoatRoughnessEXT,this.clearcoatRoughness),+this.getTextureBits()&&(this.clearcoatTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ClearcoatTextureEXT,this._clearcoatTextureMapping.getValue(),i,n),this.clearcoatRoughnessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ClearcoatRoughnessTextureEXT,this._clearcoatRoughnessTextureMapping.getValue(),i,n),this.clearcoatNormalTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ClearcoatNormalTextureEXT,this._clearcoatNormalTextureMapping.getValue(),i,n))}}),Object.defineProperties(U,{...c().getStaticProperties("ClearcoatMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"clearcoat",new(r().SFFloat)),new(a())(l().inputOutput,"clearcoatTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"clearcoatTexture",new(r().SFNode)),new(a())(l().inputOutput,"clearcoatRoughness",new(r().SFFloat)),new(a())(l().inputOutput,"clearcoatRoughnessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"clearcoatRoughnessTexture",new(r().SFNode)),new(a())(l().inputOutput,"clearcoatNormalTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"clearcoatNormalTexture",new(r().SFNode))]),enumerable:!0}});const P=U,V=x().add("ClearcoatMaterialExtension",P);function v(e){M().call(this,e),this.addType(l().DepthMode),this.addAlias("depthFunc",this._depthFunction)}Object.assign(Object.setPrototypeOf(v.prototype,M().prototype),{initialize(){M().prototype.initialize.call(this),this._depthFunction.addInterest("set_depthFunction__",this),this.set_depthFunction__()},set_depthFunction__:function(){const e=new Map([["NEVER","NEVER"],["LESS","LESS"],["EQUAL","EQUAL"],["LESS_EQUAL","LEQUAL"],["GREATER","GREATER"],["NOT_EQUAL","NOTEQUAL"],["GREATER_EQUAL","GEQUAL"],["ALWAYS","ALWAYS"]]);return function(){const t=this.getBrowser().getContext();this.depthFunction=t[e.get(this._depthFunction.getValue())??"LEQUAL"]}}(),enable(e){this.depthTest=e.isEnabled(e.DEPTH_TEST),this.depthWriteMask=e.getParameter(e.DEPTH_WRITEMASK),e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(...this._polygonOffset),this._depthTest.getValue()?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),e.depthFunc(this.depthFunction),e.depthRange(...this._depthRange.getValue()),e.depthMask(this._depthMask.getValue())},disable(e){e.disable(e.POLYGON_OFFSET_FILL),this.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.depthRange(0,1),e.depthMask(this.depthWriteMask)}}),Object.defineProperties(v,{...c().getStaticProperties("DepthMode","X_ITE",1,"depthMode","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"polygonOffset",new(r().SFVec2f)),new(a())(l().inputOutput,"depthRange",new(r().SFVec2f)(0,1)),new(a())(l().inputOutput,"depthTest",new(r().SFBool)(!0)),new(a())(l().inputOutput,"depthFunction",new(r().SFString)("LESS_EQUAL")),new(a())(l().inputOutput,"depthMask",new(r().SFBool)(!0))]),enumerable:!0}});const B=v,k=x().add("DepthMode",B);function j(e){g.call(this,e),this.addType(l().DiffuseTransmissionMaterialExtension),this.diffuseTransmissionColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(j.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._diffuseTransmission.addInterest("set_diffuseTransmission__",this),this._diffuseTransmissionTexture.addInterest("set_diffuseTransmissionTexture__",this),this._diffuseTransmissionColor.addInterest("set_diffuseTransmissionColor__",this),this._diffuseTransmissionColorTexture.addInterest("set_diffuseTransmissionColorTexture__",this),this.set_diffuseTransmission__(),this.set_diffuseTransmissionTexture__(),this.set_diffuseTransmissionColor__(),this.set_diffuseTransmissionColorTexture__()},set_diffuseTransmission__(){this.diffuseTransmission=Math.max(this._diffuseTransmission.getValue(),0)},set_diffuseTransmissionTexture__(){this.diffuseTransmissionTextureNode=N()(l().X3DSingleTextureNode,this._diffuseTransmissionTexture),this.setTexture(0,this.diffuseTransmissionTextureNode)},set_diffuseTransmissionColor__(){this.diffuseTransmissionColorArray.set(this._diffuseTransmissionColor.getValue())},set_diffuseTransmissionColorTexture__(){this.diffuseTransmissionColorTextureNode=N()(l().X3DSingleTextureNode,this._diffuseTransmissionColorTexture),this.setTexture(1,this.diffuseTransmissionColorTextureNode)},getExtensionKey:()=>I.DIFFUSE_TRANSMISSION_EXTENSION,getShaderOptions(e){e.push("X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.diffuseTransmissionTextureNode?.getShaderOptions(e,"DIFFUSE_TRANSMISSION",!0),this.diffuseTransmissionColorTextureNode?.getShaderOptions(e,"DIFFUSE_TRANSMISSION_COLOR",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_DiffuseTransmissionEXT,this.diffuseTransmission),e.uniform3fv(t.x3d_DiffuseTransmissionColorEXT,this.diffuseTransmissionColorArray),+this.getTextureBits()&&(this.diffuseTransmissionTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_DiffuseTransmissionTextureEXT,this._diffuseTransmissionTextureMapping.getValue(),i,n),this.diffuseTransmissionColorTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_DiffuseTransmissionColorTextureEXT,this._diffuseTransmissionColorTextureMapping.getValue(),i,n))}}),Object.defineProperties(j,{...c().getStaticProperties("DiffuseTransmissionMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"diffuseTransmission",new(r().SFFloat)),new(a())(l().inputOutput,"diffuseTransmissionTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"diffuseTransmissionTexture",new(r().SFNode)),new(a())(l().inputOutput,"diffuseTransmissionColor",new(r().SFColor)(1,1,1)),new(a())(l().inputOutput,"diffuseTransmissionColorTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"diffuseTransmissionColorTexture",new(r().SFNode))]),enumerable:!0}});const H=j,G=x().add("DiffuseTransmissionMaterialExtension",H);function z(e){g.call(this,e),this.addType(l().DispersionMaterialExtension)}Object.assign(Object.setPrototypeOf(z.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._dispersion.addInterest("set_dispersion__",this),this.set_dispersion__()},set_dispersion__(){this.dispersion=Math.max(this._dispersion.getValue(),0)},getExtensionKey:()=>I.DISPERSION_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_DISPERSION_MATERIAL_EXT")},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_DispersionEXT,this.dispersion)}}),Object.defineProperties(z,{...c().getStaticProperties("DispersionMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"dispersion",new(r().SFFloat))]),enumerable:!0}});const q=z,K=x().add("DispersionMaterialExtension",q);function Y(e){g.call(this,e),this.addType(l().EmissiveStrengthMaterialExtension)}Object.assign(Object.setPrototypeOf(Y.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._emissiveStrength.addInterest("set_emissiveStrength__",this),this.set_emissiveStrength__()},set_emissiveStrength__(){this.emissiveStrength=Math.max(this._emissiveStrength.getValue(),0)},getExtensionKey:()=>I.EMISSIVE_STRENGTH_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_EMISSIVE_STRENGTH_MATERIAL_EXT")},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_EmissiveStrengthEXT,this.emissiveStrength)}}),Object.defineProperties(Y,{...c().getStaticProperties("EmissiveStrengthMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"emissiveStrength",new(r().SFFloat)(1))]),enumerable:!0}});const Q=Y,W=x().add("EmissiveStrengthMaterialExtension",Q),$=e.X3DShapeNode;var Z=t.n($);const J=e.TraverseType;var ee=t.n(J);const te=e.VertexArray;var se=t.n(te);const ie=e.Matrix4;var ne=t.n(ie);const re=e.Box3;var oe=t.n(re);function ae(e){Z().call(this,e),this.addType(l().InstancedShape),this.addChildObjects(l().outputOnly,"matrices",new(r().SFTime)),this._translations.setUnit("length"),this._centers.setUnit("length"),this.numInstances=0,this.instancesStride=25*Float32Array.BYTES_PER_ELEMENT,this.matrixOffset=0,this.normalMatrixOffset=16*Float32Array.BYTES_PER_ELEMENT,this.matrices=[]}Object.assign(Object.setPrototypeOf(ae.prototype,Z().prototype),{initialize(){Z().prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();e.getContext().getVersion()<2||(this.instances=Object.assign(t.createBuffer(),{vertexArrayObject:new(se())(t),thickLinesVertexArrayObject:new(se())(t)}),this._translations.addInterest("set_transform__",this),this._rotations.addInterest("set_transform__",this),this._scales.addInterest("set_transform__",this),this._scaleOrientations.addInterest("set_transform__",this),this._centers.addInterest("set_transform__",this),this._matrices.addInterest("set_matrices__",this),this.set_transform__())},getShapeKey:()=>3,getNumInstances(){return this.numInstances},getInstances(){return this.instances},set_bbox__:function(){const e=new(oe());return function(){if(this._bboxSize.getValue().equals(this.getDefaultBBoxSize()))if(this.getGeometry()){this.bbox.set();const t=this.getGeometry().getBBox();for(const s of this.matrices)this.bbox.add(e.assign(t).multRight(s))}else this.bbox.set();else this.bbox.set(this._bboxSize.getValue(),this._bboxCenter.getValue());this.getBBoxSize().assign(this.bbox.size),this.getBBoxCenter().assign(this.bbox.center)}}(),set_transform__(){this._matrices=this.getBrowser().getCurrentTime()},set_matrices__(){const e=this.getBrowser().getContext(),t=this._translations,s=this._rotations,i=this._scales,n=this._scaleOrientations,r=this._centers,o=t.length,a=s.length,u=i.length,_=n.length,h=r.length,c=Math.max(o,a,u,_,h),d=this.instancesStride/Float32Array.BYTES_PER_ELEMENT,l=this.instancesStride*c,p=new Float32Array(l);this.numInstances=c;for(let e=0,l=0;e<c;++e,l+=d){const c=this.matrices[e]??=new(ne());c.set(o?t[Math.min(e,o-1)].getValue():null,a?s[Math.min(e,a-1)].getValue():null,u?i[Math.min(e,u-1)].getValue():null,_?n[Math.min(e,_-1)].getValue():null,h?r[Math.min(e,h-1)].getValue():null),p.set(c,l),p.set(c.submatrix.transpose().inverse(),l+16)}this.matrices.length=c,e.bindBuffer(e.ARRAY_BUFFER,this.instances),e.bufferData(e.ARRAY_BUFFER,p,e.DYNAMIC_DRAW),this.set_bbox__()},set_geometry__(){Z().prototype.set_geometry__.call(this),this.getGeometry()?delete this.traverse:this.traverse=Function.prototype,this.set_transform__()},intersectsBox(e,t,s){},traverse(e,t){if(this.numInstances){switch(e){case ee().POINTER:this._pointerEvents.getValue()&&t.addPointingShape(this);break;case ee().PICKING:break;case ee().COLLISION:t.addCollisionShape(this);break;case ee().SHADOW:this._castShadow.getValue()&&t.addShadowShape(this);break;case ee().DISPLAY:t.addDisplayShape(this)&&this.getAppearance().traverse(e,t)}this.getGeometry().traverse(e,t)}},displaySimple(e,t,s){this.getGeometry().displaySimpleInstanced(e,s,this)},display(e,t){this.getGeometry().displayInstanced(e,t,this)}}),Object.defineProperties(ae,{...c().getStaticProperties("InstancedShape","X_ITE",1,"children","2.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"translations",new(r().MFVec3f)),new(a())(l().inputOutput,"rotations",new(r().MFRotation)),new(a())(l().inputOutput,"scales",new(r().MFVec3f)),new(a())(l().inputOutput,"scaleOrientations",new(r().MFRotation)),new(a())(l().inputOutput,"centers",new(r().MFVec3f)),new(a())(l().inputOutput,"pointerEvents",new(r().SFBool)(!0)),new(a())(l().inputOutput,"castShadow",new(r().SFBool)(!0)),new(a())(l().inputOutput,"visible",new(r().SFBool)(!0)),new(a())(l().inputOutput,"bboxDisplay",new(r().SFBool)),new(a())(l().initializeOnly,"bboxSize",new(r().SFVec3f)(-1,-1,-1)),new(a())(l().initializeOnly,"bboxCenter",new(r().SFVec3f)),new(a())(l().inputOutput,"appearance",new(r().SFNode)),new(a())(l().inputOutput,"geometry",new(r().SFNode))]),enumerable:!0}});const ue=ae,_e=x().add("InstancedShape",ue);function he(e){g.call(this,e),this.addType(l().IORMaterialExtension)}Object.assign(Object.setPrototypeOf(he.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._indexOfRefraction.addInterest("set_indexOfRefraction__",this),this.set_indexOfRefraction__()},set_indexOfRefraction__(){this.indexOfRefraction=Math.max(this._indexOfRefraction.getValue(),1)},getExtensionKey:()=>I.IOR_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_IOR_MATERIAL_EXT")},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_IorEXT,this.indexOfRefraction)}}),Object.defineProperties(he,{...c().getStaticProperties("IORMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"indexOfRefraction",new(r().SFFloat)(1.5))]),enumerable:!0}});const ce=he,de=x().add("IORMaterialExtension",ce);function le(e){g.call(this,e),this.addType(l().IridescenceMaterialExtension)}Object.assign(Object.setPrototypeOf(le.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._iridescence.addInterest("set_iridescence__",this),this._iridescenceTexture.addInterest("set_iridescenceTexture__",this),this._iridescenceIndexOfRefraction.addInterest("set_iridescenceIndexOfRefraction__",this),this._iridescenceThicknessMinimum.addInterest("set_iridescenceThicknessMinimum__",this),this._iridescenceThicknessMaximum.addInterest("set_iridescenceThicknessMaximum__",this),this._iridescenceThicknessTexture.addInterest("set_iridescenceThicknessTexture__",this),this.set_iridescence__(),this.set_iridescenceTexture__(),this.set_iridescenceIndexOfRefraction__(),this.set_iridescenceThicknessMinimum__(),this.set_iridescenceThicknessMaximum__(),this.set_iridescenceThicknessTexture__()},set_iridescence__(){this.iridescence=Math.max(this._iridescence.getValue(),0)},set_iridescenceTexture__(){this.iridescenceTextureNode=N()(l().X3DSingleTextureNode,this._iridescenceTexture),this.setTexture(0,this.iridescenceTextureNode)},set_iridescenceIndexOfRefraction__(){this.iridescenceIndexOfRefraction=Math.max(this._iridescenceIndexOfRefraction.getValue(),1)},set_iridescenceThicknessMinimum__(){this.iridescenceThicknessMinimum=Math.max(this._iridescenceThicknessMinimum.getValue(),0)},set_iridescenceThicknessMaximum__(){this.iridescenceThicknessMaximum=Math.max(this._iridescenceThicknessMaximum.getValue(),0)},set_iridescenceThicknessTexture__(){this.iridescenceThicknessTextureNode=N()(l().X3DSingleTextureNode,this._iridescenceThicknessTexture),this.setTexture(1,this.iridescenceThicknessTextureNode)},getExtensionKey:()=>I.IRIDESCENCE_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_IRIDESCENCE_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.iridescenceTextureNode?.getShaderOptions(e,"IRIDESCENCE",!0),this.iridescenceThicknessTextureNode?.getShaderOptions(e,"IRIDESCENCE_THICKNESS",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_IridescenceEXT,this.iridescence),e.uniform1f(t.x3d_IridescenceIndexOfRefractionEXT,this.iridescenceIndexOfRefraction),e.uniform1f(t.x3d_IridescenceThicknessMinimumEXT,this.iridescenceThicknessMinimum),e.uniform1f(t.x3d_IridescenceThicknessMaximumEXT,this.iridescenceThicknessMaximum),+this.getTextureBits()&&(this.iridescenceTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_IridescenceTextureEXT,this._iridescenceTextureMapping.getValue(),i,n),this.iridescenceThicknessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_IridescenceThicknessTextureEXT,this._iridescenceThicknessTextureMapping.getValue(),i,n))}}),Object.defineProperties(le,{...c().getStaticProperties("IridescenceMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"iridescence",new(r().SFFloat)),new(a())(l().inputOutput,"iridescenceTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"iridescenceTexture",new(r().SFNode)),new(a())(l().inputOutput,"iridescenceIndexOfRefraction",new(r().SFFloat)(1.3)),new(a())(l().inputOutput,"iridescenceThicknessMinimum",new(r().SFFloat)(100)),new(a())(l().inputOutput,"iridescenceThicknessMaximum",new(r().SFFloat)(400)),new(a())(l().inputOutput,"iridescenceThicknessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"iridescenceThicknessTexture",new(r().SFNode))]),enumerable:!0}});const pe=le,Te=x().add("IridescenceMaterialExtension",pe);function Se(e){g.call(this,e),this.addType(l().SheenMaterialExtension),this.sheenColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Se.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this.getBrowser().getLibraryTexture("lut_charlie.png"),this.getBrowser().getLibraryTexture("lut_sheen_E.png"),this._sheenColor.addInterest("set_sheenColor__",this),this._sheenColorTexture.addInterest("set_sheenColorTexture__",this),this._sheenRoughness.addInterest("set_sheenRoughness__",this),this._sheenRoughnessTexture.addInterest("set_sheenRoughnessTexture__",this),this.set_sheenColor__(),this.set_sheenColorTexture__(),this.set_sheenRoughness__(),this.set_sheenRoughnessTexture__()},set_sheenColor__(){this.sheenColorArray.set(this._sheenColor.getValue())},set_sheenColorTexture__(){this.sheenColorTextureNode=N()(l().X3DSingleTextureNode,this._sheenColorTexture),this.setTexture(0,this.sheenColorTextureNode)},set_sheenRoughness__(){this.sheenRoughness=b().clamp(this._sheenRoughness.getValue(),0,1)},set_sheenRoughnessTexture__(){this.sheenRoughnessTextureNode=N()(l().X3DSingleTextureNode,this._sheenRoughnessTexture),this.setTexture(1,this.sheenRoughnessTextureNode)},getExtensionKey:()=>I.SHEEN_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_SHEEN_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.sheenColorTextureNode?.getShaderOptions(e,"SHEEN_COLOR",!0),this.sheenRoughnessTextureNode?.getShaderOptions(e,"SHEEN_ROUGHNESS",!0))},setShaderUniforms(e,t,s,i,n){e.uniform3fv(t.x3d_SheenColorEXT,this.sheenColorArray),e.uniform1f(t.x3d_SheenRoughnessEXT,this.sheenRoughness);const r=this.getBrowser(),o=r.getLibraryTexture("lut_sheen_E.png"),a=r.getTexture2DUnit();e.activeTexture(e.TEXTURE0+a),e.bindTexture(e.TEXTURE_2D,o.getTexture()),e.uniform1i(t.x3d_SheenELUTTextureEXT,a),+this.getTextureBits()&&(this.sheenColorTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SheenColorTextureEXT,this._sheenColorTextureMapping.getValue(),i,n),this.sheenRoughnessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SheenRoughnessTextureEXT,this._sheenRoughnessTextureMapping.getValue(),i,n))}}),Object.defineProperties(Se,{...c().getStaticProperties("SheenMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"sheenColor",new(r().SFColor)),new(a())(l().inputOutput,"sheenColorTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"sheenColorTexture",new(r().SFNode)),new(a())(l().inputOutput,"sheenRoughness",new(r().SFFloat)),new(a())(l().inputOutput,"sheenRoughnessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"sheenRoughnessTexture",new(r().SFNode))]),enumerable:!0}});const xe=Se,fe=x().add("SheenMaterialExtension",xe),Ee=e.X3DOneSidedMaterialNode;var ge=t.n(Ee);function Oe(e){console.warn("SpecularGlossinessMaterial is depreciated, please use PhysicalMaterial instead."),ge().call(this,e),this.addType(l().SpecularGlossinessMaterial),this.materialKey="4/",this.diffuseColorArray=new Float32Array(3),this.specularColorArray=new Float32Array(3),this.extensionNodes=[]}Object.assign(Object.setPrototypeOf(Oe.prototype,ge().prototype),{initialize(){ge().prototype.initialize.call(this),this._diffuseColor.addInterest("set_diffuseColor__",this),this._diffuseTexture.addInterest("set_diffuseTexture__",this),this._diffuseTexture.addInterest("set_transparent__",this),this._specularColor.addInterest("set_specularColor__",this),this._glossiness.addInterest("set_glossiness__",this),this._specularGlossinessTexture.addInterest("set_specularGlossinessTexture__",this),this._occlusionStrength.addInterest("set_occlusionStrength__",this),this._occlusionTexture.addInterest("set_occlusionTexture__",this),this._extensions.addInterest("set_extensions__",this),this.set_diffuseColor__(),this.set_diffuseTexture__(),this.set_specularColor__(),this.set_glossiness__(),this.set_specularGlossinessTexture__(),this.set_occlusionStrength__(),this.set_occlusionTexture__(),this.set_extensions__(),this.set_transparent__()},getMaterialKey(){return this.materialKey},getTextureIndices:(()=>{let e=0;const t={DIFFUSE_TEXTURE:e++,SPECULAR_GLOSSINESS_TEXTURE:e++,EMISSIVE_TEXTURE:e++,OCCLUSION_TEXTURE:e++,NORMAL_TEXTURE:e++};return function(){return t}})(),getBaseTexture(){return this.diffuseTextureNode},set_diffuseColor__(){this.diffuseColorArray.set(this._diffuseColor.getValue())},set_diffuseTexture__(){const e=this.getTextureIndices().DIFFUSE_TEXTURE;this.diffuseTextureNode&&(this.diffuseTextureNode._transparent.removeInterest("set_transparent__",this),this.diffuseTextureNode._linear.removeInterest(`setTexture${e}`,this)),this.diffuseTextureNode=N()(l().X3DSingleTextureNode,this._diffuseTexture),this.diffuseTextureNode&&(this.diffuseTextureNode._transparent.addInterest("set_transparent__",this),this.diffuseTextureNode._linear.addInterest(`setTexture${e}`,this,e,this.diffuseTextureNode)),this.setTexture(e,this.diffuseTextureNode)},set_specularColor__(){this.specularColorArray.set(this._specularColor.getValue())},set_glossiness__(){this.glossiness=b().clamp(this._glossiness.getValue(),0,1)},set_specularGlossinessTexture__(){this.specularGlossinessTextureNode=N()(l().X3DSingleTextureNode,this._specularGlossinessTexture),this.setTexture(this.getTextureIndices().SPECULAR_GLOSSINESS_TEXTURE,this.specularGlossinessTextureNode)},set_occlusionStrength__(){this.occlusionStrength=b().clamp(this._occlusionStrength.getValue(),0,1)},set_occlusionTexture__(){this.occlusionTextureNode=N()(l().X3DSingleTextureNode,this._occlusionTexture),this.setTexture(this.getTextureIndices().OCCLUSION_TEXTURE,this.occlusionTextureNode)},set_transparent__(){this.setTransparent(this.getTransparency()||this.diffuseTextureNode?.isTransparent())},set_extensions__(){const e=this.extensionNodes;for(const t of e)t.removeInterest("set_extensionsKey__",this);e.length=0;for(const t of this._extensions){const s=N()(l().X3DMaterialExtensionNode,t);s&&e.push(s)}e.sort(((e,t)=>e.getExtensionKey()-t.getExtensionKey()));for(const t of e)t.addInterest("set_extensionsKey__",this);this.setTransmission(e.some((e=>e.getType().includes(l().TransmissionMaterialExtension)))),this.set_extensionsKey__()},set_extensionsKey__(){const e=this.extensionNodes.map((e=>`${e.getExtensionKey().toString(16)}${e.getTextureBits().toString(16)}`)).join("");this.materialKey=`[4.${e}]`},createShader(e,t,s){const i=this.getBrowser(),n=this.getShaderOptions(t,s);for(const e of this.extensionNodes)e.getShaderOptions(n);n.push("X3D_PHYSICAL_MATERIAL","X3D_MATERIAL_SPECULAR_GLOSSINESS"),+this.getTextureBits()&&(this.diffuseTextureNode?.getShaderOptions(n,"DIFFUSE"),this.specularGlossinessTextureNode?.getShaderOptions(n,"SPECULAR_GLOSSINESS"),this.occlusionTextureNode?.getShaderOptions(n,"OCCLUSION"));const r=i.createShader("SpecularGlossiness","Default","Physical",n);return i.getShaders().set(e,r),r},setShaderUniforms(e,t,s,i,n){ge().prototype.setShaderUniforms.call(this,e,t,s,i,n);for(const r of this.extensionNodes)r.setShaderUniforms(e,t,s,i,n);e.uniform3fv(t.x3d_DiffuseColor,this.diffuseColorArray),e.uniform3fv(t.x3d_SpecularColor,this.specularColorArray),e.uniform1f(t.x3d_Glossiness,this.glossiness),+this.getTextureBits()&&(this.diffuseTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_DiffuseTexture,this._diffuseTextureMapping.getValue(),i,n),this.specularGlossinessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SpecularGlossinessTexture,this._specularGlossinessTextureMapping.getValue(),i,n),this.occlusionTextureNode&&e.uniform1f(t.x3d_OcclusionStrength,this.occlusionStrength),this.occlusionTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_OcclusionTexture,this._occlusionTextureMapping.getValue(),i,n))}}),Object.defineProperties(Oe,{...c().getStaticProperties("SpecularGlossinessMaterial","X_ITE",1,"material","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"diffuseColor",new(r().SFColor)(1,1,1)),new(a())(l().inputOutput,"diffuseTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"diffuseTexture",new(r().SFNode)),new(a())(l().inputOutput,"specularColor",new(r().SFColor)(1,1,1)),new(a())(l().inputOutput,"glossiness",new(r().SFFloat)(1)),new(a())(l().inputOutput,"specularGlossinessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"specularGlossinessTexture",new(r().SFNode)),new(a())(l().inputOutput,"emissiveColor",new(r().SFColor)),new(a())(l().inputOutput,"emissiveTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"emissiveTexture",new(r().SFNode)),new(a())(l().inputOutput,"occlusionStrength",new(r().SFFloat)(1)),new(a())(l().inputOutput,"occlusionTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"occlusionTexture",new(r().SFNode)),new(a())(l().inputOutput,"normalScale",new(r().SFFloat)(1)),new(a())(l().inputOutput,"normalTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"normalTexture",new(r().SFNode)),new(a())(l().inputOutput,"transparency",new(r().SFFloat)),new(a())(l().inputOutput,"extensions",new(r().MFNode))]),enumerable:!0}});for(const e of Object.values(Oe.prototype.getTextureIndices()))Oe.prototype[`setTexture${e}`]=function(e,t){this.setTexture(e,t)};const Ne=Oe,me=x().add("SpecularGlossinessMaterial",Ne);function Ae(e){g.call(this,e),this.addType(l().SpecularMaterialExtension),this.specularColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Ae.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._specular.addInterest("set_specular__",this),this._specularTexture.addInterest("set_specularTexture__",this),this._specularColor.addInterest("set_specularColor__",this),this._specularColorTexture.addInterest("set_specularColorTexture__",this),this.set_specular__(),this.set_specularTexture__(),this.set_specularColor__(),this.set_specularColorTexture__()},set_specular__(){this.specular=Math.max(this._specular.getValue(),0)},set_specularTexture__(){this.specularTextureNode=N()(l().X3DSingleTextureNode,this._specularTexture),this.setTexture(0,this.specularTextureNode)},set_specularColor__(){this.specularColorArray.set(this._specularColor.getValue())},set_specularColorTexture__(){this.specularColorTextureNode=N()(l().X3DSingleTextureNode,this._specularColorTexture),this.setTexture(1,this.specularColorTextureNode)},getExtensionKey:()=>I.SPECULAR_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_SPECULAR_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.specularTextureNode?.getShaderOptions(e,"SPECULAR",!0),this.specularColorTextureNode?.getShaderOptions(e,"SPECULAR_COLOR",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_SpecularEXT,this.specular),e.uniform3fv(t.x3d_SpecularColorEXT,this.specularColorArray),+this.getTextureBits()&&(this.specularTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SpecularTextureEXT,this._specularTextureMapping.getValue(),i,n),this.specularColorTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SpecularColorTextureEXT,this._specularColorTextureMapping.getValue(),i,n))}}),Object.defineProperties(Ae,{...c().getStaticProperties("SpecularMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"specular",new(r().SFFloat)(1)),new(a())(l().inputOutput,"specularTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"specularTexture",new(r().SFNode)),new(a())(l().inputOutput,"specularColor",new(r().SFColor)(1,1,1)),new(a())(l().inputOutput,"specularColorTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"specularColorTexture",new(r().SFNode))]),enumerable:!0}});const Ie=Ae,we=x().add("SpecularMaterialExtension",Ie);function ye(e){g.call(this,e),this.addType(l().TransmissionMaterialExtension)}Object.assign(Object.setPrototypeOf(ye.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._transmission.addInterest("set_transmission__",this),this._transmissionTexture.addInterest("set_transmissionTexture__",this),this.set_transmission__(),this.set_transmissionTexture__()},set_transmission__(){this.transmission=Math.max(this._transmission.getValue(),0)},set_transmissionTexture__(){this.transmissionTextureNode=N()(l().X3DSingleTextureNode,this._transmissionTexture),this.setTexture(0,this.transmissionTextureNode)},getExtensionKey:()=>I.TRANSMISSION_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_TRANSMISSION_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.transmissionTextureNode?.getShaderOptions(e,"TRANSMISSION",!0))},setShaderUniforms:function(){const e=new Float32Array(16);return function(t,s,i,n,r){const o=this.getBrowser();if(t.uniform1f(s.x3d_TransmissionEXT,this.transmission),i.isTransmission()){var a=o.getDefaultTexture2D(),u=o.getDefaultTexture2DUnit();t.uniformMatrix4fv(s.x3d_ModelViewMatrix,!1,e),t.uniform2i(s.x3d_TransmissionFramebufferSizeEXT,1,1)}else{var _=o.getTransmissionBuffer();a=_.getColorTexture(),u=o.getTexture2DUnit();t.uniform2i(s.x3d_TransmissionFramebufferSizeEXT,_.getWidth(),_.getHeight())}t.activeTexture(t.TEXTURE0+u),t.bindTexture(t.TEXTURE_2D,a),t.uniform1i(s.x3d_TransmissionFramebufferSamplerEXT,u),+this.getTextureBits()&&this.transmissionTextureNode?.setNamedShaderUniforms(t,s,i,s.x3d_TransmissionTextureEXT,this._transmissionTextureMapping.getValue(),n,r)}}()}),Object.defineProperties(ye,{...c().getStaticProperties("TransmissionMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"transmission",new(r().SFFloat)),new(a())(l().inputOutput,"transmissionTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"transmissionTexture",new(r().SFNode))]),enumerable:!0}});const Ce=ye,Re=x().add("TransmissionMaterialExtension",Ce);function Me(e){g.call(this,e),this.addType(l().VolumeMaterialExtension),this._thickness.setUnit("length"),this._attenuationDistance.setUnit("length"),this.attenuationColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Me.prototype,g.prototype),{initialize(){g.prototype.initialize.call(this),this._thickness.addInterest("set_thickness__",this),this._thicknessTexture.addInterest("set_thicknessTexture__",this),this._attenuationDistance.addInterest("set_attenuationDistance__",this),this._attenuationColor.addInterest("set_attenuationColor__",this),this.set_thickness__(),this.set_thicknessTexture__(),this.set_attenuationDistance__(),this.set_attenuationColor__()},set_thickness__(){this.thickness=Math.max(this._thickness.getValue(),0)},set_thicknessTexture__(){this.thicknessTextureNode=N()(l().X3DSingleTextureNode,this._thicknessTexture),this.setTexture(0,this.thicknessTextureNode)},set_attenuationDistance__(){this.attenuationDistance=Math.max(this._attenuationDistance.getValue(),0)},set_attenuationColor__(){this.attenuationColorArray.set(this._attenuationColor.getValue())},getExtensionKey:()=>I.VOLUME_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_VOLUME_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.thicknessTextureNode?.getShaderOptions(e,"THICKNESS",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_ThicknessEXT,this.thickness),e.uniform1f(t.x3d_AttenuationDistanceEXT,this.attenuationDistance),e.uniform3fv(t.x3d_AttenuationColorEXT,this.attenuationColorArray),+this.getTextureBits()&&this.thicknessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ThicknessTextureEXT,this._thicknessTextureMapping.getValue(),i,n)}}),Object.defineProperties(Me,{...c().getStaticProperties("VolumeMaterialExtension","X_ITE",1,"extensions","4.0"),fieldDefinitions:{value:new(_())([new(a())(l().inputOutput,"metadata",new(r().SFNode)),new(a())(l().inputOutput,"thickness",new(r().SFFloat)),new(a())(l().inputOutput,"thicknessTextureMapping",new(r().SFString)),new(a())(l().inputOutput,"thicknessTexture",new(r().SFNode)),new(a())(l().inputOutput,"attenuationDistance",new(r().SFFloat)(1e6)),new(a())(l().inputOutput,"attenuationColor",new(r().SFColor)(1,1,1))]),enumerable:!0}});const Fe=Me,Xe=x().add("VolumeMaterialExtension",Fe);i().add({name:"X_ITE",concreteNodes:[C,D,V,k,G,K,W,_e,de,Te,fe,me,we,Re,Xe],abstractNodes:[g]});x().add("X_ITEComponent",undefined)})();
|