@arcgis/core 4.25.0-next.20220721 → 4.25.0-next.20220722
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{791220164501a791b2cd.js → 0896986aa60516f716f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{59e18862b803fdc41786.js → 0c145b87c24bf6c7d572.js} +1 -1
- package/assets/esri/core/workers/chunks/2504c43fac77ecd9ec2a.js +1 -0
- package/assets/esri/core/workers/chunks/{39de883f236e2a8d9024.js → 30d7796ee6f7e4a6a3e1.js} +2 -2
- package/assets/esri/core/workers/chunks/{39de883f236e2a8d9024.js.LICENSE.txt → 30d7796ee6f7e4a6a3e1.js.LICENSE.txt} +0 -0
- package/assets/esri/core/workers/chunks/3281656a9bd3627e41ff.js +1 -0
- package/assets/esri/core/workers/chunks/374ee2b2cad26f7ad572.js +1 -0
- package/assets/esri/core/workers/chunks/4d14be8c7e8adaa91876.js +1011 -0
- package/assets/esri/core/workers/chunks/{c22d7622294fe4aefe0b.js → 4f2d2cc71f5ff5ac2a60.js} +1 -1
- package/assets/esri/core/workers/chunks/8b1d5b7e9de73bc9da3a.js +1 -0
- package/assets/esri/core/workers/chunks/9dc4db35c387e11e9beb.js +1 -0
- package/assets/esri/core/workers/chunks/{42987dcfda665c860151.js → a23376df9696ebe5b5cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4ad2cf5d6bded02e392.js → ed763fc352d0b55e5867.js} +1 -1
- package/assets/esri/core/workers/chunks/{a05f6afcf56245824853.js → f1fdb335c5f9ec8b27cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{9493a8e5d6001b6bf275.js → f59f82a43437a51c934c.js} +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_en.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_en.json +1 -1
- package/chunks/DefaultMaterial.glsl.js +42 -37
- package/chunks/RealisticTree.glsl.js +25 -25
- package/geometry/support/MeshMaterial.js +1 -1
- package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/resources/MarsAtmosphereTexture.js +1 -1
- package/views/3d/environment/resources/SimpleAtmosphereTexture.js +1 -1
- package/views/3d/glTF/LoaderResult.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/internal/TextureTransformUtils.js +5 -0
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/ElevationLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/support/CombinedElevationProvider.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +22 -22
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +19 -10
- package/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js +15 -0
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/input/recognizers/DoubleTapDrag.js +1 -1
- package/views/input/recognizers/Drag.js +1 -1
- package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
- package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
- package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
- package/views/input/recognizers/VerticalTwoFingerDrag.js +1 -1
- package/views/input/recognizers/support.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/overlay/ViewOverlay.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/support/DatePicker.js +1 -1
- package/widgets/support/TimePicker.js +1 -1
- package/assets/esri/core/workers/chunks/0b269862733afe740a63.js +0 -1
- package/assets/esri/core/workers/chunks/290cd411d0d18b1d0efd.js +0 -1
- package/assets/esri/core/workers/chunks/85a2cf095f002b2c486f.js +0 -1
- package/assets/esri/core/workers/chunks/b312dd3027492007d75e.js +0 -1
- package/assets/esri/core/workers/chunks/bf348f6f52701fa6016e.js +0 -987
- package/assets/esri/core/workers/chunks/c79d4cb3332550fb0df5.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{releaseMaybe as t,isSome as r,isNone as s}from"../../../../../../core/maybe.js";import{g as o,t as a}from"../../../../../../chunks/mat3.js";import{a as i}from"../../../../../../chunks/mat3f32.js";import{F as n}from"../../../../../../chunks/vec3.js";import{f as l}from"../../../../../../chunks/vec3f32.js";import{v as h}from"../../../../../../chunks/vec4.js";import{f as u}from"../../../../../../chunks/vec4f32.js";import{ColorMixModeEnum as p}from"../../../../layers/support/symbolColorUtils.js";import{OverlayIndex as c,RenderTargetType as d}from"../../../../terrain/interfaces.js";import{ComponentTechnique as m}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as g,IntegratedMeshMode as y}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as T}from"./shader/ComponentData.glsl.js";import{g as x}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as b}from"./shader/VertexDiscardByOpacity.glsl.js";import{MaterialBase as f,parameter as v,parameterBlock as M,MaterialParameterBlock as O}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as C,MaterialSubPass as w}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as P}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as S}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as N}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as A}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{defaultMaskAlphaCutoff as j}from"../../../core/shaderLibrary/util/AlphaCutoff.js";import{EllipsoidMode as D}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as q}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as R,CullFaceOptions as I}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as E}from"../../../lib/TransparencyPassType.js";class F extends f{constructor(e,t){super(),this.toMapSpace=t,this.baseColor=u(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=l(1,1,.5),this.emissiveFactor=l(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new W,this.componentParameters=new L,this.textureAlphaCutoff=j,this.alphaDiscardMode=R.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=D.Earth,this.hasOccludees=!1,this._techniqueConfiguration=new g;const r=new q(e.position),s=i(e.rotationScale);o(s,s),this.transformNormalGlobalFromModel=a(s,s),this.transformWorldFromModelTL=r.low,this.transformWorldFromModelTH=r.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this._technique=t(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return r(this.baseColorTexture)?this.baseColorTexture.glTexture:null}get textureMetallicRoughness(){return r(this.metallicRoughnessTexture)?this.metallicRoughnessTexture.glTexture:null}get textureEmissive(){return r(this.emissionTexture)?this.emissionTexture.glTexture:null}get textureOcclusion(){return r(this.occlusionTexture)?this.occlusionTexture.glTexture:null}get textureNormal(){return r(this.normalTexture)?this.normalTexture.glTexture:null}prepareTechnique(e,t,o,a){const i=this._techniqueConfiguration;i.hasVertexColors=a.colors,i.hasNormals=a.normals,i.textureCoordinateType=a.textureCoordinates,i.hasMetalnessAndRoughnessTexture=r(this.metallicRoughnessTexture),i.hasEmissionTexture=r(this.emissionTexture),i.hasOcclusionTexture=r(this.occlusionTexture),i.hasNormalTexture=r(this.normalTexture),i.transparencyPassType=t.identifier===C.Material&&null!=o.transparencyPassType?o.transparencyPassType:E.NONE,i.hasMultipassTerrain=t.identifier===C.Material&&null!=o.multipassTerrain&&o.multipassTerrain.enabled,i.cullAboveGround=t.identifier===C.Material&&null!=o.multipassTerrain&&o.multipassTerrain.cullAboveGround,i.ellipsoidMode=this.ellipsoidMode,i.componentData=this.componentParameters.type,i.cullFace=this.commonMaterialParameters.cullFace,i.doubleSidedMode=this.commonMaterialParameters.doubleSided?N.View:N.None,i.hasBaseColorTexture=r(this.baseColorTexture);const n=this._computeWhichMaterialPass();i.blendingEnabled=n===k.Transparent||n===k.OpaqueAndTransparent,i.alphaDiscardMode=this.alphaDiscardMode,i.integratedMeshMode=this.isIntegratedMesh?U(o)?x(o)?y.ColorOverlayWithWater:y.ColorOverlay:y.NoOverlay:y.None,i.isGround=this.isIntegratedMesh,i.hasPolygonOffset=this.polygonOffsetEnabled;const l=this.hasParametersFromSource&&s(this.baseColorTexture);return i.pbrMode=i.integratedMeshMode===y.ColorOverlayWithWater?A.WaterOnIntegratedMesh:this.usePBR?l?A.Schematic:A.Normal:A.Disabled,i.normalType=i.integratedMeshMode===y.None?i.hasNormals?S.CompressedAttribute:S.ScreenDerivative:S.Ground,i.hasSlicePlane=r(o.slicePlane)&&this.commonMaterialParameters.hasSlicePlane,t.identifier===C.ShadowMap?(i.output=P.Shadow,i.vertexDiscardMode=b.None):t.identifier===C.Highlight?(i.output=P.Highlight,i.vertexDiscardMode=b.None):(this._computeWhichMaterialPass()===k.OpaqueAndTransparent?i.vertexDiscardMode=t.transparent?b.Opaque:b.Transparent:i.vertexDiscardMode=b.None,i.output=G(t.subPass),t.subPass===w.Alpha&&(i.hasOccludees=o.hasOccludees),t.subPass===w.Color?(i.receiveAmbientOcclusion=o.ssaoHelper.ready,i.hasOccludees=o.hasOccludees,i.receiveShadows=o.shadowMap.ready,i.hasScreenSpaceReflections=o.ssr.enabled,i.hasCloudsReflections=r(o.clouds.data)):(i.receiveAmbientOcclusion=!1,i.receiveShadows=!1),i.snowCover=this.hasSnowCover(o),t.subPass===w.ObjectAndLayerIdColor&&(i.objectAndLayerIdColor=!0)),this._technique=e.releaseAndAcquire(m,i,this._technique),this._setClean(),this._technique}hasSnowCover(e){return r(e.weather)&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,s){if(0===this.objectOpacity)return;const o=s.renderable.geometry,a=s.components,i=s.renderable.meta.cameraDepthSquared,n=a.geometryRanges,l=a.highlightRanges,h=a.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case k.Opaque:e.materialOpaque.submitDraw(this,o,n,i);break;case k.Transparent:e.materialTransparent.submitDraw(this,o,n,i);break;case k.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,o,n,i),e.materialTransparent.submitDraw(this,o,n,i);break;case k.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,o,n,i),H(t)&&e.highlightIntegratedMesh.submitDraw(this,o,n,i)}const u=this.componentParameters.castShadows!==V.None;u&&e.shadowMap.submitDraw(this,o,n,i),r(l)&&(e.highlight.submitDraw(this,o,l,i),u&&e.highlightShadowMap.submitDraw(this,o,l,i)),u&&r(h)&&e.defaultShadowMap.submitDraw(this,o,h,i)}_computeWhichMaterialPass(){return this.isIntegratedMesh?k.IntegratedMesh:this.objectOpacity<1?k.Transparent:this.componentParameters.opaqueOverride===V.All?k.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===R.Blend||this.alphaDiscardMode===R.MaskBlend?k.Transparent:this.componentParameters.transparent===V.None?k.Opaque:this.componentParameters.transparent===V.All?k.Transparent:k.OpaqueAndTransparent}}var _,k,V;e([v({vectorOps:h})],F.prototype,"baseColor",void 0),e([v()],F.prototype,"usePBR",void 0),e([v()],F.prototype,"hasParametersFromSource",void 0),e([v({vectorOps:n})],F.prototype,"mrrFactors",void 0),e([v({vectorOps:n})],F.prototype,"emissiveFactor",void 0),e([v({dispose:!0})],F.prototype,"baseColorTexture",void 0),e([v({dispose:!0})],F.prototype,"metallicRoughnessTexture",void 0),e([v({dispose:!0})],F.prototype,"emissionTexture",void 0),e([v({dispose:!0})],F.prototype,"occlusionTexture",void 0),e([v({dispose:!0})],F.prototype,"normalTexture",void 0),e([v()],F.prototype,"objectOpacity",void 0),e([M()],F.prototype,"commonMaterialParameters",void 0),e([M()],F.prototype,"componentParameters",void 0),e([v()],F.prototype,"textureAlphaCutoff",void 0),e([v()],F.prototype,"alphaDiscardMode",void 0),e([v()],F.prototype,"isIntegratedMesh",void 0),e([v()],F.prototype,"polygonOffsetEnabled",void 0),e([v()],F.prototype,"ellipsoidMode",void 0),e([v()],F.prototype,"hasOccludees",void 0),function(e){e[e.VERTEX=0]="VERTEX",e[e.GROUND=1]="GROUND",e[e.SCREEN_DERIVATIVE=2]="SCREEN_DERIVATIVE"}(_||(_={})),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class W extends O{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=I.Back,this.hasSlicePlane=!0}}e([v()],W.prototype,"doubleSided",void 0),e([v()],W.prototype,"cullFace",void 0),e([v()],W.prototype,"hasSlicePlane",void 0);class L extends O{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=p.Multiply,this.castShadows=V.All}get transparent(){return this.externalColor[3]<1?V.All:V.None}get opaqueOverride(){return this.externalColorMixMode===p.Replace&&1===this.externalColor[3]?V.All:V.None}get visible(){return this.externalColor[3]>0?V.All:V.None}get type(){return T.Uniform}}e([v({vectorOps:h})],L.prototype,"externalColor",void 0),e([v()],L.prototype,"externalColorMixMode",void 0),e([v()],L.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(V||(V={}));class B extends O{constructor(){super(...arguments),this.texture=null,this.transparent=V.None,this.opaqueOverride=V.None,this.castShadows=V.None}get type(){return T.Varying}}function G(e){switch(e){case w.Color:return P.Color;case w.Alpha:return P.Alpha;case w.Depth:return P.Depth;case w.Normal:return P.Normal;case w.ObjectAndLayerIdColor:return P.ObjectAndLayerIdColor}}function H(e){return 0!==e.overlays.length&&r(e.overlays[c.INNER].getValidTexture(d.Highlight))}function U(e){return 0!==e.overlays.length&&r(e.overlays[c.INNER].getColorTextureNoRasterImage())}e([v()],B.prototype,"texture",void 0),e([v()],B.prototype,"transparent",void 0),e([v()],B.prototype,"opaqueOverride",void 0),e([v()],B.prototype,"castShadows",void 0);export{W as CommonMaterialParameters,F as ComponentMaterial,V as ComponentParameterSummary,L as ComponentParametersUniform,B as ComponentParametersVarying,_ as ShadingNormalSource};
|
|
5
|
+
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{releaseMaybe as t,isSome as r,isNone as s}from"../../../../../../core/maybe.js";import{g as o,t as a}from"../../../../../../chunks/mat3.js";import{a as i}from"../../../../../../chunks/mat3f32.js";import{F as n}from"../../../../../../chunks/vec3.js";import{f as l}from"../../../../../../chunks/vec3f32.js";import{v as h}from"../../../../../../chunks/vec4.js";import{f as u}from"../../../../../../chunks/vec4f32.js";import{ColorMixModeEnum as p}from"../../../../layers/support/symbolColorUtils.js";import{OverlayIndex as c,RenderTargetType as d}from"../../../../terrain/interfaces.js";import{ComponentTechnique as m}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as g,IntegratedMeshMode as y}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as T}from"./shader/ComponentData.glsl.js";import{g as x}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as b}from"./shader/VertexDiscardByOpacity.glsl.js";import{MaterialBase as f,parameter as v,parameterBlock as M,MaterialParameterBlock as O}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as C,MaterialSubPass as w}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as P}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as S}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as N}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as A}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{defaultMaskAlphaCutoff as j}from"../../../core/shaderLibrary/util/AlphaCutoff.js";import{EllipsoidMode as D}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as q}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as R,CullFaceOptions as I}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as E}from"../../../lib/TransparencyPassType.js";class F extends f{constructor(e,t){super(),this.toMapSpace=t,this.baseColor=u(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=l(1,1,.5),this.emissiveFactor=l(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new W,this.componentParameters=new L,this.textureAlphaCutoff=j,this.alphaDiscardMode=R.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=D.Earth,this.hasOccludees=!1,this._techniqueConfiguration=new g;const r=new q(e.position),s=i(e.rotationScale);o(s,s),this.transformNormalGlobalFromModel=a(s,s),this.transformWorldFromModelTL=r.low,this.transformWorldFromModelTH=r.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this._technique=t(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return r(this.baseColorTexture)?this.baseColorTexture.glTexture:null}get textureMetallicRoughness(){return r(this.metallicRoughnessTexture)?this.metallicRoughnessTexture.glTexture:null}get textureEmissive(){return r(this.emissionTexture)?this.emissionTexture.glTexture:null}get textureOcclusion(){return r(this.occlusionTexture)?this.occlusionTexture.glTexture:null}get textureNormal(){return r(this.normalTexture)?this.normalTexture.glTexture:null}prepareTechnique(e,t,o,a){const i=this._techniqueConfiguration;i.hasVertexColors=a.colors,i.hasNormals=a.normals,i.textureCoordinateType=a.textureCoordinates,i.hasMetallicRoughnessTexture=r(this.metallicRoughnessTexture),i.hasEmissionTexture=r(this.emissionTexture),i.hasOcclusionTexture=r(this.occlusionTexture),i.hasNormalTexture=r(this.normalTexture),i.transparencyPassType=t.identifier===C.Material&&null!=o.transparencyPassType?o.transparencyPassType:E.NONE,i.hasMultipassTerrain=t.identifier===C.Material&&null!=o.multipassTerrain&&o.multipassTerrain.enabled,i.cullAboveGround=t.identifier===C.Material&&null!=o.multipassTerrain&&o.multipassTerrain.cullAboveGround,i.ellipsoidMode=this.ellipsoidMode,i.componentData=this.componentParameters.type,i.cullFace=this.commonMaterialParameters.cullFace,i.doubleSidedMode=this.commonMaterialParameters.doubleSided?N.View:N.None,i.hasBaseColorTexture=r(this.baseColorTexture);const n=this._computeWhichMaterialPass();i.blendingEnabled=n===k.Transparent||n===k.OpaqueAndTransparent,i.alphaDiscardMode=this.alphaDiscardMode,i.integratedMeshMode=this.isIntegratedMesh?U(o)?x(o)?y.ColorOverlayWithWater:y.ColorOverlay:y.NoOverlay:y.None,i.isGround=this.isIntegratedMesh,i.hasPolygonOffset=this.polygonOffsetEnabled;const l=this.hasParametersFromSource&&s(this.baseColorTexture);return i.pbrMode=i.integratedMeshMode===y.ColorOverlayWithWater?A.WaterOnIntegratedMesh:this.usePBR?l?A.Schematic:A.Normal:A.Disabled,i.normalType=i.integratedMeshMode===y.None?i.hasNormals?S.CompressedAttribute:S.ScreenDerivative:S.Ground,i.hasSlicePlane=r(o.slicePlane)&&this.commonMaterialParameters.hasSlicePlane,t.identifier===C.ShadowMap?(i.output=P.Shadow,i.vertexDiscardMode=b.None):t.identifier===C.Highlight?(i.output=P.Highlight,i.vertexDiscardMode=b.None):(this._computeWhichMaterialPass()===k.OpaqueAndTransparent?i.vertexDiscardMode=t.transparent?b.Opaque:b.Transparent:i.vertexDiscardMode=b.None,i.output=G(t.subPass),t.subPass===w.Alpha&&(i.hasOccludees=o.hasOccludees),t.subPass===w.Color?(i.receiveAmbientOcclusion=o.ssaoHelper.ready,i.hasOccludees=o.hasOccludees,i.receiveShadows=o.shadowMap.ready,i.hasScreenSpaceReflections=o.ssr.enabled,i.hasCloudsReflections=r(o.clouds.data)):(i.receiveAmbientOcclusion=!1,i.receiveShadows=!1),i.snowCover=this.hasSnowCover(o),t.subPass===w.ObjectAndLayerIdColor&&(i.objectAndLayerIdColor=!0)),this._technique=e.releaseAndAcquire(m,i,this._technique),this._setClean(),this._technique}hasSnowCover(e){return r(e.weather)&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,s){if(0===this.objectOpacity)return;const o=s.renderable.geometry,a=s.components,i=s.renderable.meta.cameraDepthSquared,n=a.geometryRanges,l=a.highlightRanges,h=a.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case k.Opaque:e.materialOpaque.submitDraw(this,o,n,i);break;case k.Transparent:e.materialTransparent.submitDraw(this,o,n,i);break;case k.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,o,n,i),e.materialTransparent.submitDraw(this,o,n,i);break;case k.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,o,n,i),H(t)&&e.highlightIntegratedMesh.submitDraw(this,o,n,i)}const u=this.componentParameters.castShadows!==V.None;u&&e.shadowMap.submitDraw(this,o,n,i),r(l)&&(e.highlight.submitDraw(this,o,l,i),u&&e.highlightShadowMap.submitDraw(this,o,l,i)),u&&r(h)&&e.defaultShadowMap.submitDraw(this,o,h,i)}_computeWhichMaterialPass(){return this.isIntegratedMesh?k.IntegratedMesh:this.objectOpacity<1?k.Transparent:this.componentParameters.opaqueOverride===V.All?k.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===R.Blend||this.alphaDiscardMode===R.MaskBlend?k.Transparent:this.componentParameters.transparent===V.None?k.Opaque:this.componentParameters.transparent===V.All?k.Transparent:k.OpaqueAndTransparent}}var _,k,V;e([v({vectorOps:h})],F.prototype,"baseColor",void 0),e([v()],F.prototype,"usePBR",void 0),e([v()],F.prototype,"hasParametersFromSource",void 0),e([v({vectorOps:n})],F.prototype,"mrrFactors",void 0),e([v({vectorOps:n})],F.prototype,"emissiveFactor",void 0),e([v({dispose:!0})],F.prototype,"baseColorTexture",void 0),e([v({dispose:!0})],F.prototype,"metallicRoughnessTexture",void 0),e([v({dispose:!0})],F.prototype,"emissionTexture",void 0),e([v({dispose:!0})],F.prototype,"occlusionTexture",void 0),e([v({dispose:!0})],F.prototype,"normalTexture",void 0),e([v()],F.prototype,"objectOpacity",void 0),e([M()],F.prototype,"commonMaterialParameters",void 0),e([M()],F.prototype,"componentParameters",void 0),e([v()],F.prototype,"textureAlphaCutoff",void 0),e([v()],F.prototype,"alphaDiscardMode",void 0),e([v()],F.prototype,"isIntegratedMesh",void 0),e([v()],F.prototype,"polygonOffsetEnabled",void 0),e([v()],F.prototype,"ellipsoidMode",void 0),e([v()],F.prototype,"hasOccludees",void 0),function(e){e[e.VERTEX=0]="VERTEX",e[e.GROUND=1]="GROUND",e[e.SCREEN_DERIVATIVE=2]="SCREEN_DERIVATIVE"}(_||(_={})),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class W extends O{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=I.Back,this.hasSlicePlane=!0}}e([v()],W.prototype,"doubleSided",void 0),e([v()],W.prototype,"cullFace",void 0),e([v()],W.prototype,"hasSlicePlane",void 0);class L extends O{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=p.Multiply,this.castShadows=V.All}get transparent(){return this.externalColor[3]<1?V.All:V.None}get opaqueOverride(){return this.externalColorMixMode===p.Replace&&1===this.externalColor[3]?V.All:V.None}get visible(){return this.externalColor[3]>0?V.All:V.None}get type(){return T.Uniform}}e([v({vectorOps:h})],L.prototype,"externalColor",void 0),e([v()],L.prototype,"externalColorMixMode",void 0),e([v()],L.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(V||(V={}));class B extends O{constructor(){super(...arguments),this.texture=null,this.transparent=V.None,this.opaqueOverride=V.None,this.castShadows=V.None}get type(){return T.Varying}}function G(e){switch(e){case w.Color:return P.Color;case w.Alpha:return P.Alpha;case w.Depth:return P.Depth;case w.Normal:return P.Normal;case w.ObjectAndLayerIdColor:return P.ObjectAndLayerIdColor}}function H(e){return 0!==e.overlays.length&&r(e.overlays[c.INNER].getValidTexture(d.Highlight))}function U(e){return 0!==e.overlays.length&&r(e.overlays[c.INNER].getColorTextureNoRasterImage())}e([v()],B.prototype,"texture",void 0),e([v()],B.prototype,"transparent",void 0),e([v()],B.prototype,"opaqueOverride",void 0),e([v()],B.prototype,"castShadows",void 0);export{W as CommonMaterialParameters,F as ComponentMaterial,V as ComponentParameterSummary,L as ComponentParametersUniform,B as ComponentParametersVarying,_ as ShadingNormalSource};
|
package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../../../chunks/tslib.es6.js";import{ComponentDataType as e}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as t}from"./shader/VertexDiscardByOpacity.glsl.js";import{ShaderOutput as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as s}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as i}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as a}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as n}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{BindType as d}from"../../../core/shaderTechnique/BindType.js";import{parameter as l,ShaderTechniqueConfiguration as c}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as h,AlphaDiscardMode as u}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as y}from"../../../lib/TransparencyPassType.js";var v,T;!function(o){o[o.None=0]="None",o[o.Transparent=1]="Transparent",o[o.Opaque=2]="Opaque",o[o.COUNT=3]="COUNT"}(v||(v={})),function(o){o[o.None=0]="None",o[o.NoOverlay=1]="NoOverlay",o[o.ColorOverlay=2]="ColorOverlay",o[o.ColorOverlayWithWater=3]="ColorOverlayWithWater",o[o.COUNT=4]="COUNT"}(T||(T={}));class m extends c{constructor(){super(...arguments),this.output=r.Color,this.textureCoordinateType=i.None,this.componentData=e.Uniform,this.cullFace=h.Back,this.vertexDiscardMode=t.None,this.doubleSidedMode=a.WindingOrder,this.alphaDiscardMode=u.Opaque,this.integratedMeshMode=T.None,this.transparencyPassType=y.NONE,this.ellipsoidMode=n.Earth,this.pbrMode=p.Disabled,this.normalType=s.Attribute,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.hasSlicePlane=!1,this.hasBaseColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.hasScreenSpaceReflections=!1,this.hasPolygonOffset=!1,this.
|
|
5
|
+
import{_ as o}from"../../../../../../chunks/tslib.es6.js";import{ComponentDataType as e}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as t}from"./shader/VertexDiscardByOpacity.glsl.js";import{ShaderOutput as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as s}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as i}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as a}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as n}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{BindType as d}from"../../../core/shaderTechnique/BindType.js";import{parameter as l,ShaderTechniqueConfiguration as c}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as h,AlphaDiscardMode as u}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as y}from"../../../lib/TransparencyPassType.js";var v,T;!function(o){o[o.None=0]="None",o[o.Transparent=1]="Transparent",o[o.Opaque=2]="Opaque",o[o.COUNT=3]="COUNT"}(v||(v={})),function(o){o[o.None=0]="None",o[o.NoOverlay=1]="NoOverlay",o[o.ColorOverlay=2]="ColorOverlay",o[o.ColorOverlayWithWater=3]="ColorOverlayWithWater",o[o.COUNT=4]="COUNT"}(T||(T={}));class m extends c{constructor(){super(...arguments),this.output=r.Color,this.textureCoordinateType=i.None,this.componentData=e.Uniform,this.cullFace=h.Back,this.vertexDiscardMode=t.None,this.doubleSidedMode=a.WindingOrder,this.alphaDiscardMode=u.Opaque,this.integratedMeshMode=T.None,this.transparencyPassType=y.NONE,this.ellipsoidMode=n.Earth,this.pbrMode=p.Disabled,this.normalType=s.Attribute,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.hasSlicePlane=!1,this.hasBaseColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.hasScreenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.isGround=!1,this.hasCloudsReflections=!0,this.snowCover=!1,this.objectAndLayerIdColor=!1}}o([l({count:r.COUNT})],m.prototype,"output",void 0),o([l({count:i.COUNT})],m.prototype,"textureCoordinateType",void 0),o([l({count:e.COUNT})],m.prototype,"componentData",void 0),o([l({count:h.COUNT})],m.prototype,"cullFace",void 0),o([l({count:t.COUNT})],m.prototype,"vertexDiscardMode",void 0),o([l({count:a.COUNT})],m.prototype,"doubleSidedMode",void 0),o([l({count:u.COUNT})],m.prototype,"alphaDiscardMode",void 0),o([l({count:T.COUNT})],m.prototype,"integratedMeshMode",void 0),o([l({count:y.COUNT})],m.prototype,"transparencyPassType",void 0),o([l({count:n.COUNT})],m.prototype,"ellipsoidMode",void 0),o([l({count:p.COUNT})],m.prototype,"pbrMode",void 0),o([l({count:s.COUNT})],m.prototype,"normalType",void 0),o([l()],m.prototype,"spherical",void 0),o([l()],m.prototype,"doublePrecisionRequiresObfuscation",void 0),o([l()],m.prototype,"hasVertexColors",void 0),o([l()],m.prototype,"hasNormals",void 0),o([l()],m.prototype,"hasSlicePlane",void 0),o([l()],m.prototype,"hasBaseColorTexture",void 0),o([l()],m.prototype,"receiveAmbientOcclusion",void 0),o([l()],m.prototype,"receiveShadows",void 0),o([l()],m.prototype,"blendingEnabled",void 0),o([l()],m.prototype,"hasScreenSpaceReflections",void 0),o([l()],m.prototype,"hasPolygonOffset",void 0),o([l()],m.prototype,"hasMetallicRoughnessTexture",void 0),o([l()],m.prototype,"hasEmissionTexture",void 0),o([l()],m.prototype,"hasOcclusionTexture",void 0),o([l()],m.prototype,"hasNormalTexture",void 0),o([l()],m.prototype,"hasOccludees",void 0),o([l()],m.prototype,"hasMultipassTerrain",void 0),o([l()],m.prototype,"cullAboveGround",void 0),o([l()],m.prototype,"isGround",void 0),o([l()],m.prototype,"hasCloudsReflections",void 0),o([l()],m.prototype,"snowCover",void 0),o([l()],m.prototype,"objectAndLayerIdColor",void 0),o([l({constValue:d.Draw})],m.prototype,"pbrTextureBindType",void 0),o([l({constValue:!0})],m.prototype,"hasSliceHighlight",void 0),o([l({constValue:!1})],m.prototype,"hasSliceInVertexProgram",void 0),o([l({constValue:!1})],m.prototype,"useCustomDTRExponentForWater",void 0),o([l({constValue:!1})],m.prototype,"hasVertexTangents",void 0),o([l({constValue:!0})],m.prototype,"supportsTextureAtlas",void 0),o([l({constValue:!1})],m.prototype,"highStepCount",void 0),o([l({constValue:!1})],m.prototype,"instancedDoublePrecision",void 0),o([l({constValue:!0})],m.prototype,"useFillLights",void 0),o([l({constValue:!1})],m.prototype,"objectAndLayerIdColorInstanced",void 0);export{m as ComponentTechniqueConfiguration,T as IntegratedMeshMode,v as PassDiscardMode};
|
package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js
CHANGED
|
@@ -2,60 +2,60 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as o}from"../../../../../../core/maybe.js";import{I as r}from"../../../../../../chunks/mat4f64.js";import{ShaderOutput as e}from"../ShaderOutput.js";import{SliceDraw as t}from"../Slice.glsl.js";import{Transform as
|
|
5
|
+
import{isSome as o}from"../../../../../../core/maybe.js";import{I as r}from"../../../../../../chunks/mat4f64.js";import{ShaderOutput as e}from"../ShaderOutput.js";import{SliceDraw as t}from"../Slice.glsl.js";import{Transform as a}from"../Transform.glsl.js";import{NormalAttribute as i,NormalAttributeType as s}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as l}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as d}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as n}from"../attributes/VertexNormal.glsl.js";import{OutputDepth as u}from"../output/OutputDepth.glsl.js";import{OutputHighlight as m}from"../output/OutputHighlight.glsl.js";import{VisualVariables as c}from"../shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as p}from"../util/AlphaDiscard.glsl.js";import{addProjViewLocalOrigin as v}from"../util/View.glsl.js";import{Float2PassUniform as f}from"../../shaderModules/Float2PassUniform.js";import{glsl as h}from"../../shaderModules/interfaces.js";import{Matrix4PassUniform as g}from"../../shaderModules/Matrix4PassUniform.js";import{Texture2DPassUniform as x}from"../../shaderModules/Texture2DPassUniform.js";function j(j,C){const T=j.vertex.code,w=j.fragment.code,O=C.hasModelTransformation;switch(O&&j.vertex.uniforms.add(new g("model",(e=>o(e.modelTransformation)?e.modelTransformation:r))),C.output){case e.Depth:case e.Shadow:case e.ShadowHighlight:case e.ShadowExludeHighlight:case e.ObjectAndLayerIdColor:v(j,C),j.include(a,C),j.include(d,C),j.include(c,C),j.include(u,C),j.include(t,C),j.include(l,C),j.vertex.uniforms.add(new f("nearFar",((o,r)=>r.camera.nearFar))),j.varyings.add("depth","float"),C.hasColorTexture&&j.fragment.uniforms.add(new x("tex",(o=>o.texture))),T.add(h`
|
|
6
6
|
void main(void) {
|
|
7
7
|
vpos = calculateVPos();
|
|
8
8
|
vpos = subtractOrigin(vpos);
|
|
9
9
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
10
|
-
gl_Position = transformPositionWithDepth(proj, view, ${
|
|
10
|
+
gl_Position = transformPositionWithDepth(proj, view, ${O?"model,":""} vpos, nearFar, depth);
|
|
11
11
|
forwardTextureCoordinates();
|
|
12
12
|
forwardObjectAndLayerIdColor();
|
|
13
13
|
}
|
|
14
|
-
`),j.include(p,C),
|
|
14
|
+
`),j.include(p,C),w.add(h`
|
|
15
15
|
void main(void) {
|
|
16
16
|
discardBySlice(vpos);
|
|
17
|
-
${C.hasColorTexture?
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
${C.output===e.ObjectAndLayerIdColor?
|
|
17
|
+
${C.hasColorTexture?h`
|
|
18
|
+
vec4 texColor = texture2D(tex, ${C.hasColorTextureTransform?h`colorUV`:h`vuv0`});
|
|
19
|
+
discardOrAdjustAlpha(texColor);`:""}
|
|
20
|
+
${C.output===e.ObjectAndLayerIdColor?h`outputObjectAndLayerIdColor();`:h`outputDepth(depth);`}
|
|
21
21
|
}
|
|
22
|
-
`);break;case e.Normal:v(j,C),j.include(
|
|
22
|
+
`);break;case e.Normal:v(j,C),j.include(a,C),j.include(i,C),j.include(n,C),j.include(d,C),j.include(c,C),C.hasColorTexture&&j.fragment.uniforms.add(new x("tex",(o=>o.texture))),j.varyings.add("vPositionView","vec3"),T.add(h`
|
|
23
23
|
void main(void) {
|
|
24
24
|
vpos = calculateVPos();
|
|
25
25
|
vpos = subtractOrigin(vpos);
|
|
26
|
-
${C.normalType===s.Attribute?
|
|
26
|
+
${C.normalType===s.Attribute?h`
|
|
27
27
|
vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:""}
|
|
28
28
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
29
|
-
gl_Position = transformPosition(proj, view, ${
|
|
29
|
+
gl_Position = transformPosition(proj, view, ${O?"model,":""} vpos);
|
|
30
30
|
forwardTextureCoordinates();
|
|
31
31
|
}
|
|
32
|
-
`),j.include(t,C),j.include(p,C),
|
|
32
|
+
`),j.include(t,C),j.include(p,C),w.add(h`
|
|
33
33
|
void main() {
|
|
34
34
|
discardBySlice(vpos);
|
|
35
|
-
${C.hasColorTexture?
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
${C.hasColorTexture?h`
|
|
36
|
+
vec4 texColor = texture2D(tex, ${C.hasColorTextureTransform?h`colorUV`:h`vuv0`});
|
|
37
|
+
discardOrAdjustAlpha(texColor);`:""}
|
|
38
38
|
|
|
39
|
-
${C.normalType===s.ScreenDerivative?
|
|
40
|
-
vec3 normal = screenDerivativeNormal(vPositionView);`:
|
|
39
|
+
${C.normalType===s.ScreenDerivative?h`
|
|
40
|
+
vec3 normal = screenDerivativeNormal(vPositionView);`:h`
|
|
41
41
|
vec3 normal = normalize(vNormalWorld);
|
|
42
42
|
if (gl_FrontFacing == false) normal = -normal;`}
|
|
43
43
|
gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
|
|
44
44
|
}
|
|
45
|
-
`);break;case e.Highlight:v(j,C),j.include(
|
|
45
|
+
`);break;case e.Highlight:v(j,C),j.include(a,C),j.include(d,C),j.include(c,C),C.hasColorTexture&&j.fragment.uniforms.add(new x("tex",(o=>o.texture))),T.add(h`
|
|
46
46
|
void main(void) {
|
|
47
47
|
vpos = calculateVPos();
|
|
48
48
|
vpos = subtractOrigin(vpos);
|
|
49
49
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
50
|
-
gl_Position = transformPosition(proj, view, ${
|
|
50
|
+
gl_Position = transformPosition(proj, view, ${O?"model,":""} vpos);
|
|
51
51
|
forwardTextureCoordinates();
|
|
52
52
|
}
|
|
53
|
-
`),j.include(t,C),j.include(p,C),j.include(m),
|
|
53
|
+
`),j.include(t,C),j.include(p,C),j.include(m),w.add(h`
|
|
54
54
|
void main() {
|
|
55
55
|
discardBySlice(vpos);
|
|
56
|
-
${C.hasColorTexture?
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
${C.hasColorTexture?h`
|
|
57
|
+
vec4 texColor = texture2D(tex, ${C.hasColorTextureTransform?h`colorUV`:h`vuv0`});
|
|
58
|
+
discardOrAdjustAlpha(texColor);`:""}
|
|
59
59
|
outputHighlight();
|
|
60
60
|
}
|
|
61
61
|
`)}}export{j as DefaultMaterialAuxiliaryPasses};
|
package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js
CHANGED
|
@@ -2,30 +2,39 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{f as e}from"../../../../../../chunks/vec3f32.js";import{VertexTextureCoordinates as s}from"../attributes/VertexTextureCoordinates.glsl.js";import{Float3DrawUniform as o}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as
|
|
5
|
+
import{f as e}from"../../../../../../chunks/vec3f32.js";import{VertexTextureCoordinates as s}from"../attributes/VertexTextureCoordinates.glsl.js";import{Float3DrawUniform as o}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{glsl as t}from"../../shaderModules/interfaces.js";import{createTexture2DDrawSizeUniforms as a}from"../../shaderModules/Texture2DDrawUniform.js";import{createTexture2DPassSizeUniforms as i}from"../../shaderModules/Texture2DPassUniform.js";import{TextureSizeUniformType as c}from"../../shaderModules/TextureSizeUniformType.js";import{BindType as u}from"../../shaderTechnique/BindType.js";import{GLTextureMaterialBindParameters as n}from"../../../lib/GLTextureMaterial.js";const l=e(0,.6,.2);var m;!function(e){e[e.Disabled=0]="Disabled",e[e.Normal=1]="Normal",e[e.Schematic=2]="Schematic",e[e.Water=3]="Water",e[e.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",e[e.COUNT=5]="COUNT"}(m||(m={}));class d extends n{}function p(e,n){const l=e.fragment,d=n.hasMetallicRoughnessTexture||n.hasEmissionTexture||n.hasOcclusionTexture;if(n.pbrMode===m.Normal&&d&&e.include(s,n),n.pbrMode!==m.Schematic)if(n.pbrMode!==m.Disabled){if(n.pbrMode===m.Normal){l.code.add(t`vec3 mrr;
|
|
6
6
|
vec3 emission;
|
|
7
|
-
float occlusion;`);const e=
|
|
7
|
+
float occlusion;`);const e=n.supportsTextureAtlas?c.Size:c.None,s=n.pbrTextureBindType;n.hasMetallicRoughnessTexture&&(l.uniforms.add(s===u.Pass?i("texMetallicRoughness",(e=>e.textureMetallicRoughness),e):a("texMetallicRoughness",(e=>e.textureMetallicRoughness),e)),l.code.add(t`void applyMetallnessAndRoughness(TextureLookupParameter params) {
|
|
8
8
|
vec3 metallicRoughness = textureLookup(texMetallicRoughness, params).rgb;
|
|
9
9
|
mrr[0] *= metallicRoughness.b;
|
|
10
10
|
mrr[1] *= metallicRoughness.g;
|
|
11
|
-
}`)),
|
|
11
|
+
}`)),n.hasEmissionTexture&&(l.uniforms.add(s===u.Pass?i("texEmission",(e=>e.textureEmissive),e):a("texEmission",(e=>e.textureEmissive),e)),l.code.add(t`void applyEmission(TextureLookupParameter params) {
|
|
12
12
|
emission *= textureLookup(texEmission, params).rgb;
|
|
13
|
-
}`)),
|
|
13
|
+
}`)),n.hasOcclusionTexture?(l.uniforms.add(s===u.Pass?i("texOcclusion",(e=>e.textureOcclusion),e):a("texOcclusion",(e=>e.textureOcclusion),e)),l.code.add(t`void applyOcclusion(TextureLookupParameter params) {
|
|
14
14
|
occlusion *= textureLookup(texOcclusion, params).r;
|
|
15
15
|
}
|
|
16
16
|
float getBakedOcclusion() {
|
|
17
17
|
return occlusion;
|
|
18
|
-
}`)):l.code.add(
|
|
18
|
+
}`)):l.code.add(t`float getBakedOcclusion() { return 1.0; }`),l.uniforms.add(s===u.Pass?[new r("emissionFactor",(e=>e.emissiveFactor)),new r("mrrFactors",(e=>e.mrrFactors))]:[new o("emissionFactor",(e=>e.emissiveFactor)),new o("mrrFactors",(e=>e.mrrFactors))]),l.code.add(t`
|
|
19
19
|
void applyPBRFactors() {
|
|
20
20
|
mrr = mrrFactors;
|
|
21
21
|
emission = emissionFactor;
|
|
22
22
|
occlusion = 1.0;
|
|
23
|
-
${d?
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
|
|
23
|
+
${d?t`vtc.uv = vuv0;`:""}
|
|
24
|
+
${n.hasMetallicRoughnessTextureTransform?t`vtc.uv = metallicRoughnessUV;`:""}
|
|
25
|
+
${n.hasMetallicRoughnessTexture?n.supportsTextureAtlas?t`
|
|
26
|
+
vtc.size = texMetallicRoughnessSize;
|
|
27
|
+
applyMetallnessAndRoughness(vtc);`:t`applyMetallnessAndRoughness(vtc);`:""}
|
|
28
|
+
${n.hasEmissiveTextureTransform?t`vtc.uv = emissiveUV;`:""}
|
|
29
|
+
${n.hasEmissionTexture?n.supportsTextureAtlas?t`
|
|
30
|
+
vtc.size = texEmissionSize;
|
|
31
|
+
applyEmission(vtc);`:t`applyEmission(vtc);`:""}
|
|
32
|
+
${n.hasOcclusionTextureTransform?t`vtc.uv = occlusionUV;`:""}
|
|
33
|
+
${n.hasOcclusionTexture?n.supportsTextureAtlas?t`
|
|
34
|
+
vtc.size = texOcclusionSize;
|
|
35
|
+
applyOcclusion(vtc);`:t`applyOcclusion(vtc);`:""}
|
|
27
36
|
}
|
|
28
|
-
`)}}else l.code.add(
|
|
37
|
+
`)}}else l.code.add(t`float getBakedOcclusion() { return 1.0; }`);else l.code.add(t`vec3 mrr = vec3(0.0, 0.6, 0.2);
|
|
29
38
|
vec3 emission = vec3(0.0);
|
|
30
39
|
float occlusion = 1.0;
|
|
31
40
|
void applyPBRFactors() {}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{isSome as r}from"../../../../../../core/maybe.js";import{c as e}from"../../../../../../chunks/mat3f32.js";import{glsl as o}from"../../shaderModules/interfaces.js";import{Matrix3PassUniform as a}from"../../shaderModules/Matrix3PassUniform.js";function s(s){s.vertex.uniforms.add(new a("colorTextureTransformMatrix",(o=>r(o.colorTextureTransformMatrix)?o.colorTextureTransformMatrix:e()))),s.varyings.add("colorUV","vec2"),s.vertex.code.add(o`void forwardColorUV(){
|
|
6
|
+
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
7
|
+
}`)}function i(s){s.vertex.uniforms.add(new a("normalTextureTransformMatrix",(o=>r(o.normalTextureTransformMatrix)?o.normalTextureTransformMatrix:e()))),s.varyings.add("normalUV","vec2"),s.vertex.code.add(o`void forwardNormalUV(){
|
|
8
|
+
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
9
|
+
}`)}function t(s){s.vertex.uniforms.add(new a("emissiveTextureTransformMatrix",(o=>r(o.emissiveTextureTransformMatrix)?o.emissiveTextureTransformMatrix:e()))),s.varyings.add("emissiveUV","vec2"),s.vertex.code.add(o`void forwardEmissiveUV(){
|
|
10
|
+
emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
11
|
+
}`)}function n(s){s.vertex.uniforms.add(new a("occlusionTextureTransformMatrix",(o=>r(o.occlusionTextureTransformMatrix)?o.occlusionTextureTransformMatrix:e()))),s.varyings.add("occlusionUV","vec2"),s.vertex.code.add(o`void forwardOcclusionUV(){
|
|
12
|
+
occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
13
|
+
}`)}function x(s){s.vertex.uniforms.add(new a("metallicRoughnessTextureTransformMatrix",(o=>r(o.metallicRoughnessTextureTransformMatrix)?o.metallicRoughnessTextureTransformMatrix:e()))),s.varyings.add("metallicRoughnessUV","vec2"),s.vertex.code.add(o`void forwardMetallicRoughnessUV(){
|
|
14
|
+
metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
15
|
+
}`)}export{s as colorTextureUV,t as emissiveTextureUV,x as metallicRoughnessTextureUV,i as normalTextureUV,n as occlusionTextureUV};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{isSome as e}from"../../../../core/maybe.js";import{s as t,c as r,n as a,b as s,l as i,g as o,e as n,t as h}from"../../../../chunks/vec3.js";import{c,f as
|
|
5
|
+
import has from"../../../../core/has.js";import{isSome as e}from"../../../../core/maybe.js";import{s as t,c as r,n as a,b as s,l as i,g as o,e as n,t as h}from"../../../../chunks/vec3.js";import{c,f as u}from"../../../../chunks/vec3f64.js";import{ViewingMode as l}from"../../../ViewingMode.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as p}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as d}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as f}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as g}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{CullFaceOptions as T}from"../lib/basicInterfaces.js";import{GLTextureMaterial as _}from"../lib/GLTextureMaterial.js";import{Material as b}from"../lib/Material.js";import{OITPolygonOffsetLimit as v}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as x}from"../lib/RenderSlot.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as S}from"../lib/verticalOffsetUtils.js";import{writeDefaultAttributes as A}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as L,intersectTriangleGeometry as M}from"./internal/MaterialUtil.js";import{DefaultMaterialTechnique as I,DefaultMaterialPassParameters as w}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as y}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as E}from"../shaders/RealisticTreeTechnique.js";class C extends b{constructor(e){super(e,P),this.supportsEdges=!0,this._configuration=new y,this._vertexBufferLayout=j(this.parameters),this._instanceBufferLayout=e.instanced?B(this.parameters):null}isVisibleForOutput(e){return e!==p.Shadow&&e!==p.ShadowExludeHighlight&&e!==p.ShadowHighlight||this.parameters.castShadows}isVisible(){const t=this.parameters;if(!super.isVisible()||0===t.layerOpacity)return!1;const{instanced:r,hasVertexColors:a,hasSymbolColors:s,vvColorEnabled:i}=t,o=e(r)&&r.includes("color"),n="replace"===t.colorMixMode,h=t.opacity>0,c=t.externalColor&&t.externalColor[3]>0;return a&&(o||i||s)?!!n||h:a?n?c:h:o||i||s?!!n||h:n?c:h}getConfiguration(t,r){return this._configuration.output=t,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=!!this.parameters.instanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.hasVerticalOffset=e(this.parameters.verticalOffset),this._configuration.hasScreenSizePerspective=e(this.parameters.screenSizePerspective),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType="screenDerivative"===this.parameters.normals?d.ScreenDerivative:d.Attribute,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,e(this.parameters.customDepthTest)&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?T.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=e(this.parameters.modelTransformation),t!==p.Color&&t!==p.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=f.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?f.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?f.WindingOrder:f.None,this._configuration.instancedColor=e(this.parameters.instanced)&&this.parameters.instanced.includes("color"),this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!r.ssaoHelper.ready&&this.parameters.receiveSSAO,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?g.Schematic:g.Normal:g.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevation<v,this._configuration.snowCover=this.hasSnowCover(r),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(t){return e(t.weather)&&t.weatherVisible&&"snowy"===t.weather.type&&"enabled"===t.weather.snowCover}intersect(c,u,m,p,d,f,g){if(e(this.parameters.verticalOffset)){const e=p.camera;t(k,m[12],m[13],m[14]);let c=null;switch(p.viewingMode){case l.Global:c=a(U,k);break;case l.Local:c=r(U,G)}let u=0;const g=s(q,k,e.eye),T=i(g),_=o(g,g,1/T);let b=null;this.parameters.screenSizePerspective&&(b=n(c,_)),u+=L(e,T,this.parameters.verticalOffset,b,this.parameters.screenSizePerspective),o(c,c,u),h(z,c,p.transform.inverseRotation),d=s(V,d,z),f=s(H,f,z)}M(c,u,p,d,f,S(p.verticalOffset),g)}requiresSlot(e,t){if(t===p.Color||t===p.Alpha||t===p.Depth||t===p.Normal||t===p.Shadow||t===p.ShadowHighlight||t===p.ShadowExludeHighlight||t===p.Highlight||t===p.ObjectAndLayerIdColor){return e===(this.parameters.transparent?this.parameters.writeDepth?x.TRANSPARENT_MATERIAL:x.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:x.OPAQUE_MATERIAL)||e===x.DRAPED_MATERIAL||t===p.ObjectAndLayerIdColor&&this.parameters.writeObjectAndLayerId}return!1}createGLMaterial(e){return new R(e)}createBufferWriter(){return new N(this._vertexBufferLayout,this._instanceBufferLayout)}}class R extends _{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){const r=this._material.parameters;this.updateTexture(r.textureId);const a=e.camera.viewInverseTransposeMatrix;return t(r.origin,a[3],a[7],a[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(r.treeRendering?E:I,e)}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==p.Color&&this._output!==p.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this._updateParameters(e)}}class D extends w{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.writeObjectAndLayerId=!1,this.hasVertexTangents=!1}}const P=new D;class N{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(O.POSITION).length}write(e,t,r,a){A(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,a)}}function j(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=m().vec3f(O.POSITION).vec3f(O.NORMAL);return e.hasVertexTangents&&r.vec4f(O.TANGENT),t&&r.vec2f(O.UV0),e.hasVertexColors&&r.vec4u8(O.COLOR),e.hasSymbolColors&&r.vec4u8(O.SYMBOLCOLOR),has("enable-feature:objectAndLayerId-rendering")&&r.vec4u8(O.OBJECTANDLAYERIDCOLOR),r}function B(t){let r=m();return r=t.instancedDoublePrecision?r.vec3f(O.MODELORIGINHI).vec3f(O.MODELORIGINLO).mat3f(O.MODEL).mat3f(O.MODELNORMAL):r.mat4f(O.MODEL).mat4f(O.MODELNORMAL),e(t.instanced)&&t.instanced.includes("color")&&(r=r.vec4f(O.INSTANCECOLOR)),e(t.instanced)&&t.instanced.includes("featureAttribute")&&(r=r.vec4f(O.INSTANCEFEATUREATTRIBUTE)),e(t.instanced)&&t.instanced.includes("objectAndLayerIdColor")&&(r=r.vec4u8(O.OBJECTANDLAYERIDCOLOR_INSTANCED)),r}const V=c(),H=c(),G=u(0,0,1),U=c(),z=c(),k=c(),q=c();export{R as DefaultGLMaterial,C as DefaultMaterial,D as DefaultMaterialParameters,B as getInstanceBufferLayout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/maybe.js";import"../../../../chunks/mat4f64.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/PositionAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/Matrix4PassUniform.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";import"../lighting/SceneLighting.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
|
|
5
|
+
import"../../../../core/maybe.js";import"../../../../chunks/mat4f64.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/PositionAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/Matrix4PassUniform.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";import"../lighting/SceneLighting.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{c as e}from"../../../../chunks/mat3f64.js";import{f as t,c as i}from"../../../../chunks/vec3f64.js";import{f as s}from"../../../../chunks/vec4f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as l,VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as h}from"../core/shaderLibrary/util/AlphaCutoff.js";import{doublePrecisionRequiresObfuscation as c}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as u}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as p}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as
|
|
5
|
+
import{c as e}from"../../../../chunks/mat3f64.js";import{f as t,c as i}from"../../../../chunks/vec3f64.js";import{f as s}from"../../../../chunks/vec4f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as l,VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as h}from"../core/shaderLibrary/util/AlphaCutoff.js";import{doublePrecisionRequiresObfuscation as c}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as u}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as p}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as m,DepthTestFunction as d,AlphaDiscardMode as f}from"../lib/basicInterfaces.js";import{Default3D as b}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as v}from"../lib/Material.js";import{blendingDefault as S,oitBlending as g,oitDepthTest as y,getOITPolygonOffset as j}from"../lib/OrderIndependentTransparency.js";import{Program as x}from"../lib/Program.js";import{stencilWriteMaskOn as P,stencilToolMaskBaseParams as T,stencilBaseAllZerosParams as O}from"../lib/StencilUtils.js";import{TransparencyPassType as C}from"../lib/TransparencyPassType.js";import{D as M}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as z}from"../../../webgl/enums.js";import{makePipelineState as D,cullingParams as L,defaultDepthWriteParams as w,defaultColorWriteParams as A}from"../../../webgl/renderState.js";class F extends l{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=t(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=m.Back,this.emissiveFactor=t(0,0,0),this.instancedDoublePrecision=!1,this.normals="default",this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.externalColor=s(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=i(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvSizeValue=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.vvSymbolAnchor=[0,0,0],this.vvSymbolRotationMatrix=e(),this.vvOpacityEnabled=!1,this.vvOpacityValues=[],this.vvOpacityOpacities=[],this.transparent=!1,this.writeDepth=!0,this.customDepthTest=d.Less,this.textureAlphaMode=f.Blend,this.textureAlphaCutoff=h,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=v.Occlude}}class k extends n{constructor(){super(...arguments),this.origin=i(),this.slicePlaneLocalOrigin=this.origin}}class _ extends p{initializeConfiguration(e,t){t.spherical=e.viewingMode===r.Global,t.doublePrecisionRequiresObfuscation=c(e.rctx),t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?a.Default:a.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,_.shader)}_initializeProgram(e,t){return new x(e.rctx,t.get().build(this.configuration),b)}_convertDepthTestFunction(e){return e===d.Lequal?z.LEQUAL:z.LESS}_makePipeline(e,t){const i=this.configuration,s=e===C.NONE,r=e===C.FrontFace;return D({blending:i.output!==o.Color&&i.output!==o.Alpha||!i.transparent?null:s?S:g(e),culling:E(i)&&L(i.cullFace),depthTest:{func:y(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:s||r?i.writeDepth&&w:null,colorWrite:A,stencilWrite:i.hasOccludees?P:null,stencilTest:i.hasOccludees?t?T:O:null,polygonOffset:s||r?null:j(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function E(e){return e.cullFace!==m.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}_.shader=new u(M,(()=>import("./DefaultMaterial.glsl.js")));export{k as DefaultMaterialDrawParameters,F as DefaultMaterialPassParameters,_ as DefaultMaterialTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as r}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as s}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{AlphaDiscardMode as p,CullFaceOptions as h,DepthTestFunction as n}from"../lib/basicInterfaces.js";import{TransparencyPassType as d}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as l}from"../materials/DefaultTechniqueConfiguration.js";class c extends l{constructor(){super(...arguments),this.output=t.Color,this.alphaDiscardMode=p.Opaque,this.doubleSidedMode=s.None,this.pbrMode=i.Disabled,this.cullFace=h.None,this.transparencyPassType=d.NONE,this.normalType=e.Attribute,this.textureCoordinateType=r.None,this.customDepthTest=n.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}o([a({count:t.COUNT})],c.prototype,"output",void 0),o([a({count:p.COUNT})],c.prototype,"alphaDiscardMode",void 0),o([a({count:s.COUNT})],c.prototype,"doubleSidedMode",void 0),o([a({count:i.COUNT})],c.prototype,"pbrMode",void 0),o([a({count:h.COUNT})],c.prototype,"cullFace",void 0),o([a({count:d.COUNT})],c.prototype,"transparencyPassType",void 0),o([a({count:e.COUNT})],c.prototype,"normalType",void 0),o([a({count:r.COUNT})],c.prototype,"textureCoordinateType",void 0),o([a({count:n.COUNT})],c.prototype,"customDepthTest",void 0),o([a()],c.prototype,"spherical",void 0),o([a()],c.prototype,"hasVertexColors",void 0),o([a()],c.prototype,"hasSymbolColors",void 0),o([a()],c.prototype,"hasVerticalOffset",void 0),o([a()],c.prototype,"hasSlicePlane",void 0),o([a()],c.prototype,"hasSliceHighlight",void 0),o([a()],c.prototype,"hasColorTexture",void 0),o([a()],c.prototype,"hasMetallicRoughnessTexture",void 0),o([a()],c.prototype,"hasEmissionTexture",void 0),o([a()],c.prototype,"hasOcclusionTexture",void 0),o([a()],c.prototype,"hasNormalTexture",void 0),o([a()],c.prototype,"hasScreenSizePerspective",void 0),o([a()],c.prototype,"hasVertexTangents",void 0),o([a()],c.prototype,"hasOccludees",void 0),o([a()],c.prototype,"hasMultipassTerrain",void 0),o([a()],c.prototype,"hasModelTransformation",void 0),o([a()],c.prototype,"offsetBackfaces",void 0),o([a()],c.prototype,"vvSize",void 0),o([a()],c.prototype,"vvColor",void 0),o([a()],c.prototype,"receiveShadows",void 0),o([a()],c.prototype,"receiveAmbientOcclusion",void 0),o([a()],c.prototype,"textureAlphaPremultiplied",void 0),o([a()],c.prototype,"instanced",void 0),o([a()],c.prototype,"instancedColor",void 0),o([a()],c.prototype,"objectAndLayerIdColorInstanced",void 0),o([a()],c.prototype,"instancedDoublePrecision",void 0),o([a()],c.prototype,"doublePrecisionRequiresObfuscation",void 0),o([a()],c.prototype,"writeDepth",void 0),o([a()],c.prototype,"transparent",void 0),o([a()],c.prototype,"enableOffset",void 0),o([a()],c.prototype,"cullAboveGround",void 0),o([a()],c.prototype,"snowCover",void 0),o([a()],c.prototype,"hasColorTextureTransform",void 0),o([a()],c.prototype,"hasEmissionTextureTransform",void 0),o([a()],c.prototype,"hasNormalTextureTransform",void 0),o([a()],c.prototype,"hasOcclusionTextureTransform",void 0),o([a()],c.prototype,"hasMetallicRoughnessTextureTransform",void 0),o([a({constValue:!0})],c.prototype,"hasVvInstancing",void 0),o([a({constValue:!1})],c.prototype,"useCustomDTRExponentForWater",void 0),o([a({constValue:!1})],c.prototype,"supportsTextureAtlas",void 0),o([a({constValue:!0})],c.prototype,"useFillLights",void 0);export{c as DefaultMaterialTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as r}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{DefaultMaterialTechnique as
|
|
5
|
+
import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as r}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{DefaultMaterialTechnique as a}from"./DefaultMaterialTechnique.js";import{R as s}from"../../../../chunks/RealisticTree.glsl.js";class t extends a{initializeConfiguration(i,a){super.initializeConfiguration(i,a),a.hasMetallicRoughnessTexture=!1,a.hasEmissionTexture=!1,a.hasOcclusionTexture=!1,a.hasNormalTexture=!1,a.hasModelTransformation=!1,a.normalType=e.Attribute,a.doubleSidedMode=r.WindingOrder,a.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,t.shader)}}t.shader=new i(s,(()=>import("./RealisticTree.glsl.js")));export{t as RealisticTreeTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clock as t}from"../../../core/clock.js";import{someMap as e}from"../../../core/MapUtils.js";import{createScreenPoint as
|
|
5
|
+
import{clock as t}from"../../../core/clock.js";import{someMap as e}from"../../../core/MapUtils.js";import{createScreenPoint as a}from"../../../core/screenUtils.js";import{DragEventSeparator as i}from"../DragEventSeparator.js";import{InputHandler as o}from"../InputHandler.js";import{DefaultParameters as r}from"./SingleAndDoubleClick.js";import{getPointerId as n,manhattanDistance as s}from"./support.js";class u extends o{constructor(e=r.maximumDoubleClickDelay,o=r.maximumDoubleClickDistance,n=r.maximumDoubleTouchDelay,s=r.maximumDoubleTouchDistance,u=t){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=o,this._maximumDoubleTouchDelay=n,this._maximumDoubleTouchDistance=s,this._clock=u,this._doubleTapDragReady=!1,this._doubleTapDragActive=!1,this._dragStartCenter=a(0,0),this._pointerState=new Map,this._doubleTapDrag=this.registerOutgoing("double-tap-drag"),this._dragEventSeparator=new i({start:(t,e)=>this._dragStart(t,e),update:(t,e)=>this._dragUpdate(e),end:(t,e)=>this._dragEnd(e)}),this.registerIncoming("drag",(t=>this._dragEventSeparator.handle(t))),this.registerIncoming("pointer-down",(t=>this._handlePointerDown(t))),this.registerIncoming("pointer-up",(()=>this._handlePointerUp()))}onUninstall(){this._pointerState.forEach((t=>{null!=t.doubleTapTimeout&&(t.doubleTapTimeout.remove(),t.doubleTapTimeout=null)}))}get hasPendingInputs(){return e(this._pointerState,(t=>null!=t.doubleTapTimeout))}_clearPointerDown(t){const e=this._pointerState.get(t);e&&(e.doubleTapTimeout.remove(),e.doubleTapTimeout=null,this._pointerState.delete(t),this.refreshHasPendingInputs())}_createDoubleTapDragData(t,e,a){const{button:i,buttons:o,pointer:r,pointers:n,pointerType:s,timestamp:u}=a;return{action:t,delta:e,button:i,buttons:o,pointer:r,pointers:n,pointerType:s,timestamp:u}}_dragStart(t,e){if(!this._doubleTapDragReady||1!==t)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:i,modifiers:o}=e,{center:r}=i;this._dragStartCenter=r;const n=this._createDoubleTapDragData("begin",a(0,0),i);this._doubleTapDrag.emit(n,void 0,o),e.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:o}=e,r=a(o.x-this._dragStartCenter.x,o.y-this._dragStartCenter.y),n=this._createDoubleTapDragData("update",r,e);this._doubleTapDrag.emit(n,void 0,i),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:o}=e,r=a(o.x-this._dragStartCenter.x,o.y-this._dragStartCenter.y),n=this._createDoubleTapDragData("end",r,e);this._doubleTapDrag.emit(n,void 0,i),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:e}=t,a=n(e),i=this._pointerState.get(a),{pointerType:o}=e.native;if(i){const r="touch"===o?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(a),s(i.event.data,e)>r?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:e}=t,{pointerType:a}=e.native,i=n(e),o="touch"===a?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,r=this._clock.setTimeout((()=>this._clearPointerDown(i)),o);this._pointerState.set(i,{event:t,doubleTapTimeout:r}),this.refreshHasPendingInputs()}}export{u as DoubleTapDrag};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createScreenPoint as t}from"../../../core/screenUtils.js";import{Milliseconds as e}from"../../../core/time.js";import{InputHandler as i}from"../InputHandler.js";import{fitCircleLSQ as n}from"./support.js";class s extends i{constructor(t){super(!1),this.
|
|
5
|
+
import{createScreenPoint as t}from"../../../core/screenUtils.js";import{Milliseconds as e}from"../../../core/time.js";import{InputHandler as i}from"../InputHandler.js";import{fitCircleLSQ as n}from"./support.js";class s extends i{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,e,i,n){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:e.buttons,timestamp:n,pointers:o(this._activePointerMap),pointer:e,angle:i.angle,radius:i.radius,center:i.center}}_addPointer(t){const e=t.native.pointerId,i=a(this._activePointerMap).angle,n={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(e,n);const s=h(n,r(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(i)}_updatePointer(t){if(t&&null==t.x&&null==t.y)return;const e=t.native.pointerId,i=this._activePointerMap.get(e);i?i.event=t:this._addPointer(t)}_removePointer(t){const e=a(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(e)}_updatePointerAngles(t){const e=a(this._activePointerMap);this._activePointerMap.forEach((i=>{i.initialAngle=h(i,e)-t,i.lastAngle=h(i,e)-t}))}_emitEvent(t,e,i){const n=a(this._activePointerMap);this._drag.emit(this._createPayload(t,e,n,i),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const i=t.data.native.pointerId,n=e(t.timestamp);this._activePointerMap.get(i)&&(1===this._activePointerMap.size?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,n),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(i)):(this._removePointer(i),this._emitEvent("removed",t.data,e(t.timestamp))))}_handlePointerDrag(t){const i=t.data,n=i.currentEvent,s=e(t.timestamp);switch(i.action){case"start":case"update":this._isDragging?this._activePointerMap.has(n.native.pointerId)?(this._updatePointer(n),!this._isCurrentDragSuppressed&&this._emitEvent("update",n,s)):(this._addPointer(n),this._emitEvent("added",n,s),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(n),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",n,s))}}get _isSuppressed(){return this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&"touch"===this._pointerType&&1===this._activePointerMap.size}}function r(e){const i=[];return e.forEach((e=>{i.push(t(e.event.x,e.event.y))})),n(i)}function a(t){const e=r(t);let i=0;return t.forEach((t=>{let n=h(t,e),s=n-t.lastAngle;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;n=t.lastAngle+s,t.lastAngle=n;const r=n-t.initialAngle;i+=r})),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function o(t){const e=new Map;return t.forEach(((t,i)=>e.set(i,t.event))),e}function h(t,e){const i=t.event,n=i.x-e.center.x,s=i.y-e.center.y;return Math.atan2(s,n)}var p;!function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"}(p||(p={}));export{p as Button,s as Drag};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clock as t}from"../../../core/clock.js";import{InputHandler as e}from"../InputHandler.js";import{DefaultParameters as i}from"./SingleAndDoubleClick.js";import{manhattanDistance as
|
|
5
|
+
import{clock as t}from"../../../core/clock.js";import{InputHandler as e}from"../InputHandler.js";import{DefaultParameters as i}from"./SingleAndDoubleClick.js";import{getPointerId as o,manhattanDistance as a}from"./support.js";class m extends e{constructor(e=i.maximumDoubleClickDelay,o=i.maximumDoubleClickDistance,a=i.maximumDoubleTouchDelay,m=i.maximumDoubleTouchDistance,n=t){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=o,this._maximumDoubleTouchDelay=a,this._maximumDoubleTouchDistance=m,this._clock=n,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach((t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()})),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=o(e);if(!this._pointerState.has(i)){const t={downButton:e.native.button,immediateDoubleClick:null};this._pointerState.set(i,t),this.startCapturingPointer(e.native)}}_handlePointerUp(t){const e=t.data,i=o(e),m=this._pointerState.get(i);if(m&&m.downButton===e.native.button){const i=m.immediateDoubleClick;if(i){i.timeoutHandle.remove();const o="touch"===t.data.native.pointerType?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;a(i,t.data)>o?this._startImmediateDoubleClick(t,m):(this._immediateDoubleClick.emit(t.data,void 0,i.modifiers),this._removeState(e))}else this._startImmediateDoubleClick(t,m)}}_startImmediateDoubleClick(t,e){const i="touch"===t.data.native.pointerType?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;e.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout((()=>this._removeState(t.data)),i)}}_removeState(t){const e=o(t);this._pointerState.delete(e),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}}export{m as ImmediateDoubleClick};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clock as t}from"../../../core/clock.js";import{InputHandler as e}from"../InputHandler.js";import{euclideanDistance as i}from"./support.js";const n={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500};class o extends e{constructor(e=n.maximumClickDelay,i=n.movementUntilMouseDrag,o=n.movementUntilPenDrag,r=n.movementUntilTouchDrag,s=n.holdDelay,a=t){super(!1),this.
|
|
5
|
+
import{clock as t}from"../../../core/clock.js";import{InputHandler as e}from"../InputHandler.js";import{euclideanDistance as i}from"./support.js";const n={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500};class o extends e{constructor(e=n.maximumClickDelay,i=n.movementUntilMouseDrag,o=n.movementUntilPenDrag,r=n.movementUntilTouchDrag,s=n.holdDelay,a=t){super(!1),this._maximumClickDelay=e,this._movementUntilMouseDrag=i,this._movementUntilPenDrag=o,this._movementUntilTouchDrag=r,this._holdDelay=s,this._clock=a,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",(t=>{this._handlePointerLoss(t,"pointer-up")})),this.registerIncoming("pointer-capture-lost",(t=>{this._handlePointerLoss(t,"pointer-capture-lost")})),this.registerIncoming("pointer-cancel",(t=>{this._handlePointerLoss(t,"pointer-cancel")})),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach((t=>{null!=t.holdTimeout&&(t.holdTimeout.remove(),t.holdTimeout=null)})),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=e.native.pointerId;let n=null;0===this._pointerState.size&&(n=this._clock.setTimeout((()=>{const e=this._pointerState.get(i);if(e){if(!e.isDragging){const i=e.previousEvent;this._pointerHold.emit(i,void 0,t.modifiers),e.holdEmitted=!0}e.holdTimeout=null}}),this._holdDelay));const o={startEvent:e,previousEvent:e,startTimestamp:t.timestamp,isDragging:!1,downButton:e.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(i,o),this.startCapturingPointer(e.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_createPointerDragData(t,e,i){return{action:t,startEvent:e.startEvent,previousEvent:e.previousEvent,currentEvent:i}}_handlePointerMove(t){const e=t.data,n=e.native.pointerId,o=this._pointerState.get(n);if(o){if(o.isDragging)this._pointerDrag.emit(this._createPointerDragData("update",o,e),void 0,o.modifiers);else{i(e,o.startEvent)>this._getDragThreshold(e.native.pointerType)&&this._startDragging(t)}o.previousEvent=e}}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const e=t.data,i=e.native.pointerId;this._pointerState.forEach((n=>{null!=n.holdTimeout&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=t.modifiers,n.isDragging=!0,i===n.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",n,e)):this._pointerDrag.emit(this._createPointerDragData("start",n,n.previousEvent),t.timestamp))}))}_handlePointerLoss(t,e){const i=t.data,n=i.native.pointerId,o=this._pointerState.get(n);if(o){if(null!=o.holdTimeout&&(o.holdTimeout.remove(),o.holdTimeout=null),o.isDragging)this._pointerDrag.emit(this._createPointerDragData("end",o,"pointer-up"===e?i:o.previousEvent),void 0,o.modifiers);else if("pointer-up"===e&&o.downButton===i.native.button){t.timestamp-o.startTimestamp<=this._maximumClickDelay&&!o.holdEmitted&&this._immediateClick.emit(i)}this._pointerState.delete(n),this.stopCapturingPointer(i.native),0===this._pointerState.size&&this._moveHandle.pause()}}}export{n as DefaultParameters,o as PointerClickHoldAndDrag};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clock as e}from"../../../core/clock.js";import{someMap as t}from"../../../core/MapUtils.js";import{removeMaybe as i}from"../../../core/maybe.js";import{InputHandler as o}from"../InputHandler.js";import{manhattanDistance as
|
|
5
|
+
import{clock as e}from"../../../core/clock.js";import{someMap as t}from"../../../core/MapUtils.js";import{removeMaybe as i}from"../../../core/maybe.js";import{InputHandler as o}from"../InputHandler.js";import{manhattanDistance as n,getPointerId as s}from"./support.js";const l={maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};class m extends o{constructor(t=l.maximumDoubleClickDelay,i=l.maximumDoubleClickDistance,o=l.maximumDoubleTouchDelay,n=l.maximumDoubleTouchDistance,s=e){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=o,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",this._handleImmediateClick.bind(this)),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach((e=>e.doubleClickTimer=i(e.doubleClickTimer)))}get hasPendingInputs(){return t(this._pointerState,(e=>null!=e.doubleClickTimer))}_clearDoubleClickTimer(e,t){const o=this._pointerState.get(e);o&&(o.doubleClickTimer=i(o.doubleClickTimer),t&&this._click.emit(o.event.data,void 0,o.event.modifiers),this._pointerState.delete(e),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(e){const t=this._pointerState.get(e);1===t.pointerDownCount&&this._click.emit(t.event.data,void 0,t.event.modifiers),t.doubleClickTimer=null,this._pointerState.delete(e),this.refreshHasPendingInputs()}_getPointerId(e){const{pointerId:t,pointerType:i,button:o}=e.native;return"mouse"===i?`${t}:${o}`:`${i}`}_handleImmediateClick(e){const t=e.data,{pointerType:i}=t.native,o=this._getPointerId(t);if(!this._pointerState.has(o))return void this._startClick(e);const s=this._pointerState.get(o),{data:l,modifiers:m}=s.event,c="touch"===i?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;n(l,t)>c?(this._clearDoubleClickTimer(o,!0),this._startClick(e)):(this._clearDoubleClickTimer(o,!1),2===s.pointerDownCount&&this._doubleClick.emit(l,void 0,m))}_handlePointerDown(e){const t=s(e.data),i=this._pointerState.get(t);i&&(i.pointerDownCount+=1)}_startClick(e){const{data:t}=e,{native:{pointerType:i}}=t,o=s(t),n="touch"===i?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,l=this._clock.setTimeout((()=>this._doubleClickTimeoutExceeded(o)),n),m=1;this._pointerState.set(o,{event:e,doubleClickTimer:l,pointerDownCount:m}),this.refreshHasPendingInputs()}}export{l as DefaultParameters,m as SingleAndDoubleClick};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{DragEventSeparator as t}from"../DragEventSeparator.js";import{InputHandler as e}from"../InputHandler.js";class a extends e{constructor(e=20,a=40){super(!1),this._threshold=e,this._maxDelta=a,this._state="ready",this._emittedArtificalEnd2=!1,this._vertical=this.registerOutgoing("vertical-two-finger-drag"),this._artificalDrag=this.registerOutgoing("drag"),this._dragEventSeparator=new t({start:(t,e)=>this._observeStart(t,e),update:(t,e,a)=>this._observeUpdate(t,e,a),end:(t,e)=>this._observeEnd(e)}),this.registerIncoming("drag",(t=>this._dragEventSeparator.handle(t)))}get failed(){return"failed"===this._state}_observeStart(t,e){1===t&&this._emittedArtificalEnd2&&(this._emittedArtificalEnd2=!1,this._artificalDrag.emit({action:"start",button:e.data.button,buttons:e.data.buttons,pointerType:e.data.pointerType,timestamp:e.data.timestamp,pointers:e.data.pointers,pointer:e.data.pointer,angle:e.data.angle,radius:e.data.radius,center:e.data.center}),e.stopPropagation()),this._state=2===t?"ready":"failed"}_observeUpdate(t,e,a){if("failed"!==this._state&&2===t)return"active"===this._state?(this._vertical.emit({delta:e.data.center.y-this._thresholdReachedCenter.y,action:"update"}),void e.stopPropagation()):void(this._checkMovementWithinLimits(e.data,a.data)?this._checkVerticalThresholdReached(e.data,a.data)&&(this._state="active",this._emittedArtificalEnd2=!0,this._thresholdReachedCenter=e.data.center,this._artificalDrag.emit({action:"end",button:e.data.button,buttons:e.data.buttons,pointerType:e.data.pointerType,timestamp:e.data.timestamp,pointers:e.data.pointers,pointer:e.data.pointer,angle:e.data.angle,radius:e.data.radius,center:e.data.center}),this._vertical.emit({delta:e.data.center.y-this._thresholdReachedCenter.y,action:"begin"}),e.stopPropagation()):this._state="failed")}_observeEnd(t){"active"===this._state&&(this._vertical.emit({delta:t.data.center.y-this._thresholdReachedCenter.y,action:"end"}),this._state="ready",t.stopPropagation())}_checkMovementWithinLimits(t,e){let a=-1/0,i=1/0,r=-1/0,s=1/0;e.pointers.
|
|
5
|
+
import{DragEventSeparator as t}from"../DragEventSeparator.js";import{InputHandler as e}from"../InputHandler.js";class a extends e{constructor(e=20,a=40){super(!1),this._threshold=e,this._maxDelta=a,this._state="ready",this._emittedArtificalEnd2=!1,this._vertical=this.registerOutgoing("vertical-two-finger-drag"),this._artificalDrag=this.registerOutgoing("drag"),this._dragEventSeparator=new t({start:(t,e)=>this._observeStart(t,e),update:(t,e,a)=>this._observeUpdate(t,e,a),end:(t,e)=>this._observeEnd(e)}),this.registerIncoming("drag",(t=>this._dragEventSeparator.handle(t)))}get failed(){return"failed"===this._state}_observeStart(t,e){1===t&&this._emittedArtificalEnd2&&(this._emittedArtificalEnd2=!1,this._artificalDrag.emit({action:"start",button:e.data.button,buttons:e.data.buttons,pointerType:e.data.pointerType,timestamp:e.data.timestamp,pointers:e.data.pointers,pointer:e.data.pointer,angle:e.data.angle,radius:e.data.radius,center:e.data.center}),e.stopPropagation()),this._state=2===t?"ready":"failed"}_observeUpdate(t,e,a){if("failed"!==this._state&&2===t)return"active"===this._state?(this._vertical.emit({delta:e.data.center.y-this._thresholdReachedCenter.y,action:"update"}),void e.stopPropagation()):void(this._checkMovementWithinLimits(e.data,a.data)?this._checkVerticalThresholdReached(e.data,a.data)&&(this._state="active",this._emittedArtificalEnd2=!0,this._thresholdReachedCenter=e.data.center,this._artificalDrag.emit({action:"end",button:e.data.button,buttons:e.data.buttons,pointerType:e.data.pointerType,timestamp:e.data.timestamp,pointers:e.data.pointers,pointer:e.data.pointer,angle:e.data.angle,radius:e.data.radius,center:e.data.center}),this._vertical.emit({delta:e.data.center.y-this._thresholdReachedCenter.y,action:"begin"}),e.stopPropagation()):this._state="failed")}_observeEnd(t){"active"===this._state&&(this._vertical.emit({delta:t.data.center.y-this._thresholdReachedCenter.y,action:"end"}),this._state="ready",t.stopPropagation())}_checkMovementWithinLimits(t,e){let a=-1/0,i=1/0,r=-1/0,s=1/0;for(const{x:m,y:g}of e.pointers.values())a=Math.max(a,m),i=Math.min(i,m),r=Math.max(r,g),s=Math.min(s,g);let n=-1/0,h=1/0,d=-1/0,o=1/0;for(const{x:m,y:g}of t.pointers.values())n=Math.max(n,m),h=Math.min(h,m),d=Math.max(d,g),o=Math.min(o,g);const c=a-i,l=r-s,p=n-h,_=d-o;return Math.abs(t.center.x-e.center.x)<this._threshold&&Math.abs(p-c)<=this._maxDelta&&Math.abs(_-l)<=this._maxDelta}_checkVerticalThresholdReached(t,e){let a=Math.abs(t.center.y-e.center.y);return t.pointers.forEach(((t,i)=>{const r=e.pointers.get(i);a=Math.min(a,Math.abs(t.y-r.y))})),a>=this._threshold}}export{a as VerticalTwoFingerDrag};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createScreenPoint as t}from"../../../core/screenUtils.js";function e(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function n(t,e){const n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function r(e,n){if(n?(n.radius=0,n.center.x=0,n.center.y=0):n={radius:0,center:t()},0===e.length)return n;if(1===e.length)return n.center.x=e[0].x,n.center.y=e[0].y,n;if(2===e.length){const[t,r]=e,[c,
|
|
5
|
+
import{createScreenPoint as t}from"../../../core/screenUtils.js";function e(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function n(t,e){const n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function r(e,n){if(n?(n.radius=0,n.center.x=0,n.center.y=0):n={radius:0,center:t()},0===e.length)return n;if(1===e.length)return n.center.x=e[0].x,n.center.y=e[0].y,n;if(2===e.length){const[t,r]=e,[c,o]=[r.x-t.x,r.y-t.y];return n.radius=Math.sqrt(c*c+o*o)/2,n.center.x=(t.x+r.x)/2,n.center.y=(t.y+r.y)/2,n}let r=0,c=0;for(let t=0;t<e.length;t++)r+=e[t].x,c+=e[t].y;r/=e.length,c/=e.length;const o=e.map((t=>t.x-r)),s=e.map((t=>t.y-c));let u=0,i=0,x=0,y=0,a=0,h=0,l=0;for(let t=0;t<o.length;t++){const e=o[t],n=s[t],r=e*e,c=n*n;u+=r,i+=c,x+=e*n,y+=r*e,a+=c*n,h+=e*c,l+=n*r}const f=.5*(y+h),g=.5*(a+l),p=u*i-x*x,d=(f*i-g*x)/p,m=(u*g-x*f)/p,M=t(d+r,m+c);return{radius:Math.sqrt(d*d+m*m+(u+i)/e.length),center:M}}function c(t){const{native:e}=t,{pointerId:n,button:r,pointerType:c}=e;return"mouse"===c?`${n}:${r}`:`${c}`}export{n as euclideanDistance,r as fitCircleLSQ,c as getPointerId,e as manhattanDistance};
|