x_ite 15.1.8 → 15.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/assets/components/AnnotationComponent.js +1 -1
- package/dist/assets/components/AnnotationComponent.min.js +1 -1
- package/dist/assets/components/CADGeometryComponent.js +1 -1
- package/dist/assets/components/CADGeometryComponent.min.js +1 -1
- package/dist/assets/components/CubeMapTexturingComponent.js +17 -20
- package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
- package/dist/assets/components/DISComponent.js +1 -1
- package/dist/assets/components/DISComponent.min.js +1 -1
- package/dist/assets/components/EventUtilitiesComponent.js +1 -1
- package/dist/assets/components/EventUtilitiesComponent.min.js +1 -1
- package/dist/assets/components/GaussianSplatsComponent.js +11 -3
- package/dist/assets/components/GaussianSplatsComponent.min.js +2 -2
- package/dist/assets/components/Geometry2DComponent.js +5 -5
- package/dist/assets/components/Geometry2DComponent.min.js +1 -1
- package/dist/assets/components/Geometry3DComponent.js +1 -1
- package/dist/assets/components/Geometry3DComponent.min.js +1 -1
- package/dist/assets/components/GeospatialComponent.js +2 -2
- package/dist/assets/components/GeospatialComponent.min.js +1 -1
- package/dist/assets/components/HAnimComponent.js +1 -1
- package/dist/assets/components/HAnimComponent.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensorComponent.js +1 -1
- package/dist/assets/components/KeyDeviceSensorComponent.min.js +1 -1
- package/dist/assets/components/LayoutComponent.js +1 -1
- package/dist/assets/components/LayoutComponent.min.js +1 -1
- package/dist/assets/components/NURBSComponent.js +3 -3
- package/dist/assets/components/NURBSComponent.min.js +1 -1
- package/dist/assets/components/ParticleSystemsComponent.js +8 -8
- package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
- package/dist/assets/components/PickingComponent.js +1 -1
- package/dist/assets/components/PickingComponent.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysicsComponent.js +23 -23
- package/dist/assets/components/RigidBodyPhysicsComponent.min.js +1 -1
- package/dist/assets/components/ScriptingComponent.js +1 -1
- package/dist/assets/components/ScriptingComponent.min.js +1 -1
- package/dist/assets/components/TextComponent.js +1 -1
- package/dist/assets/components/TextComponent.min.js +1 -1
- package/dist/assets/components/TextureProjectionComponent.js +1 -1
- package/dist/assets/components/TextureProjectionComponent.min.js +1 -1
- package/dist/assets/components/Texturing3DComponent.js +23 -24
- package/dist/assets/components/Texturing3DComponent.min.js +2 -2
- package/dist/assets/components/VolumeRenderingComponent.js +1 -1
- package/dist/assets/components/VolumeRenderingComponent.min.js +1 -1
- package/dist/assets/components/WebXRComponent.js +1 -1
- package/dist/assets/components/WebXRComponent.min.js +1 -1
- package/dist/assets/components/X_ITEComponent.js +1 -1
- package/dist/assets/components/X_ITEComponent.min.js +1 -1
- package/dist/assets/lib/meshopt_decoder.js +1 -1
- package/dist/example.html +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.d.ts +96 -67
- package/dist/x_ite.js +888 -1003
- package/dist/x_ite.min.js +2 -2
- package/dist/x_ite.min.mjs +2 -2
- package/dist/x_ite.mjs +887 -1002
- package/dist/x_ite.zip +0 -0
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -37,10 +37,10 @@ If you are going to use X_ITE in a production environment, you should use a fixe
|
|
|
37
37
|
jsDelivr is an open-source content delivery network (CDN) renowned for its no-cost access, swift performance, and reliable service.
|
|
38
38
|
|
|
39
39
|
```html
|
|
40
|
-
<script defer src="https://cdn.jsdelivr.net/npm/x_ite@15.1.
|
|
40
|
+
<script defer src="https://cdn.jsdelivr.net/npm/x_ite@15.1.9/dist/x_ite.min.js"></script>
|
|
41
41
|
<!-- or as ES module for use in scripts -->
|
|
42
42
|
<script type="module">
|
|
43
|
-
import X3D from "https://cdn.jsdelivr.net/npm/x_ite@15.1.
|
|
43
|
+
import X3D from "https://cdn.jsdelivr.net/npm/x_ite@15.1.9/dist/x_ite.min.mjs";
|
|
44
44
|
</script>
|
|
45
45
|
```
|
|
46
46
|
|
|
@@ -71,7 +71,7 @@ This script initializes an X3D canvas within an HTML page, configuring it to con
|
|
|
71
71
|
You can include an external file:
|
|
72
72
|
|
|
73
73
|
```html
|
|
74
|
-
<script defer src="https://cdn.jsdelivr.net/npm/x_ite@15.1.
|
|
74
|
+
<script defer src="https://cdn.jsdelivr.net/npm/x_ite@15.1.9/dist/x_ite.min.js"></script>
|
|
75
75
|
<x3d-canvas
|
|
76
76
|
src="box.x3d"
|
|
77
77
|
contentScale="auto"
|
|
@@ -83,7 +83,7 @@ You can include an external file:
|
|
|
83
83
|
However, you can also include and manipulate the XML directly:
|
|
84
84
|
|
|
85
85
|
```html
|
|
86
|
-
<script defer src="https://cdn.jsdelivr.net/npm/x_ite@15.1.
|
|
86
|
+
<script defer src="https://cdn.jsdelivr.net/npm/x_ite@15.1.9/dist/x_ite.min.js"></script>
|
|
87
87
|
<x3d-canvas contentScale="auto" update="auto">
|
|
88
88
|
<X3D profile='Interchange' version='4.1'>
|
|
89
89
|
<head>
|
|
@@ -122,7 +122,7 @@ The same scene can also be created using pure JavaScript:
|
|
|
122
122
|
|
|
123
123
|
```html
|
|
124
124
|
<script type="module">
|
|
125
|
-
import X3D from "https://cdn.jsdelivr.net/npm/x_ite@15.1.
|
|
125
|
+
import X3D from "https://cdn.jsdelivr.net/npm/x_ite@15.1.9/dist/x_ite.min.mjs";
|
|
126
126
|
|
|
127
127
|
const
|
|
128
128
|
canvas = document .createElement ("x3d-canvas"), // Or get an already inserted <x3d-canvas> element.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v15.1.
|
|
1
|
+
/* X_ITE v15.1.9 */
|
|
2
2
|
const t=window[Symbol.for("X_ITE.X3D")];(()=>{const e={n:t=>{const n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{if(Array.isArray(n))for(var i=0;i<n.length;){var o=n[i++],a=n[i++];e.o(t,o)?0===a&&i++:0===a?Object.defineProperty(t,o,{enumerable:!0,value:n[i++]}):Object.defineProperty(t,o,{enumerable:!0,get:a})}else for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},n=t.Components;var i=e.n(n);const o=t.Fields;var a=e.n(o);const p=t.X3DFieldDefinition;var r=e.n(p);const u=t.FieldDefinitionArray;var l=e.n(u);const s=t.X3DNode;var d=e.n(s);const c=t.X3DLayerNode;var w=e.n(c);const y=t.Viewpoint;var O=e.n(y);const S=t.Group;var b=e.n(S);const f=t.X3DConstants;var h=e.n(f);const F=t.Namespace;var g=e.n(F);function A(t){w().call(this,t,new(O())(t),new(b())(t)),this.addType(h().AnnotationLayer)}Object.assign(Object.setPrototypeOf(A.prototype,w().prototype),{initialize(){w().prototype.initialize.call(this)}}),Object.defineProperties(A,{...d().getStaticProperties("AnnotationLayer","Annotation",1,"layers","4.0"),fieldDefinitions:{value:new(l())([new(r())(h().inputOutput,"metadata",new(a().SFNode)),new(r())(h().inputOutput,"isPickable",new(a().SFBool)(!0)),new(r())(h().inputOutput,"layoutPolicy",new(a().MFString)),new(r())(h().inputOutput,"shownGroupID",new(a().MFString)),new(r())(h().inputOutput,"viewport",new(a().SFNode))]),enumerable:!0}});const P=A,m=g().add("AnnotationLayer",P),v=t.X3DChildNode;var N=e.n(v);function j(t){N().call(this,t),this.addType(h().AnnotationTarget)}Object.assign(Object.setPrototypeOf(j.prototype,N().prototype),{initialize(){N().prototype.initialize.call(this)}}),Object.defineProperties(j,{...d().getStaticProperties("AnnotationTarget","Annotation",1,"children","4.0"),fieldDefinitions:{value:new(l())([new(r())(h().inputOutput,"metadata",new(a().SFNode)),new(r())(h().inputOutput,"referencePoint",new(a().SFVec3f)),new(r())(h().inputOutput,"leadLineStyle",new(a().SFNode)),new(r())(h().inputOutput,"marker",new(a().SFNode)),new(r())(h().inputOutput,"annotations",new(a().MFNode))]),enumerable:!0}});const D=j,z=g().add("AnnotationTarget",D),T=t.X3DGroupingNode;var X=e.n(T);function G(t){N().call(this,t),this.addType(h().X3DAnnotationNode)}Object.assign(Object.setPrototypeOf(G.prototype,N().prototype),{initialize(){N().prototype.initialize.call(this)}}),Object.defineProperties(G,d().getStaticProperties("X3DAnnotationNode","Annotation",1));const I=G,L=g().add("X3DAnnotationNode",I);function E(t){X().call(this,t),L.call(this,t),this.addType(h().GroupAnnotation)}Object.assign(Object.setPrototypeOf(E.prototype,X().prototype),L.prototype,{initialize(){X().prototype.initialize.call(this),L.prototype.initialize.call(this)},dispose(){L.prototype.dispose.call(this),X().prototype.dispose.call(this)}}),Object.defineProperties(E,{...d().getStaticProperties("GroupAnnotation","Annotation",1,"children","4.0"),fieldDefinitions:{value:new(l())([new(r())(h().inputOutput,"metadata",new(a().SFNode)),new(r())(h().inputOutput,"enabled",new(a().SFBool)(!0)),new(r())(h().inputOutput,"annotationGroupID",new(a().SFString)),new(r())(h().inputOutput,"displayPolicy",new(a().SFString)("NEVER")),new(r())(h().inputOutput,"visible",new(a().SFBool)(!0)),new(r())(h().inputOutput,"bboxDisplay",new(a().SFBool)),new(r())(h().initializeOnly,"bboxSize",new(a().SFVec3f)(-1,-1,-1)),new(r())(h().initializeOnly,"bboxCenter",new(a().SFVec3f)),new(r())(h().inputOnly,"addChildren",new(a().MFNode)),new(r())(h().inputOnly,"removeChildren",new(a().MFNode)),new(r())(h().inputOutput,"children",new(a().MFNode))]),enumerable:!0}});const M=E,R=g().add("GroupAnnotation",M),x=t.X3DUrlObject;var V=e.n(x);function B(t){L.call(this,t),V().call(this,t),this.addType(h().IconAnnotation)}Object.assign(Object.setPrototypeOf(B.prototype,L.prototype),V().prototype,{initialize(){L.prototype.initialize.call(this),V().prototype.initialize.call(this)},async requestImmediateLoad(t=!0){},dispose(){V().prototype.dispose.call(this),L.prototype.dispose.call(this)}}),Object.defineProperties(B,{...d().getStaticProperties("IconAnnotation","Annotation",1,"children","4.0"),fieldDefinitions:{value:new(l())([new(r())(h().inputOutput,"metadata",new(a().SFNode)),new(r())(h().inputOutput,"enabled",new(a().SFBool)(!0)),new(r())(h().inputOutput,"annotationGroupID",new(a().SFString)),new(r())(h().inputOutput,"displayPolicy",new(a().SFString)("NEVER")),new(r())(h().inputOutput,"url",new(a().MFString)),new(r())(h().inputOutput,"autoRefresh",new(a().SFTime)(0)),new(r())(h().inputOutput,"autoRefreshTimeLimit",new(a().SFTime)(3600))]),enumerable:!0}});const C=B,U=g().add("IconAnnotation",C);function _(t){L.call(this,t),this.addType(h().TextAnnotation)}Object.assign(Object.setPrototypeOf(_.prototype,L.prototype),{initialize(){L.prototype.initialize.call(this)}}),Object.defineProperties(_,{...d().getStaticProperties("TextAnnotation","Annotation",1,"children","4.0"),fieldDefinitions:{value:new(l())([new(r())(h().inputOutput,"metadata",new(a().SFNode)),new(r())(h().inputOutput,"enabled",new(a().SFBool)(!0)),new(r())(h().inputOutput,"annotationGroupID",new(a().SFString)),new(r())(h().inputOutput,"displayPolicy",new(a().SFString)("NEVER")),new(r())(h().inputOutput,"contentType",new(a().SFString)("text/plain")),new(r())(h().inputOutput,"text",new(a().SFString))]),enumerable:!0}});const k=_,q=g().add("TextAnnotation",k);function H(t){L.call(this,t),this.addType(h().URLAnnotation)}Object.assign(Object.setPrototypeOf(H.prototype,L.prototype),{initialize(){L.prototype.initialize.call(this)}}),Object.defineProperties(H,{...d().getStaticProperties("URLAnnotation","Annotation",1,"children","4.0"),fieldDefinitions:{value:new(l())([new(r())(h().inputOutput,"metadata",new(a().SFNode)),new(r())(h().inputOutput,"enabled",new(a().SFBool)(!0)),new(r())(h().inputOutput,"annotationGroupID",new(a().SFString)),new(r())(h().inputOutput,"displayPolicy",new(a().SFString)("NEVER")),new(r())(h().inputOutput,"url",new(a().MFString))]),enumerable:!0}});const J=H,K=g().add("URLAnnotation",J);i().add({name:"Annotation",concreteNodes:[m,z,R,U,q,K],abstractNodes:[L]});g().add("AnnotationComponent",void 0)})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v15.1.
|
|
1
|
+
/* X_ITE v15.1.9 */
|
|
2
2
|
const e=window[Symbol.for("X_ITE.X3D")];(()=>{const t={n:e=>{const i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{if(Array.isArray(i))for(var n=0;n<i.length;){var s=i[n++],o=i[n++];t.o(e,s)?0===o&&n++:0===o?Object.defineProperty(e,s,{enumerable:!0,value:i[n++]}):Object.defineProperty(e,s,{enumerable:!0,get:o})}else 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)},i=e.Components;var n=t.n(i);const s=e.Fields;var o=t.n(s);const r=e.X3DFieldDefinition;var l=t.n(r);const d=e.FieldDefinitionArray;var a=t.n(d);const u=e.X3DNode;var c=t.n(u);const b=e.X3DGroupingNode;var p=t.n(b);const O=e.X3DChildNode;var h=t.n(O);const w=e.X3DConstants;var j=t.n(w);const y=e.Namespace;var S=t.n(y);function _(e){h().call(this,e),this.addType(j().X3DProductStructureChildNode)}Object.setPrototypeOf(_.prototype,h().prototype),Object.defineProperties(_,c().getStaticProperties("X3DProductStructureChildNode","CADGeometry",2));const m=_,f=S().add("X3DProductStructureChildNode",m);function F(e){p().call(this,e),f.call(this,e),this.addType(j().CADAssembly)}Object.setPrototypeOf(F.prototype,p().prototype),Object.defineProperties(F,{...c().getStaticProperties("CADAssembly","CADGeometry",2,"children","3.1"),fieldDefinitions:{value:new(a())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOutput,"name",new(o().SFString)),new(l())(j().inputOutput,"visible",new(o().SFBool)(!0)),new(l())(j().inputOutput,"bboxDisplay",new(o().SFBool)),new(l())(j().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(l())(j().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(l())(j().inputOnly,"addChildren",new(o().MFNode)),new(l())(j().inputOnly,"removeChildren",new(o().MFNode)),new(l())(j().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const g=F,v=S().add("CADAssembly",g),C=e.X3DBoundedObject;var D=t.n(C);const N=e.TraverseType;var P=t.n(N);const x=e.X3DCast;var B=t.n(x);function I(e){f.call(this,e),D().call(this,e),this.addType(j().CADFace),this.addChildObjects(j().outputOnly,"rebuild",new(o().SFTime)),this.setBoundedObject(!0),this.setPointingObject(!0),this.setCollisionObject(!0),this.setShadowObject(!0),this.setVisibleObject(!0),this.visibleObjects=[]}Object.assign(Object.setPrototypeOf(I.prototype,f.prototype),D().prototype,{initialize(){f.prototype.initialize.call(this),D().prototype.initialize.call(this),this._rebuild.addInterest("set_children__",this),this._bboxSize.addInterest("set_boundedObjects__",this),this._shape.addInterest("requestRebuild",this),this.set_children__()},getBBox(e,t){return this.isDefaultBBoxSize()?this.boundedObject?.getBBox(e,t)??e.set():e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getShapes(e,t){for(const i of this.visibleObjects)i.getShapes(e,t);return e},requestRebuild(){this._rebuild.addEvent()},set_children__(){this.setChild(B()(j().X3DChildNode,this._shape))},setChild(e){if(this.childNode){const e=this.childNode;e._isBoundedObject.removeInterest("requestRebuild",this),e._isPointingObject.removeInterest("requestRebuild",this),e._isCameraObject.removeInterest("requestRebuild",this),e._isPickableObject.removeInterest("requestRebuild",this),e._isCollisionObject.removeInterest("requestRebuild",this),e._isShadowObject.removeInterest("requestRebuild",this),e._isVisibleObject.removeInterest("requestRebuild",this),B()(j().X3DBoundedObject,e)&&(e._display.removeInterest("requestRebuild",this),e._bboxDisplay.removeInterest("requestRebuild",this))}if(this.childNode=null,this.boundedObject=null,this.pointingObject=null,this.cameraObject=null,this.pickableObject=null,this.collisionObject=null,this.shadowObject=null,this.visibleObjects.length=0,e){const t=e.getType();for(let i=t.length-1;i>=0;--i){switch(t[i]){case j().LOD:case j().Transform:case j().X3DShapeNode:e._isBoundedObject.addInterest("requestRebuild",this),e._isPointingObject.addInterest("requestRebuild",this),e._isCameraObject.addInterest("requestRebuild",this),e._isPickableObject.addInterest("requestRebuild",this),e._isCollisionObject.addInterest("requestRebuild",this),e._isShadowObject.addInterest("requestRebuild",this),e._isVisibleObject.addInterest("requestRebuild",this),this.childNode=e,e.isVisible()&&(e.isBoundedObject()&&(this.boundedObject=e),e.isPointingObject()&&(this.pointingObject=e),e.isCameraObject()&&(this.cameraObject=e),e.isPickableObject()&&(this.pickableObject=e),e.isCollisionObject()&&(this.collisionObject=e),e.isShadowObject()&&(this.shadowObject=e),e.isVisibleObject()&&this.visibleObjects.push(e)),B()(j().X3DBoundedObject,e)&&(e._display.addInterest("requestRebuild",this),e._bboxDisplay.addInterest("requestRebuild",this),e.isBBoxVisible()&&this.visibleObjects.push(e.getBBoxNode()));break;default:continue}break}}this.set_pointingObjects__(),this.set_cameraObjects__(),this.set_pickableObjects__(),this.set_collisionObjects__(),this.set_shadowObjects__(),this.set_visibleObjects__(),this.set_boundedObjects__()},set_boundedObjects__(){this.setBoundedObject(this.boundedObject||!this.isDefaultBBoxSize())},set_pointingObjects__(){this.setPointingObject(this.pointingObject)},set_cameraObjects__(){this.setCameraObject(this.cameraObject)},set_pickableObjects__(){this.setPickableObject(this.getTransformSensors().size||this.pickableObject)},set_collisionObjects__(){this.setCollisionObject(this.collisionObject)},set_shadowObjects__(){this.setShadowObject(this.shadowObject)},set_visibleObjects__(){this.setVisibleObject(this.visibleObjects.length)},traverse(e,t){switch(e){case P().POINTER:return void this.pointingObject?.traverse(e,t);case P().CAMERA:return void this.cameraObject?.traverse(e,t);case P().PICKING:if(this.getBrowser().getPickable().at(-1))for(const i of this.visibleObjects)i.traverse(e,t);else this.pickableObject?.traverse(e,t);return;case P().COLLISION:return void this.collisionObject?.traverse(e,t);case P().DEPTH:case P().SHADOW:return void this.shadowObject?.traverse(e,t);case P().DISPLAY:for(const i of this.visibleObjects)i.traverse(e,t);return}},dispose(){D().prototype.dispose.call(this),f.prototype.dispose.call(this)}}),Object.defineProperties(I,{...c().getStaticProperties("CADFace","CADGeometry",2,"children","3.1"),fieldDefinitions:{value:new(a())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOutput,"name",new(o().SFString)),new(l())(j().inputOutput,"visible",new(o().SFBool)(!0)),new(l())(j().inputOutput,"bboxDisplay",new(o().SFBool)),new(l())(j().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(l())(j().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(l())(j().inputOutput,"shape",new(o().SFNode))]),enumerable:!0}});const z=I,V=S().add("CADFace",z);function A(e){p().call(this,e),this.addType(j().CADLayer)}Object.setPrototypeOf(A.prototype,p().prototype),Object.defineProperties(A,{...c().getStaticProperties("CADLayer","CADGeometry",2,"children","3.1"),fieldDefinitions:{value:new(a())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOutput,"name",new(o().SFString)),new(l())(j().inputOutput,"visible",new(o().SFBool)(!0)),new(l())(j().inputOutput,"bboxDisplay",new(o().SFBool)),new(l())(j().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(l())(j().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(l())(j().inputOnly,"addChildren",new(o().MFNode)),new(l())(j().inputOnly,"removeChildren",new(o().MFNode)),new(l())(j().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const R=A,q=S().add("CADLayer",R),T=e.X3DTransformNode;var X=t.n(T);function k(e){X().call(this,e),f.call(this,e),this.addType(j().CADPart)}Object.setPrototypeOf(k.prototype,X().prototype),Object.defineProperties(k,{...c().getStaticProperties("CADPart","CADGeometry",2,"children","3.1"),fieldDefinitions:{value:new(a())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOutput,"name",new(o().SFString)),new(l())(j().inputOutput,"translation",new(o().SFVec3f)),new(l())(j().inputOutput,"rotation",new(o().SFRotation)),new(l())(j().inputOutput,"scale",new(o().SFVec3f)(1,1,1)),new(l())(j().inputOutput,"scaleOrientation",new(o().SFRotation)),new(l())(j().inputOutput,"center",new(o().SFVec3f)),new(l())(j().inputOutput,"visible",new(o().SFBool)(!0)),new(l())(j().inputOutput,"bboxDisplay",new(o().SFBool)),new(l())(j().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(l())(j().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(l())(j().inputOnly,"addChildren",new(o().MFNode)),new(l())(j().inputOnly,"removeChildren",new(o().MFNode)),new(l())(j().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const M=k,G=S().add("CADPart",M),L=e.X3DComposedGeometryNode;var Q=t.n(L);function E(e){Q().call(this,e),this.addType(j().IndexedQuadSet)}Object.assign(Object.setPrototypeOf(E.prototype,Q().prototype),{initialize(){Q().prototype.initialize.call(this),this._set_index.addFieldInterest(this._index)},getTriangleIndex:(()=>{const e=[0,1,2,0,2,3];return function(t){const i=t%6;return(t-i)/6*4+e[i]}})(),getPolygonIndex(e){return this._index[e]},getVerticesPerPolygon:()=>4,getNumVertices(){return this.checkVertexCount(this._index.length,4)},build(){const e=this.getNumVertices();Q().prototype.build.call(this,4,e,6,e/4*6)}}),Object.defineProperties(E,{...c().getStaticProperties("IndexedQuadSet","CADGeometry",1,"geometry","3.1"),fieldDefinitions:{value:new(a())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOnly,"set_index",new(o().MFInt32)),new(l())(j().initializeOnly,"solid",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"ccw",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"colorPerVertex",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"normalPerVertex",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"index",new(o().MFInt32)),new(l())(j().inputOutput,"attrib",new(o().MFNode)),new(l())(j().inputOutput,"fogCoord",new(o().SFNode)),new(l())(j().inputOutput,"color",new(o().SFNode)),new(l())(j().inputOutput,"texCoord",new(o().SFNode)),new(l())(j().inputOutput,"tangent",new(o().SFNode)),new(l())(j().inputOutput,"normal",new(o().SFNode)),new(l())(j().inputOutput,"coord",new(o().SFNode))]),enumerable:!0}});const H=E,K=S().add("IndexedQuadSet",H);function W(e){Q().call(this,e),this.addType(j().QuadSet)}Object.assign(Object.setPrototypeOf(W.prototype,Q().prototype),{getTriangleIndex:(()=>{const e=[0,1,2,0,2,3];return function(t){const i=t%6;return(t-i)/6*4+e[i]}})(),getVerticesPerPolygon:()=>4,getNumVertices(){return this.checkVertexCount(this.getCoord()?.getSize()??0,4)},build(){const e=this.getNumVertices();Q().prototype.build.call(this,4,e,6,e/4*6)},createNormals(e,t,i){return this.createFaceNormals(e,t,i)}}),Object.defineProperties(W,{...c().getStaticProperties("QuadSet","CADGeometry",1,"geometry","3.1"),fieldDefinitions:{value:new(a())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().initializeOnly,"solid",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"ccw",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"colorPerVertex",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"normalPerVertex",new(o().SFBool)(!0)),new(l())(j().inputOutput,"attrib",new(o().MFNode)),new(l())(j().inputOutput,"fogCoord",new(o().SFNode)),new(l())(j().inputOutput,"color",new(o().SFNode)),new(l())(j().inputOutput,"texCoord",new(o().SFNode)),new(l())(j().inputOutput,"tangent",new(o().SFNode)),new(l())(j().inputOutput,"normal",new(o().SFNode)),new(l())(j().inputOutput,"coord",new(o().SFNode))]),enumerable:!0}});const Y=W,J=S().add("QuadSet",Y);n().add({name:"CADGeometry",concreteNodes:[v,V,q,G,K,J],abstractNodes:[f]});S().add("CADGeometryComponent",void 0)})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* X_ITE v15.1.
|
|
1
|
+
/* X_ITE v15.1.9 */
|
|
2
2
|
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D")];
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ "use strict";
|
|
@@ -151,6 +151,8 @@ function X3DEnvironmentTextureNode (executionContext)
|
|
|
151
151
|
|
|
152
152
|
this .addType ((external_X_ITE_X3D_X3DConstants_default()).X3DEnvironmentTextureNode);
|
|
153
153
|
|
|
154
|
+
// Private properties
|
|
155
|
+
|
|
154
156
|
const gl = this .getBrowser () .getContext ();
|
|
155
157
|
|
|
156
158
|
this .target = gl .TEXTURE_CUBE_MAP;
|
|
@@ -163,25 +165,28 @@ function X3DEnvironmentTextureNode (executionContext)
|
|
|
163
165
|
gl .TEXTURE_CUBE_MAP_POSITIVE_Y, // Top
|
|
164
166
|
gl .TEXTURE_CUBE_MAP_NEGATIVE_Y, // Bottom
|
|
165
167
|
];
|
|
166
|
-
|
|
167
|
-
this .size = 1;
|
|
168
|
-
this .levels = 0;
|
|
169
168
|
}
|
|
170
169
|
|
|
171
170
|
Object .assign (Object .setPrototypeOf (X3DEnvironmentTextureNode .prototype, (external_X_ITE_X3D_X3DSingleTextureNode_default()).prototype),
|
|
172
171
|
{
|
|
173
|
-
|
|
172
|
+
initialize ()
|
|
174
173
|
{
|
|
175
|
-
|
|
174
|
+
external_X_ITE_X3D_X3DSingleTextureNode_default().prototype .initialize .call (this);
|
|
175
|
+
|
|
176
|
+
this .clearTexture ();
|
|
176
177
|
},
|
|
177
|
-
|
|
178
|
+
getTarget ()
|
|
178
179
|
{
|
|
179
|
-
return
|
|
180
|
+
return this .target;
|
|
180
181
|
},
|
|
181
182
|
getTargets ()
|
|
182
183
|
{
|
|
183
184
|
return this .targets;
|
|
184
185
|
},
|
|
186
|
+
getTextureType ()
|
|
187
|
+
{
|
|
188
|
+
return 4;
|
|
189
|
+
},
|
|
185
190
|
getSize ()
|
|
186
191
|
{
|
|
187
192
|
return this .size;
|
|
@@ -299,10 +304,6 @@ Object .assign (Object .setPrototypeOf (ComposedCubeMapTexture .prototype, CubeM
|
|
|
299
304
|
|
|
300
305
|
this .frameBuffer = gl .createFramebuffer ();
|
|
301
306
|
|
|
302
|
-
// Upload default data.
|
|
303
|
-
|
|
304
|
-
this .clearTexture ();
|
|
305
|
-
|
|
306
307
|
// Initialize.
|
|
307
308
|
|
|
308
309
|
this ._frontTexture .addInterest ("set_texture__", this, 0);
|
|
@@ -523,10 +524,6 @@ Object .assign (Object .setPrototypeOf (GeneratedCubeMapTexture .prototype, Cube
|
|
|
523
524
|
{
|
|
524
525
|
CubeMapTexturing_X3DEnvironmentTextureNode .prototype .initialize .call (this);
|
|
525
526
|
|
|
526
|
-
// Upload default data.
|
|
527
|
-
|
|
528
|
-
this .clearTexture ();
|
|
529
|
-
|
|
530
527
|
// Initialize.
|
|
531
528
|
|
|
532
529
|
this ._size .addInterest ("set_size__", this);
|
|
@@ -555,6 +552,10 @@ Object .assign (Object .setPrototypeOf (GeneratedCubeMapTexture .prototype, Cube
|
|
|
555
552
|
browser = this .getBrowser (),
|
|
556
553
|
gl = browser .getContext ();
|
|
557
554
|
|
|
555
|
+
// Dispose old framebuffer.
|
|
556
|
+
|
|
557
|
+
this .frameBuffer ?.dispose ();
|
|
558
|
+
|
|
558
559
|
// Transfer 6 textures of size x size pixels.
|
|
559
560
|
|
|
560
561
|
const size = this ._size .getValue ();
|
|
@@ -805,10 +806,6 @@ Object .assign (Object .setPrototypeOf (ImageCubeMapTexture .prototype, CubeMapT
|
|
|
805
806
|
CubeMapTexturing_X3DEnvironmentTextureNode .prototype .initialize .call (this);
|
|
806
807
|
external_X_ITE_X3D_X3DUrlObject_default().prototype .initialize .call (this);
|
|
807
808
|
|
|
808
|
-
// Upload default data.
|
|
809
|
-
|
|
810
|
-
this .clearTexture ();
|
|
811
|
-
|
|
812
809
|
// Initialize.
|
|
813
810
|
|
|
814
811
|
this .image
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v15.1.
|
|
2
|
-
const e=window[Symbol.for("X_ITE.X3D")];(()=>{var t={254(t){t.exports=e.jquery}};const r={};function i(e){const s=r[e];if(void 0!==s)return s.exports;const a=r[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var s=t[r++],a=t[r++];i.o(e,s)?0===a&&r++:0===a?Object.defineProperty(e,s,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,s,{enumerable:!0,get:a})}else for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const s=e.Components;var a=i.n(s);const n=e.Namespace;var o=i.n(n);const u=o().add("Panorama2.fs","#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;const float M_PI=3.1415926535897932384626433832795;in vec2 texCoord;out vec4 x3d_FragColor;uniform sampler2D x3d_PanoramaTextureEXT;uniform int x3d_CurrentFaceEXT;vec3 uvToXYZ(const in int face,const in vec2 uv){switch(face){case 0:return vec3(1.,uv.y,uv.x);case 1:return vec3(-1.,uv.y,-uv.x);case 2:return vec3(uv.x,uv.y,-1.);case 3:return vec3(-uv.x,uv.y,1.);case 4:return vec3(uv.y,-1.,uv.x);default:return vec3(-uv.y,1.,uv.x);}}vec2 dirToUV(const in vec3 dir){return vec2(.5+.5*atan(dir.z,dir.x)/M_PI,1.-acos(dir.y)/M_PI);}vec3 panoramaToCubeMap(const in int face,const in vec2 texCoord){vec3 scan=uvToXYZ(face,texCoord);vec3 direction=normalize(scan);vec2 src=dirToUV(direction);return texture(x3d_PanoramaTextureEXT,src).rgb;}void main(){x3d_FragColor=vec4(panoramaToCubeMap(x3d_CurrentFaceEXT,texCoord),1.);}"),h=Symbol();function d(){}Object.assign(d.prototype,{getPanoramaShader(){return this[h]??=this.createShader({name:"Panorama",vertexShader:"FullScreen",fragmentShader:`data:x-shader/x-fragment,${u}`,uniforms:["x3d_PanoramaTextureEXT","x3d_CurrentFaceEXT"]})}});const T=d,p=o().add("X3DCubeMapTexturingContext",T),c=e.Fields;var x=i.n(c);const l=e.X3DFieldDefinition;var g=i.n(l);const _=e.FieldDefinitionArray;var E=i.n(_);const f=e.X3DNode;var m=i.n(f);const b=e.X3DSingleTextureNode;var R=i.n(b);const w=e.X3DConstants;var S=i.n(w);function M(e){R().call(this,e),this.addType(S().X3DEnvironmentTextureNode);const t=this.getBrowser().getContext();this.target=t.TEXTURE_CUBE_MAP,this.targets=[t.TEXTURE_CUBE_MAP_POSITIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_Y,t.TEXTURE_CUBE_MAP_NEGATIVE_Y],this.size=1,this.levels=0}Object.assign(Object.setPrototypeOf(M.prototype,R().prototype),{getTarget(){return this.target},getTextureType:()=>4,getTargets(){return this.targets},getSize(){return this.size},setSize(e){this.size=e,this.levels=Math.floor(Math.log2(Math.max(e,1)))},getLevels(){return this.levels},clearTexture:(()=>{const e=new Uint8Array([255,255,255,255]);return function(){const t=this.getBrowser().getContext();t.bindTexture(this.getTarget(),this.getTexture());for(const r of this.getTargets())t.texImage2D(r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,e);this.setSize(1),this.setTransparent(!1),this.updateTextureParameters()}})(),updateTextureParameters(){R().prototype.updateTextureParameters.call(this,this.target,this._textureProperties.getValue(),this.texturePropertiesNode,this.size,this.size,!1,!1,!1)},setShaderUniforms(e,t){const r=this.getBrowser().popTextureUnit();e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_CUBE_MAP,this.getTexture()),e.uniform1i(t.textureCube,r)}}),Object.defineProperties(M,m().getStaticProperties("X3DEnvironmentTextureNode","CubeMapTexturing",1));const v=M,C=o().add("X3DEnvironmentTextureNode",v),U=e.X3DCast;var A=i.n(U);const I=e.BitSet;var P=i.n(I);function y(e){C.call(this,e),this.addType(S().ComposedCubeMapTexture),this.addChildObjects(S().outputOnly,"update",new(x().SFTime)),e.getSpecificationVersion()<=3.3&&(this.addAlias("front",this._frontTexture),this.addAlias("back",this._backTexture),this.addAlias("left",this._leftTexture),this.addAlias("right",this._rightTexture),this.addAlias("top",this._topTexture),this.addAlias("bottom",this._bottomTexture)),this.textureNodes=[null,null,null,null,null,null],this.textureBits=new(P())}Object.assign(Object.setPrototypeOf(y.prototype,C.prototype),{initialize(){C.prototype.initialize.call(this);const e=this.getBrowser().getContext();this.frameBuffer=e.createFramebuffer(),this.clearTexture(),this._frontTexture.addInterest("set_texture__",this,0),this._backTexture.addInterest("set_texture__",this,1),this._leftTexture.addInterest("set_texture__",this,2),this._rightTexture.addInterest("set_texture__",this,3),this._topTexture.addInterest("set_texture__",this,5),this._bottomTexture.addInterest("set_texture__",this,4),this._update.addInterest("update",this),this.set_texture__(0,this._frontTexture),this.set_texture__(1,this._backTexture),this.set_texture__(2,this._leftTexture),this.set_texture__(3,this._rightTexture),this.set_texture__(4,this._topTexture),this.set_texture__(5,this._bottomTexture)},set_texture__(e,t){let r=this.textureNodes[e];r?.removeInterest("set_loadState__",this),r=this.textureNodes[e]=A()(S().X3DTexture2DNode,t),r?.addInterest("set_loadState__",this,e,r),this.set_loadState__(e,r)},set_loadState__(e,t){this.setTextureBit(e,t?.checkLoadState()),this._update.addEvent()},setTextureBit(e,t){this.textureBits.set(e,t===S().COMPLETE_STATE)},isComplete(){if(63!==+this.textureBits)return!1;const e=this.textureNodes,t=e[0].getWidth();for(const r of e){if(r.getWidth()!==t)return!1;if(r.getHeight()!==t)return!1}return!0},update(){if(this.isComplete()){const e=this.getBrowser().getContext(),t=this.textureNodes,r=t[0].getWidth();if(r!==this.getSize()){const t=new Uint8Array(r*r*4);e.bindTexture(this.getTarget(),this.getTexture());for(let i=0;i<6;++i)e.texImage2D(this.getTargets()[i],0,e.RGBA,r,r,0,e.RGBA,e.UNSIGNED_BYTE,t);this.setSize(r),this.updateTextureParameters()}e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer);for(let i=0;i<6;++i){const s=t[i];if(e.bindTexture(e.TEXTURE_2D,s.getTexture()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s.getTexture(),0),e.bindTexture(this.getTarget(),this.getTexture()),1===s.getTextureType())e.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,r,r);else for(let t=0;t<r;++t)e.copyTexSubImage2D(this.getTargets()[i],0,0,r-t-1,0,t,r,1)}this.setTransparent(t.some(e=>e.isTransparent())),this.setLinear(t.some(e=>e.isLinear())),this.setMipMaps(t.every(e=>e.canMipMaps())),this.updateTextureParameters(),this.addNodeEvent()}else this.clearTexture(),this.addNodeEvent()},getRenderedTextures(e){for(const t of this.textureNodes)t?.getRenderedTextures(e)}}),Object.defineProperties(y,{...m().getStaticProperties("ComposedCubeMapTexture","CubeMapTexturing",1,"texture","3.1"),fieldDefinitions:{value:new(E())([new(g())(S().inputOutput,"metadata",new(x().SFNode)),new(g())(S().inputOutput,"description",new(x().SFString)),new(g())(S().inputOutput,"frontTexture",new(x().SFNode)),new(g())(S().inputOutput,"backTexture",new(x().SFNode)),new(g())(S().inputOutput,"leftTexture",new(x().SFNode)),new(g())(S().inputOutput,"rightTexture",new(x().SFNode)),new(g())(S().inputOutput,"topTexture",new(x().SFNode)),new(g())(S().inputOutput,"bottomTexture",new(x().SFNode)),new(g())(S().initializeOnly,"textureProperties",new(x().SFNode))]),enumerable:!0}});const N=y,X=o().add("ComposedCubeMapTexture",N),F=e.DependentRenderer;var B=i.n(F);const O=e.TextureBuffer;var D=i.n(O);const L=e.TraverseType;var V=i.n(L);const G=e.Camera;var z=i.n(G);const j=e.ViewVolume;var k=i.n(j);const Y=e.Rotation4;var Z=i.n(Y);const W=e.Vector3;var H=i.n(W);const K=e.Vector4;var $=i.n(K);const q=e.Matrix4;var J=i.n(q);const Q=e.Algorithm;var ee=i.n(Q);function te(e){C.call(this,e),this.addType(S().GeneratedCubeMapTexture),this.dependentRenderers=new WeakMap,this.projectionMatrix=new(J()),this.modelMatrix=new(J()),this.updateCallbacks=new Map}Object.assign(Object.setPrototypeOf(te.prototype,C.prototype),{initialize(){C.prototype.initialize.call(this),this.clearTexture(),this._size.addInterest("set_size__",this),this.set_size__()},isRenderedTexture:()=>!0,getRenderedTextures(e){e.add(this)},addUpdateCallback(e,t){this.updateCallbacks.set(e,t)},removeUpdateCallback(e){this.updateCallbacks.delete(e)},set_size__(){const e=this.getBrowser(),t=e.getContext(),r=this._size.getValue();if(r>0){const i=new Uint8Array(r*r*4);t.bindTexture(this.getTarget(),this.getTexture());for(const e of this.getTargets())t.texImage2D(e,0,t.RGBA,r,r,0,t.RGBA,t.UNSIGNED_BYTE,i);this.updateTextureParameters(),this.viewport=new($())(0,0,r,r),this.frameBuffer=new(D())({browser:e,width:r,height:r}),this.setSize(r)}else this.frameBuffer=null,this.setSize(0)},traverse(e,t){t.isIndependent()&&this.frameBuffer&&"NONE"!==this._update.getValue()&&(t.getRenderedTextures().add(this),this.modelMatrix.assign(t.getModelViewMatrix().get()).multRight(t.getCameraSpaceMatrix().get()))},renderTexture:(()=>{const e=[Z().fromVectors(H().Z_AXIS,H().NEGATIVE_Z_AXIS),Z().fromVectors(H().Z_AXIS,H().Z_AXIS),Z().fromVectors(H().Z_AXIS,H().X_AXIS),Z().fromVectors(H().Z_AXIS,H().NEGATIVE_X_AXIS),Z().fromVectors(H().Z_AXIS,H().NEGATIVE_Y_AXIS),Z().fromVectors(H().Z_AXIS,H().Y_AXIS)],t=[new(H())(-1,-1,1),new(H())(-1,-1,1),new(H())(-1,-1,1),new(H())(-1,-1,1),new(H())(1,1,1),new(H())(1,1,1)],r=new(J()),i=new(k());return function(s){this.textureRenderingPass=!0,this.dependentRenderers.has(s)||this.dependentRenderers.set(s,new(B())(this.getExecutionContext(),s));const a=this.dependentRenderers.get(s),n=this.getBrowser(),o=n.getContext(),u=s.getLayer(),h=this.viewport,d=a.getBackground(),T=a.getNavigationInfo(),p=a.getViewpoint(),c=n.getHeadlight(),x=T._headlight.getValue(),l=p.getNearDistance(T),g=p.getFarDistance(T),_=z().perspective(ee().radians(90),l,g,1,1,this.projectionMatrix),E=this.frameBuffer.getWidth(),f=this.frameBuffer.getHeight();this.setTransparent(d.isTransparent()),a.setFramebuffer(this.frameBuffer),a.getViewVolumes().push(i.set(_,h,h)),a.getProjectionMatrix().push(_),o.bindTexture(this.getTarget(),this.getTexture()),this.frameBuffer.bind();for(let i=0;i<6;++i)o.viewport(...h),o.scissor(...h),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),a.getCameraSpaceMatrix().push(this.modelMatrix),a.getCameraSpaceMatrix().rotate(e[i]),a.getCameraSpaceMatrix().scale(t[i]),r.assign(a.getCameraSpaceMatrix().get()).inverse(),a.getViewMatrix().push(r),a.getModelViewMatrix().push(r),x&&(c.modelViewMatrix.push(r),c.modelViewMatrix.multLeft(p.getCameraSpaceMatrix())),u.traverse(V().DISPLAY,a),x&&c.modelViewMatrix.pop(),a.getModelViewMatrix().pop(),a.getCameraSpaceMatrix().pop(),a.getViewMatrix().pop(),o.bindTexture(this.getTarget(),this.getTexture()),o.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,E,f);this.updateTextureParameters(),a.getProjectionMatrix().pop(),a.getViewVolumes().pop(),this._update.equals("NEXT_FRAME_ONLY")&&(this._update="NONE");for(const e of this.updateCallbacks.values())e();this.textureRenderingPass=!1}})(),setShaderUniforms(e,t){C.prototype.setShaderUniforms.call(this,e,t),this.textureRenderingPass&&e.scissor(0,0,0,0)}}),Object.defineProperties(te,{...m().getStaticProperties("GeneratedCubeMapTexture","CubeMapTexturing",3,"texture","3.0"),fieldDefinitions:{value:new(E())([new(g())(S().inputOutput,"metadata",new(x().SFNode)),new(g())(S().inputOutput,"description",new(x().SFString)),new(g())(S().inputOutput,"update",new(x().SFString)("NONE")),new(g())(S().initializeOnly,"size",new(x().SFInt32)(128)),new(g())(S().initializeOnly,"textureProperties",new(x().SFNode))]),enumerable:!0}});const re=te,ie=o().add("GeneratedCubeMapTexture",re),se=e.X3DUrlObject;var ae=i.n(se);const ne=e.FileLoader;var oe=i.n(ne);const ue=e.Vector2;var he=i.n(ue);const de=e.DEVELOPMENT;var Te=i.n(de),pe=i(254);function ce(e){C.call(this,e),ae().call(this,e),this.addType(S().ImageCubeMapTexture),this.image=pe("<img></img>"),this.urlStack=new(x().MFString)}Object.assign(Object.setPrototypeOf(ce.prototype,C.prototype),ae().prototype,{initialize(){C.prototype.initialize.call(this),ae().prototype.initialize.call(this),this.clearTexture(),this.image.on("load",this.setImage.bind(this)).on("abort error",this.setError.bind(this)).attr("crossorigin","anonymous"),this.requestImmediateLoad().catch(Function.prototype)},unloadData(){this.clearTexture()},loadData(){this.urlStack.setValue(this._url),this.loadNext()},loadNext(){if(0===this.urlStack.length)return this.clearTexture(),this.setLoadState(S().FAILED_STATE),void this.addNodeEvent();new(oe())(this,{dataAsString:!1}).loadDocument([this.urlStack.shift()],(e,t)=>{if(null===e)this.loadNext();else{if(!(e instanceof ArrayBuffer))throw new Error("ImageTexture: no suitable file type handler found.");this.fileURL=new URL(t),this.fileURL.pathname.match(/\.ktx2?(?:\.gz)?$/)||this.fileURL.href.match(/^\s*data:image\/ktx2[;,]/s)?(this.setLinear(!0),this.setMipMaps(!1),this.getBrowser().getKTXDecoder().then(t=>t.loadKTXFromBuffer(e)).then(e=>this.setKTXTexture(e)).catch(e=>this.setError({type:e.message}))):(this.setLinear(!1),this.setMipMaps(!0),this.objectURL=URL.createObjectURL(new Blob([e])),this.image.attr("src",this.objectURL))}})},setError(e){"data:"!==this.fileURL.protocol&&console.warn(`Error loading image '${decodeURI(this.fileURL)}':`,e.type),URL.revokeObjectURL(this.objectURL),this.loadNext()},setKTXTexture(e){if(e.target!==this.getTarget())return this.setError({type:"Invalid KTX texture target, must be 'TEXTURE_CUBE_MAP'."});Te()&&"data:"!==this.fileURL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.fileURL)}'.`);try{this.setTexture(e),this.setTransparent(!1),this.setSize(e.baseWidth),this.updateTextureParameters(),this.setLoadState(S().COMPLETE_STATE),this.addNodeEvent()}catch(e){this.setError({type:e.message})}},setImage(){Te()&&"data:"!==this.fileURL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.fileURL)}'.`);try{const e=this.getBrowser().getContext(),t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.image[0]),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.imageToCubeMap(t,this.image.prop("width"),this.image.prop("height"),!1),this.setLoadState(S().COMPLETE_STATE),this.addNodeEvent()}catch(e){this.setError({type:e.message})}finally{URL.revokeObjectURL(this.objectURL)}},imageToCubeMap(e,t,r){const i=t/r;Math.abs(i-4/3)<.01&&this.skyBoxToCubeMap(e,t,r),Math.abs(i-2)<.01&&this.panoramaToCubeMap(e,t,r),this.updateTextureParameters()},skyBoxToCubeMap:(()=>{const e=[new(he())(1,1),new(he())(3,1),new(he())(0,1),new(he())(2,1),new(he())(1,0),new(he())(1,2)];return function(t,r,i){const s=this.getBrowser().getContext(),a=s.createFramebuffer(),n=Math.floor(r/4),o=Math.floor(i/3),u=new Uint8Array(n*o*4);s.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)s.texImage2D(this.getTargets()[e],0,s.RGBA,n,o,0,s.RGBA,s.UNSIGNED_BYTE,null);s.bindFramebuffer(s.FRAMEBUFFER,a),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0);let h=!1;s.bindTexture(this.getTarget(),this.getTexture());for(let t=0;t<6;++t)s.copyTexSubImage2D(this.getTargets()[t],0,0,0,e[t].x*n,e[t].y*o,n,o),h||(s.readPixels(e[t].x*n,e[t].y*o,n,o,s.RGBA,s.UNSIGNED_BYTE,u),h=this.isImageTransparent(u));s.deleteFramebuffer(a),s.deleteTexture(t),this.setTransparent(h),this.setSize(n)}})(),panoramaToCubeMap(e,t,r){const i=this.getBrowser(),s=i.getContext(),a=i.getPanoramaShader(),n=s.createFramebuffer(),o=Math.floor(r/2),u=new Uint8Array(o*o*4);s.bindTexture(s.TEXTURE_2D,e),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.MIRRORED_REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.MIRRORED_REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)s.texImage2D(this.getTargets()[e],0,s.RGBA,o,o,0,s.RGBA,s.UNSIGNED_BYTE,null);s.useProgram(a.getProgram()),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,e),s.uniform1i(a.x3d_PanoramaTextureEXT,0),s.bindFramebuffer(s.FRAMEBUFFER,n),s.viewport(0,0,o,o),s.scissor(0,0,o,o),s.disable(s.DEPTH_TEST),s.enable(s.CULL_FACE),s.frontFace(s.CCW),s.clearColor(0,0,0,0),s.bindVertexArray(i.getFullscreenVertexArrayObject());let h=!1;for(let e=0;e<6;++e)s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,this.getTargets()[e],this.getTexture(),0),s.clear(s.COLOR_BUFFER_BIT),s.uniform1i(a.x3d_CurrentFaceEXT,e),s.drawArrays(s.TRIANGLES,0,6),h||(s.readPixels(0,0,o,o,s.RGBA,s.UNSIGNED_BYTE,u),h=this.isImageTransparent(u));s.enable(s.DEPTH_TEST),s.deleteFramebuffer(n),s.deleteTexture(e),this.setTransparent(h),this.setSize(o)},dispose(){ae().prototype.dispose.call(this),C.prototype.dispose.call(this)}}),Object.defineProperties(ce,{...m().getStaticProperties("ImageCubeMapTexture","CubeMapTexturing",2,"texture","3.0"),fieldDefinitions:{value:new(E())([new(g())(S().inputOutput,"metadata",new(x().SFNode)),new(g())(S().inputOutput,"description",new(x().SFString)),new(g())(S().inputOutput,"load",new(x().SFBool)(!0)),new(g())(S().inputOutput,"url",new(x().MFString)),new(g())(S().inputOutput,"autoRefresh",new(x().SFTime)(0)),new(g())(S().inputOutput,"autoRefreshTimeLimit",new(x().SFTime)(3600)),new(g())(S().initializeOnly,"textureProperties",new(x().SFNode))]),enumerable:!0}});const xe=ce,le=o().add("ImageCubeMapTexture",xe);a().add({name:"CubeMapTexturing",concreteNodes:[X,ie,le],abstractNodes:[C],browserContext:p});o().add("CubeMapTexturingComponent",void 0)})();
|
|
1
|
+
/* X_ITE v15.1.9 */
|
|
2
|
+
const e=window[Symbol.for("X_ITE.X3D")];(()=>{var t={254(t){t.exports=e.jquery}};const r={};function i(e){const s=r[e];if(void 0!==s)return s.exports;const a=r[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var s=t[r++],a=t[r++];i.o(e,s)?0===a&&r++:0===a?Object.defineProperty(e,s,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,s,{enumerable:!0,get:a})}else for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const s=e.Components;var a=i.n(s);const n=e.Namespace;var o=i.n(n);const u=o().add("Panorama2.fs","#version 300 es\nprecision highp float;precision highp int;precision highp sampler2D;const float M_PI=3.1415926535897932384626433832795;in vec2 texCoord;out vec4 x3d_FragColor;uniform sampler2D x3d_PanoramaTextureEXT;uniform int x3d_CurrentFaceEXT;vec3 uvToXYZ(const in int face,const in vec2 uv){switch(face){case 0:return vec3(1.,uv.y,uv.x);case 1:return vec3(-1.,uv.y,-uv.x);case 2:return vec3(uv.x,uv.y,-1.);case 3:return vec3(-uv.x,uv.y,1.);case 4:return vec3(uv.y,-1.,uv.x);default:return vec3(-uv.y,1.,uv.x);}}vec2 dirToUV(const in vec3 dir){return vec2(.5+.5*atan(dir.z,dir.x)/M_PI,1.-acos(dir.y)/M_PI);}vec3 panoramaToCubeMap(const in int face,const in vec2 texCoord){vec3 scan=uvToXYZ(face,texCoord);vec3 direction=normalize(scan);vec2 src=dirToUV(direction);return texture(x3d_PanoramaTextureEXT,src).rgb;}void main(){x3d_FragColor=vec4(panoramaToCubeMap(x3d_CurrentFaceEXT,texCoord),1.);}"),h=Symbol();function d(){}Object.assign(d.prototype,{getPanoramaShader(){return this[h]??=this.createShader({name:"Panorama",vertexShader:"FullScreen",fragmentShader:`data:x-shader/x-fragment,${u}`,uniforms:["x3d_PanoramaTextureEXT","x3d_CurrentFaceEXT"]})}});const T=d,p=o().add("X3DCubeMapTexturingContext",T),c=e.Fields;var x=i.n(c);const l=e.X3DFieldDefinition;var g=i.n(l);const _=e.FieldDefinitionArray;var E=i.n(_);const f=e.X3DNode;var m=i.n(f);const b=e.X3DSingleTextureNode;var R=i.n(b);const w=e.X3DConstants;var S=i.n(w);function M(e){R().call(this,e),this.addType(S().X3DEnvironmentTextureNode);const t=this.getBrowser().getContext();this.target=t.TEXTURE_CUBE_MAP,this.targets=[t.TEXTURE_CUBE_MAP_POSITIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_Z,t.TEXTURE_CUBE_MAP_NEGATIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_X,t.TEXTURE_CUBE_MAP_POSITIVE_Y,t.TEXTURE_CUBE_MAP_NEGATIVE_Y]}Object.assign(Object.setPrototypeOf(M.prototype,R().prototype),{initialize(){R().prototype.initialize.call(this),this.clearTexture()},getTarget(){return this.target},getTargets(){return this.targets},getTextureType:()=>4,getSize(){return this.size},setSize(e){this.size=e,this.levels=Math.floor(Math.log2(Math.max(e,1)))},getLevels(){return this.levels},clearTexture:(()=>{const e=new Uint8Array([255,255,255,255]);return function(){const t=this.getBrowser().getContext();t.bindTexture(this.getTarget(),this.getTexture());for(const r of this.getTargets())t.texImage2D(r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,e);this.setSize(1),this.setTransparent(!1),this.updateTextureParameters()}})(),updateTextureParameters(){R().prototype.updateTextureParameters.call(this,this.target,this._textureProperties.getValue(),this.texturePropertiesNode,this.size,this.size,!1,!1,!1)},setShaderUniforms(e,t){const r=this.getBrowser().popTextureUnit();e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_CUBE_MAP,this.getTexture()),e.uniform1i(t.textureCube,r)}}),Object.defineProperties(M,m().getStaticProperties("X3DEnvironmentTextureNode","CubeMapTexturing",1));const v=M,C=o().add("X3DEnvironmentTextureNode",v),U=e.X3DCast;var A=i.n(U);const I=e.BitSet;var P=i.n(I);function y(e){C.call(this,e),this.addType(S().ComposedCubeMapTexture),this.addChildObjects(S().outputOnly,"update",new(x().SFTime)),e.getSpecificationVersion()<=3.3&&(this.addAlias("front",this._frontTexture),this.addAlias("back",this._backTexture),this.addAlias("left",this._leftTexture),this.addAlias("right",this._rightTexture),this.addAlias("top",this._topTexture),this.addAlias("bottom",this._bottomTexture)),this.textureNodes=[null,null,null,null,null,null],this.textureBits=new(P())}Object.assign(Object.setPrototypeOf(y.prototype,C.prototype),{initialize(){C.prototype.initialize.call(this);const e=this.getBrowser().getContext();this.frameBuffer=e.createFramebuffer(),this._frontTexture.addInterest("set_texture__",this,0),this._backTexture.addInterest("set_texture__",this,1),this._leftTexture.addInterest("set_texture__",this,2),this._rightTexture.addInterest("set_texture__",this,3),this._topTexture.addInterest("set_texture__",this,5),this._bottomTexture.addInterest("set_texture__",this,4),this._update.addInterest("update",this),this.set_texture__(0,this._frontTexture),this.set_texture__(1,this._backTexture),this.set_texture__(2,this._leftTexture),this.set_texture__(3,this._rightTexture),this.set_texture__(4,this._topTexture),this.set_texture__(5,this._bottomTexture)},set_texture__(e,t){let r=this.textureNodes[e];r?.removeInterest("set_loadState__",this),r=this.textureNodes[e]=A()(S().X3DTexture2DNode,t),r?.addInterest("set_loadState__",this,e,r),this.set_loadState__(e,r)},set_loadState__(e,t){this.setTextureBit(e,t?.checkLoadState()),this._update.addEvent()},setTextureBit(e,t){this.textureBits.set(e,t===S().COMPLETE_STATE)},isComplete(){if(63!==+this.textureBits)return!1;const e=this.textureNodes,t=e[0].getWidth();for(const r of e){if(r.getWidth()!==t)return!1;if(r.getHeight()!==t)return!1}return!0},update(){if(this.isComplete()){const e=this.getBrowser().getContext(),t=this.textureNodes,r=t[0].getWidth();if(r!==this.getSize()){const t=new Uint8Array(r*r*4);e.bindTexture(this.getTarget(),this.getTexture());for(let i=0;i<6;++i)e.texImage2D(this.getTargets()[i],0,e.RGBA,r,r,0,e.RGBA,e.UNSIGNED_BYTE,t);this.setSize(r),this.updateTextureParameters()}e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer);for(let i=0;i<6;++i){const s=t[i];if(e.bindTexture(e.TEXTURE_2D,s.getTexture()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s.getTexture(),0),e.bindTexture(this.getTarget(),this.getTexture()),1===s.getTextureType())e.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,r,r);else for(let t=0;t<r;++t)e.copyTexSubImage2D(this.getTargets()[i],0,0,r-t-1,0,t,r,1)}this.setTransparent(t.some(e=>e.isTransparent())),this.setLinear(t.some(e=>e.isLinear())),this.setMipMaps(t.every(e=>e.canMipMaps())),this.updateTextureParameters(),this.addNodeEvent()}else this.clearTexture(),this.addNodeEvent()},getRenderedTextures(e){for(const t of this.textureNodes)t?.getRenderedTextures(e)}}),Object.defineProperties(y,{...m().getStaticProperties("ComposedCubeMapTexture","CubeMapTexturing",1,"texture","3.1"),fieldDefinitions:{value:new(E())([new(g())(S().inputOutput,"metadata",new(x().SFNode)),new(g())(S().inputOutput,"description",new(x().SFString)),new(g())(S().inputOutput,"frontTexture",new(x().SFNode)),new(g())(S().inputOutput,"backTexture",new(x().SFNode)),new(g())(S().inputOutput,"leftTexture",new(x().SFNode)),new(g())(S().inputOutput,"rightTexture",new(x().SFNode)),new(g())(S().inputOutput,"topTexture",new(x().SFNode)),new(g())(S().inputOutput,"bottomTexture",new(x().SFNode)),new(g())(S().initializeOnly,"textureProperties",new(x().SFNode))]),enumerable:!0}});const N=y,X=o().add("ComposedCubeMapTexture",N),F=e.DependentRenderer;var B=i.n(F);const O=e.TextureBuffer;var D=i.n(O);const L=e.TraverseType;var V=i.n(L);const z=e.Camera;var G=i.n(z);const j=e.ViewVolume;var k=i.n(j);const Y=e.Rotation4;var Z=i.n(Y);const W=e.Vector3;var H=i.n(W);const K=e.Vector4;var $=i.n(K);const q=e.Matrix4;var J=i.n(q);const Q=e.Algorithm;var ee=i.n(Q);function te(e){C.call(this,e),this.addType(S().GeneratedCubeMapTexture),this.dependentRenderers=new WeakMap,this.projectionMatrix=new(J()),this.modelMatrix=new(J()),this.updateCallbacks=new Map}Object.assign(Object.setPrototypeOf(te.prototype,C.prototype),{initialize(){C.prototype.initialize.call(this),this._size.addInterest("set_size__",this),this.set_size__()},isRenderedTexture:()=>!0,getRenderedTextures(e){e.add(this)},addUpdateCallback(e,t){this.updateCallbacks.set(e,t)},removeUpdateCallback(e){this.updateCallbacks.delete(e)},set_size__(){const e=this.getBrowser(),t=e.getContext();this.frameBuffer?.dispose();const r=this._size.getValue();if(r>0){const i=new Uint8Array(r*r*4);t.bindTexture(this.getTarget(),this.getTexture());for(const e of this.getTargets())t.texImage2D(e,0,t.RGBA,r,r,0,t.RGBA,t.UNSIGNED_BYTE,i);this.updateTextureParameters(),this.viewport=new($())(0,0,r,r),this.frameBuffer=new(D())({browser:e,width:r,height:r}),this.setSize(r)}else this.frameBuffer=null,this.setSize(0)},traverse(e,t){t.isIndependent()&&this.frameBuffer&&"NONE"!==this._update.getValue()&&(t.getRenderedTextures().add(this),this.modelMatrix.assign(t.getModelViewMatrix().get()).multRight(t.getCameraSpaceMatrix().get()))},renderTexture:(()=>{const e=[Z().fromVectors(H().Z_AXIS,H().NEGATIVE_Z_AXIS),Z().fromVectors(H().Z_AXIS,H().Z_AXIS),Z().fromVectors(H().Z_AXIS,H().X_AXIS),Z().fromVectors(H().Z_AXIS,H().NEGATIVE_X_AXIS),Z().fromVectors(H().Z_AXIS,H().NEGATIVE_Y_AXIS),Z().fromVectors(H().Z_AXIS,H().Y_AXIS)],t=[new(H())(-1,-1,1),new(H())(-1,-1,1),new(H())(-1,-1,1),new(H())(-1,-1,1),new(H())(1,1,1),new(H())(1,1,1)],r=new(J()),i=new(k());return function(s){this.textureRenderingPass=!0,this.dependentRenderers.has(s)||this.dependentRenderers.set(s,new(B())(this.getExecutionContext(),s));const a=this.dependentRenderers.get(s),n=this.getBrowser(),o=n.getContext(),u=s.getLayer(),h=this.viewport,d=a.getBackground(),T=a.getNavigationInfo(),p=a.getViewpoint(),c=n.getHeadlight(),x=T._headlight.getValue(),l=p.getNearDistance(T),g=p.getFarDistance(T),_=G().perspective(ee().radians(90),l,g,1,1,this.projectionMatrix),E=this.frameBuffer.getWidth(),f=this.frameBuffer.getHeight();this.setTransparent(d.isTransparent()),a.setFramebuffer(this.frameBuffer),a.getViewVolumes().push(i.set(_,h,h)),a.getProjectionMatrix().push(_),o.bindTexture(this.getTarget(),this.getTexture()),this.frameBuffer.bind();for(let i=0;i<6;++i)o.viewport(...h),o.scissor(...h),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),a.getCameraSpaceMatrix().push(this.modelMatrix),a.getCameraSpaceMatrix().rotate(e[i]),a.getCameraSpaceMatrix().scale(t[i]),r.assign(a.getCameraSpaceMatrix().get()).inverse(),a.getViewMatrix().push(r),a.getModelViewMatrix().push(r),x&&(c.modelViewMatrix.push(r),c.modelViewMatrix.multLeft(p.getCameraSpaceMatrix())),u.traverse(V().DISPLAY,a),x&&c.modelViewMatrix.pop(),a.getModelViewMatrix().pop(),a.getCameraSpaceMatrix().pop(),a.getViewMatrix().pop(),o.bindTexture(this.getTarget(),this.getTexture()),o.copyTexSubImage2D(this.getTargets()[i],0,0,0,0,0,E,f);this.updateTextureParameters(),a.getProjectionMatrix().pop(),a.getViewVolumes().pop(),this._update.equals("NEXT_FRAME_ONLY")&&(this._update="NONE");for(const e of this.updateCallbacks.values())e();this.textureRenderingPass=!1}})(),setShaderUniforms(e,t){C.prototype.setShaderUniforms.call(this,e,t),this.textureRenderingPass&&e.scissor(0,0,0,0)}}),Object.defineProperties(te,{...m().getStaticProperties("GeneratedCubeMapTexture","CubeMapTexturing",3,"texture","3.0"),fieldDefinitions:{value:new(E())([new(g())(S().inputOutput,"metadata",new(x().SFNode)),new(g())(S().inputOutput,"description",new(x().SFString)),new(g())(S().inputOutput,"update",new(x().SFString)("NONE")),new(g())(S().initializeOnly,"size",new(x().SFInt32)(128)),new(g())(S().initializeOnly,"textureProperties",new(x().SFNode))]),enumerable:!0}});const re=te,ie=o().add("GeneratedCubeMapTexture",re),se=e.X3DUrlObject;var ae=i.n(se);const ne=e.FileLoader;var oe=i.n(ne);const ue=e.Vector2;var he=i.n(ue);const de=e.DEVELOPMENT;var Te=i.n(de),pe=i(254);function ce(e){C.call(this,e),ae().call(this,e),this.addType(S().ImageCubeMapTexture),this.image=pe("<img></img>"),this.urlStack=new(x().MFString)}Object.assign(Object.setPrototypeOf(ce.prototype,C.prototype),ae().prototype,{initialize(){C.prototype.initialize.call(this),ae().prototype.initialize.call(this),this.image.on("load",this.setImage.bind(this)).on("abort error",this.setError.bind(this)).attr("crossorigin","anonymous"),this.requestImmediateLoad().catch(Function.prototype)},unloadData(){this.clearTexture()},loadData(){this.urlStack.setValue(this._url),this.loadNext()},loadNext(){if(0===this.urlStack.length)return this.clearTexture(),this.setLoadState(S().FAILED_STATE),void this.addNodeEvent();new(oe())(this,{dataAsString:!1}).loadDocument([this.urlStack.shift()],(e,t)=>{if(null===e)this.loadNext();else{if(!(e instanceof ArrayBuffer))throw new Error("ImageTexture: no suitable file type handler found.");this.fileURL=new URL(t),this.fileURL.pathname.match(/\.ktx2?(?:\.gz)?$/)||this.fileURL.href.match(/^\s*data:image\/ktx2[;,]/s)?(this.setLinear(!0),this.setMipMaps(!1),this.getBrowser().getKTXDecoder().then(t=>t.loadKTXFromBuffer(e)).then(e=>this.setKTXTexture(e)).catch(e=>this.setError({type:e.message}))):(this.setLinear(!1),this.setMipMaps(!0),this.objectURL=URL.createObjectURL(new Blob([e])),this.image.attr("src",this.objectURL))}})},setError(e){"data:"!==this.fileURL.protocol&&console.warn(`Error loading image '${decodeURI(this.fileURL)}':`,e.type),URL.revokeObjectURL(this.objectURL),this.loadNext()},setKTXTexture(e){if(e.target!==this.getTarget())return this.setError({type:"Invalid KTX texture target, must be 'TEXTURE_CUBE_MAP'."});Te()&&"data:"!==this.fileURL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.fileURL)}'.`);try{this.setTexture(e),this.setTransparent(!1),this.setSize(e.baseWidth),this.updateTextureParameters(),this.setLoadState(S().COMPLETE_STATE),this.addNodeEvent()}catch(e){this.setError({type:e.message})}},setImage(){Te()&&"data:"!==this.fileURL.protocol&&console.info(`Done loading image cube map texture '${decodeURI(this.fileURL)}'.`);try{const e=this.getBrowser().getContext(),t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.image[0]),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.imageToCubeMap(t,this.image.prop("width"),this.image.prop("height"),!1),this.setLoadState(S().COMPLETE_STATE),this.addNodeEvent()}catch(e){this.setError({type:e.message})}finally{URL.revokeObjectURL(this.objectURL)}},imageToCubeMap(e,t,r){const i=t/r;Math.abs(i-4/3)<.01&&this.skyBoxToCubeMap(e,t,r),Math.abs(i-2)<.01&&this.panoramaToCubeMap(e,t,r),this.updateTextureParameters()},skyBoxToCubeMap:(()=>{const e=[new(he())(1,1),new(he())(3,1),new(he())(0,1),new(he())(2,1),new(he())(1,0),new(he())(1,2)];return function(t,r,i){const s=this.getBrowser().getContext(),a=s.createFramebuffer(),n=Math.floor(r/4),o=Math.floor(i/3),u=new Uint8Array(n*o*4);s.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)s.texImage2D(this.getTargets()[e],0,s.RGBA,n,o,0,s.RGBA,s.UNSIGNED_BYTE,null);s.bindFramebuffer(s.FRAMEBUFFER,a),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0);let h=!1;s.bindTexture(this.getTarget(),this.getTexture());for(let t=0;t<6;++t)s.copyTexSubImage2D(this.getTargets()[t],0,0,0,e[t].x*n,e[t].y*o,n,o),h||(s.readPixels(e[t].x*n,e[t].y*o,n,o,s.RGBA,s.UNSIGNED_BYTE,u),h=this.isImageTransparent(u));s.deleteFramebuffer(a),s.deleteTexture(t),this.setTransparent(h),this.setSize(n)}})(),panoramaToCubeMap(e,t,r){const i=this.getBrowser(),s=i.getContext(),a=i.getPanoramaShader(),n=s.createFramebuffer(),o=Math.floor(r/2),u=new Uint8Array(o*o*4);s.bindTexture(s.TEXTURE_2D,e),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.MIRRORED_REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.MIRRORED_REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)s.texImage2D(this.getTargets()[e],0,s.RGBA,o,o,0,s.RGBA,s.UNSIGNED_BYTE,null);s.useProgram(a.getProgram()),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,e),s.uniform1i(a.x3d_PanoramaTextureEXT,0),s.bindFramebuffer(s.FRAMEBUFFER,n),s.viewport(0,0,o,o),s.scissor(0,0,o,o),s.disable(s.DEPTH_TEST),s.enable(s.CULL_FACE),s.frontFace(s.CCW),s.clearColor(0,0,0,0),s.bindVertexArray(i.getFullscreenVertexArrayObject());let h=!1;for(let e=0;e<6;++e)s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,this.getTargets()[e],this.getTexture(),0),s.clear(s.COLOR_BUFFER_BIT),s.uniform1i(a.x3d_CurrentFaceEXT,e),s.drawArrays(s.TRIANGLES,0,6),h||(s.readPixels(0,0,o,o,s.RGBA,s.UNSIGNED_BYTE,u),h=this.isImageTransparent(u));s.enable(s.DEPTH_TEST),s.deleteFramebuffer(n),s.deleteTexture(e),this.setTransparent(h),this.setSize(o)},dispose(){ae().prototype.dispose.call(this),C.prototype.dispose.call(this)}}),Object.defineProperties(ce,{...m().getStaticProperties("ImageCubeMapTexture","CubeMapTexturing",2,"texture","3.0"),fieldDefinitions:{value:new(E())([new(g())(S().inputOutput,"metadata",new(x().SFNode)),new(g())(S().inputOutput,"description",new(x().SFString)),new(g())(S().inputOutput,"load",new(x().SFBool)(!0)),new(g())(S().inputOutput,"url",new(x().MFString)),new(g())(S().inputOutput,"autoRefresh",new(x().SFTime)(0)),new(g())(S().inputOutput,"autoRefreshTimeLimit",new(x().SFTime)(3600)),new(g())(S().initializeOnly,"textureProperties",new(x().SFNode))]),enumerable:!0}});const xe=ce,le=o().add("ImageCubeMapTexture",xe);a().add({name:"CubeMapTexturing",concreteNodes:[X,ie,le],abstractNodes:[C],browserContext:p});o().add("CubeMapTexturingComponent",void 0)})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v15.1.
|
|
1
|
+
/* X_ITE v15.1.9 */
|
|
2
2
|
const t=window[Symbol.for("X_ITE.X3D")];(()=>{const e={n:t=>{const n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{if(Array.isArray(n))for(var i=0;i<n.length;){var u=n[i++],p=n[i++];e.o(t,u)?0===p&&i++:0===p?Object.defineProperty(t,u,{enumerable:!0,value:n[i++]}):Object.defineProperty(t,u,{enumerable:!0,get:p})}else for(var u in n)e.o(n,u)&&!e.o(t,u)&&Object.defineProperty(t,u,{enumerable:!0,get:n[u]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},n=t.Components;var i=e.n(n);const u=t.Fields;var p=e.n(u);const o=t.X3DFieldDefinition;var a=e.n(o);const w=t.FieldDefinitionArray;var r=e.n(w);const l=t.X3DNode;var S=e.n(l);const s=t.X3DChildNode;var O=e.n(s);const F=t.X3DConstants;var c=e.n(F);const d=t.Namespace;var y=e.n(d);function I(t){O().call(this,t),this.addType(c().DISEntityManager),t.getSpecificationVersion()<=3.3&&this.addAlias("mapping",this._children)}Object.setPrototypeOf(I.prototype,O().prototype),Object.defineProperties(I,{...S().getStaticProperties("DISEntityManager","DIS",2,"children","3.0"),fieldDefinitions:{value:new(r())([new(a())(c().inputOutput,"metadata",new(p().SFNode)),new(a())(c().inputOutput,"address",new(p().SFString)("localhost")),new(a())(c().inputOutput,"applicationID",new(p().SFInt32)),new(a())(c().inputOutput,"children",new(p().MFNode)),new(a())(c().inputOutput,"port",new(p().SFInt32)),new(a())(c().inputOutput,"siteID",new(p().SFInt32)),new(a())(c().outputOnly,"addedEntities",new(p().MFNode)),new(a())(c().outputOnly,"removedEntities",new(p().MFNode))]),enumerable:!0}});const m=I,g=y().add("DISEntityManager",m),h=t.X3DInfoNode;var f=e.n(h);const D=t.X3DUrlObject;var b=e.n(D);function P(t){f().call(this,t),b().call(this,t),this.addType(c().DISEntityTypeMapping)}Object.assign(Object.setPrototypeOf(P.prototype,f().prototype),b().prototype,{initialize(){f().prototype.initialize.call(this),b().prototype.initialize.call(this)},dispose(){b().prototype.dispose.call(this),f().prototype.dispose.call(this)}}),Object.defineProperties(P,{...S().getStaticProperties("DISEntityTypeMapping","DIS",2,"children","3.0"),fieldDefinitions:{value:new(r())([new(a())(c().inputOutput,"metadata",new(p().SFNode)),new(a())(c().inputOutput,"description",new(p().SFString)),new(a())(c().inputOutput,"load",new(p().SFBool)(!0)),new(a())(c().inputOutput,"url",new(p().MFString)),new(a())(c().inputOutput,"autoRefresh",new(p().SFTime)(0)),new(a())(c().inputOutput,"autoRefreshTimeLimit",new(p().SFTime)(3600)),new(a())(c().initializeOnly,"category",new(p().SFInt32)),new(a())(c().initializeOnly,"country",new(p().SFInt32)),new(a())(c().initializeOnly,"domain",new(p().SFInt32)),new(a())(c().initializeOnly,"extra",new(p().SFInt32)),new(a())(c().initializeOnly,"kind",new(p().SFInt32)),new(a())(c().initializeOnly,"specific",new(p().SFInt32)),new(a())(c().initializeOnly,"subcategory",new(p().SFInt32))]),enumerable:!0}});const B=P,v=y().add("DISEntityTypeMapping",B),T=t.X3DGroupingNode;var V=e.n(T);const z=t.X3DNetworkSensorNode;var N=e.n(z);function _(t){V().call(this,t),N().call(this,t),this.addType(c().EspduTransform),t.getSpecificationVersion()<=3.3&&(this._applicationID=1,this._munitionApplicationID=1)}Object.assign(Object.setPrototypeOf(_.prototype,V().prototype),N().prototype,{initialize(){V().prototype.initialize.call(this),N().prototype.initialize.call(this)}}),Object.defineProperties(_,{...S().getStaticProperties("EspduTransform","DIS",1,"children","3.0"),fieldDefinitions:{value:new(r())([new(a())(c().inputOutput,"metadata",new(p().SFNode)),new(a())(c().inputOutput,"description",new(p().SFString)),new(a())(c().inputOutput,"enabled",new(p().SFBool)(!0)),new(a())(c().inputOutput,"visible",new(p().SFBool)(!0)),new(a())(c().inputOutput,"bboxDisplay",new(p().SFBool)),new(a())(c().initializeOnly,"bboxSize",new(p().SFVec3f)(-1,-1,-1)),new(a())(c().initializeOnly,"bboxCenter",new(p().SFVec3f)),new(a())(c().inputOnly,"addChildren",new(p().MFNode)),new(a())(c().inputOnly,"removeChildren",new(p().MFNode)),new(a())(c().inputOutput,"children",new(p().MFNode)),new(a())(c().outputOnly,"isActive",new(p().SFBool)),new(a())(c().inputOnly,"set_articulationParameterValue0",new(p().SFFloat)),new(a())(c().inputOnly,"set_articulationParameterValue1",new(p().SFFloat)),new(a())(c().inputOnly,"set_articulationParameterValue2",new(p().SFFloat)),new(a())(c().inputOnly,"set_articulationParameterValue3",new(p().SFFloat)),new(a())(c().inputOnly,"set_articulationParameterValue4",new(p().SFFloat)),new(a())(c().inputOnly,"set_articulationParameterValue5",new(p().SFFloat)),new(a())(c().inputOnly,"set_articulationParameterValue6",new(p().SFFloat)),new(a())(c().inputOnly,"set_articulationParameterValue7",new(p().SFFloat)),new(a())(c().inputOutput,"address",new(p().SFString)("localhost")),new(a())(c().inputOutput,"applicationID",new(p().SFInt32)),new(a())(c().inputOutput,"articulationParameterCount",new(p().SFInt32)),new(a())(c().inputOutput,"articulationParameterDesignatorArray",new(p().MFInt32)),new(a())(c().inputOutput,"articulationParameterChangeIndicatorArray",new(p().MFInt32)),new(a())(c().inputOutput,"articulationParameterIdPartAttachedToArray",new(p().MFInt32)),new(a())(c().inputOutput,"articulationParameterTypeArray",new(p().MFInt32)),new(a())(c().inputOutput,"articulationParameterArray",new(p().MFFloat)),new(a())(c().inputOutput,"center",new(p().SFVec3f)),new(a())(c().inputOutput,"collisionType",new(p().SFInt32)),new(a())(c().inputOutput,"deadReckoning",new(p().SFInt32)),new(a())(c().inputOutput,"detonationLocation",new(p().SFVec3f)),new(a())(c().inputOutput,"detonationRelativeLocation",new(p().SFVec3f)),new(a())(c().inputOutput,"detonationResult",new(p().SFInt32)),new(a())(c().inputOutput,"entityCategory",new(p().SFInt32)),new(a())(c().inputOutput,"entityCountry",new(p().SFInt32)),new(a())(c().inputOutput,"entityDomain",new(p().SFInt32)),new(a())(c().inputOutput,"entityExtra",new(p().SFInt32)),new(a())(c().inputOutput,"entityID",new(p().SFInt32)),new(a())(c().inputOutput,"entityKind",new(p().SFInt32)),new(a())(c().inputOutput,"entitySpecific",new(p().SFInt32)),new(a())(c().inputOutput,"entitySubcategory",new(p().SFInt32)),new(a())(c().inputOutput,"eventApplicationID",new(p().SFInt32)),new(a())(c().inputOutput,"eventEntityID",new(p().SFInt32)),new(a())(c().inputOutput,"eventNumber",new(p().SFInt32)),new(a())(c().inputOutput,"eventSiteID",new(p().SFInt32)),new(a())(c().inputOutput,"fired1",new(p().SFBool)),new(a())(c().inputOutput,"fired2",new(p().SFBool)),new(a())(c().inputOutput,"fireMissionIndex",new(p().SFInt32)),new(a())(c().inputOutput,"firingRange",new(p().SFFloat)),new(a())(c().inputOutput,"firingRate",new(p().SFInt32)),new(a())(c().inputOutput,"forceID",new(p().SFInt32)),new(a())(c().inputOutput,"fuse",new(p().SFInt32)),new(a())(c().inputOutput,"linearVelocity",new(p().SFVec3f)),new(a())(c().inputOutput,"linearAcceleration",new(p().SFVec3f)),new(a())(c().inputOutput,"marking",new(p().SFString)),new(a())(c().inputOutput,"multicastRelayHost",new(p().SFString)),new(a())(c().inputOutput,"multicastRelayPort",new(p().SFInt32)),new(a())(c().inputOutput,"munitionApplicationID",new(p().SFInt32)),new(a())(c().inputOutput,"munitionEndPoint",new(p().SFVec3f)),new(a())(c().inputOutput,"munitionEntityID",new(p().SFInt32)),new(a())(c().inputOutput,"munitionQuantity",new(p().SFInt32)),new(a())(c().inputOutput,"munitionSiteID",new(p().SFInt32)),new(a())(c().inputOutput,"munitionStartPoint",new(p().SFVec3f)),new(a())(c().inputOutput,"networkMode",new(p().SFString)("standAlone")),new(a())(c().inputOutput,"port",new(p().SFInt32)),new(a())(c().inputOutput,"readInterval",new(p().SFTime)(.1)),new(a())(c().inputOutput,"rotation",new(p().SFRotation)),new(a())(c().inputOutput,"scale",new(p().SFVec3f)(1,1,1)),new(a())(c().inputOutput,"scaleOrientation",new(p().SFRotation)),new(a())(c().inputOutput,"siteID",new(p().SFInt32)),new(a())(c().inputOutput,"translation",new(p().SFVec3f)),new(a())(c().inputOutput,"warhead",new(p().SFInt32)),new(a())(c().inputOutput,"writeInterval",new(p().SFTime)(1)),new(a())(c().outputOnly,"articulationParameterValue0_changed",new(p().SFFloat)),new(a())(c().outputOnly,"articulationParameterValue1_changed",new(p().SFFloat)),new(a())(c().outputOnly,"articulationParameterValue2_changed",new(p().SFFloat)),new(a())(c().outputOnly,"articulationParameterValue3_changed",new(p().SFFloat)),new(a())(c().outputOnly,"articulationParameterValue4_changed",new(p().SFFloat)),new(a())(c().outputOnly,"articulationParameterValue5_changed",new(p().SFFloat)),new(a())(c().outputOnly,"articulationParameterValue6_changed",new(p().SFFloat)),new(a())(c().outputOnly,"articulationParameterValue7_changed",new(p().SFFloat)),new(a())(c().outputOnly,"collideTime",new(p().SFTime)),new(a())(c().outputOnly,"detonateTime",new(p().SFTime)),new(a())(c().outputOnly,"firedTime",new(p().SFTime)),new(a())(c().outputOnly,"isCollided",new(p().SFBool)),new(a())(c().outputOnly,"isDetonated",new(p().SFBool)),new(a())(c().outputOnly,"isNetworkReader",new(p().SFBool)),new(a())(c().outputOnly,"isNetworkWriter",new(p().SFBool)),new(a())(c().outputOnly,"isRtpHeaderHeard",new(p().SFBool)),new(a())(c().outputOnly,"isStandAlone",new(p().SFBool)),new(a())(c().outputOnly,"timestamp",new(p().SFTime)),new(a())(c().inputOutput,"rtpHeaderExpected",new(p().SFBool)),new(a())(c().inputOutput,"geoCoords",new(p().SFVec3d)),new(a())(c().initializeOnly,"geoSystem",new(p().MFString)("GD","WE"))]),enumerable:!0}});const x=_,E=y().add("EspduTransform",x),M=t.X3DBoundedObject;var R=e.n(M);function A(t){N().call(this,t),R().call(this,t),this.addType(c().ReceiverPdu),t.getSpecificationVersion()<=3.3&&(this._applicationID=1,this._transmitterApplicationID=1)}Object.assign(Object.setPrototypeOf(A.prototype,N().prototype),R().prototype,{initialize(){N().prototype.initialize.call(this),R().prototype.initialize.call(this)},getBBox(t,e){return this.isDefaultBBoxSize()?t.set():t.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},dispose(){R().prototype.dispose.call(this),N().prototype.dispose.call(this)}}),Object.defineProperties(A,{...S().getStaticProperties("ReceiverPdu","DIS",1,"children","3.0"),fieldDefinitions:{value:new(r())([new(a())(c().inputOutput,"metadata",new(p().SFNode)),new(a())(c().inputOutput,"description",new(p().SFString)),new(a())(c().inputOutput,"visible",new(p().SFBool)(!0)),new(a())(c().inputOutput,"bboxDisplay",new(p().SFBool)),new(a())(c().initializeOnly,"bboxSize",new(p().SFVec3f)(-1,-1,-1)),new(a())(c().initializeOnly,"bboxCenter",new(p().SFVec3f)),new(a())(c().inputOutput,"enabled",new(p().SFBool)(!0)),new(a())(c().outputOnly,"isActive",new(p().SFBool)),new(a())(c().inputOutput,"address",new(p().SFString)("localhost")),new(a())(c().inputOutput,"applicationID",new(p().SFInt32)),new(a())(c().inputOutput,"entityID",new(p().SFInt32)),new(a())(c().inputOutput,"multicastRelayHost",new(p().SFString)),new(a())(c().inputOutput,"multicastRelayPort",new(p().SFInt32)),new(a())(c().inputOutput,"networkMode",new(p().SFString)("standAlone")),new(a())(c().inputOutput,"port",new(p().SFInt32)),new(a())(c().inputOutput,"radioID",new(p().SFInt32)),new(a())(c().inputOutput,"readInterval",new(p().SFTime)(.1)),new(a())(c().inputOutput,"receivedPower",new(p().SFFloat)),new(a())(c().inputOutput,"receiverState",new(p().SFInt32)),new(a())(c().inputOutput,"rtpHeaderExpected",new(p().SFBool)),new(a())(c().inputOutput,"siteID",new(p().SFInt32)),new(a())(c().inputOutput,"transmitterApplicationID",new(p().SFInt32)),new(a())(c().inputOutput,"transmitterEntityID",new(p().SFInt32)),new(a())(c().inputOutput,"transmitterRadioID",new(p().SFInt32)),new(a())(c().inputOutput,"transmitterSiteID",new(p().SFInt32)),new(a())(c().inputOutput,"whichGeometry",new(p().SFInt32)(1)),new(a())(c().inputOutput,"writeInterval",new(p().SFTime)(1)),new(a())(c().outputOnly,"isNetworkReader",new(p().SFBool)),new(a())(c().outputOnly,"isNetworkWriter",new(p().SFBool)),new(a())(c().outputOnly,"isRtpHeaderHeard",new(p().SFBool)),new(a())(c().outputOnly,"isStandAlone",new(p().SFBool)),new(a())(c().outputOnly,"timestamp",new(p().SFTime)),new(a())(c().inputOutput,"geoCoords",new(p().SFVec3d)),new(a())(c().initializeOnly,"geoSystem",new(p().MFString)("GD","WE"))]),enumerable:!0}});const j=A,C=y().add("ReceiverPdu",j);function k(t){N().call(this,t),R().call(this,t),this.addType(c().SignalPdu),t.getSpecificationVersion()<=3.3&&(this._applicationID=1)}Object.assign(Object.setPrototypeOf(k.prototype,N().prototype),R().prototype,{initialize(){N().prototype.initialize.call(this),R().prototype.initialize.call(this)},getBBox(t,e){return this.isDefaultBBoxSize()?t.set():t.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},dispose(){R().prototype.dispose.call(this),N().prototype.dispose.call(this)}}),Object.defineProperties(k,{...S().getStaticProperties("SignalPdu","DIS",1,"children","3.0"),fieldDefinitions:{value:new(r())([new(a())(c().inputOutput,"metadata",new(p().SFNode)),new(a())(c().inputOutput,"description",new(p().SFString)),new(a())(c().inputOutput,"visible",new(p().SFBool)(!0)),new(a())(c().inputOutput,"bboxDisplay",new(p().SFBool)),new(a())(c().initializeOnly,"bboxSize",new(p().SFVec3f)(-1,-1,-1)),new(a())(c().initializeOnly,"bboxCenter",new(p().SFVec3f)),new(a())(c().inputOutput,"enabled",new(p().SFBool)(!0)),new(a())(c().outputOnly,"isActive",new(p().SFBool)),new(a())(c().inputOutput,"address",new(p().SFString)("localhost")),new(a())(c().inputOutput,"applicationID",new(p().SFInt32)),new(a())(c().inputOutput,"data",new(p().MFInt32)),new(a())(c().inputOutput,"dataLength",new(p().SFInt32)),new(a())(c().inputOutput,"encodingScheme",new(p().SFInt32)),new(a())(c().inputOutput,"entityID",new(p().SFInt32)),new(a())(c().inputOutput,"multicastRelayHost",new(p().SFString)),new(a())(c().inputOutput,"multicastRelayPort",new(p().SFInt32)),new(a())(c().inputOutput,"networkMode",new(p().SFString)("standAlone")),new(a())(c().inputOutput,"port",new(p().SFInt32)),new(a())(c().inputOutput,"radioID",new(p().SFInt32)),new(a())(c().inputOutput,"readInterval",new(p().SFTime)(.1)),new(a())(c().inputOutput,"rtpHeaderExpected",new(p().SFBool)),new(a())(c().inputOutput,"sampleRate",new(p().SFInt32)),new(a())(c().inputOutput,"samples",new(p().SFInt32)),new(a())(c().inputOutput,"siteID",new(p().SFInt32)),new(a())(c().inputOutput,"tdlType",new(p().SFInt32)),new(a())(c().inputOutput,"whichGeometry",new(p().SFInt32)(1)),new(a())(c().inputOutput,"writeInterval",new(p().SFTime)(1)),new(a())(c().outputOnly,"isNetworkReader",new(p().SFBool)),new(a())(c().outputOnly,"isNetworkWriter",new(p().SFBool)),new(a())(c().outputOnly,"isRtpHeaderHeard",new(p().SFBool)),new(a())(c().outputOnly,"isStandAlone",new(p().SFBool)),new(a())(c().outputOnly,"timestamp",new(p().SFTime)),new(a())(c().inputOutput,"geoCoords",new(p().SFVec3d)),new(a())(c().initializeOnly,"geoSystem",new(p().MFString)("GD","WE"))]),enumerable:!0}});const H=k,X=y().add("SignalPdu",H);function G(t){N().call(this,t),R().call(this,t),this.addType(c().TransmitterPdu),t.getSpecificationVersion()<=3.3&&(this._applicationID=1)}Object.assign(Object.setPrototypeOf(G.prototype,N().prototype),R().prototype,{initialize(){N().prototype.initialize.call(this),R().prototype.initialize.call(this)},getBBox(t,e){return this.isDefaultBBoxSize()?t.set():t.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},dispose(){R().prototype.dispose.call(this),N().prototype.dispose.call(this)}}),Object.defineProperties(G,{...S().getStaticProperties("TransmitterPdu","DIS",1,"children","3.0"),fieldDefinitions:{value:new(r())([new(a())(c().inputOutput,"metadata",new(p().SFNode)),new(a())(c().inputOutput,"description",new(p().SFString)),new(a())(c().inputOutput,"visible",new(p().SFBool)(!0)),new(a())(c().inputOutput,"bboxDisplay",new(p().SFBool)),new(a())(c().initializeOnly,"bboxSize",new(p().SFVec3f)(-1,-1,-1)),new(a())(c().initializeOnly,"bboxCenter",new(p().SFVec3f)),new(a())(c().inputOutput,"enabled",new(p().SFBool)(!0)),new(a())(c().outputOnly,"isActive",new(p().SFBool)),new(a())(c().inputOutput,"address",new(p().SFString)("localhost")),new(a())(c().inputOutput,"antennaLocation",new(p().SFVec3f)),new(a())(c().inputOutput,"antennaPatternLength",new(p().SFInt32)),new(a())(c().inputOutput,"antennaPatternType",new(p().SFInt32)),new(a())(c().inputOutput,"applicationID",new(p().SFInt32)),new(a())(c().inputOutput,"cryptoKeyID",new(p().SFInt32)),new(a())(c().inputOutput,"cryptoSystem",new(p().SFInt32)),new(a())(c().inputOutput,"entityID",new(p().SFInt32)),new(a())(c().inputOutput,"frequency",new(p().SFInt32)),new(a())(c().inputOutput,"inputSource",new(p().SFInt32)),new(a())(c().inputOutput,"lengthOfModulationParameters",new(p().SFInt32)),new(a())(c().inputOutput,"modulationTypeDetail",new(p().SFInt32)),new(a())(c().inputOutput,"modulationTypeMajor",new(p().SFInt32)),new(a())(c().inputOutput,"modulationTypeSpreadSpectrum",new(p().SFInt32)),new(a())(c().inputOutput,"modulationTypeSystem",new(p().SFInt32)),new(a())(c().inputOutput,"multicastRelayHost",new(p().SFString)),new(a())(c().inputOutput,"multicastRelayPort",new(p().SFInt32)),new(a())(c().inputOutput,"networkMode",new(p().SFString)("standAlone")),new(a())(c().inputOutput,"port",new(p().SFInt32)),new(a())(c().inputOutput,"power",new(p().SFFloat)),new(a())(c().inputOutput,"radioEntityTypeCategory",new(p().SFInt32)),new(a())(c().inputOutput,"radioEntityTypeCountry",new(p().SFInt32)),new(a())(c().inputOutput,"radioEntityTypeDomain",new(p().SFInt32)),new(a())(c().inputOutput,"radioEntityTypeKind",new(p().SFInt32)),new(a())(c().inputOutput,"radioEntityTypeNomenclature",new(p().SFInt32)),new(a())(c().inputOutput,"radioEntityTypeNomenclatureVersion",new(p().SFInt32)),new(a())(c().inputOutput,"radioID",new(p().SFInt32)),new(a())(c().inputOutput,"readInterval",new(p().SFTime)(.1)),new(a())(c().inputOutput,"relativeAntennaLocation",new(p().SFVec3f)),new(a())(c().inputOutput,"rtpHeaderExpected",new(p().SFBool)),new(a())(c().inputOutput,"siteID",new(p().SFInt32)),new(a())(c().inputOutput,"transmitFrequencyBandwidth",new(p().SFFloat)),new(a())(c().inputOutput,"transmitState",new(p().SFInt32)),new(a())(c().inputOutput,"whichGeometry",new(p().SFInt32)(1)),new(a())(c().inputOutput,"writeInterval",new(p().SFTime)(1)),new(a())(c().outputOnly,"isNetworkReader",new(p().SFBool)),new(a())(c().outputOnly,"isNetworkWriter",new(p().SFBool)),new(a())(c().outputOnly,"isRtpHeaderHeard",new(p().SFBool)),new(a())(c().outputOnly,"isStandAlone",new(p().SFBool)),new(a())(c().outputOnly,"timestamp",new(p().SFTime)),new(a())(c().inputOutput,"geoCoords",new(p().SFVec3d)),new(a())(c().initializeOnly,"geoSystem",new(p().MFString)("GD","WE"))]),enumerable:!0}});const W=G,L=y().add("TransmitterPdu",W);i().add({name:"DIS",concreteNodes:[g,v,E,C,X,L],abstractNodes:[]});y().add("DISComponent",void 0)})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v15.1.
|
|
1
|
+
/* X_ITE v15.1.9 */
|
|
2
2
|
const e=window[Symbol.for("X_ITE.X3D")];(()=>{const t={n:e=>{const i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{if(Array.isArray(i))for(var n=0;n<i.length;){var o=i[n++],s=i[n++];t.o(e,o)?0===s&&n++:0===s?Object.defineProperty(e,o,{enumerable:!0,value:i[n++]}):Object.defineProperty(e,o,{enumerable:!0,get:s})}else for(var o in i)t.o(i,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},i=e.Components;var n=t.n(i);const o=e.Fields;var s=t.n(o);const r=e.X3DFieldDefinition;var a=t.n(r);const l=e.FieldDefinitionArray;var p=t.n(l);const u=e.X3DNode;var d=t.n(u);const c=e.X3DChildNode;var _=t.n(c);const h=e.X3DConstants;var g=t.n(h);const y=e.Namespace;var w=t.n(y);function O(e){_().call(this,e),this.addType(g().BooleanFilter)}Object.assign(Object.setPrototypeOf(O.prototype,_().prototype),{initialize(){_().prototype.initialize.call(this),this._set_boolean.addInterest("set_boolean__",this)},set_boolean__(){const e=this._set_boolean.getValue();e?this._inputTrue=!0:this._inputFalse=!1,this._inputNegate=!e}}),Object.defineProperties(O,{...d().getStaticProperties("BooleanFilter","EventUtilities",1,"children","3.0"),fieldDefinitions:{value:new(p())([new(a())(g().inputOutput,"metadata",new(s().SFNode)),new(a())(g().inputOnly,"set_boolean",new(s().SFBool)),new(a())(g().outputOnly,"inputTrue",new(s().SFBool)),new(a())(g().outputOnly,"inputFalse",new(s().SFBool)),new(a())(g().outputOnly,"inputNegate",new(s().SFBool))]),enumerable:!0}});const b=O,f=w().add("BooleanFilter",b),S=e.Algorithm;var F=t.n(S);function v(e){_().call(this,e),this.addType(g().X3DSequencerNode),this.index=-1}Object.assign(Object.setPrototypeOf(v.prototype,_().prototype),{initialize(){_().prototype.initialize.call(this),this._set_fraction.addInterest("set_fraction__",this),this._previous.addInterest("set_previous__",this),this._next.addInterest("set_next__",this),this._key.addInterest("set_index__",this)},set_fraction__(){const e=this._set_fraction.getValue(),t=this._key,i=t.length;if(0===i)return;let n=0;if(1===i||e<=t[0])n=0;else if(e>=t[i-1])n=this.getSize()-1;else{n=F().upperBound(t,0,i,e)-1}n!==this.index&&n<this.getSize()&&this.sequence(this.index=n)},set_previous__(){this._previous.getValue()&&(this.index<=0?this.index=this.getSize()-1:--this.index,this.index<this.getSize()&&this.sequence(this.index))},set_next__(){this._next.getValue()&&(this.index>=this.getSize()-1?this.index=0:++this.index,this.index<this.getSize()&&this.sequence(this.index))},set_index__(){this.index=-1}}),Object.defineProperties(v,d().getStaticProperties("X3DSequencerNode","EventUtilities",1));const T=v,m=w().add("X3DSequencerNode",T);function P(e){m.call(this,e),this.addType(g().BooleanSequencer)}Object.assign(Object.setPrototypeOf(P.prototype,m.prototype),{initialize(){m.prototype.initialize.call(this),this._keyValue.addInterest("set_index__",this)},getSize(){return this._keyValue.length},sequence(e){this._value_changed=this._keyValue[e]}}),Object.defineProperties(P,{...d().getStaticProperties("BooleanSequencer","EventUtilities",1,"children","3.0"),fieldDefinitions:{value:new(p())([new(a())(g().inputOutput,"metadata",new(s().SFNode)),new(a())(g().inputOnly,"set_fraction",new(s().SFFloat)),new(a())(g().inputOnly,"previous",new(s().SFBool)),new(a())(g().inputOnly,"next",new(s().SFBool)),new(a())(g().inputOutput,"key",new(s().MFFloat)),new(a())(g().inputOutput,"keyValue",new(s().MFBool)),new(a())(g().outputOnly,"value_changed",new(s().SFBool))]),enumerable:!0}});const j=P,B=w().add("BooleanSequencer",j);function x(e){_().call(this,e),this.addType(g().BooleanToggle)}Object.assign(Object.setPrototypeOf(x.prototype,_().prototype),{initialize(){_().prototype.initialize.call(this),this._set_boolean.addInterest("set_boolean__",this)},set_boolean__(){this._set_boolean.getValue()&&(this._toggle=!this._toggle.getValue())}}),Object.defineProperties(x,{...d().getStaticProperties("BooleanToggle","EventUtilities",1,"children","3.0"),fieldDefinitions:{value:new(p())([new(a())(g().inputOutput,"metadata",new(s().SFNode)),new(a())(g().inputOnly,"set_boolean",new(s().SFBool)),new(a())(g().inputOutput,"toggle",new(s().SFBool))]),enumerable:!0}});const z=x,I=w().add("BooleanToggle",z);function D(e){_().call(this,e),this.addType(g().X3DTriggerNode)}Object.setPrototypeOf(D.prototype,_().prototype),Object.defineProperties(D,d().getStaticProperties("X3DTriggerNode","EventUtilities",1));const N=D,V=w().add("X3DTriggerNode",N);function q(e){V.call(this,e),this.addType(g().BooleanTrigger)}Object.assign(Object.setPrototypeOf(q.prototype,V.prototype),{initialize(){V.prototype.initialize.call(this),this._set_triggerTime.addInterest("set_triggerTime__",this)},set_triggerTime__(){this._triggerTrue=!0}}),Object.defineProperties(q,{...d().getStaticProperties("BooleanTrigger","EventUtilities",1,"children","3.0"),fieldDefinitions:{value:new(p())([new(a())(g().inputOutput,"metadata",new(s().SFNode)),new(a())(g().inputOnly,"set_triggerTime",new(s().SFTime)),new(a())(g().outputOnly,"triggerTrue",new(s().SFBool))]),enumerable:!0}});const k=q,E=w().add("BooleanTrigger",k);function X(e){m.call(this,e),this.addType(g().IntegerSequencer)}Object.assign(Object.setPrototypeOf(X.prototype,m.prototype),{initialize(){m.prototype.initialize.call(this),this._keyValue.addInterest("set_index__",this)},getSize(){return this._keyValue.length},sequence(e){this._value_changed=this._keyValue[e]}}),Object.defineProperties(X,{...d().getStaticProperties("IntegerSequencer","EventUtilities",1,"children","3.0"),fieldDefinitions:{value:new(p())([new(a())(g().inputOutput,"metadata",new(s().SFNode)),new(a())(g().inputOnly,"set_fraction",new(s().SFFloat)),new(a())(g().inputOnly,"previous",new(s().SFBool)),new(a())(g().inputOnly,"next",new(s().SFBool)),new(a())(g().inputOutput,"key",new(s().MFFloat)),new(a())(g().inputOutput,"keyValue",new(s().MFInt32)),new(a())(g().outputOnly,"value_changed",new(s().SFInt32))]),enumerable:!0}});const U=X,C=w().add("IntegerSequencer",U);function M(e){V.call(this,e),this.addType(g().IntegerTrigger)}Object.assign(Object.setPrototypeOf(M.prototype,V.prototype),{initialize(){V.prototype.initialize.call(this),this._set_boolean.addInterest("set_boolean__",this)},set_boolean__(){this._triggerValue=this._integerKey}}),Object.defineProperties(M,{...d().getStaticProperties("IntegerTrigger","EventUtilities",1,"children","3.0"),fieldDefinitions:{value:new(p())([new(a())(g().inputOutput,"metadata",new(s().SFNode)),new(a())(g().inputOnly,"set_boolean",new(s().SFBool)),new(a())(g().inputOutput,"integerKey",new(s().SFInt32)(-1)),new(a())(g().outputOnly,"triggerValue",new(s().SFInt32))]),enumerable:!0}});const A=M,K=w().add("IntegerTrigger",A);function G(e){V.call(this,e),this.addType(g().TimeTrigger)}Object.assign(Object.setPrototypeOf(G.prototype,V.prototype),{initialize(){V.prototype.initialize.call(this),this._set_boolean.addInterest("set_boolean__",this)},set_boolean__(){this._triggerTime=this.getBrowser().getCurrentTime()}}),Object.defineProperties(G,{...d().getStaticProperties("TimeTrigger","EventUtilities",1,"children","3.0"),fieldDefinitions:{value:new(p())([new(a())(g().inputOutput,"metadata",new(s().SFNode)),new(a())(g().inputOnly,"set_boolean",new(s().SFBool)),new(a())(g().outputOnly,"triggerTime",new(s().SFTime))]),enumerable:!0}});const H=G,J=w().add("TimeTrigger",H);n().add({name:"EventUtilities",concreteNodes:[f,B,I,E,C,K,J],abstractNodes:[m,V]});w().add("EventUtilitiesComponent",void 0)})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* X_ITE v15.1.
|
|
1
|
+
/* X_ITE v15.1.9 */
|
|
2
2
|
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D")];
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ "use strict";
|
|
@@ -150,7 +150,7 @@ precision highp int;precision highp float;precision highp sampler2D;precision hi
|
|
|
150
150
|
#if defined(X3D_XR_SESSION)
|
|
151
151
|
uniform mat4 x3d_EyeMatrix;
|
|
152
152
|
#endif
|
|
153
|
-
uniform vec2 x3d_FocalLength;uniform sampler2D x3d_PositionsTexture;uniform sampler2D x3d_ScalesTexture;uniform mediump sampler2D x3d_OrientationsTexture;uniform mediump sampler2D x3d_OpacitiesTexture;
|
|
153
|
+
uniform int x3d_ViewpointType;uniform vec2 x3d_FocalLength;uniform sampler2D x3d_PositionsTexture;uniform sampler2D x3d_ScalesTexture;uniform mediump sampler2D x3d_OrientationsTexture;uniform mediump sampler2D x3d_OpacitiesTexture;
|
|
154
154
|
#if!defined(X3D_POINTING_PASS)&&!defined(X3D_DEPTH_PASS)
|
|
155
155
|
uniform mediump sampler2DArray x3d_SphericalHarmonicsTexture;
|
|
156
156
|
#endif
|
|
@@ -173,7 +173,7 @@ const float SH_C3_0=-.5900435899266435;const float SH_C3_1=2.890611442640554;con
|
|
|
173
173
|
#endif
|
|
174
174
|
#endif
|
|
175
175
|
#endif
|
|
176
|
-
mat3 computeCov3D(const in vec4 rotation,const in vec3 scale){float qx=rotation.x;float qy=rotation.y;float qz=rotation.z;float qw=-rotation.w;float yy=qy*qy;float zz=qz*qz;float xy=qx*qy;float zw=qz*qw;float xz=qx*qz;float yw=qy*qw;float xx=qx*qx;float yz=qy*qz;float xw=qx*qw;mat3 R=mat3(1.-2.*(yy+zz),2.*(xy+zw),2.*(xz-yw),2.*(xy-zw),1.-2.*(zz+xx),2.*(yz+xw),2.*(xz+yw),2.*(yz-xw),1.-2.*(yy+xx));mat3 S=mat3(scale.x,0.,0.,0.,scale.y,0.,0.,0.,scale.z);mat3 M=S*R;mat3 Sigma=transpose(M)*M;return Sigma;}vec3 computeCov2D(const in vec3 viewSplatCenter,const in mat3 cov3D){float x=viewSplatCenter.x;float y=viewSplatCenter.y;float z=viewSplatCenter.z;float zz=z*z;
|
|
176
|
+
mat3 computeCov3D(const in vec4 rotation,const in vec3 scale){float qx=rotation.x;float qy=rotation.y;float qz=rotation.z;float qw=-rotation.w;float yy=qy*qy;float zz=qz*qz;float xy=qx*qy;float zw=qz*qw;float xz=qx*qz;float yw=qy*qw;float xx=qx*qx;float yz=qy*qz;float xw=qx*qw;mat3 R=mat3(1.-2.*(yy+zz),2.*(xy+zw),2.*(xz-yw),2.*(xy-zw),1.-2.*(zz+xx),2.*(yz+xw),2.*(xz+yw),2.*(yz-xw),1.-2.*(yy+xx));mat3 S=mat3(scale.x,0.,0.,0.,scale.y,0.,0.,0.,scale.z);mat3 M=S*R;mat3 Sigma=transpose(M)*M;return Sigma;}vec3 computeCov2D(const in vec3 viewSplatCenter,const in mat3 cov3D){mat3 J;if(x3d_ViewpointType==0){float x=viewSplatCenter.x;float y=viewSplatCenter.y;float z=viewSplatCenter.z;float zz=z*z;J=mat3(x3d_FocalLength.x/z,0.,-(x3d_FocalLength.x*x)/zz,0.,x3d_FocalLength.y/z,-(x3d_FocalLength.y*y)/zz,0.,0.,0.);}else{J=mat3(x3d_FocalLength.x,0.,0.,0.,x3d_FocalLength.y,0.,0.,0.,0.);}mat3 W=transpose(mat3(x3d_ModelViewMatrix));mat3 T=W*J;mat3 cov=transpose(T)*cov3D*T;cov[0][0]+=.3;cov[1][1]+=.3;return vec3(cov[0][0],cov[0][1],cov[1][1]);}
|
|
177
177
|
#if!defined(X3D_POINTING_PASS)&&!defined(X3D_DEPTH_PASS)
|
|
178
178
|
vec3 computeColorFromSH(const in ivec2 texelCoord,const in vec3 splatCenter){vec3 sh0=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,0),0).rgb;
|
|
179
179
|
#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_1
|
|
@@ -588,6 +588,9 @@ Object .assign (Object .setPrototypeOf (GaussianSplatsShape .prototype, (externa
|
|
|
588
588
|
|
|
589
589
|
gl .uniform4i (shaderNode .x3d_Viewport, ... viewport);
|
|
590
590
|
|
|
591
|
+
// Set uniform 0 for perspective and 1 for ortho viewpoint.
|
|
592
|
+
gl .uniform1i (shaderNode .x3d_ViewpointType, projectionMatrixArray [15]);
|
|
593
|
+
|
|
591
594
|
// The projection matrix stores the focal length in the first and second element of the diagonal.
|
|
592
595
|
// We need to convert from NDC space to screen space, which is done by multiplying with the
|
|
593
596
|
// framebuffer dimensions and dividing by 2, since NDC goes from -1 to 1.
|
|
@@ -654,6 +657,9 @@ Object .assign (Object .setPrototypeOf (GaussianSplatsShape .prototype, (externa
|
|
|
654
657
|
gl .uniformMatrix4fv (shaderNode .x3d_EyeMatrix, false, renderObject .getEyeMatrixArray ());
|
|
655
658
|
gl .uniformMatrix4fv (shaderNode .x3d_ModelViewMatrix, false, modelViewMatrix);
|
|
656
659
|
|
|
660
|
+
// Set uniform 0 for perspective and 1 for ortho viewpoint.
|
|
661
|
+
gl .uniform1i (shaderNode .x3d_ViewpointType, projectionMatrixArray [15]);
|
|
662
|
+
|
|
657
663
|
// The projection matrix stores the focal length in the first and second element of the diagonal.
|
|
658
664
|
// We need to convert from NDC space to screen space, which is done by multiplying with the
|
|
659
665
|
// framebuffer dimensions and dividing by 2, since NDC goes from -1 to 1.
|
|
@@ -750,6 +756,7 @@ Object .assign (Object .setPrototypeOf (GaussianSplatsShape .prototype, (externa
|
|
|
750
756
|
"x3d_ScalesTexture",
|
|
751
757
|
"x3d_OpacitiesTexture",
|
|
752
758
|
"x3d_SphericalHarmonicsTexture",
|
|
759
|
+
"x3d_ViewpointType",
|
|
753
760
|
"x3d_FocalLength",
|
|
754
761
|
],
|
|
755
762
|
});
|
|
@@ -787,6 +794,7 @@ Object .assign (Object .setPrototypeOf (GaussianSplatsShape .prototype, (externa
|
|
|
787
794
|
"x3d_OrientationsTexture",
|
|
788
795
|
"x3d_ScalesTexture",
|
|
789
796
|
"x3d_OpacitiesTexture",
|
|
797
|
+
"x3d_ViewpointType",
|
|
790
798
|
"x3d_FocalLength",
|
|
791
799
|
],
|
|
792
800
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v15.1.
|
|
2
|
-
const e=window[Symbol.for("X_ITE.X3D")];(()=>{const t={n:e=>{const i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{if(Array.isArray(i))for(var n=0;n<i.length;){var r=i[n++],o=i[n++];t.o(e,r)?0===o&&n++:0===o?Object.defineProperty(e,r,{enumerable:!0,value:i[n++]}):Object.defineProperty(e,r,{enumerable:!0,get:o})}else for(var r in i)t.o(i,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:i[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},i=e.Components;var n=t.n(i);const r=e.Fields;var o=t.n(r);const s=e.X3DFieldDefinition;var a=t.n(s);const d=e.FieldDefinitionArray;var c=t.n(d);const l=e.X3DNode;var x=t.n(l);const _=e.X3DChildNode;var u=t.n(_);const p=e.X3DBoundedObject;var h=t.n(p);const f=e.X3DConstants;var S=t.n(f);const T=e.Namespace;var v=t.n(T);function g(e){u().call(this,e),h().call(this,e),this.addType(S().X3DGaussianSplatsNode)}Object.assign(Object.setPrototypeOf(g.prototype,u().prototype),h().prototype,{initialize(){u().prototype.initialize.call(this),h().prototype.initialize.call(this)},dispose(){h().prototype.dispose.call(this),u().prototype.dispose.call(this)}}),Object.defineProperties(g,x().getStaticProperties("X3DGaussianSplatsNode","GaussianSplats",1));const y=g,m=v().add("X3DGaussianSplatsNode",y),D=e.X3DShapeNode;var C=t.n(D);const b=e.URLs;var w=t.n(b);const E=e.GeometryContext;var F=t.n(E);const A=e.GeometryType;var R=t.n(A);const O=e.AlphaMode;var I=t.n(O);const P=e.VertexArray;var N=t.n(P);const z=e.Matrix4;var X=t.n(z);const U=e.ShaderRegistry;var G=t.n(U);const M=()=>"#version 300 es\nprecision highp int;precision highp float;precision highp sampler2D;precision highp sampler2DArray;uniform ivec4 x3d_Viewport;uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;\n#if defined(X3D_XR_SESSION)\nuniform mat4 x3d_EyeMatrix;\n#endif\nuniform vec2 x3d_FocalLength;uniform sampler2D x3d_PositionsTexture;uniform sampler2D x3d_ScalesTexture;uniform mediump sampler2D x3d_OrientationsTexture;uniform mediump sampler2D x3d_OpacitiesTexture;\n#if!defined(X3D_POINTING_PASS)&&!defined(X3D_DEPTH_PASS)\nuniform mediump sampler2DArray x3d_SphericalHarmonicsTexture;\n#endif\nin vec4 x3d_Vertex;in uint x3d_SplatIndex;out vec4 color;out vec2 coordXY;out vec3 conic;\n#if defined(X3D_CLIP_PLANES)||defined(X3D_FOG)||defined(X3D_POINTING_PASS)\nout vec3 vertex;\n#endif\n#if defined(X3D_POINTING_PASS)\nout vec2 texCoord;\n#endif\n#include<Fog>\n#include<Logarithmic>\nconst float SPLAT_SIGMA=3.;const float SH_C0=.28209479177387814;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_1\nconst float SH_C1_0=-.4886025119029199;const float SH_C1_1=.4886025119029199;const float SH_C1_2=-.4886025119029199;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_2\nconst float SH_C2_0=1.0925484305920792;const float SH_C2_1=-1.0925484305920792;const float SH_C2_2=.31539156525252005;const float SH_C2_3=-1.0925484305920792;const float SH_C2_4=.5462742152960396;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_3\nconst float SH_C3_0=-.5900435899266435;const float SH_C3_1=2.890611442640554;const float SH_C3_2=-.4570457994644658;const float SH_C3_3=.3731763325901154;const float SH_C3_4=-.4570457994644658;const float SH_C3_5=1.445305721320277;const float SH_C3_6=-.5900435899266435;\n#endif\n#endif\n#endif\nmat3 computeCov3D(const in vec4 rotation,const in vec3 scale){float qx=rotation.x;float qy=rotation.y;float qz=rotation.z;float qw=-rotation.w;float yy=qy*qy;float zz=qz*qz;float xy=qx*qy;float zw=qz*qw;float xz=qx*qz;float yw=qy*qw;float xx=qx*qx;float yz=qy*qz;float xw=qx*qw;mat3 R=mat3(1.-2.*(yy+zz),2.*(xy+zw),2.*(xz-yw),2.*(xy-zw),1.-2.*(zz+xx),2.*(yz+xw),2.*(xz+yw),2.*(yz-xw),1.-2.*(yy+xx));mat3 S=mat3(scale.x,0.,0.,0.,scale.y,0.,0.,0.,scale.z);mat3 M=S*R;mat3 Sigma=transpose(M)*M;return Sigma;}vec3 computeCov2D(const in vec3 viewSplatCenter,const in mat3 cov3D){float x=viewSplatCenter.x;float y=viewSplatCenter.y;float z=viewSplatCenter.z;float zz=z*z;mat3 J=mat3(x3d_FocalLength.x/z,0.,-(x3d_FocalLength.x*x)/zz,0.,x3d_FocalLength.y/z,-(x3d_FocalLength.y*y)/zz,0.,0.,0.);mat3 W=transpose(mat3(x3d_ModelViewMatrix));mat3 T=W*J;mat3 cov=transpose(T)*cov3D*T;cov[0][0]+=.3;cov[1][1]+=.3;return vec3(cov[0][0],cov[0][1],cov[1][1]);}\n#if!defined(X3D_POINTING_PASS)&&!defined(X3D_DEPTH_PASS)\nvec3 computeColorFromSH(const in ivec2 texelCoord,const in vec3 splatCenter){vec3 sh0=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,0),0).rgb;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_1\nvec3 sh1_0=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,1),0).rgb;vec3 sh1_1=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,2),0).rgb;vec3 sh1_2=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,3),0).rgb;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_2\nvec3 sh2_0=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,4),0).rgb;vec3 sh2_1=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,5),0).rgb;vec3 sh2_2=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,6),0).rgb;vec3 sh2_3=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,7),0).rgb;vec3 sh2_4=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,8),0).rgb;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_3\nvec3 sh3_0=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,9),0).rgb;vec3 sh3_1=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,10),0).rgb;vec3 sh3_2=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,11),0).rgb;vec3 sh3_3=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,12),0).rgb;vec3 sh3_4=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,13),0).rgb;vec3 sh3_5=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,14),0).rgb;vec3 sh3_6=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,15),0).rgb;\n#endif\n#endif\n#endif\nvec3 color=sh0*SH_C0;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_1\nvec3 x3d_Camera=inverse(x3d_ModelViewMatrix)[3].xyz;vec3 viewDir=normalize(splatCenter-x3d_Camera);float x=viewDir.x;float y=viewDir.y;float z=viewDir.z;color+=SH_C1_1*(-y*sh1_0+z*sh1_1-x*sh1_2);\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_2\nfloat xx=x*x;float yy=y*y;float zz=z*z;float xy=x*y;float yz=y*z;float xz=x*z;color+=SH_C2_0*xy*sh2_0+SH_C2_1*yz*sh2_1+SH_C2_2*(2.*zz-xx-yy)*sh2_2+SH_C2_3*xz*sh2_3+SH_C2_4*(xx-yy)*sh2_4;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_3\ncolor+=SH_C3_0*y*(3.*xx-yy)*sh3_0+SH_C3_1*xy*z*sh3_1+SH_C3_2*y*(4.*zz-xx-yy)*sh3_2+SH_C3_3*z*(2.*zz-3.*xx-3.*yy)*sh3_3+SH_C3_4*x*(4.*zz-xx-yy)*sh3_4+SH_C3_5*z*(xx-yy)*sh3_5+SH_C3_6*x*(xx-3.*yy)*sh3_6;\n#endif\n#endif\n#endif\ncolor+=.5;return color;}\n#endif\nvoid main(){uint textureWidth=uint(textureSize(x3d_PositionsTexture,0).x);ivec2 texelCoord=ivec2(x3d_SplatIndex % textureWidth,x3d_SplatIndex/textureWidth);vec3 splatCenter=texelFetch(x3d_PositionsTexture,texelCoord,0).xyz;vec4 viewSplatCenter=x3d_ModelViewMatrix*vec4(splatCenter,1.);\n#if defined(X3D_XR_SESSION)\nviewSplatCenter=x3d_EyeMatrix*viewSplatCenter;\n#endif\nvec4 clipSplatCenter=x3d_ProjectionMatrix*viewSplatCenter;clipSplatCenter/=clipSplatCenter.w;if(any(greaterThan(abs(clipSplatCenter.xyz),vec3(1.3)))){gl_Position=vec4(0.,0.,2.,1.);return;}vec4 splatOrientation=texelFetch(x3d_OrientationsTexture,texelCoord,0);vec3 splatScale=texelFetch(x3d_ScalesTexture,texelCoord,0).xyz;float opacity=texelFetch(x3d_OpacitiesTexture,texelCoord,0).r;mat3 cov3d=computeCov3D(normalize(splatOrientation),splatScale);vec3 cov2d=computeCov2D(viewSplatCenter.xyz/viewSplatCenter.w,cov3d);float a=cov2d.x;float b=cov2d.y;float c=cov2d.z;float det=a*c-b*b;if(det==0.){gl_Position=vec4(0.,0.,2.,1.);return;}conic=vec3(c,-b,a)/det;vec2 quadPixelSize=SPLAT_SIGMA*sqrt(vec2(a,c));vec2 quadNdcSize=quadPixelSize/vec2(x3d_Viewport.zw)*2.;clipSplatCenter.xy+=x3d_Vertex.xy*quadNdcSize;float minScreen=float(min(x3d_Viewport.z,x3d_Viewport.w));float maxQuadSize=max(quadPixelSize.x,quadPixelSize.y);if(maxQuadSize>minScreen){gl_Position=vec4(0.,0.,2.,1.);return;}coordXY=x3d_Vertex.xy*quadPixelSize;gl_Position=clipSplatCenter;\n#if defined(X3D_CLIP_PLANES)||defined(X3D_FOG)||defined(X3D_POINTING_PASS)\nvec4 invClipSplatCenter=inverse(x3d_ProjectionMatrix)*clipSplatCenter;vertex=invClipSplatCenter.xyz/invClipSplatCenter.w;\n#endif\n#if defined(X3D_POINTING_PASS)\ntexCoord=(x3d_Vertex.xy+1.)/2.;\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\nlogarithmic(gl_Position);\n#endif\n#if defined(X3D_POINTING_PASS)||defined(X3D_DEPTH_PASS)\ncolor=vec4(vec3(0),opacity);\n#else\ncolor=vec4(computeColorFromSH(texelCoord,splatCenter),opacity);\n#endif\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nfog();\n#endif\n}",H=v().add("GaussianSplats.vs",M),B=()=>"#version 300 es\nprecision highp int;precision highp float;precision highp sampler2D;in vec4 color;in vec2 coordXY;in vec3 conic;\n#if defined(X3D_CLIP_PLANES)||defined(X3D_FOG)||defined(X3D_POINTING_PASS)\nin vec3 vertex;\n#endif\n#if defined(X3D_POINTING_PASS)\nin vec2 texCoord;\n#endif\n#if defined(X3D_POINTING_PASS)\nuniform float x3d_Id;layout(location=0)out vec4 x3d_FragData0;layout(location=1)out vec4 x3d_FragData1;layout(location=2)out vec4 x3d_FragData2;\n#elif defined(X3D_DEPTH_PASS)\nuniform int x3d_Id;layout(location=0)out vec4 x3d_FragData0;\n#if defined(X3D_NORMAL_BUFFER)\nlayout(location=1)out vec4 x3d_FragData1;\n#endif\n#else\n#if!defined(X3D_ORDER_INDEPENDENT_TRANSPARENCY)\nout vec4 x3d_FragColor;\n#endif\n#endif\n#include<ToneMapping>\n#include<ClipPlanes>\n#include<Fog>\n#include<OIT>\n#include<Logarithmic>\nvoid main(){\n#if defined(X3D_CLIP_PLANES)\nclip();\n#endif\nfloat exponent=-.5*(conic.x*coordXY.x*coordXY.x+conic.z*coordXY.y*coordXY.y)-conic.y*coordXY.x*coordXY.y;if(exponent>0.)discard;float alpha=min(.99,exp(exponent)*color.a);if(alpha<1./255.)discard;\n#if defined(X3D_POINTING_PASS)\nx3d_FragData0=vec4(vertex,x3d_Id);x3d_FragData1=vec4(0.,0.,1.,0.);x3d_FragData2=vec4(texCoord,0.,1.);\n#elif defined(X3D_DEPTH_PASS)\n#if defined(X3D_NORMAL_BUFFER)\nx3d_FragData0=vec4(gl_FragCoord.z,vec3(x3d_Id));x3d_FragData1=vec4(0.,0.,1.,float(gl_FrontFacing));\n#else\nx3d_FragData0=vec4(vec3(gl_FragCoord.z),1.);\n#endif\n#else\nvec4 finalColor=vec4(color.rgb,alpha);\n#if defined(X3D_FOG)\nfinalColor.rgb=getFogColor(finalColor.rgb);\n#endif\nfinalColor.rgb=toneMap(finalColor.rgb);\n#if defined(X3D_ORDER_INDEPENDENT_TRANSPARENCY)\noit(finalColor);\n#else\nx3d_FragColor=finalColor;\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\nlogarithmic();\n#endif\n#endif\n}",L=v().add("GaussianSplats.fs",B);G().addVertexShader("GaussianSplats",H),G().addFragmentShader("GaussianSplats",L);const V=[1,3,5,7],q=new Float32Array([-1,-1,0,1,1,-1,0,1,1,1,0,1,-1,-1,0,1,1,1,0,1,-1,1,0,1]);function j(e,t){C().call(this,e),this.addChildObjects(S().outputOnly,"rebuild",new(o().SFTime)),this.node=t,this.shaderCache=this.getBrowser().getShaders(),this.currentModelViewMatrix=new Float32Array(16),this.sortModelViewMatrix=new Float32Array(16),this.clipPlanes=[]}Object.assign(Object.setPrototypeOf(j.prototype,C().prototype),{initialize(){C().prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();this.geometryContext=new(F()),this.geometryBuffer=t.createBuffer(),this.splatsIndexBuffer=t.createBuffer(),this.vertexArrayObject=new(N())(t),t.bindBuffer(t.ARRAY_BUFFER,this.geometryBuffer),t.bufferData(t.ARRAY_BUFFER,q,t.DYNAMIC_DRAW),this.positionsTexture=this.createTexture(),this.orientationsTexture=this.createTexture(),this.scalesTexture=this.createTexture(),this.sphericalHarmonicsTexture=this.createTexture(t.TEXTURE_2D_ARRAY),this.opacitiesTexture=this.createTexture(),this.positionsTextureUnit=e.popTextureUnit(),this.orientationsTextureUnit=e.popTextureUnit(),this.scalesTextureUnit=e.popTextureUnit(),this.sphericalHarmonicsTextureUnit=e.popTextureUnit(),this.opacitiesTextureUnit=e.popTextureUnit(),e.resetTextureUnits(),this.node._colorSpace.addInterest("set_key__",this),this.node._positions.addInterest("requestRebuild",this),this.node._orientations.addInterest("requestRebuild",this),this.node._scales.addInterest("requestRebuild",this),this.node._opacities.addInterest("requestRebuild",this);for(const[e,t]of V.entries())for(let i=0;i<t;++i)this.node.getField(`sphericalHarmonicsDegree${e}Coef${i}`).addInterest("requestRebuild",this);this._rebuild.addInterest("rebuild",this),this.rebuild()},getShapeKey(){return this.key},getGeometryContext(){return this.geometryContext},getGeometryType:()=>R().POINT,getNumInstances(){return this.numSplats},set_key__(){let e="GS";if(e+=this.degrees,"LIN_REC709_DISPLAY"===this.node._colorSpace.getValue())e+=1;else e+=0;this.key=e},set_bbox__(){const e=this.bbox;this.isDefaultBBoxSize()?e.setArray(this.node._positions.shrinkToFit()):e.set(this._bboxSize.getValue(),this._bboxCenter.getValue()),this.getBBoxSize().assign(e.size),this.getBBoxCenter().assign(e.center)},set_geometry__(){},set_transparent__(){this.setTransparent(!0),this.setAlphaMode(I().BLEND)},createTexture(e){const t=this.getBrowser().getContext(),i=t.createTexture();return e??=t.TEXTURE_2D,t.bindTexture(e,i),t.texParameteri(e,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(e,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),i},requestRebuild(){this._rebuild=Date.now()/1e3},rebuild(){const e=this.getBrowser().getContext(),t=this.node._positions.length;this.numSplats=t,e.bindBuffer(e.ARRAY_BUFFER,this.splatsIndexBuffer),e.bufferData(e.ARRAY_BUFFER,new Uint32Array(Array(t).keys()),e.DYNAMIC_DRAW);const i=Math.ceil(Math.sqrt(t));if(i){const n=i*i,r=new Float32Array(3*n),o=new Float32Array(4*n),s=new Float32Array(3*n),a=new Float32Array(n);r.set(this.node._positions.getValue().subarray(0,3*t)),o.set(this.node._orientations.getValue().subarray(0,4*t)),s.set(this.node._scales.getValue().subarray(0,3*t)),a.set(this.node._opacities.getValue().subarray(0,t)),this.degrees=-1;for(const[e,t]of V.entries()){if(!Array.from({length:t},(t,i)=>this.node.getField(`sphericalHarmonicsDegree${e}Coef${i}`).length).every(e=>e))break;++this.degrees}const d=(this.degrees+1)**2,c=new Float32Array(3*n*d);let l=0;for(const[e,i]of V.entries()){if(e>this.degrees)break;for(let r=0;r<i;++r){const i=this.node.getField(`sphericalHarmonicsDegree${e}Coef${r}`).getValue();c.set(i.subarray(0,3*t),l),l+=3*n}}e.bindTexture(e.TEXTURE_2D,this.positionsTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGB32F,i,i,0,e.RGB,e.FLOAT,r),e.bindTexture(e.TEXTURE_2D,this.orientationsTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA16F,i,i,0,e.RGBA,e.FLOAT,o),e.bindTexture(e.TEXTURE_2D,this.scalesTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGB32F,i,i,0,e.RGB,e.FLOAT,s),e.bindTexture(e.TEXTURE_2D,this.opacitiesTexture),e.texImage2D(e.TEXTURE_2D,0,e.R16F,i,i,0,e.RED,e.FLOAT,a),d&&(e.bindTexture(e.TEXTURE_2D_ARRAY,this.sphericalHarmonicsTexture),e.texImage3D(e.TEXTURE_2D_ARRAY,0,e.RGB16F,i,i,d,0,e.RGB,e.FLOAT,c))}this.initSortWorker(),this.set_key__(),this.set_bbox__(),this.set_objects__()},displaySimple(e,t,i){const{renderObject:n,viewport:r}=t,o=n.getProjectionMatrixArray();e.uniform4i(i.x3d_Viewport,...r),e.uniform2f(i.x3d_FocalLength,o[0]*r[2]*.5,o[5]*r[3]*.5),e.activeTexture(e.TEXTURE0+this.positionsTextureUnit),e.bindTexture(e.TEXTURE_2D,this.positionsTexture),e.activeTexture(e.TEXTURE0+this.orientationsTextureUnit),e.bindTexture(e.TEXTURE_2D,this.orientationsTexture),e.activeTexture(e.TEXTURE0+this.scalesTextureUnit),e.bindTexture(e.TEXTURE_2D,this.scalesTexture),e.activeTexture(e.TEXTURE0+this.opacitiesTextureUnit),e.bindTexture(e.TEXTURE_2D,this.opacitiesTexture),this.vertexArrayObject.enable(i.getProgram())&&(e.bindBuffer(e.ARRAY_BUFFER,this.splatsIndexBuffer),e.enableVertexAttribArray(i.x3d_SplatIndex),e.vertexAttribIPointer(i.x3d_SplatIndex,1,e.UNSIGNED_INT,0,0),e.vertexAttribDivisor(i.x3d_SplatIndex,1),i.enableVertexAttribute(e,this.geometryBuffer,0,0)),e.drawArraysInstanced(e.TRIANGLES,0,6,this.numSplats)},display(e,t){const i=this.getShader(t);i.enable(e),i.hasFog(null);const{renderObject:n,viewport:r,modelViewMatrix:o,localObjects:s,fogNode:a}=t,d=n.getProjectionMatrixArray();this.sortIndices(o),i.setClipPlanes(e,s,n),a?.setShaderUniforms(e,i),e.viewport(...r),e.scissor(...r),e.uniform4i(i.x3d_Viewport,...r),e.uniformMatrix4fv(i.x3d_ProjectionMatrix,!1,d),e.uniformMatrix4fv(i.x3d_EyeMatrix,!1,n.getEyeMatrixArray()),e.uniformMatrix4fv(i.x3d_ModelViewMatrix,!1,o),e.uniform2f(i.x3d_FocalLength,d[0]*r[2]*.5,d[5]*r[3]*.5),e.activeTexture(e.TEXTURE0+this.positionsTextureUnit),e.bindTexture(e.TEXTURE_2D,this.positionsTexture),e.activeTexture(e.TEXTURE0+this.orientationsTextureUnit),e.bindTexture(e.TEXTURE_2D,this.orientationsTexture),e.activeTexture(e.TEXTURE0+this.scalesTextureUnit),e.bindTexture(e.TEXTURE_2D,this.scalesTexture),e.activeTexture(e.TEXTURE0+this.opacitiesTextureUnit),e.bindTexture(e.TEXTURE_2D,this.opacitiesTexture),e.activeTexture(e.TEXTURE0+this.sphericalHarmonicsTextureUnit),e.bindTexture(e.TEXTURE_2D_ARRAY,this.sphericalHarmonicsTexture),this.vertexArrayObject.enable(i.getProgram())&&(e.bindBuffer(e.ARRAY_BUFFER,this.splatsIndexBuffer),e.enableVertexAttribArray(i.x3d_SplatIndex),e.vertexAttribIPointer(i.x3d_SplatIndex,1,e.UNSIGNED_INT,0,0),e.vertexAttribDivisor(i.x3d_SplatIndex,1),i.enableVertexAttribute(e,this.geometryBuffer,0,0)),e.frontFace(e.CCW),e.enable(e.CULL_FACE),e.drawArraysInstanced(e.TRIANGLES,0,6,this.numSplats)},getShader(e){const{renderObject:t,fogNode:i,localObjectsKeys:n}=e;let r="";return r+=this.key,r+=t.getRenderKey(),r+=i?.getFogType()??0,r+=n.join(""),this.shaderCache.get(r)??this.createShader(r,e)},createShader(e,t){const i=this.getBrowser(),n=i.getContext(),r=i.getDefaultMaterial().getShaderOptions(this.geometryContext,t).filter(e=>!e.startsWith("X3D_COLORSPACE_"));if("LIN_REC709_DISPLAY"===this.node._colorSpace.getValue())r.push("X3D_COLORSPACE_LINEAR");else r.push("X3D_COLORSPACE_SRGB");for(let e=0;e<=this.degrees;++e)r.push(`X3D_GAUSSIAN_SPLATTING_DEGREE_${e}`);const o=i.createShader({name:"GaussianSplats",vertexShader:"GaussianSplats",fragmentShader:"GaussianSplats",options:r,attributes:["x3d_SplatIndex"],uniforms:["x3d_PositionsTexture","x3d_OrientationsTexture","x3d_ScalesTexture","x3d_OpacitiesTexture","x3d_SphericalHarmonicsTexture","x3d_FocalLength"]});return this.shaderCache.set(e,o),o.enable(n),n.uniform1i(o.x3d_PositionsTexture,this.positionsTextureUnit),n.uniform1i(o.x3d_OrientationsTexture,this.orientationsTextureUnit),n.uniform1i(o.x3d_ScalesTexture,this.scalesTextureUnit),n.uniform1i(o.x3d_OpacitiesTexture,this.opacitiesTextureUnit),n.uniform1i(o.x3d_SphericalHarmonicsTexture,this.sphericalHarmonicsTextureUnit),o},createPointingShader(e){const t=this.getBrowser(),i=t.getContext(),n=t.createShader({name:"GaussianSplatsPointing",vertexShader:"GaussianSplats",fragmentShader:"GaussianSplats",options:e,attributes:["x3d_SplatIndex"],uniforms:["x3d_PositionsTexture","x3d_OrientationsTexture","x3d_ScalesTexture","x3d_OpacitiesTexture","x3d_FocalLength"]});return n.enable(i),i.uniform1i(n.x3d_PositionsTexture,this.positionsTextureUnit),i.uniform1i(n.x3d_OrientationsTexture,this.orientationsTextureUnit),i.uniform1i(n.x3d_ScalesTexture,this.scalesTextureUnit),i.uniform1i(n.x3d_OpacitiesTexture,this.opacitiesTextureUnit),n},createDepthShader(e){return this.createPointingShader(e)},initSortWorker(){if(!this.getBrowser().getBrowserOption("LoadUrlObjects"))return;this.sortWorker?.terminate();const e=`import "${w().getLibraryURL("mkkellogg-sort.worker.js")}";`,t=URL.createObjectURL(new Blob([e],{type:"text/javascript"}));this.sortWorker=new Worker(t,{type:"module"}),URL.revokeObjectURL(t);const i=this.getBrowser(),n=i.getContext();this.sortWorker.onmessage=e=>{switch(this.sortPending=!1,e.data.type){case"ready":this.sortModelViewMatrix.fill(0),i.addBrowserEvent();break;case"sorted":n.bindBuffer(n.ARRAY_BUFFER,this.splatsIndexBuffer),n.bufferData(n.ARRAY_BUFFER,e.data.indices,n.DYNAMIC_DRAW),i.addBrowserEvent();break;case"error":console.error("Sort worker error:",e.data.message)}},this.sortWorker.onerror=e=>{console.error(e),this.sortPending=!1},this.sortWorker.postMessage({type:"init",positions:this.node._positions.getValue().subarray(0,3*this.numSplats),splatCount:this.numSplats}),this.sortPending=!0},sortIndices(e){this.currentModelViewMatrix.set(e),this.sortPending||X().prototype.equals.call(this.currentModelViewMatrix,this.sortModelViewMatrix)||(this.sortModelViewMatrix.set(e),this.sortWorker?.postMessage({type:"sort",viewMatrix:this.sortModelViewMatrix}),this.sortPending=!0)}}),Object.defineProperties(j,{...x().getStaticProperties("GaussianSplatsShape","X_ITE",1,"children","2.0"),fieldDefinitions:{value:new(c())([new(a())(S().inputOutput,"metadata",new(o().SFNode)),new(a())(S().inputOutput,"pointerEvents",new(o().SFBool)(!0)),new(a())(S().inputOutput,"castShadow",new(o().SFBool)(!0)),new(a())(S().inputOutput,"visible",new(o().SFBool)(!0)),new(a())(S().inputOutput,"bboxDisplay",new(o().SFBool)),new(a())(S().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(a())(S().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(a())(S().inputOutput,"appearance",new(o().SFNode)),new(a())(S().inputOutput,"geometry",new(o().SFNode))]),enumerable:!0}});const Y=j,k=v().add("GaussianSplatsShape",Y);function W(e){m.call(this,e),this.addType(S().GaussianSplats),this._positions.setUnit("length"),this.shapeNode=new k(e,this)}Object.assign(Object.setPrototypeOf(W.prototype,m.prototype),{initialize(){m.prototype.initialize.call(this),this._pointerEvents.addFieldInterest(this.shapeNode._pointerEvents),this._castShadow.addFieldInterest(this.shapeNode._castShadow),this._hidden.addFieldInterest(this.shapeNode._hidden),this._visible.addFieldInterest(this.shapeNode._visible),this._bboxDisplay.addFieldInterest(this.shapeNode._bboxDisplay),this._bboxSize.addFieldInterest(this.shapeNode._bboxSize),this._bboxCenter.addFieldInterest(this.shapeNode._bboxCenter),this.shapeNode._pointerEvents=this._pointerEvents,this.shapeNode._hidden=this._hidden,this.shapeNode._visible=this._visible,this.shapeNode._bboxDisplay=this._bboxDisplay,this.shapeNode._bboxSize=this._bboxSize,this.shapeNode._bboxCenter=this._bboxCenter,this.shapeNode.setup()},getInnerNode(){return this.shapeNode},getBBox(e,t){return this.shapeNode.getBBox(e,t)}}),Object.defineProperties(W,{...x().getStaticProperties("GaussianSplats","GaussianSplats",1,"children","4.1"),fieldDefinitions:{value:new(c())([new(a())(S().inputOutput,"metadata",new(o().SFNode)),new(a())(S().inputOutput,"colorSpace",new(o().SFString)("SRGB_REC709_DISPLAY")),new(a())(S().inputOutput,"positions",new(o().MFVec3f)),new(a())(S().inputOutput,"orientations",new(o().MFQuaternion)),new(a())(S().inputOutput,"scales",new(o().MFVec3f)),new(a())(S().inputOutput,"opacities",new(o().MFFloat)),new(a())(S().inputOutput,"sphericalHarmonicsDegree0Coef0",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree1Coef0",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree1Coef1",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree1Coef2",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef0",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef1",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef2",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef3",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef4",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef0",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef1",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef2",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef3",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef4",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef5",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef6",new(o().MFVec3f)),new(a())(S().inputOutput,"pointerEvents",new(o().SFBool)(!0)),new(a())(S().inputOutput,"castShadow",new(o().SFBool)(!0)),new(a())(S().inputOutput,"visible",new(o().SFBool)(!0)),new(a())(S().inputOutput,"bboxDisplay",new(o().SFBool)),new(a())(S().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(a())(S().initializeOnly,"bboxCenter",new(o().SFVec3f))]),enumerable:!0}});const $=W,K=v().add("GaussianSplats",$);n().add({name:"Layout",concreteNodes:[K],abstractNodes:[m]});v().add("GaussianSplatsComponent",void 0)})();
|
|
1
|
+
/* X_ITE v15.1.9 */
|
|
2
|
+
const e=window[Symbol.for("X_ITE.X3D")];(()=>{const t={n:e=>{const i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{if(Array.isArray(i))for(var n=0;n<i.length;){var r=i[n++],o=i[n++];t.o(e,r)?0===o&&n++:0===o?Object.defineProperty(e,r,{enumerable:!0,value:i[n++]}):Object.defineProperty(e,r,{enumerable:!0,get:o})}else for(var r in i)t.o(i,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:i[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},i=e.Components;var n=t.n(i);const r=e.Fields;var o=t.n(r);const s=e.X3DFieldDefinition;var a=t.n(s);const d=e.FieldDefinitionArray;var c=t.n(d);const l=e.X3DNode;var x=t.n(l);const _=e.X3DChildNode;var u=t.n(_);const p=e.X3DBoundedObject;var h=t.n(p);const f=e.X3DConstants;var S=t.n(f);const T=e.Namespace;var v=t.n(T);function g(e){u().call(this,e),h().call(this,e),this.addType(S().X3DGaussianSplatsNode)}Object.assign(Object.setPrototypeOf(g.prototype,u().prototype),h().prototype,{initialize(){u().prototype.initialize.call(this),h().prototype.initialize.call(this)},dispose(){h().prototype.dispose.call(this),u().prototype.dispose.call(this)}}),Object.defineProperties(g,x().getStaticProperties("X3DGaussianSplatsNode","GaussianSplats",1));const y=g,m=v().add("X3DGaussianSplatsNode",y),D=e.X3DShapeNode;var C=t.n(D);const b=e.URLs;var w=t.n(b);const E=e.GeometryContext;var F=t.n(E);const A=e.GeometryType;var R=t.n(A);const O=e.AlphaMode;var I=t.n(O);const P=e.VertexArray;var N=t.n(P);const z=e.Matrix4;var X=t.n(z);const U=e.ShaderRegistry;var G=t.n(U);const M=()=>"#version 300 es\nprecision highp int;precision highp float;precision highp sampler2D;precision highp sampler2DArray;uniform ivec4 x3d_Viewport;uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;\n#if defined(X3D_XR_SESSION)\nuniform mat4 x3d_EyeMatrix;\n#endif\nuniform int x3d_ViewpointType;uniform vec2 x3d_FocalLength;uniform sampler2D x3d_PositionsTexture;uniform sampler2D x3d_ScalesTexture;uniform mediump sampler2D x3d_OrientationsTexture;uniform mediump sampler2D x3d_OpacitiesTexture;\n#if!defined(X3D_POINTING_PASS)&&!defined(X3D_DEPTH_PASS)\nuniform mediump sampler2DArray x3d_SphericalHarmonicsTexture;\n#endif\nin vec4 x3d_Vertex;in uint x3d_SplatIndex;out vec4 color;out vec2 coordXY;out vec3 conic;\n#if defined(X3D_CLIP_PLANES)||defined(X3D_FOG)||defined(X3D_POINTING_PASS)\nout vec3 vertex;\n#endif\n#if defined(X3D_POINTING_PASS)\nout vec2 texCoord;\n#endif\n#include<Fog>\n#include<Logarithmic>\nconst float SPLAT_SIGMA=3.;const float SH_C0=.28209479177387814;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_1\nconst float SH_C1_0=-.4886025119029199;const float SH_C1_1=.4886025119029199;const float SH_C1_2=-.4886025119029199;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_2\nconst float SH_C2_0=1.0925484305920792;const float SH_C2_1=-1.0925484305920792;const float SH_C2_2=.31539156525252005;const float SH_C2_3=-1.0925484305920792;const float SH_C2_4=.5462742152960396;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_3\nconst float SH_C3_0=-.5900435899266435;const float SH_C3_1=2.890611442640554;const float SH_C3_2=-.4570457994644658;const float SH_C3_3=.3731763325901154;const float SH_C3_4=-.4570457994644658;const float SH_C3_5=1.445305721320277;const float SH_C3_6=-.5900435899266435;\n#endif\n#endif\n#endif\nmat3 computeCov3D(const in vec4 rotation,const in vec3 scale){float qx=rotation.x;float qy=rotation.y;float qz=rotation.z;float qw=-rotation.w;float yy=qy*qy;float zz=qz*qz;float xy=qx*qy;float zw=qz*qw;float xz=qx*qz;float yw=qy*qw;float xx=qx*qx;float yz=qy*qz;float xw=qx*qw;mat3 R=mat3(1.-2.*(yy+zz),2.*(xy+zw),2.*(xz-yw),2.*(xy-zw),1.-2.*(zz+xx),2.*(yz+xw),2.*(xz+yw),2.*(yz-xw),1.-2.*(yy+xx));mat3 S=mat3(scale.x,0.,0.,0.,scale.y,0.,0.,0.,scale.z);mat3 M=S*R;mat3 Sigma=transpose(M)*M;return Sigma;}vec3 computeCov2D(const in vec3 viewSplatCenter,const in mat3 cov3D){mat3 J;if(x3d_ViewpointType==0){float x=viewSplatCenter.x;float y=viewSplatCenter.y;float z=viewSplatCenter.z;float zz=z*z;J=mat3(x3d_FocalLength.x/z,0.,-(x3d_FocalLength.x*x)/zz,0.,x3d_FocalLength.y/z,-(x3d_FocalLength.y*y)/zz,0.,0.,0.);}else{J=mat3(x3d_FocalLength.x,0.,0.,0.,x3d_FocalLength.y,0.,0.,0.,0.);}mat3 W=transpose(mat3(x3d_ModelViewMatrix));mat3 T=W*J;mat3 cov=transpose(T)*cov3D*T;cov[0][0]+=.3;cov[1][1]+=.3;return vec3(cov[0][0],cov[0][1],cov[1][1]);}\n#if!defined(X3D_POINTING_PASS)&&!defined(X3D_DEPTH_PASS)\nvec3 computeColorFromSH(const in ivec2 texelCoord,const in vec3 splatCenter){vec3 sh0=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,0),0).rgb;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_1\nvec3 sh1_0=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,1),0).rgb;vec3 sh1_1=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,2),0).rgb;vec3 sh1_2=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,3),0).rgb;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_2\nvec3 sh2_0=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,4),0).rgb;vec3 sh2_1=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,5),0).rgb;vec3 sh2_2=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,6),0).rgb;vec3 sh2_3=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,7),0).rgb;vec3 sh2_4=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,8),0).rgb;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_3\nvec3 sh3_0=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,9),0).rgb;vec3 sh3_1=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,10),0).rgb;vec3 sh3_2=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,11),0).rgb;vec3 sh3_3=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,12),0).rgb;vec3 sh3_4=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,13),0).rgb;vec3 sh3_5=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,14),0).rgb;vec3 sh3_6=texelFetch(x3d_SphericalHarmonicsTexture,ivec3(texelCoord,15),0).rgb;\n#endif\n#endif\n#endif\nvec3 color=sh0*SH_C0;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_1\nvec3 x3d_Camera=inverse(x3d_ModelViewMatrix)[3].xyz;vec3 viewDir=normalize(splatCenter-x3d_Camera);float x=viewDir.x;float y=viewDir.y;float z=viewDir.z;color+=SH_C1_1*(-y*sh1_0+z*sh1_1-x*sh1_2);\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_2\nfloat xx=x*x;float yy=y*y;float zz=z*z;float xy=x*y;float yz=y*z;float xz=x*z;color+=SH_C2_0*xy*sh2_0+SH_C2_1*yz*sh2_1+SH_C2_2*(2.*zz-xx-yy)*sh2_2+SH_C2_3*xz*sh2_3+SH_C2_4*(xx-yy)*sh2_4;\n#ifdef X3D_GAUSSIAN_SPLATTING_DEGREE_3\ncolor+=SH_C3_0*y*(3.*xx-yy)*sh3_0+SH_C3_1*xy*z*sh3_1+SH_C3_2*y*(4.*zz-xx-yy)*sh3_2+SH_C3_3*z*(2.*zz-3.*xx-3.*yy)*sh3_3+SH_C3_4*x*(4.*zz-xx-yy)*sh3_4+SH_C3_5*z*(xx-yy)*sh3_5+SH_C3_6*x*(xx-3.*yy)*sh3_6;\n#endif\n#endif\n#endif\ncolor+=.5;return color;}\n#endif\nvoid main(){uint textureWidth=uint(textureSize(x3d_PositionsTexture,0).x);ivec2 texelCoord=ivec2(x3d_SplatIndex % textureWidth,x3d_SplatIndex/textureWidth);vec3 splatCenter=texelFetch(x3d_PositionsTexture,texelCoord,0).xyz;vec4 viewSplatCenter=x3d_ModelViewMatrix*vec4(splatCenter,1.);\n#if defined(X3D_XR_SESSION)\nviewSplatCenter=x3d_EyeMatrix*viewSplatCenter;\n#endif\nvec4 clipSplatCenter=x3d_ProjectionMatrix*viewSplatCenter;clipSplatCenter/=clipSplatCenter.w;if(any(greaterThan(abs(clipSplatCenter.xyz),vec3(1.3)))){gl_Position=vec4(0.,0.,2.,1.);return;}vec4 splatOrientation=texelFetch(x3d_OrientationsTexture,texelCoord,0);vec3 splatScale=texelFetch(x3d_ScalesTexture,texelCoord,0).xyz;float opacity=texelFetch(x3d_OpacitiesTexture,texelCoord,0).r;mat3 cov3d=computeCov3D(normalize(splatOrientation),splatScale);vec3 cov2d=computeCov2D(viewSplatCenter.xyz/viewSplatCenter.w,cov3d);float a=cov2d.x;float b=cov2d.y;float c=cov2d.z;float det=a*c-b*b;if(det==0.){gl_Position=vec4(0.,0.,2.,1.);return;}conic=vec3(c,-b,a)/det;vec2 quadPixelSize=SPLAT_SIGMA*sqrt(vec2(a,c));vec2 quadNdcSize=quadPixelSize/vec2(x3d_Viewport.zw)*2.;clipSplatCenter.xy+=x3d_Vertex.xy*quadNdcSize;float minScreen=float(min(x3d_Viewport.z,x3d_Viewport.w));float maxQuadSize=max(quadPixelSize.x,quadPixelSize.y);if(maxQuadSize>minScreen){gl_Position=vec4(0.,0.,2.,1.);return;}coordXY=x3d_Vertex.xy*quadPixelSize;gl_Position=clipSplatCenter;\n#if defined(X3D_CLIP_PLANES)||defined(X3D_FOG)||defined(X3D_POINTING_PASS)\nvec4 invClipSplatCenter=inverse(x3d_ProjectionMatrix)*clipSplatCenter;vertex=invClipSplatCenter.xyz/invClipSplatCenter.w;\n#endif\n#if defined(X3D_POINTING_PASS)\ntexCoord=(x3d_Vertex.xy+1.)/2.;\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\nlogarithmic(gl_Position);\n#endif\n#if defined(X3D_POINTING_PASS)||defined(X3D_DEPTH_PASS)\ncolor=vec4(vec3(0),opacity);\n#else\ncolor=vec4(computeColorFromSH(texelCoord,splatCenter),opacity);\n#endif\n#if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)\nfog();\n#endif\n}",H=v().add("GaussianSplats.vs",M),B=()=>"#version 300 es\nprecision highp int;precision highp float;precision highp sampler2D;in vec4 color;in vec2 coordXY;in vec3 conic;\n#if defined(X3D_CLIP_PLANES)||defined(X3D_FOG)||defined(X3D_POINTING_PASS)\nin vec3 vertex;\n#endif\n#if defined(X3D_POINTING_PASS)\nin vec2 texCoord;\n#endif\n#if defined(X3D_POINTING_PASS)\nuniform float x3d_Id;layout(location=0)out vec4 x3d_FragData0;layout(location=1)out vec4 x3d_FragData1;layout(location=2)out vec4 x3d_FragData2;\n#elif defined(X3D_DEPTH_PASS)\nuniform int x3d_Id;layout(location=0)out vec4 x3d_FragData0;\n#if defined(X3D_NORMAL_BUFFER)\nlayout(location=1)out vec4 x3d_FragData1;\n#endif\n#else\n#if!defined(X3D_ORDER_INDEPENDENT_TRANSPARENCY)\nout vec4 x3d_FragColor;\n#endif\n#endif\n#include<ToneMapping>\n#include<ClipPlanes>\n#include<Fog>\n#include<OIT>\n#include<Logarithmic>\nvoid main(){\n#if defined(X3D_CLIP_PLANES)\nclip();\n#endif\nfloat exponent=-.5*(conic.x*coordXY.x*coordXY.x+conic.z*coordXY.y*coordXY.y)-conic.y*coordXY.x*coordXY.y;if(exponent>0.)discard;float alpha=min(.99,exp(exponent)*color.a);if(alpha<1./255.)discard;\n#if defined(X3D_POINTING_PASS)\nx3d_FragData0=vec4(vertex,x3d_Id);x3d_FragData1=vec4(0.,0.,1.,0.);x3d_FragData2=vec4(texCoord,0.,1.);\n#elif defined(X3D_DEPTH_PASS)\n#if defined(X3D_NORMAL_BUFFER)\nx3d_FragData0=vec4(gl_FragCoord.z,vec3(x3d_Id));x3d_FragData1=vec4(0.,0.,1.,float(gl_FrontFacing));\n#else\nx3d_FragData0=vec4(vec3(gl_FragCoord.z),1.);\n#endif\n#else\nvec4 finalColor=vec4(color.rgb,alpha);\n#if defined(X3D_FOG)\nfinalColor.rgb=getFogColor(finalColor.rgb);\n#endif\nfinalColor.rgb=toneMap(finalColor.rgb);\n#if defined(X3D_ORDER_INDEPENDENT_TRANSPARENCY)\noit(finalColor);\n#else\nx3d_FragColor=finalColor;\n#endif\n#if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)\nlogarithmic();\n#endif\n#endif\n}",L=v().add("GaussianSplats.fs",B);G().addVertexShader("GaussianSplats",H),G().addFragmentShader("GaussianSplats",L);const V=[1,3,5,7],q=new Float32Array([-1,-1,0,1,1,-1,0,1,1,1,0,1,-1,-1,0,1,1,1,0,1,-1,1,0,1]);function j(e,t){C().call(this,e),this.addChildObjects(S().outputOnly,"rebuild",new(o().SFTime)),this.node=t,this.shaderCache=this.getBrowser().getShaders(),this.currentModelViewMatrix=new Float32Array(16),this.sortModelViewMatrix=new Float32Array(16),this.clipPlanes=[]}Object.assign(Object.setPrototypeOf(j.prototype,C().prototype),{initialize(){C().prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();this.geometryContext=new(F()),this.geometryBuffer=t.createBuffer(),this.splatsIndexBuffer=t.createBuffer(),this.vertexArrayObject=new(N())(t),t.bindBuffer(t.ARRAY_BUFFER,this.geometryBuffer),t.bufferData(t.ARRAY_BUFFER,q,t.DYNAMIC_DRAW),this.positionsTexture=this.createTexture(),this.orientationsTexture=this.createTexture(),this.scalesTexture=this.createTexture(),this.sphericalHarmonicsTexture=this.createTexture(t.TEXTURE_2D_ARRAY),this.opacitiesTexture=this.createTexture(),this.positionsTextureUnit=e.popTextureUnit(),this.orientationsTextureUnit=e.popTextureUnit(),this.scalesTextureUnit=e.popTextureUnit(),this.sphericalHarmonicsTextureUnit=e.popTextureUnit(),this.opacitiesTextureUnit=e.popTextureUnit(),e.resetTextureUnits(),this.node._colorSpace.addInterest("set_key__",this),this.node._positions.addInterest("requestRebuild",this),this.node._orientations.addInterest("requestRebuild",this),this.node._scales.addInterest("requestRebuild",this),this.node._opacities.addInterest("requestRebuild",this);for(const[e,t]of V.entries())for(let i=0;i<t;++i)this.node.getField(`sphericalHarmonicsDegree${e}Coef${i}`).addInterest("requestRebuild",this);this._rebuild.addInterest("rebuild",this),this.rebuild()},getShapeKey(){return this.key},getGeometryContext(){return this.geometryContext},getGeometryType:()=>R().POINT,getNumInstances(){return this.numSplats},set_key__(){let e="GS";if(e+=this.degrees,"LIN_REC709_DISPLAY"===this.node._colorSpace.getValue())e+=1;else e+=0;this.key=e},set_bbox__(){const e=this.bbox;this.isDefaultBBoxSize()?e.setArray(this.node._positions.shrinkToFit()):e.set(this._bboxSize.getValue(),this._bboxCenter.getValue()),this.getBBoxSize().assign(e.size),this.getBBoxCenter().assign(e.center)},set_geometry__(){},set_transparent__(){this.setTransparent(!0),this.setAlphaMode(I().BLEND)},createTexture(e){const t=this.getBrowser().getContext(),i=t.createTexture();return e??=t.TEXTURE_2D,t.bindTexture(e,i),t.texParameteri(e,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(e,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),i},requestRebuild(){this._rebuild=Date.now()/1e3},rebuild(){const e=this.getBrowser().getContext(),t=this.node._positions.length;this.numSplats=t,e.bindBuffer(e.ARRAY_BUFFER,this.splatsIndexBuffer),e.bufferData(e.ARRAY_BUFFER,new Uint32Array(Array(t).keys()),e.DYNAMIC_DRAW);const i=Math.ceil(Math.sqrt(t));if(i){const n=i*i,r=new Float32Array(3*n),o=new Float32Array(4*n),s=new Float32Array(3*n),a=new Float32Array(n);r.set(this.node._positions.getValue().subarray(0,3*t)),o.set(this.node._orientations.getValue().subarray(0,4*t)),s.set(this.node._scales.getValue().subarray(0,3*t)),a.set(this.node._opacities.getValue().subarray(0,t)),this.degrees=-1;for(const[e,t]of V.entries()){if(!Array.from({length:t},(t,i)=>this.node.getField(`sphericalHarmonicsDegree${e}Coef${i}`).length).every(e=>e))break;++this.degrees}const d=(this.degrees+1)**2,c=new Float32Array(3*n*d);let l=0;for(const[e,i]of V.entries()){if(e>this.degrees)break;for(let r=0;r<i;++r){const i=this.node.getField(`sphericalHarmonicsDegree${e}Coef${r}`).getValue();c.set(i.subarray(0,3*t),l),l+=3*n}}e.bindTexture(e.TEXTURE_2D,this.positionsTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGB32F,i,i,0,e.RGB,e.FLOAT,r),e.bindTexture(e.TEXTURE_2D,this.orientationsTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA16F,i,i,0,e.RGBA,e.FLOAT,o),e.bindTexture(e.TEXTURE_2D,this.scalesTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGB32F,i,i,0,e.RGB,e.FLOAT,s),e.bindTexture(e.TEXTURE_2D,this.opacitiesTexture),e.texImage2D(e.TEXTURE_2D,0,e.R16F,i,i,0,e.RED,e.FLOAT,a),d&&(e.bindTexture(e.TEXTURE_2D_ARRAY,this.sphericalHarmonicsTexture),e.texImage3D(e.TEXTURE_2D_ARRAY,0,e.RGB16F,i,i,d,0,e.RGB,e.FLOAT,c))}this.initSortWorker(),this.set_key__(),this.set_bbox__(),this.set_objects__()},displaySimple(e,t,i){const{renderObject:n,viewport:r}=t,o=n.getProjectionMatrixArray();e.uniform4i(i.x3d_Viewport,...r),e.uniform1i(i.x3d_ViewpointType,o[15]),e.uniform2f(i.x3d_FocalLength,o[0]*r[2]*.5,o[5]*r[3]*.5),e.activeTexture(e.TEXTURE0+this.positionsTextureUnit),e.bindTexture(e.TEXTURE_2D,this.positionsTexture),e.activeTexture(e.TEXTURE0+this.orientationsTextureUnit),e.bindTexture(e.TEXTURE_2D,this.orientationsTexture),e.activeTexture(e.TEXTURE0+this.scalesTextureUnit),e.bindTexture(e.TEXTURE_2D,this.scalesTexture),e.activeTexture(e.TEXTURE0+this.opacitiesTextureUnit),e.bindTexture(e.TEXTURE_2D,this.opacitiesTexture),this.vertexArrayObject.enable(i.getProgram())&&(e.bindBuffer(e.ARRAY_BUFFER,this.splatsIndexBuffer),e.enableVertexAttribArray(i.x3d_SplatIndex),e.vertexAttribIPointer(i.x3d_SplatIndex,1,e.UNSIGNED_INT,0,0),e.vertexAttribDivisor(i.x3d_SplatIndex,1),i.enableVertexAttribute(e,this.geometryBuffer,0,0)),e.drawArraysInstanced(e.TRIANGLES,0,6,this.numSplats)},display(e,t){const i=this.getShader(t);i.enable(e),i.hasFog(null);const{renderObject:n,viewport:r,modelViewMatrix:o,localObjects:s,fogNode:a}=t,d=n.getProjectionMatrixArray();this.sortIndices(o),i.setClipPlanes(e,s,n),a?.setShaderUniforms(e,i),e.viewport(...r),e.scissor(...r),e.uniform4i(i.x3d_Viewport,...r),e.uniformMatrix4fv(i.x3d_ProjectionMatrix,!1,d),e.uniformMatrix4fv(i.x3d_EyeMatrix,!1,n.getEyeMatrixArray()),e.uniformMatrix4fv(i.x3d_ModelViewMatrix,!1,o),e.uniform1i(i.x3d_ViewpointType,d[15]),e.uniform2f(i.x3d_FocalLength,d[0]*r[2]*.5,d[5]*r[3]*.5),e.activeTexture(e.TEXTURE0+this.positionsTextureUnit),e.bindTexture(e.TEXTURE_2D,this.positionsTexture),e.activeTexture(e.TEXTURE0+this.orientationsTextureUnit),e.bindTexture(e.TEXTURE_2D,this.orientationsTexture),e.activeTexture(e.TEXTURE0+this.scalesTextureUnit),e.bindTexture(e.TEXTURE_2D,this.scalesTexture),e.activeTexture(e.TEXTURE0+this.opacitiesTextureUnit),e.bindTexture(e.TEXTURE_2D,this.opacitiesTexture),e.activeTexture(e.TEXTURE0+this.sphericalHarmonicsTextureUnit),e.bindTexture(e.TEXTURE_2D_ARRAY,this.sphericalHarmonicsTexture),this.vertexArrayObject.enable(i.getProgram())&&(e.bindBuffer(e.ARRAY_BUFFER,this.splatsIndexBuffer),e.enableVertexAttribArray(i.x3d_SplatIndex),e.vertexAttribIPointer(i.x3d_SplatIndex,1,e.UNSIGNED_INT,0,0),e.vertexAttribDivisor(i.x3d_SplatIndex,1),i.enableVertexAttribute(e,this.geometryBuffer,0,0)),e.frontFace(e.CCW),e.enable(e.CULL_FACE),e.drawArraysInstanced(e.TRIANGLES,0,6,this.numSplats)},getShader(e){const{renderObject:t,fogNode:i,localObjectsKeys:n}=e;let r="";return r+=this.key,r+=t.getRenderKey(),r+=i?.getFogType()??0,r+=n.join(""),this.shaderCache.get(r)??this.createShader(r,e)},createShader(e,t){const i=this.getBrowser(),n=i.getContext(),r=i.getDefaultMaterial().getShaderOptions(this.geometryContext,t).filter(e=>!e.startsWith("X3D_COLORSPACE_"));if("LIN_REC709_DISPLAY"===this.node._colorSpace.getValue())r.push("X3D_COLORSPACE_LINEAR");else r.push("X3D_COLORSPACE_SRGB");for(let e=0;e<=this.degrees;++e)r.push(`X3D_GAUSSIAN_SPLATTING_DEGREE_${e}`);const o=i.createShader({name:"GaussianSplats",vertexShader:"GaussianSplats",fragmentShader:"GaussianSplats",options:r,attributes:["x3d_SplatIndex"],uniforms:["x3d_PositionsTexture","x3d_OrientationsTexture","x3d_ScalesTexture","x3d_OpacitiesTexture","x3d_SphericalHarmonicsTexture","x3d_ViewpointType","x3d_FocalLength"]});return this.shaderCache.set(e,o),o.enable(n),n.uniform1i(o.x3d_PositionsTexture,this.positionsTextureUnit),n.uniform1i(o.x3d_OrientationsTexture,this.orientationsTextureUnit),n.uniform1i(o.x3d_ScalesTexture,this.scalesTextureUnit),n.uniform1i(o.x3d_OpacitiesTexture,this.opacitiesTextureUnit),n.uniform1i(o.x3d_SphericalHarmonicsTexture,this.sphericalHarmonicsTextureUnit),o},createPointingShader(e){const t=this.getBrowser(),i=t.getContext(),n=t.createShader({name:"GaussianSplatsPointing",vertexShader:"GaussianSplats",fragmentShader:"GaussianSplats",options:e,attributes:["x3d_SplatIndex"],uniforms:["x3d_PositionsTexture","x3d_OrientationsTexture","x3d_ScalesTexture","x3d_OpacitiesTexture","x3d_ViewpointType","x3d_FocalLength"]});return n.enable(i),i.uniform1i(n.x3d_PositionsTexture,this.positionsTextureUnit),i.uniform1i(n.x3d_OrientationsTexture,this.orientationsTextureUnit),i.uniform1i(n.x3d_ScalesTexture,this.scalesTextureUnit),i.uniform1i(n.x3d_OpacitiesTexture,this.opacitiesTextureUnit),n},createDepthShader(e){return this.createPointingShader(e)},initSortWorker(){if(!this.getBrowser().getBrowserOption("LoadUrlObjects"))return;this.sortWorker?.terminate();const e=`import "${w().getLibraryURL("mkkellogg-sort.worker.js")}";`,t=URL.createObjectURL(new Blob([e],{type:"text/javascript"}));this.sortWorker=new Worker(t,{type:"module"}),URL.revokeObjectURL(t);const i=this.getBrowser(),n=i.getContext();this.sortWorker.onmessage=e=>{switch(this.sortPending=!1,e.data.type){case"ready":this.sortModelViewMatrix.fill(0),i.addBrowserEvent();break;case"sorted":n.bindBuffer(n.ARRAY_BUFFER,this.splatsIndexBuffer),n.bufferData(n.ARRAY_BUFFER,e.data.indices,n.DYNAMIC_DRAW),i.addBrowserEvent();break;case"error":console.error("Sort worker error:",e.data.message)}},this.sortWorker.onerror=e=>{console.error(e),this.sortPending=!1},this.sortWorker.postMessage({type:"init",positions:this.node._positions.getValue().subarray(0,3*this.numSplats),splatCount:this.numSplats}),this.sortPending=!0},sortIndices(e){this.currentModelViewMatrix.set(e),this.sortPending||X().prototype.equals.call(this.currentModelViewMatrix,this.sortModelViewMatrix)||(this.sortModelViewMatrix.set(e),this.sortWorker?.postMessage({type:"sort",viewMatrix:this.sortModelViewMatrix}),this.sortPending=!0)}}),Object.defineProperties(j,{...x().getStaticProperties("GaussianSplatsShape","X_ITE",1,"children","2.0"),fieldDefinitions:{value:new(c())([new(a())(S().inputOutput,"metadata",new(o().SFNode)),new(a())(S().inputOutput,"pointerEvents",new(o().SFBool)(!0)),new(a())(S().inputOutput,"castShadow",new(o().SFBool)(!0)),new(a())(S().inputOutput,"visible",new(o().SFBool)(!0)),new(a())(S().inputOutput,"bboxDisplay",new(o().SFBool)),new(a())(S().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(a())(S().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(a())(S().inputOutput,"appearance",new(o().SFNode)),new(a())(S().inputOutput,"geometry",new(o().SFNode))]),enumerable:!0}});const Y=j,k=v().add("GaussianSplatsShape",Y);function W(e){m.call(this,e),this.addType(S().GaussianSplats),this._positions.setUnit("length"),this.shapeNode=new k(e,this)}Object.assign(Object.setPrototypeOf(W.prototype,m.prototype),{initialize(){m.prototype.initialize.call(this),this._pointerEvents.addFieldInterest(this.shapeNode._pointerEvents),this._castShadow.addFieldInterest(this.shapeNode._castShadow),this._hidden.addFieldInterest(this.shapeNode._hidden),this._visible.addFieldInterest(this.shapeNode._visible),this._bboxDisplay.addFieldInterest(this.shapeNode._bboxDisplay),this._bboxSize.addFieldInterest(this.shapeNode._bboxSize),this._bboxCenter.addFieldInterest(this.shapeNode._bboxCenter),this.shapeNode._pointerEvents=this._pointerEvents,this.shapeNode._hidden=this._hidden,this.shapeNode._visible=this._visible,this.shapeNode._bboxDisplay=this._bboxDisplay,this.shapeNode._bboxSize=this._bboxSize,this.shapeNode._bboxCenter=this._bboxCenter,this.shapeNode.setup()},getInnerNode(){return this.shapeNode},getBBox(e,t){return this.shapeNode.getBBox(e,t)}}),Object.defineProperties(W,{...x().getStaticProperties("GaussianSplats","GaussianSplats",1,"children","4.1"),fieldDefinitions:{value:new(c())([new(a())(S().inputOutput,"metadata",new(o().SFNode)),new(a())(S().inputOutput,"colorSpace",new(o().SFString)("SRGB_REC709_DISPLAY")),new(a())(S().inputOutput,"positions",new(o().MFVec3f)),new(a())(S().inputOutput,"orientations",new(o().MFQuaternion)),new(a())(S().inputOutput,"scales",new(o().MFVec3f)),new(a())(S().inputOutput,"opacities",new(o().MFFloat)),new(a())(S().inputOutput,"sphericalHarmonicsDegree0Coef0",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree1Coef0",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree1Coef1",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree1Coef2",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef0",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef1",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef2",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef3",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree2Coef4",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef0",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef1",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef2",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef3",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef4",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef5",new(o().MFVec3f)),new(a())(S().inputOutput,"sphericalHarmonicsDegree3Coef6",new(o().MFVec3f)),new(a())(S().inputOutput,"pointerEvents",new(o().SFBool)(!0)),new(a())(S().inputOutput,"castShadow",new(o().SFBool)(!0)),new(a())(S().inputOutput,"visible",new(o().SFBool)(!0)),new(a())(S().inputOutput,"bboxDisplay",new(o().SFBool)),new(a())(S().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(a())(S().initializeOnly,"bboxCenter",new(o().SFVec3f))]),enumerable:!0}});const $=W,J=v().add("GaussianSplats",$);n().add({name:"Layout",concreteNodes:[J],abstractNodes:[m]});v().add("GaussianSplatsComponent",void 0)})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* X_ITE v15.1.
|
|
1
|
+
/* X_ITE v15.1.9 */
|
|
2
2
|
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D")];
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ "use strict";
|
|
@@ -78,7 +78,7 @@ function Arc2DOptions (executionContext)
|
|
|
78
78
|
{
|
|
79
79
|
external_X_ITE_X3D_X3DBaseNode_default().call (this, executionContext);
|
|
80
80
|
|
|
81
|
-
this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40))
|
|
81
|
+
this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
Object .setPrototypeOf (Arc2DOptions .prototype, (external_X_ITE_X3D_X3DBaseNode_default()).prototype);
|
|
@@ -105,7 +105,7 @@ function ArcClose2DOptions (executionContext)
|
|
|
105
105
|
{
|
|
106
106
|
external_X_ITE_X3D_X3DBaseNode_default().call (this, executionContext);
|
|
107
107
|
|
|
108
|
-
this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40))
|
|
108
|
+
this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40));
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
Object .setPrototypeOf (ArcClose2DOptions .prototype, (external_X_ITE_X3D_X3DBaseNode_default()).prototype);
|
|
@@ -144,7 +144,7 @@ function Circle2DOptions (executionContext)
|
|
|
144
144
|
{
|
|
145
145
|
external_X_ITE_X3D_X3DBaseNode_default().call (this, executionContext);
|
|
146
146
|
|
|
147
|
-
this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40))
|
|
147
|
+
this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40));
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
Object .assign (Object .setPrototypeOf (Circle2DOptions .prototype, (external_X_ITE_X3D_X3DBaseNode_default()).prototype),
|
|
@@ -235,7 +235,7 @@ function Disk2DOptions (executionContext)
|
|
|
235
235
|
{
|
|
236
236
|
external_X_ITE_X3D_X3DBaseNode_default().call (this, executionContext);
|
|
237
237
|
|
|
238
|
-
this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40))
|
|
238
|
+
this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40));
|
|
239
239
|
|
|
240
240
|
this .diskTexCoords = external_X_ITE_X3D_X3DGeometryNode_default().createArray ();
|
|
241
241
|
this .diskNormals = external_X_ITE_X3D_X3DGeometryNode_default().createArray ();
|