x_ite 11.0.1 → 11.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/assets/components/AnnotationComponent.js +2 -2
- package/dist/assets/components/AnnotationComponent.min.js +2 -2
- package/dist/assets/components/CADGeometryComponent.js +2 -2
- package/dist/assets/components/CADGeometryComponent.min.js +2 -2
- package/dist/assets/components/CubeMapTexturingComponent.js +2 -2
- package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
- package/dist/assets/components/DISComponent.js +2 -2
- package/dist/assets/components/DISComponent.min.js +2 -2
- package/dist/assets/components/EventUtilitiesComponent.js +2 -2
- package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
- package/dist/assets/components/Geometry2DComponent.js +2 -2
- package/dist/assets/components/Geometry2DComponent.min.js +2 -2
- package/dist/assets/components/GeospatialComponent.js +2 -2
- package/dist/assets/components/GeospatialComponent.min.js +2 -2
- package/dist/assets/components/HAnimComponent.js +9 -9
- package/dist/assets/components/HAnimComponent.min.js +2 -2
- package/dist/assets/components/KeyDeviceSensorComponent.js +2 -2
- package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -2
- package/dist/assets/components/LayoutComponent.js +2 -2
- package/dist/assets/components/LayoutComponent.min.js +2 -2
- package/dist/assets/components/NURBSComponent.js +2 -2
- package/dist/assets/components/NURBSComponent.min.js +2 -2
- package/dist/assets/components/ParticleSystemsComponent.js +2 -2
- package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
- package/dist/assets/components/PickingComponent.js +2 -2
- package/dist/assets/components/PickingComponent.min.js +2 -2
- package/dist/assets/components/RigidBodyPhysicsComponent.js +2 -2
- package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -2
- package/dist/assets/components/ScriptingComponent.js +2 -2
- package/dist/assets/components/ScriptingComponent.min.js +2 -2
- package/dist/assets/components/TextComponent.js +4 -4
- package/dist/assets/components/TextComponent.min.js +2 -2
- package/dist/assets/components/TextureProjectionComponent.js +9 -21
- package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
- package/dist/assets/components/Texturing3DComponent.js +12 -12
- package/dist/assets/components/Texturing3DComponent.min.js +2 -2
- package/dist/assets/components/VolumeRenderingComponent.js +2 -2
- package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
- package/dist/assets/components/X_ITEComponent.js +2 -2
- package/dist/assets/components/X_ITEComponent.min.js +2 -2
- package/dist/example.html +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.d.ts +2 -2
- package/dist/x_ite.js +988 -975
- package/dist/x_ite.min.js +2 -2
- package/dist/x_ite.min.mjs +2 -2
- package/dist/x_ite.mjs +987 -974
- package/dist/x_ite.zip +0 -0
- package/package.json +4 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* X_ITE v11.0.
|
|
2
|
-
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.0.
|
|
1
|
+
/* X_ITE v11.0.3 */
|
|
2
|
+
const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.0.3")];
|
|
3
3
|
/******/ (() => { // webpackBootstrap
|
|
4
4
|
/******/ "use strict";
|
|
5
5
|
/******/ // The require scope
|
|
@@ -437,11 +437,6 @@ function TextureProjector (executionContext)
|
|
|
437
437
|
this .addType ((external_X_ITE_X3D_X3DConstants_default()).TextureProjector);
|
|
438
438
|
|
|
439
439
|
this ._fieldOfView .setUnit ("angle");
|
|
440
|
-
|
|
441
|
-
// Legacy
|
|
442
|
-
|
|
443
|
-
if (executionContext .getSpecificationVersion () <= 4.0)
|
|
444
|
-
this ._upVector = new (external_X_ITE_X3D_Vector3_default()) (0, 0, 1);
|
|
445
440
|
}
|
|
446
441
|
|
|
447
442
|
Object .assign (Object .setPrototypeOf (TextureProjector .prototype, TextureProjection_X3DTextureProjectorNode .prototype),
|
|
@@ -478,7 +473,7 @@ Object .defineProperties (TextureProjector,
|
|
|
478
473
|
|
|
479
474
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "location", new (external_X_ITE_X3D_Fields_default()).SFVec3f ()),
|
|
480
475
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "direction", new (external_X_ITE_X3D_Fields_default()).SFVec3f (0, 0, 1)),
|
|
481
|
-
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "upVector", new (external_X_ITE_X3D_Fields_default()).SFVec3f (0,
|
|
476
|
+
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "upVector", new (external_X_ITE_X3D_Fields_default()).SFVec3f (0, 0, 1)),
|
|
482
477
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "fieldOfView", new (external_X_ITE_X3D_Fields_default()).SFFloat (0.785398)),
|
|
483
478
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "nearDistance", new (external_X_ITE_X3D_Fields_default()).SFFloat (-1)),
|
|
484
479
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "farDistance", new (external_X_ITE_X3D_Fields_default()).SFFloat (-1)),
|
|
@@ -697,11 +692,6 @@ function TextureProjectorParallel (executionContext)
|
|
|
697
692
|
this .addType ((external_X_ITE_X3D_X3DConstants_default()).TextureProjectorParallel);
|
|
698
693
|
|
|
699
694
|
this ._fieldOfView .setUnit ("length");
|
|
700
|
-
|
|
701
|
-
// Legacy
|
|
702
|
-
|
|
703
|
-
if (executionContext .getSpecificationVersion () <= 4.0)
|
|
704
|
-
this ._upVector = new (external_X_ITE_X3D_Vector3_default()) (0, 0, 1);
|
|
705
695
|
}
|
|
706
696
|
|
|
707
697
|
Object .assign (Object .setPrototypeOf (TextureProjectorParallel .prototype, TextureProjection_X3DTextureProjectorNode .prototype),
|
|
@@ -716,12 +706,10 @@ Object .assign (Object .setPrototypeOf (TextureProjectorParallel .prototype, Tex
|
|
|
716
706
|
},
|
|
717
707
|
set_fieldOfView___ ()
|
|
718
708
|
{
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
this .
|
|
722
|
-
this .
|
|
723
|
-
this .maximumX = (length > 2 ? this ._fieldOfView [2] : 1);
|
|
724
|
-
this .maximumY = (length > 3 ? this ._fieldOfView [3] : 1);
|
|
709
|
+
this .minimumX = this ._fieldOfView [0];
|
|
710
|
+
this .minimumY = this ._fieldOfView [1];
|
|
711
|
+
this .maximumX = this ._fieldOfView [2];
|
|
712
|
+
this .maximumY = this ._fieldOfView [3];
|
|
725
713
|
|
|
726
714
|
this .sizeX = this .maximumX - this .minimumX;
|
|
727
715
|
this .sizeY = this .maximumY - this .minimumY;
|
|
@@ -772,8 +760,8 @@ Object .defineProperties (TextureProjectorParallel,
|
|
|
772
760
|
|
|
773
761
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "location", new (external_X_ITE_X3D_Fields_default()).SFVec3f ()),
|
|
774
762
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "direction", new (external_X_ITE_X3D_Fields_default()).SFVec3f (0, 0, 1)),
|
|
775
|
-
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "upVector", new (external_X_ITE_X3D_Fields_default()).SFVec3f (0,
|
|
776
|
-
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "fieldOfView", new (external_X_ITE_X3D_Fields_default()).
|
|
763
|
+
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "upVector", new (external_X_ITE_X3D_Fields_default()).SFVec3f (0, 0, 1)),
|
|
764
|
+
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "fieldOfView", new (external_X_ITE_X3D_Fields_default()).SFVec4f (-1, -1, 1, 1)),
|
|
777
765
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "nearDistance", new (external_X_ITE_X3D_Fields_default()).SFFloat (-1)),
|
|
778
766
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "farDistance", new (external_X_ITE_X3D_Fields_default()).SFFloat (-1)),
|
|
779
767
|
new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).outputOnly, "aspectRatio", new (external_X_ITE_X3D_Fields_default()).SFFloat ()),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v11.0.
|
|
2
|
-
const t=window[Symbol.for("X_ITE.X3D-11.0.1")];(()=>{var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const i=t.Components;var r=e.n(i);const n=t.Fields;var o=e.n(n);const a=t.X3DFieldDefinition;var s=e.n(a);const u=t.FieldDefinitionArray;var h=e.n(u);const c=t.X3DNode;var l=e.n(c);const x=t.X3DLightNode;var p=e.n(x);const w=t.X3DConstants;var g=e.n(w);const d=t.X3DCast;var m=e.n(d);const f=t.Vector3;var _=e.n(f);const T=t.Rotation4;var O=e.n(T);const F=t.Matrix4;var S=e.n(F);const M=t.Namespace;var P=e.n(M);function j(t){p().call(this,t),this.addType(g().X3DTextureProjectorNode),this._location.setUnit("length"),this._farDistance.setUnit("length"),this._location.setUnit("length")}Object.assign(Object.setPrototypeOf(j.prototype,p().prototype),{initialize(){p().prototype.initialize.call(this),this._nearDistance.addInterest("set_nearDistance__",this),this._farDistance.addInterest("set_farDistance__",this),this._texture.addInterest("set_texture__",this),this.set_nearDistance__(),this.set_farDistance__(),this.set_texture__()},getLightKey:()=>3,getGlobal(){return this._global.getValue()},getLocation(){return this._location.getValue()},getDirection(){return this._direction.getValue()},getNearDistance(){return this.nearDistance},getNearParameter(){return this.nearParameter},getFarDistance(){return this.farDistance},getFarParameter(){return this.farParameter},getTexture(){return this.textureNode},getBiasMatrix:(()=>{const t=new(S())(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1);return function(){return t}})(),straightenHorizon(t){return t.straighten(this._upVector.getValue())},set_nearDistance__(){const t=this._nearDistance.getValue();this.nearDistance=t<0?.125:t,this.nearParameter=t<0?0:-1},set_farDistance__(){const t=this._farDistance.getValue();this.farDistance=t<0?1e5:t,this.farParameter=t<0?1:2},set_texture__(){this.textureNode?.removeInterest("set_aspectRatio__",this),this.textureNode=m()(g().X3DTexture2DNode,this._texture),this.textureNode?.addInterest("set_aspectRatio__",this),this.setEnabled(!!this.textureNode),this.set_aspectRatio__(),this.set_on__()},set_aspectRatio__(){this.textureNode?this._aspectRatio=this.textureNode.getWidth()/this.textureNode.getHeight():this._aspectRatio=1}}),Object.defineProperties(j,l().getStaticProperties("X3DTextureProjectorNode","TextureProjection",4));const y=j,V=P().add("X3DTextureProjectorNode",y),D=t.Camera;var b=e.n(D);const v=t.MatrixStack;var N=e.n(v);const X=t.ObjectCache;var U=e.n(X);const z=U()(R);function R(){this.projectionMatrix=new(S()),this.modelViewMatrix=new(N())(S()),this.modelMatrix=new(S()),this.invTextureSpaceMatrix=new(S()),this.invTextureSpaceProjectionMatrix=new(S()),this.location=new(_()),this.locationArray=new Float32Array(3),this.direction=new(_()),this.rotation=new(O()),this.matrix=new(S()),this.matrixArray=new Float32Array(16),this.textureMatrix=new(S())}function A(t){V.call(this,t),this.addType(g().TextureProjector),this._fieldOfView.setUnit("angle"),t.getSpecificationVersion()<=4&&(this._upVector=new(_())(0,0,1))}Object.assign(R.prototype,{set(t,e,i){this.browser=t.getBrowser(),this.lightNode=t,this.global=t.getGlobal(),this.modelViewMatrix.push(i),this.textureMatrix.set(...t.getTexture().getMatrix())},renderShadowMap(t){},setGlobalVariables(t){const e=this.lightNode,i=t.getCameraSpaceMatrixArray(),r=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),n=this.invTextureSpaceMatrix.assign(this.global?r:S().Identity);this.rotation.setFromToVec(_().zAxis,this.direction.assign(e.getDirection()).negate()),e.straightenHorizon(this.rotation),n.translate(e.getLocation()),n.rotate(this.rotation),n.inverse();const o=e.getTexture().getWidth(),a=e.getTexture().getHeight(),s=e.getNearDistance(),u=e.getFarDistance(),h=e.getFieldOfView();b().perspective(h,s,u,o,a,this.projectionMatrix),this.global||n.multLeft(r.inverse()),this.invTextureSpaceProjectionMatrix.assign(n).multRight(this.projectionMatrix).multRight(e.getBiasMatrix()),this.matrix.assign(i).multRight(this.invTextureSpaceProjectionMatrix).multRight(this.textureMatrix),this.matrixArray.set(this.matrix),this.modelViewMatrix.get().multVecMatrix(this.location.assign(e._location.getValue())),this.locationArray.set(this.location)},setShaderUniforms(t,e,i){const r=e.numTextureProjectors++,n=this.lightNode,o=n.getTexture(),a=this.global?this.textureUnit=this.textureUnit??this.browser.popTexture2DUnit():this.browser.getTexture2DUnit();if(t.activeTexture(t.TEXTURE0+a),t.bindTexture(t.TEXTURE_2D,o.getTexture()),t.uniform1i(e.x3d_TextureProjectorTexture[r],a),e.hasTextureProjector(r,this))return;const s=n.getNearParameter(),u=n.getFarParameter();t.uniform3f(e.x3d_TextureProjectorColor[r],...n.getColor()),t.uniform1f(e.x3d_TextureProjectorIntensity[r],n.getIntensity()),t.uniform3fv(e.x3d_TextureProjectorLocation[r],this.locationArray),t.uniform3f(e.x3d_TextureProjectorParams[r],s,u,o.isLinear()),t.uniformMatrix4fv(e.x3d_TextureProjectorMatrix[r],!1,this.matrixArray)},dispose(){this.browser.pushTexture2DUnit(this.textureUnit),this.modelViewMatrix.clear(),this.textureUnit=void 0,z.push(this)}}),Object.assign(Object.setPrototypeOf(A.prototype,V.prototype),{initialize(){V.prototype.initialize.call(this)},getFieldOfView(){const t=this._fieldOfView.getValue();return t>0&&t<Math.PI?t:Math.PI/4},getLights:()=>z}),Object.defineProperties(A,{...l().getStaticProperties("TextureProjector","TextureProjection",2,"children","4.0"),fieldDefinitions:{value:new(h())([new(s())(g().inputOutput,"metadata",new(o().SFNode)),new(s())(g().inputOutput,"description",new(o().SFString)),new(s())(g().inputOutput,"global",new(o().SFBool)(!0)),new(s())(g().inputOutput,"on",new(o().SFBool)(!0)),new(s())(g().inputOutput,"color",new(o().SFColor)(1,1,1)),new(s())(g().inputOutput,"intensity",new(o().SFFloat)(1)),new(s())(g().inputOutput,"ambientIntensity",new(o().SFFloat)),new(s())(g().inputOutput,"location",new(o().SFVec3f)),new(s())(g().inputOutput,"direction",new(o().SFVec3f)(0,0,1)),new(s())(g().inputOutput,"upVector",new(o().SFVec3f)(0,1,0)),new(s())(g().inputOutput,"fieldOfView",new(o().SFFloat)(.785398)),new(s())(g().inputOutput,"nearDistance",new(o().SFFloat)(-1)),new(s())(g().inputOutput,"farDistance",new(o().SFFloat)(-1)),new(s())(g().outputOnly,"aspectRatio",new(o().SFFloat)),new(s())(g().inputOutput,"texture",new(o().SFNode)),new(s())(g().inputOutput,"shadows",new(o().SFBool)),new(s())(g().inputOutput,"shadowColor",new(o().SFColor)),new(s())(g().inputOutput,"shadowIntensity",new(o().SFFloat)(1)),new(s())(g().inputOutput,"shadowBias",new(o().SFFloat)(.005)),new(s())(g().initializeOnly,"shadowMapSize",new(o().SFInt32)(1024))]),enumerable:!0}});const I=A,C=P().add("TextureProjector",I),Y=U()(B);function B(){this.projectionMatrix=new(S()),this.modelViewMatrix=new(N())(S()),this.modelMatrix=new(S()),this.invTextureSpaceMatrix=new(S()),this.location=new(_()),this.locationArray=new Float32Array(3),this.invTextureSpaceProjectionMatrix=new(S()),this.direction=new(_()),this.rotation=new(O()),this.matrix=new(S()),this.matrixArray=new Float32Array(16),this.textureMatrix=new(S())}function L(t){V.call(this,t),this.addType(g().TextureProjectorParallel),this._fieldOfView.setUnit("length"),t.getSpecificationVersion()<=4&&(this._upVector=new(_())(0,0,1))}Object.assign(B.prototype,{set(t,e,i){this.browser=t.getBrowser(),this.lightNode=t,this.global=t.getGlobal(),this.modelViewMatrix.push(i),this.textureMatrix.set(...t.getTexture().getMatrix())},renderShadowMap(t){},setGlobalVariables(t){const e=this.lightNode,i=t.getCameraSpaceMatrixArray(),r=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),n=this.invTextureSpaceMatrix.assign(this.global?r:S().Identity);this.rotation.setFromToVec(_().zAxis,this.direction.assign(e.getDirection()).negate()),e.straightenHorizon(this.rotation),n.translate(e.getLocation()),n.rotate(this.rotation),n.inverse();const o=e.getTexture().getWidth()/e.getTexture().getHeight(),a=e.getMinimumX(),s=e.getMaximumX(),u=e.getMinimumY(),h=e.getMaximumY(),c=e.getSizeX(),l=e.getSizeY(),x=e.getNearDistance(),p=e.getFarDistance();if(o>c/l){const t=(a+s)/2,e=l*o/2;b().ortho(t-e,t+e,u,h,x,p,this.projectionMatrix)}else{const t=(u+h)/2,e=c/o/2;b().ortho(a,s,t-e,t+e,x,p,this.projectionMatrix)}this.global||n.multLeft(r.inverse()),this.invTextureSpaceProjectionMatrix.assign(n).multRight(this.projectionMatrix).multRight(e.getBiasMatrix()),this.matrix.assign(i).multRight(this.invTextureSpaceProjectionMatrix).multRight(this.textureMatrix),this.matrixArray.set(this.matrix),this.modelViewMatrix.get().multVecMatrix(this.location.assign(e._location.getValue())),this.locationArray.set(this.location)},setShaderUniforms(t,e,i){const r=e.numTextureProjectors++,n=this.lightNode,o=n.getTexture(),a=this.global?this.textureUnit=this.textureUnit??this.browser.popTexture2DUnit():this.browser.getTexture2DUnit();if(t.activeTexture(t.TEXTURE0+a),t.bindTexture(t.TEXTURE_2D,o.getTexture()),t.uniform1i(e.x3d_TextureProjectorTexture[r],a),e.hasTextureProjector(r,this))return;const s=n.getNearParameter(),u=n.getFarParameter();t.uniform3f(e.x3d_TextureProjectorColor[r],...n.getColor()),t.uniform1f(e.x3d_TextureProjectorIntensity[r],n.getIntensity()),t.uniform3fv(e.x3d_TextureProjectorLocation[r],this.locationArray),t.uniform3f(e.x3d_TextureProjectorParams[r],s,u,o.isLinear()),t.uniformMatrix4fv(e.x3d_TextureProjectorMatrix[r],!1,this.matrixArray)},dispose(){this.browser.pushTexture2DUnit(this.textureUnit),this.modelViewMatrix.clear(),this.textureUnit=void 0,Y.push(this)}}),Object.assign(Object.setPrototypeOf(L.prototype,V.prototype),{initialize(){V.prototype.initialize.call(this),this._fieldOfView.addInterest("set_fieldOfView___",this),this.set_fieldOfView___()},set_fieldOfView___(){const t=this._fieldOfView.length;this.minimumX=t>0?this._fieldOfView[0]:-1,this.minimumY=t>1?this._fieldOfView[1]:-1,this.maximumX=t>2?this._fieldOfView[2]:1,this.maximumY=t>3?this._fieldOfView[3]:1,this.sizeX=this.maximumX-this.minimumX,this.sizeY=this.maximumY-this.minimumY},getMinimumX(){return this.minimumX},getMinimumY(){return this.minimumY},getMaximumX(){return this.maximumX},getMaximumY(){return this.maximumY},getSizeX(){return this.sizeX},getSizeY(){return this.sizeY},getLights:()=>Y}),Object.defineProperties(L,{...l().getStaticProperties("TextureProjectorParallel","TextureProjection",2,"children","4.0"),fieldDefinitions:{value:new(h())([new(s())(g().inputOutput,"metadata",new(o().SFNode)),new(s())(g().inputOutput,"description",new(o().SFString)),new(s())(g().inputOutput,"global",new(o().SFBool)(!0)),new(s())(g().inputOutput,"on",new(o().SFBool)(!0)),new(s())(g().inputOutput,"color",new(o().SFColor)(1,1,1)),new(s())(g().inputOutput,"intensity",new(o().SFFloat)(1)),new(s())(g().inputOutput,"ambientIntensity",new(o().SFFloat)),new(s())(g().inputOutput,"location",new(o().SFVec3f)),new(s())(g().inputOutput,"direction",new(o().SFVec3f)(0,0,1)),new(s())(g().inputOutput,"upVector",new(o().SFVec3f)(0,1,0)),new(s())(g().inputOutput,"fieldOfView",new(o().MFFloat)(-1,-1,1,1)),new(s())(g().inputOutput,"nearDistance",new(o().SFFloat)(-1)),new(s())(g().inputOutput,"farDistance",new(o().SFFloat)(-1)),new(s())(g().outputOnly,"aspectRatio",new(o().SFFloat)),new(s())(g().inputOutput,"texture",new(o().SFNode)),new(s())(g().inputOutput,"shadows",new(o().SFBool)),new(s())(g().inputOutput,"shadowColor",new(o().SFColor)),new(s())(g().inputOutput,"shadowIntensity",new(o().SFFloat)(1)),new(s())(g().inputOutput,"shadowBias",new(o().SFFloat)(.005)),new(s())(g().initializeOnly,"shadowMapSize",new(o().SFInt32)(1024))]),enumerable:!0}});const E=L,H=P().add("TextureProjectorParallel",E);r().add({name:"TextureProjection",concreteNodes:[C,H],abstractNodes:[V]});P().add("TextureProjectionComponent",undefined)})();
|
|
1
|
+
/* X_ITE v11.0.3 */
|
|
2
|
+
const t=window[Symbol.for("X_ITE.X3D-11.0.3")];(()=>{var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const i=t.Components;var r=e.n(i);const n=t.Fields;var o=e.n(n);const a=t.X3DFieldDefinition;var s=e.n(a);const u=t.FieldDefinitionArray;var h=e.n(u);const c=t.X3DNode;var l=e.n(c);const x=t.X3DLightNode;var p=e.n(x);const w=t.X3DConstants;var g=e.n(w);const d=t.X3DCast;var m=e.n(d);const f=t.Vector3;var _=e.n(f);const T=t.Rotation4;var O=e.n(T);const F=t.Matrix4;var S=e.n(F);const M=t.Namespace;var P=e.n(M);function j(t){p().call(this,t),this.addType(g().X3DTextureProjectorNode),this._location.setUnit("length"),this._farDistance.setUnit("length"),this._location.setUnit("length")}Object.assign(Object.setPrototypeOf(j.prototype,p().prototype),{initialize(){p().prototype.initialize.call(this),this._nearDistance.addInterest("set_nearDistance__",this),this._farDistance.addInterest("set_farDistance__",this),this._texture.addInterest("set_texture__",this),this.set_nearDistance__(),this.set_farDistance__(),this.set_texture__()},getLightKey:()=>3,getGlobal(){return this._global.getValue()},getLocation(){return this._location.getValue()},getDirection(){return this._direction.getValue()},getNearDistance(){return this.nearDistance},getNearParameter(){return this.nearParameter},getFarDistance(){return this.farDistance},getFarParameter(){return this.farParameter},getTexture(){return this.textureNode},getBiasMatrix:(()=>{const t=new(S())(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1);return function(){return t}})(),straightenHorizon(t){return t.straighten(this._upVector.getValue())},set_nearDistance__(){const t=this._nearDistance.getValue();this.nearDistance=t<0?.125:t,this.nearParameter=t<0?0:-1},set_farDistance__(){const t=this._farDistance.getValue();this.farDistance=t<0?1e5:t,this.farParameter=t<0?1:2},set_texture__(){this.textureNode?.removeInterest("set_aspectRatio__",this),this.textureNode=m()(g().X3DTexture2DNode,this._texture),this.textureNode?.addInterest("set_aspectRatio__",this),this.setEnabled(!!this.textureNode),this.set_aspectRatio__(),this.set_on__()},set_aspectRatio__(){this.textureNode?this._aspectRatio=this.textureNode.getWidth()/this.textureNode.getHeight():this._aspectRatio=1}}),Object.defineProperties(j,l().getStaticProperties("X3DTextureProjectorNode","TextureProjection",4));const y=j,D=P().add("X3DTextureProjectorNode",y),V=t.Camera;var b=e.n(V);const v=t.MatrixStack;var N=e.n(v);const X=t.ObjectCache;var U=e.n(X);const z=U()(R);function R(){this.projectionMatrix=new(S()),this.modelViewMatrix=new(N())(S()),this.modelMatrix=new(S()),this.invTextureSpaceMatrix=new(S()),this.invTextureSpaceProjectionMatrix=new(S()),this.location=new(_()),this.locationArray=new Float32Array(3),this.direction=new(_()),this.rotation=new(O()),this.matrix=new(S()),this.matrixArray=new Float32Array(16),this.textureMatrix=new(S())}function A(t){D.call(this,t),this.addType(g().TextureProjector),this._fieldOfView.setUnit("angle")}Object.assign(R.prototype,{set(t,e,i){this.browser=t.getBrowser(),this.lightNode=t,this.global=t.getGlobal(),this.modelViewMatrix.push(i),this.textureMatrix.set(...t.getTexture().getMatrix())},renderShadowMap(t){},setGlobalVariables(t){const e=this.lightNode,i=t.getCameraSpaceMatrixArray(),r=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),n=this.invTextureSpaceMatrix.assign(this.global?r:S().Identity);this.rotation.setFromToVec(_().zAxis,this.direction.assign(e.getDirection()).negate()),e.straightenHorizon(this.rotation),n.translate(e.getLocation()),n.rotate(this.rotation),n.inverse();const o=e.getTexture().getWidth(),a=e.getTexture().getHeight(),s=e.getNearDistance(),u=e.getFarDistance(),h=e.getFieldOfView();b().perspective(h,s,u,o,a,this.projectionMatrix),this.global||n.multLeft(r.inverse()),this.invTextureSpaceProjectionMatrix.assign(n).multRight(this.projectionMatrix).multRight(e.getBiasMatrix()),this.matrix.assign(i).multRight(this.invTextureSpaceProjectionMatrix).multRight(this.textureMatrix),this.matrixArray.set(this.matrix),this.modelViewMatrix.get().multVecMatrix(this.location.assign(e._location.getValue())),this.locationArray.set(this.location)},setShaderUniforms(t,e,i){const r=e.numTextureProjectors++,n=this.lightNode,o=n.getTexture(),a=this.global?this.textureUnit=this.textureUnit??this.browser.popTexture2DUnit():this.browser.getTexture2DUnit();if(t.activeTexture(t.TEXTURE0+a),t.bindTexture(t.TEXTURE_2D,o.getTexture()),t.uniform1i(e.x3d_TextureProjectorTexture[r],a),e.hasTextureProjector(r,this))return;const s=n.getNearParameter(),u=n.getFarParameter();t.uniform3f(e.x3d_TextureProjectorColor[r],...n.getColor()),t.uniform1f(e.x3d_TextureProjectorIntensity[r],n.getIntensity()),t.uniform3fv(e.x3d_TextureProjectorLocation[r],this.locationArray),t.uniform3f(e.x3d_TextureProjectorParams[r],s,u,o.isLinear()),t.uniformMatrix4fv(e.x3d_TextureProjectorMatrix[r],!1,this.matrixArray)},dispose(){this.browser.pushTexture2DUnit(this.textureUnit),this.modelViewMatrix.clear(),this.textureUnit=void 0,z.push(this)}}),Object.assign(Object.setPrototypeOf(A.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this)},getFieldOfView(){const t=this._fieldOfView.getValue();return t>0&&t<Math.PI?t:Math.PI/4},getLights:()=>z}),Object.defineProperties(A,{...l().getStaticProperties("TextureProjector","TextureProjection",2,"children","4.0"),fieldDefinitions:{value:new(h())([new(s())(g().inputOutput,"metadata",new(o().SFNode)),new(s())(g().inputOutput,"description",new(o().SFString)),new(s())(g().inputOutput,"global",new(o().SFBool)(!0)),new(s())(g().inputOutput,"on",new(o().SFBool)(!0)),new(s())(g().inputOutput,"color",new(o().SFColor)(1,1,1)),new(s())(g().inputOutput,"intensity",new(o().SFFloat)(1)),new(s())(g().inputOutput,"ambientIntensity",new(o().SFFloat)),new(s())(g().inputOutput,"location",new(o().SFVec3f)),new(s())(g().inputOutput,"direction",new(o().SFVec3f)(0,0,1)),new(s())(g().inputOutput,"upVector",new(o().SFVec3f)(0,0,1)),new(s())(g().inputOutput,"fieldOfView",new(o().SFFloat)(.785398)),new(s())(g().inputOutput,"nearDistance",new(o().SFFloat)(-1)),new(s())(g().inputOutput,"farDistance",new(o().SFFloat)(-1)),new(s())(g().outputOnly,"aspectRatio",new(o().SFFloat)),new(s())(g().inputOutput,"texture",new(o().SFNode)),new(s())(g().inputOutput,"shadows",new(o().SFBool)),new(s())(g().inputOutput,"shadowColor",new(o().SFColor)),new(s())(g().inputOutput,"shadowIntensity",new(o().SFFloat)(1)),new(s())(g().inputOutput,"shadowBias",new(o().SFFloat)(.005)),new(s())(g().initializeOnly,"shadowMapSize",new(o().SFInt32)(1024))]),enumerable:!0}});const I=A,C=P().add("TextureProjector",I),Y=U()(B);function B(){this.projectionMatrix=new(S()),this.modelViewMatrix=new(N())(S()),this.modelMatrix=new(S()),this.invTextureSpaceMatrix=new(S()),this.location=new(_()),this.locationArray=new Float32Array(3),this.invTextureSpaceProjectionMatrix=new(S()),this.direction=new(_()),this.rotation=new(O()),this.matrix=new(S()),this.matrixArray=new Float32Array(16),this.textureMatrix=new(S())}function L(t){D.call(this,t),this.addType(g().TextureProjectorParallel),this._fieldOfView.setUnit("length")}Object.assign(B.prototype,{set(t,e,i){this.browser=t.getBrowser(),this.lightNode=t,this.global=t.getGlobal(),this.modelViewMatrix.push(i),this.textureMatrix.set(...t.getTexture().getMatrix())},renderShadowMap(t){},setGlobalVariables(t){const e=this.lightNode,i=t.getCameraSpaceMatrixArray(),r=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),n=this.invTextureSpaceMatrix.assign(this.global?r:S().Identity);this.rotation.setFromToVec(_().zAxis,this.direction.assign(e.getDirection()).negate()),e.straightenHorizon(this.rotation),n.translate(e.getLocation()),n.rotate(this.rotation),n.inverse();const o=e.getTexture().getWidth()/e.getTexture().getHeight(),a=e.getMinimumX(),s=e.getMaximumX(),u=e.getMinimumY(),h=e.getMaximumY(),c=e.getSizeX(),l=e.getSizeY(),x=e.getNearDistance(),p=e.getFarDistance();if(o>c/l){const t=(a+s)/2,e=l*o/2;b().ortho(t-e,t+e,u,h,x,p,this.projectionMatrix)}else{const t=(u+h)/2,e=c/o/2;b().ortho(a,s,t-e,t+e,x,p,this.projectionMatrix)}this.global||n.multLeft(r.inverse()),this.invTextureSpaceProjectionMatrix.assign(n).multRight(this.projectionMatrix).multRight(e.getBiasMatrix()),this.matrix.assign(i).multRight(this.invTextureSpaceProjectionMatrix).multRight(this.textureMatrix),this.matrixArray.set(this.matrix),this.modelViewMatrix.get().multVecMatrix(this.location.assign(e._location.getValue())),this.locationArray.set(this.location)},setShaderUniforms(t,e,i){const r=e.numTextureProjectors++,n=this.lightNode,o=n.getTexture(),a=this.global?this.textureUnit=this.textureUnit??this.browser.popTexture2DUnit():this.browser.getTexture2DUnit();if(t.activeTexture(t.TEXTURE0+a),t.bindTexture(t.TEXTURE_2D,o.getTexture()),t.uniform1i(e.x3d_TextureProjectorTexture[r],a),e.hasTextureProjector(r,this))return;const s=n.getNearParameter(),u=n.getFarParameter();t.uniform3f(e.x3d_TextureProjectorColor[r],...n.getColor()),t.uniform1f(e.x3d_TextureProjectorIntensity[r],n.getIntensity()),t.uniform3fv(e.x3d_TextureProjectorLocation[r],this.locationArray),t.uniform3f(e.x3d_TextureProjectorParams[r],s,u,o.isLinear()),t.uniformMatrix4fv(e.x3d_TextureProjectorMatrix[r],!1,this.matrixArray)},dispose(){this.browser.pushTexture2DUnit(this.textureUnit),this.modelViewMatrix.clear(),this.textureUnit=void 0,Y.push(this)}}),Object.assign(Object.setPrototypeOf(L.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this),this._fieldOfView.addInterest("set_fieldOfView___",this),this.set_fieldOfView___()},set_fieldOfView___(){this.minimumX=this._fieldOfView[0],this.minimumY=this._fieldOfView[1],this.maximumX=this._fieldOfView[2],this.maximumY=this._fieldOfView[3],this.sizeX=this.maximumX-this.minimumX,this.sizeY=this.maximumY-this.minimumY},getMinimumX(){return this.minimumX},getMinimumY(){return this.minimumY},getMaximumX(){return this.maximumX},getMaximumY(){return this.maximumY},getSizeX(){return this.sizeX},getSizeY(){return this.sizeY},getLights:()=>Y}),Object.defineProperties(L,{...l().getStaticProperties("TextureProjectorParallel","TextureProjection",2,"children","4.0"),fieldDefinitions:{value:new(h())([new(s())(g().inputOutput,"metadata",new(o().SFNode)),new(s())(g().inputOutput,"description",new(o().SFString)),new(s())(g().inputOutput,"global",new(o().SFBool)(!0)),new(s())(g().inputOutput,"on",new(o().SFBool)(!0)),new(s())(g().inputOutput,"color",new(o().SFColor)(1,1,1)),new(s())(g().inputOutput,"intensity",new(o().SFFloat)(1)),new(s())(g().inputOutput,"ambientIntensity",new(o().SFFloat)),new(s())(g().inputOutput,"location",new(o().SFVec3f)),new(s())(g().inputOutput,"direction",new(o().SFVec3f)(0,0,1)),new(s())(g().inputOutput,"upVector",new(o().SFVec3f)(0,0,1)),new(s())(g().inputOutput,"fieldOfView",new(o().SFVec4f)(-1,-1,1,1)),new(s())(g().inputOutput,"nearDistance",new(o().SFFloat)(-1)),new(s())(g().inputOutput,"farDistance",new(o().SFFloat)(-1)),new(s())(g().outputOnly,"aspectRatio",new(o().SFFloat)),new(s())(g().inputOutput,"texture",new(o().SFNode)),new(s())(g().inputOutput,"shadows",new(o().SFBool)),new(s())(g().inputOutput,"shadowColor",new(o().SFColor)),new(s())(g().inputOutput,"shadowIntensity",new(o().SFFloat)(1)),new(s())(g().inputOutput,"shadowBias",new(o().SFFloat)(.005)),new(s())(g().initializeOnly,"shadowMapSize",new(o().SFInt32)(1024))]),enumerable:!0}});const E=L,H=P().add("TextureProjectorParallel",E);r().add({name:"TextureProjection",concreteNodes:[C,H],abstractNodes:[D]});P().add("TextureProjectionComponent",undefined)})();
|