@arcgis/core 5.2.0-next.48 → 5.2.0-next.49
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/applications/Components/OrientedImageryViewer/PanoramicViewer/utils.d.ts +33 -0
- package/applications/Components/OrientedImageryViewer/PanoramicViewer/utils.js +2 -0
- package/arcgisGlobal.d.ts +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/031ccf2e1583beebdf24.js +1 -0
- package/assets/esri/core/workers/chunks/0474af7687466d8befd2.js +1 -0
- package/assets/esri/core/workers/chunks/{f9b2727b41943d83d4ca.js → 0a413d917f3d19440fc1.js} +1 -1
- package/assets/esri/core/workers/chunks/0b2ca406761c63529a6a.js +1 -0
- package/assets/esri/core/workers/chunks/{c369d4266f38e9ea6592.js → 1119a33245138e7b3914.js} +1 -1
- package/assets/esri/core/workers/chunks/{6fbcf1b85461c6c6c127.js → 172571397c66f992d08c.js} +1 -1
- package/assets/esri/core/workers/chunks/18edf2846d7546285e5e.js +1 -0
- package/assets/esri/core/workers/chunks/{7759a489205a874e13bb.js → 1b0557fcb058fc450230.js} +1 -1
- package/assets/esri/core/workers/chunks/{7d0ff52748fd4eb0334d.js → 1bc45872d22d61dbd7d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{835643f716f7058a2722.js → 1cf8fb704c48ac3d3b15.js} +1 -1
- package/assets/esri/core/workers/chunks/25cb56c3b538d00e7693.js +1 -0
- package/assets/esri/core/workers/chunks/{2c0d92c0e3511775401a.js → 35cbf00f0c37a86517af.js} +1 -1
- package/assets/esri/core/workers/chunks/382d9491c2a56c1925fe.js +1 -0
- package/assets/esri/core/workers/chunks/3af2b9d6d5466cb2b957.js +256 -0
- package/assets/esri/core/workers/chunks/{c3766d98f0a70897647f.js → 3bc2943035391b44d4cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{bd8b180c61a80e60568c.js → 40f7bb0ebd918d76f078.js} +1 -1
- package/assets/esri/core/workers/chunks/43b39abd49c4a8ce891f.js +1 -0
- package/assets/esri/core/workers/chunks/{821176ee3be724621bb0.js → 461c2de938bf4c9b1442.js} +1 -1
- package/assets/esri/core/workers/chunks/4ee7232ea41fa41c5ed4.js +29 -0
- package/assets/esri/core/workers/chunks/50674ba5f24129d61d89.js +1 -0
- package/assets/esri/core/workers/chunks/547a2fe53139f705f95e.js +1 -0
- package/assets/esri/core/workers/chunks/5ce09c4d06e98b1e9251.js +1 -0
- package/assets/esri/core/workers/chunks/{4d9433f127aef76f3449.js → 5dbd28fce73751d2d1aa.js} +1 -1
- package/assets/esri/core/workers/chunks/5ec8b02e097cf6718462.js +1 -0
- package/assets/esri/core/workers/chunks/5f54d927dc77e92cf145.js +1 -0
- package/assets/esri/core/workers/chunks/63e3d338751240479335.js +1 -0
- package/assets/esri/core/workers/chunks/6ccd5fa5e35dc70fcd5d.js +1 -0
- package/assets/esri/core/workers/chunks/6e520ef645c5edcd499a.js +1 -0
- package/assets/esri/core/workers/chunks/{68d898037feb0aee3138.js → 78add8e6b54b51eaa299.js} +1 -1
- package/assets/esri/core/workers/chunks/7b61f56d0f766421eaef.js +1 -0
- package/assets/esri/core/workers/chunks/7f2f2a92dce3f68e579b.js +1 -0
- package/assets/esri/core/workers/chunks/{e7e3ea7af928b49b226c.js → 801a664f21e0218bc705.js} +1 -1
- package/assets/esri/core/workers/chunks/8d21e2dabc5165f1c8ca.js +1 -0
- package/assets/esri/core/workers/chunks/9008090a5d8431ddfa22.js +1 -0
- package/assets/esri/core/workers/chunks/{71ce1009dadcae8f8094.js → 95b3b8fe45ef4ac6b277.js} +1 -1
- package/assets/esri/core/workers/chunks/{78918035144c3c76df71.js → 96cec8a02ca96175d602.js} +1 -1
- package/assets/esri/core/workers/chunks/{bab71e1b8b93d09d4809.js → 99eccf9ce53582cfa5b5.js} +1 -1
- package/assets/esri/core/workers/chunks/9b7cb96acea388d86fa4.js +1 -0
- package/assets/esri/core/workers/chunks/{ff2c4f648f77850922d5.js → 9e474465d069cb9e94f5.js} +1 -1
- package/assets/esri/core/workers/chunks/{ae9f9e975d7a9d442fa5.js → ab5aa4280ed0cb7fcbe9.js} +1 -1
- package/assets/esri/core/workers/chunks/b49952541d189b4b9f7e.js +1 -0
- package/assets/esri/core/workers/chunks/{fed6c75485601cd3afa1.js → baac90da0703891d59c4.js} +1 -1
- package/assets/esri/core/workers/chunks/bb552089b34d6811fb03.js +1 -0
- package/assets/esri/core/workers/chunks/{b30237361d87cf982e41.js → d1af0bd611a3dc549858.js} +64 -59
- package/assets/esri/core/workers/chunks/d2cb3d5ef0a9285afb78.js +1 -0
- package/assets/esri/core/workers/chunks/d560ed96dde5ca3a5583.js +1 -0
- package/assets/esri/core/workers/chunks/dc1787d88b11ed985159.js +1 -0
- package/assets/esri/core/workers/chunks/{399e23d777a043efa9f1.js → dd95f50dac3f33cdb6d2.js} +1 -1
- package/assets/esri/core/workers/chunks/ddb92c815d17c67a45e6.js +1 -0
- package/assets/esri/core/workers/chunks/{52efa4ded11c1e71f04f.js → e2e2162adbfb9b46bede.js} +1 -1
- package/assets/esri/core/workers/chunks/e4353f0792f45aa6a62f.js +1 -0
- package/assets/esri/core/workers/chunks/eac8cae89da9ce2f4946.js +1 -0
- package/assets/esri/core/workers/chunks/edf87407dd20685c82ab.js +1 -0
- package/assets/esri/core/workers/chunks/{be6caade351e89f84251.js → ee7c8a7f384ea6393487.js} +107 -82
- package/assets/esri/core/workers/chunks/f1299b4fc760ccca1518.js +1 -0
- package/assets/esri/core/workers/chunks/f244632f7934a4b72c91.js +1 -0
- package/assets/esri/core/workers/chunks/fc639c730115e07a4a1a.js +1 -0
- package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
- package/chunks/Component.glsl.js +104 -67
- package/chunks/LineMarker.glsl.js +31 -31
- package/chunks/RibbonLine.glsl.js +60 -49
- package/chunks/dxt_encoder.js +1 -1
- package/chunks/vec3.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/geometry/support/aaBoundingBox.js +1 -1
- package/geometry/support/buffer/math/vec3.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/meshUtils/extent.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/kernel.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/TextRasterizer.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/richTextUtils.js +2 -0
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/focusAreaUtils.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.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/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/meshUtils.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +36 -25
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +17 -10
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/PolygonIntersections2D.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +8 -5
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/selection/SelectionOperation.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTileNode.d.ts +63 -0
- package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.d.ts +66 -0
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Sketch/VisibleElements.d.ts +0 -10
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector3D/selectorUtils.js +2 -0
- package/assets/esri/core/workers/chunks/0e64e20fedfe01a1985f.js +0 -1
- package/assets/esri/core/workers/chunks/0f674c625f24ac73e25a.js +0 -1
- package/assets/esri/core/workers/chunks/15351354afcbf840a23d.js +0 -29
- package/assets/esri/core/workers/chunks/1843a762f7051f61af43.js +0 -1
- package/assets/esri/core/workers/chunks/1d1f5578c7d8619f7a46.js +0 -1
- package/assets/esri/core/workers/chunks/2015f4def2ef201bdab8.js +0 -1
- package/assets/esri/core/workers/chunks/20c363a113dc068de9e0.js +0 -1
- package/assets/esri/core/workers/chunks/24d936d459c538187af6.js +0 -1
- package/assets/esri/core/workers/chunks/272c8ab189217240d05f.js +0 -1
- package/assets/esri/core/workers/chunks/2e121eac97ae72a8b49a.js +0 -1
- package/assets/esri/core/workers/chunks/327899182a4dace428eb.js +0 -1
- package/assets/esri/core/workers/chunks/32ca15d928d51b380068.js +0 -1
- package/assets/esri/core/workers/chunks/3e1a7e4c674057807e3a.js +0 -1
- package/assets/esri/core/workers/chunks/4e2baa60c5d5197b2271.js +0 -1
- package/assets/esri/core/workers/chunks/519c0b51b1ba42fb71d7.js +0 -1
- package/assets/esri/core/workers/chunks/57fa3c0e7892c2eef3ee.js +0 -261
- package/assets/esri/core/workers/chunks/68b615bbd27fadcfcb66.js +0 -1
- package/assets/esri/core/workers/chunks/69d740ab18510156f5d6.js +0 -1
- package/assets/esri/core/workers/chunks/8d21f3d6edbcd7b335d0.js +0 -1
- package/assets/esri/core/workers/chunks/9a97f6cda2f36941efae.js +0 -1
- package/assets/esri/core/workers/chunks/9ceeae787dc7c194d60e.js +0 -1
- package/assets/esri/core/workers/chunks/a90f7b1c6c69b6033b4c.js +0 -1
- package/assets/esri/core/workers/chunks/b32bdf5730953c2fb16b.js +0 -1
- package/assets/esri/core/workers/chunks/b5d23efa584c74955d5b.js +0 -1
- package/assets/esri/core/workers/chunks/b83f2bbd634f57a5e8f9.js +0 -1
- package/assets/esri/core/workers/chunks/bb8e9b8343b83dd1ba3c.js +0 -1
- package/assets/esri/core/workers/chunks/bef1990159c0e49e7d27.js +0 -1
- package/assets/esri/core/workers/chunks/bf287f0e2ecb4532dc00.js +0 -1
- package/assets/esri/core/workers/chunks/c5e36544b2d1792e4c5f.js +0 -1
- package/assets/esri/core/workers/chunks/cba3316910ff088f4d77.js +0 -1
- package/assets/esri/core/workers/chunks/de9573871f64c01e9f01.js +0 -1
- package/assets/esri/core/workers/chunks/e232459f0b00110e07ac.js +0 -1
- package/assets/esri/core/workers/chunks/ee6bb6cd16f99421c76b.js +0 -1
- package/assets/esri/core/workers/chunks/fd2ba6f76645ba503cbb.js +0 -1
- package/views/3d/analysis/Viewshed/ViewshedTool2.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"../../../../core/PooledArray.js";import{
|
|
2
|
+
import t from"../../../../core/PooledArray.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i,fromValues as o,expandWithValues as r,center as n,width as s,height as c,depth as h,squareDiameter as l}from"../../../../geometry/support/aaBoundingBox.js";import{Sphere as d}from"../../../../geometry/support/sphere.js";import{assert as u}from"./Util.js";class a{get boundingSphere(){return this._sphere}get boundingBox(){return this._boundingBox}constructor(t,e,l){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this.position=l,this._sphere=new d,this._boundingBox=i(),this._children=void 0,u(t.length>=1),u(3===l.size||4===l.size);const{data:a,size:p,indices:g}=l;u(g.length%e===0),u(g.length>=t.length*e);const m=t.length;let v=p*g[e*t[0]];f.clear(),f.push(v);const _=o(a[v],a[v+1],a[v+2],a[v],a[v+1],a[v+2],this._boundingBox);for(let i=0;i<m;++i){const o=e*t[i];for(let t=0;t<e;++t)v=p*g[o+t],f.push(v),r(_,a[v],a[v+1],a[v+2])}const x=n(_,this._sphere.center);let b=.5*Math.max(s(_),c(_),h(_)),B=b*b;for(let i=0;i<f.length;++i){v=f.at(i);const t=a[v]-x[0],e=a[v+1]-x[1],o=a[v+2]-x[2],r=t*t+e*e+o*o;if(r<=B)continue;const n=Math.sqrt(r),s=.5*(n-b);b+=s,B=b*b;const c=s/n;x[0]+=t*c,x[1]+=e*c,x[2]+=o*c}this._sphere.radius=b,f.clear()}get children(){if(this._children)return this._children;const t=this._boundingBox;if(l(t)<=1)return;const{position:e,_numIndexPerPrimitive:i,primitiveIndices:o}=this,r=n(t,p),s=o.length,c=new Uint8Array(s),h=[0,0,0,0,0,0,0,0],{data:d,size:u,indices:f}=e;for(let n=0;n<s;++n){let t=0;const e=i*o[n];let s=u*f[e],l=d[s],a=d[s+1],p=d[s+2];for(let o=1;o<i;++o){s=u*f[e+o];const t=d[s],i=d[s+1],r=d[s+2];t<l&&(l=t),i<a&&(a=i),r<p&&(p=r)}l<r[0]&&(t|=1),a<r[1]&&(t|=2),p<r[2]&&(t|=4),c[n]=t,++h[t]}let g=0;for(let n=0;n<8;++n)h[n]>0&&++g;if(g<2)return;const m=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let n=0;n<8;++n)h[n]>0&&(m[n]=new Uint32Array(h[n]));h.fill(0);for(let n=0;n<s;++n){const t=c[n];m[t][h[t]++]=o[n]}const v=new Array;for(let n=0;n<8;++n){const t=m[n];void 0!==t&&v.push(new a(t,i,e))}return this._children=v,this._children}static prune(){f.prune()}}const p=e(),f=new t({deallocator:null});export{a as BoundingInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as i,copy as e,hasIdentityRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{lerp as a,transformMat4 as h,distance as n,set as m,add as d,exactEquals as l,copy as
|
|
2
|
+
import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as i,copy as e,hasIdentityRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{lerp as a,transformMat4 as h,distance as n,set as m,add as d,exactEquals as l,copy as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as c,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getMin as _,getMax as f}from"../../../../geometry/support/aaBoundingBox.js";import{Sphere as b}from"../../../../geometry/support/sphere.js";import{maxScale as v}from"../../support/mathUtils.js";import{Object3DOccludeeStateID as p,Object3DHighlightStateID as y}from"./Object3DStateID.js";import{assert as j}from"./Util.js";import{affectsGeometry as S}from"./VertexAttribute.js";import{addObject3DStateID as x,removeObject3DStateID as V}from"../materials/renderers/utils.js";class W{constructor(i={}){this.id=t(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=i.castShadow??!0,this.usesVerticalDistanceToGround=i.usesVerticalDistanceToGround??!1,this.graphicUid=i.graphicUid,this.layerViewUid=i.layerViewUid,i.isElevationSource&&(this.lastValidElevationBB=new A),this._geometries=i.geometries?Array.from(i.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(t){j(null==this._layer||null==t,"Object3D can only be added to a single Layer"),this._layer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t);for(const i of this._highlightIds)t.addHighlight(i);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const i=this._geometries.splice(t,1)[0];if(i){for(const t of this._highlightIds)i.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:i}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,i,e=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:i,sync:e}),S(i)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new p;for(const i of this._geometries)i.occludees=x(i.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const i of this._geometries)i.occludees=V(i.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const i=new y(t);for(const e of this._geometries)e.addHighlight(i);return this._emit("highlightChanged",this),this._highlightIds.add(i),i}removeHighlight(t){this._highlightIds.delete(t);for(const i of this._geometries)i.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){0===t.channel?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.transformation)}getCombinedShaderTransformation(t,e=o()){return i(e,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new B,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new B,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(t,i){const e=1===i;for(const s of this._geometries){const i=s.boundingInfo;i&&T(i,t,e?s.transformation:this.getCombinedShaderTransformation(s))}a(t.bounds.center,t.min,t.max,.5);for(const s of this._geometries){const i=s.boundingInfo;if(null==i)continue;const o=e?s.transformation:this.getCombinedShaderTransformation(s),r=v(o);h(O,i.boundingSphere.center,o);const a=n(O,t.bounds.center),m=i.boundingSphere.radius*r;t.bounds.radius=Math.max(t.bounds.radius,a+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&t&&this.layer.notifyObjectBBChanged(this,t)}_emit(t,i){this.layer?.events.emit(t,i)}get geometries(){return this._geometries}get transformation(){return this._transformation??r}set transformation(t){this._transformation=e(this._transformation??o(),t),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(t){this._shaderTransformation=t?e(this._shaderTransformation??o(),t):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class A{constructor(){this._data=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]}get min(){return c(this._data[0],this._data[1],this._data[2])}get max(){return c(this._data[3],this._data[4],this._data[5])}minWith(t){const{_data:i}=this;i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.min(i[2],t[2])}maxWith(t){const{_data:i}=this;i[3]=Math.max(i[3],t[0]),i[4]=Math.max(i[4],t[1]),i[5]=Math.max(i[5],t[2])}assignMinMax(t,i){for(let e=0;e<3;++e)this._data[0+e]=t[e],this._data[3+e]=i[e]}isEmpty(){return this._data[3]<this._data[0]&&this._data[4]<this._data[1]&&this._data[5]<this._data[2]}}class B extends A{constructor(){super(...arguments),this.bounds=new b}}function T(t,i,e){const o=t.boundingBox,r=_(o,w),a=f(o,I);if(s(e)){const t=m(C,e[12],e[13],e[14]);return d(M,r,t),d(U,a,t),i.minWith(M),void i.maxWith(U)}if(h(M,r,e),l(r,a))return i.minWith(M),void i.maxWith(M);h(U,a,e),i.minWith(M),i.minWith(U),i.maxWith(M),i.maxWith(U);for(let s=0;s<3;++s)g(M,r),g(U,a),M[s]=a[s],U[s]=r[s],h(M,M,e),h(U,U,e),i.minWith(M),i.minWith(U),i.maxWith(M),i.maxWith(U)}const C=u(),M=u(),U=u(),O=u(),w=u(),I=u();export{B as BoundingVolume,W as Object3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{fromValues as n,create as t}from"../../../../geometry/support/aaBoundingRect.js";import{screenPolygonIntersectsBounds as o,screenPolygonIntersectsTriangle as i}from"./screenPolygonOverlapUtils.js";function r(t,i,r){if(!r.visible)return null;const{boundingInfo:s}=r;if(s){const{
|
|
2
|
+
import{fromValues as n,create as t}from"../../../../geometry/support/aaBoundingRect.js";import{screenPolygonIntersectsBounds as o,screenPolygonIntersectsTriangle as i}from"./screenPolygonOverlapUtils.js";function r(t,i,r){if(!r.visible)return null;const{boundingInfo:s}=r;if(s){const{boundingBox:r}=s;if(n(r[0]+i[0],r[1]+i[1],r[3]+i[0],r[4]+i[1],u),!o(t,u))return null}const c=r.positionAttribute,l=r.primitivePositionIndices;return e(t,i,0,l.length/3,l,c)}function e(n,t,o,r,e,u){const{data:p,stride:d}=u;for(let g=o;g<r;++g){const o=3*g;if(s(c,t,p,d,e[o]),s(l,t,p,d,e[o+1]),s(f,t,p,d,e[o+2]),i(n,c,l,f))return g}return null}function s(n,t,o,i,r){const e=i*r;n[0]=o[e]+t[0],n[1]=o[e+1]+t[1]}const u=t(),c=[0,0],l=[0,0],f=[0,0];export{r as intersectTriangleGeometryPolygon2D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{sub as
|
|
2
|
+
import{sub as n,set as t,cross as o,normalize as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as e,create as s}from"../../../../geometry/support/aaBoundingBox.js";import{boundingInfoSubdivisionThreshold as r}from"./intersectionConstants.js";import{assert as u}from"./Util.js";class f{constructor(n=0,t=!1,o=!0){this.tolerance=n,this.isVerticalRay=t,this.normalRequired=o}}const l=s();function a(t,o,i,c,e,s){if(!t.visible)return;const r=n(D,c,i),{tolerance:l}=o,a=new f(l,!1,o.options.normalRequired);if(t.boundingInfo)u(0===t.type),p(t.boundingInfo,i,r,l,e,a,s);else{const n=t.positionAttribute,o=t.primitivePositionIndices;q(i,r,0,o.length/3,o,n.data,n.stride,e,a,s)}}const m=c();function p(n,t,o,i,c,s,u){if(null==n)return;const f=w(o,m);if(e(l,n.boundingBox),null!=c&&c.applyToAabb(l),C(l,t,f,i)){const{primitiveIndices:e,position:f}=n,l=e?e.length:f.indices.length/3;if(l>r){const e=n.children;if(void 0!==e){for(const n of e)p(n,t,o,i,c,s,u);return}}v(t,o,0,l,f.indices,f.data,f.stride,e,c,s,u)}}const h=c();function d(t,o,i,c,e,s,r,u,f){const{data:l,stride:a}=s;q(t,n(D,o,t),i,c,e,l,a,r,u,f)}function x(n,t,o,i){if(!o.visible)return;const{boundingInfo:c}=o;if(c){const{boundingBox:o}=c;if(n<o[0]||n>o[3]||t<o[1]||t>o[4])return}const e=o.positionAttribute,s=o.primitivePositionIndices;M(n,t,0,s.length/3,s,e,i)}function M(n,t,o,i,c,e,s){const{data:r,stride:u}=e;for(let f=o;f<i;++f){const o=3*f,i=u*c[o],e=u*c[o+1],l=u*c[o+2],a=r[i+0]-n,m=r[i+1]-t,p=r[e+0]-n,h=r[e+1]-t,d=r[l+0]-n,x=r[l+1]-t,M=d*h-x*p,b=a*x-m*d,g=p*m-h*a;(M<0||b<0||g<0)&&(M>0||b>0||g>0)||s(0,null,f)}}function b(n,t,o,i,c,e,s,r,u,f=null,l=0){const a=n[0],m=n[1],p=n[2],d=t[0],x=t[1],M=t[2];for(let b=o;b<i;++b){const n=l+(f?.[b]??b),t=3*n,o=s*c[t],i=e[o],g=e[o+1],y=e[o+2],v=s*c[t+1],q=e[v],T=e[v+1],V=e[v+2],I=s*c[t+2],R=q-i,B=T-g,A=V-y,P=e[I]-i,w=e[I+1]-g,C=e[I+2]-y,U=x*C-w*M,k=M*P-C*d,D=d*w-P*x,E=R*U+B*k+A*D,F=E*E;if(F<=z)continue;const G=a-i,H=m-g,J=p-y,K=(G*U+H*k+J*D)*E;if(K<0||K>F)continue;const L=H*A-B*J,N=J*R-A*G,O=G*B-R*H,Q=(d*L+x*N+M*O)*E;if(Q<0||K+Q>F)continue;const S=(P*L+w*N+C*O)/E;if(S>=0){u(S,r?j(R,B,A,P,w,C,h):null,n)}}}function g(n,t,o,i,c,e,s,r){const u=n[0],f=n[1],l=n[2],a=t[0],m=t[1],p=t[2];for(let d=o;d<i;++d){const n=3*d,t=n+1,o=n+2,i=e*n,x=c[i],M=c[i+1],b=c[i+2],g=e*t,y=e*o,v=c[g]-x,q=c[g+1]-M,T=c[g+2]-b,V=c[y]-x,I=c[y+1]-M,R=c[y+2]-b,B=m*R-I*p,A=p*V-R*a,P=a*I-V*m,w=v*B+q*A+T*P,C=w*w;if(C<=z)continue;const U=u-x,k=f-M,D=l-b,E=(U*B+k*A+D*P)*w;if(E<0||E>C)continue;const F=k*T-q*D,G=D*v-T*U,H=U*q-v*k,J=(a*F+m*G+p*H)*w;if(J<0||E+J>C)continue;const K=(V*F+I*G+R*H)/w;if(K>=0){r(K,s?j(v,q,T,V,I,R,h):null,d)}}}function y(n,t,o,i,c,e,s,r,u,f,l,a=null,m=0){const p=n[0],d=n[1],x=n[2],M=t[0],b=t[1],g=t[2];for(let y=o;y<i;++y){const n=m+(a?.[y]??y),t=3*n,o=s*c[t],i=e[o],v=e[o+1],q=e[o+2],T=s*c[t+1],V=e[T],I=e[T+1],R=e[T+2],B=s*c[t+2],A=e[B],P=e[B+1],w=e[B+2],C=q-u,U=r/Math.sqrt(i*i+v*v+C*C),k=i+i*U,D=v+v*U,E=q+C*U,F=R-u,G=r/Math.sqrt(V*V+I*I+F*F),H=V+V*G,J=I+I*G,K=R+F*G,L=w-u,N=r/Math.sqrt(A*A+P*P+L*L),O=H-k,Q=J-D,S=K-E,W=A+A*N-k,X=P+P*N-D,Y=w+L*N-E,Z=b*Y-X*g,$=g*W-Y*M,_=M*X-W*b,nn=O*Z+Q*$+S*_,tn=nn*nn;if(tn<=z)continue;const on=p-k,cn=d-D,en=x-E,sn=(on*Z+cn*$+en*_)*nn;if(sn<0||sn>tn)continue;const rn=cn*S-Q*en,un=en*O-S*on,fn=on*Q-O*cn,ln=(M*rn+b*un+g*fn)*nn;if(ln<0||sn+ln>tn)continue;const an=(W*rn+X*un+Y*fn)/nn;if(an>=0){l(an,f?j(O,Q,S,W,X,Y,h):null,n)}}}function v(n,t,o,i,c,e,s,r,u,f,l){const a=n[0],m=n[1],p=n[2],d=t[0],x=t[1],M=t[2],{normalRequired:b}=f;for(let g=o;g<i;++g){const n=r[g],t=3*n,o=s*c[t];let i=e[o],f=e[o+1],y=e[o+2];const v=s*c[t+1];let q=e[v],T=e[v+1],V=e[v+2];const I=s*c[t+2];let R=e[I],B=e[I+1],A=e[I+2];null!=u&&([i,f,y]=u.applyToVertex(F,i,f,y,g),[q,T,V]=u.applyToVertex(F,q,T,V,g),[R,B,A]=u.applyToVertex(F,R,B,A,g));const P=q-i,w=T-f,C=V-y,U=R-i,k=B-f,D=A-y,E=x*D-k*M,G=M*U-D*d,H=d*k-U*x,J=P*E+w*G+C*H,K=J*J;if(K<=z)continue;const L=a-i,N=m-f,O=p-y,Q=(L*E+N*G+O*H)*J;if(Q<0||Q>K)continue;const S=N*C-w*O,W=O*P-C*L,X=L*w-P*N,Y=(d*S+x*W+M*X)*J;if(Y<0||Q+Y>K)continue;const Z=(U*S+k*W+D*X)/J;if(Z>=0){l(Z,b?j(P,w,C,U,k,D,h):null,n)}}}function q(o,i,c,e,s,r,u,f,l,a){const m=i,p=E,h=Math.abs(m[0]),d=Math.abs(m[1]),x=Math.abs(m[2]),M=h>=d?h>=x?0:2:d>=x?1:2,b=M,g=m[b]<0?2:1,y=(M+g)%3,v=(M+(3-g))%3,q=m[y]/m[b],j=m[v]/m[b],B=1/m[b],A=T,P=V,w=I,{normalRequired:C}=l;for(let T=c;T<e;++T){const i=3*T,c=u*s[i];t(p[0],r[c+0],r[c+1],r[c+2]);const e=u*s[i+1];t(p[1],r[e+0],r[e+1],r[e+2]);const l=u*s[i+2];t(p[2],r[l+0],r[l+1],r[l+2]),f&&(f.applyToVertex(p[0],p[0][0],p[0][1],p[0][2],T),f.applyToVertex(p[1],p[1][0],p[1][1],p[1][2],T),f.applyToVertex(p[2],p[2][0],p[2][1],p[2][2],T)),n(A,p[0],o),n(P,p[1],o),n(w,p[2],o);const m=A[y]-q*A[b],h=A[v]-j*A[b],d=P[y]-q*P[b],x=P[v]-j*P[b],M=w[y]-q*w[b],g=w[v]-j*w[b],V=M*x-g*d,I=m*g-h*M,U=d*h-x*m;if((V<0||I<0||U<0)&&(V>0||I>0||U>0))continue;const k=V+I+U;if(0===k)continue;const z=V*(B*A[b])+I*(B*P[b])+U*(B*w[b]);if(z*Math.sign(k)<0)continue;const D=z/k;if(D>=0){a(D,C?R(p):null,T)}}}const T=c(),V=c(),I=c();function j(n,c,e,s,r,u,f){return t(B,n,c,e),t(A,s,r,u),o(f,B,A),i(f,f),f}function R(t){return n(B,t[1],t[0]),n(A,t[2],t[0]),o(h,B,A),i(h,h),h}const B=c(),A=c();function P(n,o,i){return t(i,1/(o[0]-n[0]),1/(o[1]-n[1]),1/(o[2]-n[2]))}function w(n,o){return t(o,1/n[0],1/n[1],1/n[2])}function C(n,t,o,i){return U(n,t,o,i,1/0)}function U(n,t,o,i,c){const e=(n[0]-i-t[0])*o[0],s=(n[3]+i-t[0])*o[0];let r=Math.min(e,s),u=Math.max(e,s);const f=(n[1]-i-t[1])*o[1],l=(n[4]+i-t[1])*o[1];if(u=Math.min(u,Math.max(f,l)),u<0)return!1;if(r=Math.max(r,Math.min(f,l)),r>u)return!1;const a=(n[2]-i-t[2])*o[2],m=(n[5]+i-t[2])*o[2];return u=Math.min(u,Math.max(a,m)),!(u<0)&&(r=Math.max(r,Math.min(a,m)),!(r>u)&&r<c)}const k=1e-7,z=k*k,D=c(),E=[c(),c(),c()],F=c();export{f as MeshIntersectionOptions,P as computeInvDir,w as computeInvDirFromDirection,j as computeNormalFromBarycentric,C as intersectAabbInvDir,U as intersectAabbInvDirBefore,b as intersectRayTriangles,q as intersectRayTrianglesWithDisplacementWatertight,y as intersectRayTrianglesWithVerticalOffsetENUGlobal,g as intersectRenderGeometryTriangles,a as intersectTriangleGeometry,x as intersectTriangleGeometry2D,d as intersectTriangles,M as intersectTriangles2d,k as triangleRayParallelTolerance};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{generateUID as t}from"../../../../core/uid.js";import{copy as r,multiply as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{NullSphere as s,Sphere as n}from"../../../../geometry/support/sphere.js";import{maxScale as
|
|
2
|
+
import{generateUID as t}from"../../../../core/uid.js";import{copy as r,multiply as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{NullSphere as s,Sphere as n}from"../../../../geometry/support/sphere.js";import{maxScale as h}from"../../support/mathUtils.js";class a{constructor(r,i={}){this.geometry=r,this.screenToWorldRatio=1,this._transformation=e(),this._shaderTransformation=null,this._boundingSphere=null,this.id=t(),this.layerViewUid=i.layerViewUid,this.graphicUid=i.graphicUid,this.castShadow=i.castShadow??!1,i.objectShaderTransformation&&this.objectShaderTransformationChanged(i.objectShaderTransformation)}get transformation(){return this._transformation}set transformation(t){r(this._transformation,t),this._boundingSphere=null}get boundingInfo(){return this.geometry.boundingInfo}objectShaderTransformationChanged(t){null==t?this._shaderTransformation=null:(this._shaderTransformation??=e(),i(this._shaderTransformation,t,this.geometry.transformation)),this._boundingSphere=null}get boundingSphere(){return this.boundingInfo?(null==this._boundingSphere&&(this._boundingSphere??=new n,o(this._boundingSphere.center,this.boundingInfo.boundingSphere.center,this.shaderTransformation),this._boundingSphere.radius=this.boundingInfo.boundingSphere.radius*h(this.shaderTransformation)),this._boundingSphere):s}get material(){return this.geometry.material}get type(){return this.geometry.type}get shaderTransformation(){return this._shaderTransformation??this.transformation}get attributes(){return this.geometry.attributes}get positionAttribute(){return this.geometry.positionAttribute}get primitivePositionIndices(){return this.geometry.primitivePositionIndices}foreachHighlightOptions(t){this.geometry.foreachHighlightOptions(t)}get hasHighlights(){return this.geometry.hasHighlights}get occludees(){return this.geometry.occludees}get visible(){return this.geometry.visible}set visible(t){this.geometry.visible=t}}class g extends a{}export{a as RenderGeometry,g as ValidatedRenderGeometry};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/PooledArray.js";import{multiply as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4Z as n,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{lerp as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{intersectsSphere as o}from"../../../../geometry/support/frustum.js";import{Sphere as
|
|
2
|
+
import e from"../../../../core/PooledArray.js";import{multiply as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4Z as n,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{lerp as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{intersectsSphere as o}from"../../../../geometry/support/frustum.js";import{Sphere as h}from"../../../../geometry/support/sphere.js";import{maxScale as f}from"../../support/mathUtils.js";import{DepthRange as c}from"./DepthRange.js";import{assert as u}from"./Util.js";const d=1e4,l=100,m=500,g=500,_=.1;function p(e,t,r,n){let i=0;if(!t.some(e=>!!e.material&&(i+=e.numGeometries,i>=d)))return W.compute(e,t,n);const a=new c;return r.forEach(t=>a.union(b(e,t))),a}function b(e,t){if(!t.visible)return;const r=new c,n=t.getSpatialQueryAccelerator();return n?w(r,e,n):j(r,e,t.objects),r}function w(e,t,r){const{eye:n,viewForward:i,frustum:a}=t,s=e=>e.visible,o=r.objectCount;if(o<m)E.set(t.near,Math.min(e.near,t.far)),r.forEachInDepthRange(n,i,1,E,(r,n)=>{x(e,t,r),E.far=e.near,n.setRange(E)},a,s),E.set(Math.max(e.far,t.near),t.far),r.forEachInDepthRange(n,i,-1,E,(r,n)=>{x(e,t,r),E.near=e.far,n.setRange(E)},a,s);else{const n=Math.max(Math.min(o,g),Math.ceil(o*_)),h=r.findClosest(i,1,a,s,n),f=r.findClosest(i,-1,a,s,n);h&&f&&(v(e,t,h.boundingVolumeWorldSpace.bounds),v(e,t,f.boundingVolumeWorldSpace.bounds))}}function j(e,t,r){F.clear(),r.forEach(e=>{e.visible&&0!==e.geometries.length&&F.add(e,t)}),F.empty||(F.sort(),E.set(t.near,Math.min(e.near,t.far)),F.forEachInDepthRange(E,1,(r,n)=>{n<e.near&&x(e,t,r)}),E.set(Math.max(e.far,t.near),t.far),F.forEachInDepthRange(E,-1,(t,r,n)=>{e.far=Math.max(e.far,n)}))}function x(e,r,n){if(!n.visible)return;if(!o(r.frustum,n.boundingVolumeWorldSpace.bounds))return;const i=n.transformation,a=D;n.geometries.forEach(n=>{t(a,i,n.transformation);const s=f(a);R(e,r,n.boundingInfo,a,s)})}function R(e,t,r,n,a){if(null==r)return;i(A.center,r.boundingSphere.center,n);const{eye:s,viewForward:h}=t,f=h[0]*(A.center[0]-s[0])+h[1]*(A.center[1]-s[1])+h[2]*(A.center[2]-s[2]);if(A.radius=r.boundingSphere.radius*a,!(f-A.radius>e.near&&f+A.radius<e.far)&&o(t.frustum,A))if(r.boundingSphere.radius>l&&r.children)for(const i of r.children)R(e,t,i,n,a);else N.unionDepthRangeWithAABB(e,t.viewProjectionMatrix,n,r.boundingBox)}function v(e,t,r){const n=t.eye,i=t.viewForward,a=(r.center[0]-n[0])*i[0]+(r.center[1]-n[1])*i[1]+(r.center[2]-n[2])*i[2];e.near=Math.min(e.near,a-r.radius),e.far=Math.max(e.far,a+r.radius)}class M{constructor(){this._items=new e({allocator:e=>e||{object:null,distance:0,near:0,far:0},deallocator:e=>(e.object=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return 0===this._items.length}clear(){this._items.clear()}add(e,t){const r=t.eye,n=t.viewForward,i=e.boundingVolumeWorldSpace.bounds,a=(i.center[0]-r[0])*n[0]+(i.center[1]-r[1])*n[1]+(i.center[2]-r[2])*n[2];if(!Number.isFinite(a))return;const s=this._items.pushNew();s.object=e,s.distance=a,s.near=a-i.radius,s.far=a+i.radius}sort(){this._items.sort((e,t)=>e.distance-t.distance)}forEachInDepthRange(e,t,r){if(1===t)for(let n=0;n<this._items.length;++n){const t=this._items.data[n];t.far<e.near||t.near>e.far||r(t.object,t.near,t.far)}else for(let n=this._items.length-1;n>=0;--n){const t=this._items.data[n];t.far<e.near||t.near>e.far||r(t.object,t.near,t.far)}}}class B{constructor(){this._geometries=new Array,this._near=[],this._far=[],this._nearCandidates=[],this._farCandidates=[],this._looseRange=new c(0,0)}compute(e,t,r){this._reset();const{viewMatrix:i}=e;t.forEach(e=>{e.forEachGeometry(e=>{if(!e.visible||0===r&&!e.castShadow)return;const t=e.boundingSphere,a=n(t.center,i),s=a-t.radius,o=a+t.radius;this._geometries.push(e),this._near.push(-o),this._far.push(-s)})});const a=new c;if(0===this._geometries.length)return a;for(let n=0;n<this._geometries.length;++n)this._near[n]>a.far&&(a.far=this._near[n]),this._near[n]>2&&this._far[n]<a.near&&(a.near=this._far[n]);const s=this._looseRange;s.near=Math.max(.5*a.near,2),s.far=2*a.far;let o=0,h=0;for(let n=0;n<this._geometries.length;++n)this._near[n]<a.near&&(this._near[n]>=s.near?a.near=this._near[n]:this._nearCandidates[o++]=n),this._far[n]>a.far&&(this._far[n]<=s.far?a.far=this._far[n]:this._farCandidates[h++]=n);if(0===this._nearCandidates.length&&0===this._farCandidates.length)return a;this._nearCandidates.sort((e,t)=>this._near[e]<this._near[t]?-1:this._near[e]>this._near[t]?1:0),this._farCandidates.sort((e,t)=>this._far[e]<this._far[t]?1:this._far[e]>this._far[t]?-1:0);for(let n=0;n<this._nearCandidates.length;++n){const t=this._nearCandidates[n];if(this._near[t]<a.near){const r=this._geometries[t],{boundingInfo:n,shaderTransformation:i}=r;this._includeNearBoundingInfoRec(e,n,i,a)}}for(let n=0;n<this._farCandidates.length;++n){const t=this._farCandidates[n];if(this._far[t]>a.far){const r=this._geometries[t],{boundingInfo:n,shaderTransformation:i}=r;this._includeFarBoundingInfoRec(e,n,i,a)}}return this._reset(),a}_reset(){this._geometries.length=0,this._near.length=0,this._far.length=0,this._nearCandidates.length=0,this._farCandidates.length=0}_isOutsideSidePlanes(e,t){const{center:r,radius:n}=e;return t[0][0]*r[0]+t[0][1]*r[1]+t[0][2]*r[2]+t[0][3]>n||t[1][0]*r[0]+t[1][1]*r[1]+t[1][2]*r[2]+t[1][3]>n||t[2][0]*r[0]+t[2][1]*r[1]+t[2][2]*r[2]+t[2][3]>n||t[3][0]*r[0]+t[3][1]*r[1]+t[3][2]*r[2]+t[3][3]>n}_includeNearBoundingInfoRec(e,t,r,a){if(null==t)return;i(A.center,t.boundingSphere.center,r),A.radius=t.boundingSphere.radius*f(r);const{frustum:s}=e;if(this._isOutsideSidePlanes(A,s))return;const o=A.radius,{viewMatrix:h}=e,c=n(A.center,h),u=c+o;if(!(-(c-o)<2||-u>=a.near))if(-u>this._looseRange.near)a.near=-u;else{if(o>l){const n=t.children;if(void 0!==n){for(const t of n)this._includeNearBoundingInfoRec(e,t,r,a);return}}N.unionDepthRangeWithAABB(a,e.viewProjectionMatrix,r,t.boundingBox)}}_includeFarBoundingInfoRec(e,t,r,a){if(null==t)return;i(A.center,t.boundingSphere.center,r),A.radius=t.boundingSphere.radius*f(r);const{frustum:s}=e;if(this._isOutsideSidePlanes(A,s))return;const{viewMatrix:o,viewProjectionMatrix:h}=e,c=n(A.center,o)-A.radius;if(!(-c<=a.far))if(-c<this._looseRange.far)a.far=-c;else{if(A.radius>l){const n=t.children;if(void 0!==n){for(const t of n)this._includeFarBoundingInfoRec(e,t,r,a);return}}N.unionDepthRangeWithAABB(a,h,r,t.boundingBox)}}}class C{constructor(){this._modelViewProj=r(),this._clipPosition=[s(),s(),s(),s(),s(),s(),s(),s()]}unionDepthRangeWithAABB(e,r,n,i){const a=this._modelViewProj;t(a,r,n);let s=!1;for(let t=0;t<8;++t){const e=this._clipPosition[t],r=0===t||3===t||4===t||7===t?i[0]:i[3],n=0===t||1===t||4===t||5===t?i[1]:i[4],s=t<4?i[2]:i[5];e[0]=a[0]*r+a[4]*n+a[8]*s+a[12],e[1]=a[1]*r+a[5]*n+a[9]*s+a[13],e[2]=a[2]*r+a[6]*n+a[10]*s+a[14],e[3]=a[3]*r+a[7]*n+a[11]*s+a[15]}for(let t=0;t<12;++t){const r=S(this._clipPosition[y[t][0]],this._clipPosition[y[t][1]],this._clipPosition[y[t][2]]);let n=!0;for(let e=0;e<r.length;++e){if(r[e][3]>=2){n=!1;break}}if(!n){s=!0;for(let t=0;t<r.length;++t){const n=r[t][3];Number.isFinite(n)&&(e.near=Math.min(n,e.near),e.far=Math.max(n,e.far))}}}return s}}function S(e,t,r){let n=[e,t,r];for(let i=0;i<4;++i){const e=n;n=[];for(let t=0;t<e.length;++t){const r=e[t],a=e[(t+1)%e.length];I(a,i)?(I(r,i)||n.push(P(r,a,i)),n.push(a)):I(r,i)&&n.push(P(r,a,i))}}return n}function I(e,t){return 0===t?e[0]>=-e[3]:1===t?e[1]>=-e[3]:2===t?e[0]<=e[3]:3===t?e[1]<=e[3]:void u(!1)}function P(e,t,r){let n=0;return 0===r?n=(-e[3]-e[0])/(t[0]-e[0]+t[3]-e[3]):1===r?n=(-e[3]-e[1])/(t[1]-e[1]+t[3]-e[3]):2===r?n=(e[3]-e[0])/(t[0]-e[0]-t[3]+e[3]):3===r&&(n=(e[3]-e[1])/(t[1]-e[1]-t[3]+e[3])),a(s(),e,t,n)}const y=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],A=new h,D=r(),E=new c,F=new M,W=new B,N=new C;export{p as depthRangeFromScene};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isSome as e}from"../../../../../core/arrayUtils.js";import{isAborted as o,throwIfAborted as n}from"../../../../../core/promiseUtils.js";import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as s,
|
|
2
|
+
import{isSome as e}from"../../../../../core/arrayUtils.js";import{isAborted as o,throwIfAborted as n}from"../../../../../core/promiseUtils.js";import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as s,expandWithAABB as r,center as i,diameter as c}from"../../../../../geometry/support/aaBoundingBox.js";import{getEmissions as u}from"../../effects/emissive/emissions.js";import{LodComponentData as m}from"./LodComponentData.js";class a{static async create(t,s,r){const i=await Promise.allSettled(s.components.map(e=>t.controller.schedule(()=>new m(t,e.geometry),r))),c=i.map(e=>"fulfilled"===e.status?e.value:null).filter(e);if(o(r)||c.length!==i.length){c.forEach(e=>e.destroy()),n(r);for(const e of i)if("rejected"===e.status)throw e.reason}return new a(s.minScreenSpaceRadius,c)}constructor(e,o){this.minScreenSpaceRadius=e,this.components=o}destroy(){this.components.forEach(e=>e.destroy())}intersect(e,o,n,t,s,r,i){this.components.forEach(c=>c.intersect(e,o,n,t,s,r,this.boundingSphere,i))}*intersectScreenPolygon(e,o,n,t,s){for(const r of this.components)r.intersectScreenPolygon(e,o,n,t,this.boundingSphere,s),yield}get boundingBox(){if(null==this._boundingBox){const e=s();this.components.forEach(o=>{const{boundingInfo:n}=o;null!=n&&r(e,n.boundingBox)}),this._boundingBox=e}return this._boundingBox}get boundingSphere(){if(null==this._boundingSphere){const e=this.boundingBox,o=t();i(e,o),this._boundingSphere={center:o,radius:.5*c(e)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((e,o)=>e+o.numTriangles,0)}get emissions(){return u(this.components)}}export{a as LodLevel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{createScreenPointArray as t,createRenderScreenPointArray3 as n}from"../../../../core/screenUtils.js";import{copy as r,set as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i,intersects as s,containsPoint as u,create as f}from"../../../../geometry/support/aaBoundingRect.js";import{create as c,distance2 as p,fromPoints as m}from"../../../../geometry/support/lineSegment.js";import{signedDistance as a,intersectLineSegment as l}from"../../../../geometry/support/plane.js";import{containsPoint2dFromValues as h}from"../../../../geometry/support/triangle.js";function g(t,n){return t.isRectangle?u(t.bounds,n):v(n,t.points)}function M(t,n,r){const o=n[0]-r,e=n[1]-r,u=n[0]+r,f=n[1]+r;if(!s(t.bounds,i(o,e,u,f,A)))return!1;if(g(t,n))return!0;const c=r*r;for(const i of t.points){const t=i[0]-n[0],r=i[1]-n[1];if(t*t+r*r<=c)return!0}for(let i=0;i<t.points.length;i++){if(k(n,t.points[i],t.points[(i+1)%t.points.length])<=c)return!0}return!1}function j(t,n){if(!s(t.bounds,n))return!1;if(t.isRectangle)return!0;for(const r of t.points)if(u(n,r))return!0;for(let r=0;r<4;r++)if(v(z(C,n,r),t.points))return!0;for(let r=0;r<t.points.length;r++){const o=t.points[r],e=r===t.points.length-1?t.points[0]:t.points[r+1];for(let t=0;t<4;t++){if(B(o,e,z(C,n,t),z(D,n,(t+1)%4)))return!0}}return!1}function x(t,n,r,o){const e=Math.min(n[0],r[0],o[0]),s=Math.min(n[1],r[1],o[1]),u=Math.max(n[0],r[0],o[0]),f=Math.max(n[1],r[1],o[1]);if(!j(t,i(e,s,u,f,A)))return!1;if(g(t,n)||g(t,r)||g(t,o))return!0;for(const i of t.points)if(h(n,r,o,i,K))return!0;for(let i=0;i<t.points.length;i++){const e=t.points[i],s=t.points[(i+1)%t.points.length];if(B(n,r,e,s)||B(r,o,e,s)||B(o,n,e,s))return!0}return!1}function d(t,n,r,o){const e=Math.min(n[0],r[0])-o,u=Math.min(n[1],r[1])-o,f=Math.max(n[0],r[0])+o,c=Math.max(n[1],r[1])+o;if(!s(t.bounds,i(e,u,f,c,A)))return!1;if(g(t,n)||g(t,r))return!0;const p=o*o;for(const i of t.points)if(k(i,n,r)<=p)return!0;for(let i=0;i<t.points.length;i++){const o=t.points[i],e=t.points[(i+1)%t.points.length];if(B(n,r,o,e)||U(n,r,o,e)<=p)return!0}return!1}function b(t,n,o,e,i){r(G,n),r(H,o);const s=t.projectToRenderScreen(G,E),u=t.projectToRenderScreen(H,F);if(null==s||null==u)return!1;const f=R(t,G),c=R(t,H);if(f&&c)return!1;if(f!==c){const n=f?G:H,r=f?s:u;if(!S(t,n,f?H:G))return!1;if(!t.projectToRenderScreen(n,r))return!1}return e[0]=s[0],e[1]=s[1],e[2]=0,i[0]=u[0],i[1]=u[1],i[2]=0,!0}function R(t,n){return y(t,n)>0}function y(t,n){return a(t.frustum[4],n)}function S(t,n,r){return T(t,n,r,n)}function T(t,n,r,o){return l(t.frustum[4],m(n,r,J),o)}function v(t,n){let r=!1;for(let o=0,e=n.length-1;o<n.length;e=o++){const i=n[o],s=n[e];if(!(i[1]>t[1]!=s[1]>t[1]))continue;const u=(s[0]-i[0])*(t[1]-i[1])/(s[1]-i[1])+i[0];t[0]<u&&(r=!r)}return r}function B(t,n,r,o){const e=q(t,n,r),i=q(t,n,o),s=q(r,o,t),u=q(r,o,n);return e!==i&&s!==u||(0===e&&w(t,n,r)||0===i&&w(t,n,o)||0===s&&w(r,o,t)||0===u&&w(r,o,n))}function U(t,n,r,o){return B(t,n,r,o)?0:Math.min(k(t,r,o),k(n,r,o),k(r,t,n),k(o,t,n))}function k(t,n,r){return p(m(o(G,n[0],n[1],0),o(H,r[0],r[1],0),J),o(I,t[0],t[1],0))}function q(t,n,r){const o=(n[1]-t[1])*(r[0]-n[0])-(n[0]-t[0])*(r[1]-n[1]);return Math.abs(o)<=K?0:Math.sign(o)}function w(t,n,r){return r[0]>=Math.min(t[0],n[0])-K&&r[0]<=Math.max(t[0],n[0])+K&&r[1]>=Math.min(t[1],n[1])-K&&r[1]<=Math.max(t[1],n[1])+K}function z(t,n,r){return t[0]=0===r||3===r?n[0]:n[2],t[1]=r<2?n[1]:n[3],t}const A=f(),C=t(),D=t(),E=n(),F=n(),G=e(),H=e(),I=e(),J=c(),K=1e-9;export{R as isBehindNearPlane,b as projectWorldLineSegmentToRenderScreen,g as screenPolygonContainsPoint,j as screenPolygonIntersectsBounds,d as screenPolygonIntersectsBufferedSegment,M as screenPolygonIntersectsCircle,x as screenPolygonIntersectsTriangle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"../../../../core/PooledArray.js";import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{copy as
|
|
2
|
+
import t from"../../../../core/PooledArray.js";import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{copy as o,distance as r,squaredDistance as n,set as i,transformMat4 as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a,create as u}from"../../../../geometry/support/aaBoundingBox.js";import{intersectsTransformedAabb as c}from"../../../../geometry/support/frustum.js";import{clipPolygon as m}from"../../../../geometry/support/plane.js";import{normalFromValues as f,closestPointFromValues as p}from"../../../../geometry/support/triangle.js";import{boundingInfoSubdivisionThreshold as d}from"./intersectionConstants.js";import{screenPolygonIntersectsTriangle as h}from"./screenPolygonOverlapUtils.js";class I{constructor(t){this.primitiveIndex=t}}class g{constructor(t){this.type=t,this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=l(),this.normal=l()}reset(){this.distance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(t,e,r,n){this.distance=t,this.primitiveIndex=e,o(this.point,r),this.hasNormal=null!=n,null!=n&&o(this.normal,n)}updateIfCloserFromValues(t,e,o,r){t<this.distance&&this.update(t,e,o,r)}updateIfCloser(t){const{distance:e,primitiveIndex:o,point:r,normal:n}=t;this.updateIfCloserFromValues(e,o,r,t.hasNormal?n:null)}get valid(){return Number.isFinite(this.distance)}}function y(t,e,o,r,n){if(!t.visible||0!==t.type)return null;const i=new g(4);let s;if(t.boundingInfo)s=j(t.boundingInfo,e,o,r,n);else{const i=t.positionAttribute,l=t.primitivePositionIndices;s=v(e,o,r,0,l.length/3,l,i.data,i.stride,n,null,0)}for(const l of s)i.updateIfCloser(l);return i.valid?i:null}function b(t,e,o,r,n){const i=new g(4);for(const s of N(t,e,o,r,n))i.updateIfCloser(s);return i.valid?i:null}function*v(t,e,o,r,n,i,s,l,a,u=null,c=0){const m=(t,o,r,n)=>{const m=(u?.[n]??n)+c,f=null==u?m:n,p=3*m;return x(t,i,s,l,p+0,a,f,e),x(o,i,s,l,p+1,a,f,e),x(r,i,s,l,p+2,a,f,e),m};return yield*N(t,o,r,n,m)}function*N(t,e,o,n,i){if(null==t.camera)return;const{camera:s,screenPolygonPrimitiveProcessor:l}=t;for(let a=o;a<n;++a){const t=i(V[0],V[1],V[2],a),o=O;let n;E.reset();const u=w;for(const i of l.processTriangle(V))if(u.length=0,m(s.frustum[4],i,()=>u.pushNew(),!1),!(u.length<3)){for(let t=0;t<u.length;t++)s.projectToScreen(u.at(t),A[t]);P(e,A,u.length)&&(T(s.eye,u,B),null==n&&(n=f(O,V[0],V[1],V[2])),E.updateIfCloserFromValues(r(s.eye,B),t,B,n?o:null))}E.valid&&(yield E)}}function*j(t,e,o,r,n){let i;if(null!=n?(a(F,t.boundingBox),n.applyToAabb(F),i=c(r.broadPhaseFrustum,F,o)):i=c(r.broadPhaseFrustum,t.boundingBox,o),!i)return;const{primitiveIndices:s,position:l}=t,u=s?s.length:l.indices.length/3;if(u>d){const i=t.children;if(void 0!==i){for(const t of i)yield*j(t,e,o,r,n);return}}yield*v(e,o,r,0,u,l.indices,l.data,l.stride,n,s,0)}function x(t,e,o,r,n,l,a,u){const c=r*e[n],m=o[c+0],f=o[c+1],p=o[c+2];null!=l?l.applyToVertex(t,m,f,p,a):i(t,m,f,p),u&&s(t,t,u)}function P(t,e,o){for(let r=1;r<o-1;r++)if(h(t,e[0],e[r],e[r+1]))return!0;return!1}function T(t,e,r){let i=Number.POSITIVE_INFINITY;const s=e.at(0);for(let l=1;l<e.length-1;l++){p(S,t,s,e.at(l),e.at(l+1));const a=n(t,S);a<i&&(i=a,o(r,S))}}const F=u(),C=12,V=[l(),l(),l()],w=new t({allocator:t=>t??l()}),A=Array.from({length:C},()=>e()),B=l(),O=l(),S=l(),E=new g(4);export{I as DrapedHit,g as Hit,v as forEachTriangleRangeScreenPolygonHit,N as forEachTriangleReaderRangeScreenPolygonHit,y as intersectTriangleGeometryScreenPolygon,b as intersectTriangleReaderRangeScreenPolygon};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{BufferViewUint32 as t,BufferViewVec3f as e,BufferViewVec2Snorm16 as i,BufferViewSnorm16 as r,BufferViewFloat16 as s,BufferViewFloat as o,BufferViewVec2f as a,BufferViewVec4Unorm8 as n,BufferViewUnorm8 as h}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as c}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as u,is3DGeometry as f,isColor as p}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import g from"../lib/GLMaterial.js";import{isPathGeometry as m}from"../lib/PathGeometry.js";import{offsetPathVertexInfoFrameIndex as d}from"../lib/PathVertexInfo.js";import{MeshIntersectionOptions as y,intersectAabbInvDir as b}from"../lib/RayIntersections.js";import{assert as _}from"../lib/Util.js";import{applyPolygonOffsetToHit as S}from"./intersectWithPolygonOffset.js";import{getLayout as w,getTextureLayout as F}from"./PathLayouts.js";import{PathPassParameters as P,PathTechnique as V}from"./PathTechnique.js";import{PathTechniqueConfiguration as x}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as C}from"./TriangleMaterial.js";import{writeAttributes as R,writePosition as j,writeBufferVec2 as z,writeBufferInt16 as B,writeBufferFloat16 as O,writeBufferFloat as v,writeColor as A,writeBufferUint8 as T,writeOlidColor as M}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as I}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as U}from"../../../../webscene/support/AlphaCutoff.js";class L extends C{constructor(t,e){super(t,D),this.supportsEdges=!0,this.produces=new Map([[2,t=>(this.parameters.castShadows&&u(t)||f(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&u(t)||f(t))&&this.transparent]]),this._configuration=new x(e.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.offsetBackfaces=this.transparent,p(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=I(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type,this._configuration.hasPathSize=this.parameters.hasPathSize,this._configuration.hasPathColor=this.parameters.hasPathColor,this._configuration.hasPathOpacity=this.parameters.hasPathOpacity}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=U}intersectRay(t,e,i,r,s,o){this._intersectRay(t,i,r,s,o)}intersectRayDraped(){}intersectScreenPolygonDraped(){return null}intersectScreenPolygon(t,e,i,r){return m(t)?S(t.intersectScreenPolygon(i,e,r),this._configuration,i.camera.eye):null}_intersectRay(t,e,i,r,s){if(!m(t))return;const o=new y(e.tolerance,!1,e.options.normalRequired),a=t.boundingInfo;if(null==a)return void t.intersectRay(i,r,o,s);const n=a.boundingBox,h=[r[0]-i[0],r[1]-i[1],r[2]-i[2]],c=Math.sqrt(h[0]*h[0]+h[1]*h[1]+h[2]*h[2]),u=[c/h[0],c/h[1],c/h[2]];b(n,i,u,e.tolerance)&&t.intersectRay(i,r,o,s)}createBufferWriter(){return new G(w(),F(this.parameters))}createGLMaterial(t){return new q(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class q extends g{beginSlot(t){return this.getTechnique(V,t)}}class D extends P{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2}}class G{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=c}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,s,o,a){null!=s&&this._writeVertexBuffer(t,e,i,s,o),null!=a&&this._writeTextureBuffer(t,i,r,a)}_writeVertexBuffer(e,i,r,s,o){R(r,null,this.layout,e,i,s);const a=o?.from??0,n=s.buffer.getField("pathVertexInfo",t),h=r.get("pathVertexInfo");if(n&&h){_(1===h.size);const{data:t,stride:e,indices:i}=h;for(let r=0;r<i.length;++r){const o=t[e*i[r]];n.set(s.offset+r,d(o,a))}}}_writeTextureBuffer(t,c,u,f){const p=f.offset,g=f.buffer.getField("position",e),m=c.get("position");g&&m&&(_(3===m.size),j(m,t,g,p));const d=f.buffer.getField("profileRight",i),y=c.get("profileRight");d&&y&&(_(2===y.size),z(y,d,p));const b=f.buffer.getField("profileUp",i),S=c.get("profileUp");b&&S&&(_(2===S.size),z(S,b,p));const w=f.buffer.getField("profileRotation",r),F=c.get("profileRotation");w&&F&&(_(1===F.size),B(F,w,p));const P=f.buffer.getField("pathRotationUp",i),V=c.get("pathRotationUp");P&&V&&(_(2===V.size),z(V,P,p));const x=f.buffer.getField("pathMaxStretchDistance",s),C=c.get("pathMaxStretchDistance");x&&C&&(_(1===C.size),O(C,x,p));const R=f.buffer.getField("sizeFeatureAttribute",o),I=c.get("sizeFeatureAttribute");R&&I&&v(I,R,p);const U=f.buffer.getField("size",a),L=c.get("size");U&&L&&(_(2===L.size),z(L,U,p));const q=f.buffer.getField("colorFeatureAttribute",o),D=c.get("colorFeatureAttribute");q&&D&&v(D,q,p);const G=f.buffer.getField("color",n),W=c.get("color");G&&W&&A(W,4,G,p);const H=f.buffer.getField("opacityFeatureAttribute",o),k=c.get("opacityFeatureAttribute");H&&k&&v(k,H,p);const E=f.buffer.getField("opacity",h),J=c.get("opacity");if(E&&J&&(_(1===J.size),T(J,E,p)),l()){const t=f.buffer.getField("olidColor",n),e=m?.indices.length??0;u&&t&&e&&M(u,t,e,p)}}}export{D as Parameters,G as PathBufferWriter,L as PathMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as a}from"../../../../core/time.js";import{copy as n,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as m,scale as h,add as u,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as y}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ONES as v,create as w}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{fromPoints as E,distance2 as x,closestLineSegmentPoint as j,projectPoint as L,projectPointFraction as z,create as A}from"../../../../geometry/support/lineSegment.js";import{fromPoints as M,signedDistance as C,getNormal as R,create as O}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as V,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as F,isColor as U,isDepth as I,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{Material as Y}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as X,DrapedHit as G}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{r as ee}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as te,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ie}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as se}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class ne extends Y{constructor(e,t){super(e,le),this.produces=new Map([[2,e=>F(e)||U(e)&&8===this.parameters.renderOccluded],[3,e=>I(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>U(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>U(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new se(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,r=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,i=r&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=de(this.parameters.join,r),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&fe(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!i,this._configuration.worldSizedImagePattern=i}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=s[0],c=s[1],p=he(o,r);let m=Number.MAX_VALUE,h=0;for(const u of ue(Se,Pe,this.parameters,e)){const e=l-Se[0],r=c-Se[1],i=Pe[0]-Se[0],s=Pe[1]-Se[1],a=t((i*e+s*r)/(i*i+s*s),0,1),n=i*a-e,o=s*a-r,p=n*n+o*o;p<m&&(m=p,h=u)}m<p*p&&a(n.distance,n.normal,h)}intersectRay(t,r,i,s,a,o){const{options:l,camera:_,rayBegin:b,rayEnd:S}=i;if(!l.selectionMode||!t.visible||!_)return;if(!K(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,v=this._getLineSize(P),w=xe;n(w,i.point);const T=v*_.pixelRatio,L=Je*_.pixelRatio,z=T/2+L;c(Ie[0],w[0]-z,w[1]+z,0),c(Ie[1],w[0]+z,w[1]+z,0),c(Ie[2],w[0]+z,w[1]-z,0),c(Ie[3],w[0]-z,w[1]-z,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ie[e],Ne[e]))return;M(_.eye,Ne[0],Ne[1],ke),M(_.eye,Ne[1],Ne[2],We),M(_.eye,Ne[2],Ne[3],De),M(_.eye,Ne[3],Ne[0],Ye);let A=Number.MAX_VALUE,O=0;for(const e of this._forEachTransformedLineSegment(_e,be,y,r,me(this.parameters,P))){if(C(ke,_e)<0&&C(ke,be)<0||C(We,_e)<0&&C(We,be)<0||C(De,_e)<0&&C(De,be)<0||C(Ye,_e)<0&&C(Ye,be)<0)continue;const t=_.projectToRenderScreen(_e,je),r=_.projectToRenderScreen(be,Le);if(null==t||null==r)continue;if(t[2]<0&&r[2]>0){p(Te,_e,be);const e=_.frustum,r=-C(e[4],_e)/m(Te,R(e[4]));if(h(Te,Te,r),u(_e,_e,Te),!_.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&r[2]<0){p(Te,be,_e);const e=_.frustum,t=-C(e[4],be)/m(Te,R(e[4]));if(h(Te,Te,t),u(be,be,Te),!_.projectToRenderScreen(be,r))continue}else if(t[2]<0&&r[2]<0)continue;t[2]=0,r[2]=0;const i=E(t,r,Re),s=x(i,w);if(!(s>=A)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(i,_e,be,w,_,v,L);if(s>=e*e)continue}A=s,f(Me,_e),f(Ce,be),O=e}}if(A<z*z){let e=Number.MAX_VALUE;if(j(E(Me,Ce,Re),E(b,S,Oe),Ee)){p(Ee,Ee,b);const t=d(Ee);h(Ee,Ee,1/t),e=t/g(b,S)}o(e,Ee,O)}}intersectScreenPolygon(t,r,i,s){const{options:a,camera:n,screenPolygonPrimitiveProcessor:o}=i;if(!a.selectionMode||!t.visible)return null;if(!K(r))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),m=Je,h=m*n.pixelRatio,u=new X(4);for(const e of this._forEachTransformedLineSegment(_e,be,c,r,me(this.parameters,l)))for(const[t,r]of o.processLineSegment(qe,_e,be)){if(!J(n,t,r,je,Le))continue;const i=E(je,Le,Re);let a=p/2+m;this.parameters.screenSizePerspective&&(_(xe,je,Le,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(i,t,r,xe,n,p,h)/n.pixelRatio)),n.renderToScreen(je,ze),n.renderToScreen(Le,Ae),q(s,ze,Ae,a)&&(L(E(t,r,Oe),n.eye,ye),u.updateIfCloserFromValues(g(n.eye,ye),e,ye,null))}return u}intersectScreenPolygonDraped({attributes:e,screenToWorldRatio:t},r,i,s){if(!i.options.selectionMode)return null;const a=he(this._getLineSize(e,!0),t);for(const n of ue(Se,Pe,this.parameters,e,r))if(q(s,Se,Pe,a))return new G(n);return null}createBufferWriter(){return new ce(te(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new oe(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,r,i,s,a,n){const o=z(e,i);_(ye,t,r,o),b(ve,ye,s.viewMatrix);const l=d(ve),c=this.computeCameraAbsCosAngle(ye,s,this._configuration.spherical);ge.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return ge.apply(a)*s.pixelRatio/2+n}computeCameraAbsCosAngle(e,t,r){return r?S(Ee,e):c(Ee,0,0,1),p(we,e,t.eye),S(we,we),Math.abs(m(Ee,we))}_getLineSize(e,r=!1){let i=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?r&&(i*=this.parameters.vvSize.fallback[0]):i*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(i*=e.get("size").data[0]);return i}*_forEachTransformedLineSegment(e,t,r,i,s){const a=s?r.length-2:r.length-5;for(let n=0;n<a;n+=3){e[0]=r[n]+i[12],e[1]=r[n+1]+i[13],e[2]=r[n+2]+i[14];const s=(n+3)%r.length;t[0]=r[s]+i[12],t[1]=r[s+1]+i[13],t[2]=r[s+2]+i[14],yield n/3}}}class oe extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ie,e)}}class le extends ${constructor(){super(...arguments),this._width=0,this.color=v,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class ce{constructor(e,t,r){this.layout=e,this.textureBufferLayout=t,this._parameters=r,this.numJoinSubdivisions=de(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+2}elementCount(e){const t=2,r=e.get("position").indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,a,n){null!=n&&this._writeTextureBuffer(e,r,n),null!=s&&this._writeVertexBuffer(e,r,i,s,a)}_writeTextureBuffer(e,t,r){const i=t.get("position"),s=i.data.length/3,a=s+2,n=this._isClosed(t),{buffer:o,offset:l}=r,c=o.getField("position",V);Q(null!==c,"Expected valid position field in texture buffer");for(let p=0;p<s;++p)this._getTransformedPosition(Be,i.data,p,e),c.setVec(l+p+1,Be);n?(o.copyItem(l+a-2,l+0),o.copyItem(l+1,l+a-1)):(o.copyItem(l+1,l+0),o.copyItem(l+a-2,l+a-1))}_writeVertexBuffer(e,t,r,i,s){const{buffer:a,offset:n}=i,{layout:o}=this,l=t.get("position"),c=l.indices,p=l.data.length/3,m=p+2,h=t.get("distanceToStart")?.data;c&&c.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=a.getField("textureElementIndex",B);Q(null!=u,"Missing texture buffer index field"),Q(null!=s,"Using a texture layout, but the texture range for this instance was not provided");const d=s.from;Q(s.numElements===m,"Expected number of elements in TextureBuffer to equal number of points");const _=o.fields.has("sizeFeatureAttribute");let b=1,S=null;if(_){const e=t.get("sizeFeatureAttribute");1===e.data.length?b=e.data[0]:S=e.data}else b=t.get("size")?.data[0]??1;let P=[1,1,1,1],v=0,w=null;const E=o.fields.has("colorFeatureAttribute");if(E){const e=t.get("colorFeatureAttribute");1===e.data.length?v=e.data[0]:w=e.data}else P=t.get("color")?.data??P;const x=t.get("timeStamps")?.data,j=x&&o.fields.has("timeStamps"),L=o.fields.has("opacityFeatureAttribute");let z=0,A=null;if(L){const e=t.get("opacityFeatureAttribute");1===e.data.length?z=e.data[0]:A=e.data}const M=new Float32Array(a.buffer),C=T(a.buffer),R=new Uint8Array(a.buffer),O=new Uint32Array(a.buffer),V=o.stride/4;let F=n*V;const U=F;let I=0;const N=M.BYTES_PER_ELEMENT/C.BYTES_PER_ELEMENT,k=W(),D=this._isClosed(t),Y=(e,t,i,s,a,n,o,l)=>{const c=o+1;O[F]=d+c,F++,M[F++]=l;let p=F*N;if(C[p++]=a,C[p++]=n,F=Math.ceil(p/N),E)M[F]=w?.[o]??v;else{const e=Math.min(4*o,P.length-4),t=4*F;R[t]=255*P[e],R[t+1]=255*P[e+1],R[t+2]=255*P[e+2],R[t+3]=255*P[e+3]}if(F++,M[F++]=S?.[o]??b,L&&(M[F++]=A?.[o]??z),k){let e=4*F;r?(R[e++]=r[0],R[e++]=r[1],R[e++]=r[2],R[e++]=r[3]):(R[e++]=0,R[e++]=0,R[e++]=0,R[e++]=0),F=Math.ceil(.25*e)}j&&(p=F*N,C[p++]=s[0],C[p++]=s[1],C[p++]=s[2],C[p++]=s[3],F=Math.ceil(p/N))},J=()=>{f(Ve,Be),f(Be,Fe)},q=e=>{if(j){const t=4*e;y(Ue,x[t+0],x[t+1],x[t+2],x[t+3])}},X=(e,t,r)=>{null!=h?I=h[r]:I+=g(e,t)};F+=V,this._getTransformedPosition(Be,l.data,0,e),q(0);let G=0,H=0;D?(this._getTransformedPosition(Ve,l.data,p-1,e),G=0,H=p):(this._getTransformedPosition(Fe,l.data,1,e),Y(Be,Be,Fe,Ue,1,-4,0,0),Y(Be,Be,Fe,Ue,1,4,0,0),J(),q(1),G=1,H=p-1);for(let f=G;f<H;f++){this._getTransformedPosition(Fe,l.data,(f+1)%p,e),X(Ve,Be,f),Y(Ve,Be,Fe,Ue,0,-1,f,I),Y(Ve,Be,Fe,Ue,0,1,f,I);const t=this.numJoinSubdivisions;for(let e=0;e<t;++e){const r=(e+1)/(t+1);Y(Ve,Be,Fe,Ue,r,-1,f,I),Y(Ve,Be,Fe,Ue,r,1,f,I)}Y(Ve,Be,Fe,Ue,1,-2,f,I),Y(Ve,Be,Fe,Ue,1,2,f,I),J(),q((f+1)%p)}X(Ve,Be,H),D?(this._getTransformedPosition(Fe,l.data,1,e),Y(Ve,Be,Fe,Ue,0,-1,G,I),Y(Ve,Be,Fe,Ue,0,1,G,I)):(Y(Ve,Be,Be,Ue,0,-5,H,I),Y(Ve,Be,Be,Ue,0,5,H,I)),pe(M,U+V,M,U,V);F=pe(M,F-V,M,F,V),this._parameters.wireframe&&this._addWireframeVertices(a,U,F,V)}_getTransformedPosition(e,t,r,i){const s=3*r;c(e,t[s+0],t[s+1],t[s+2]),i&&b(e,e,i)}_addWireframeVertices(e,t,r,i){const s=new Uint8Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(r-t)*Float32Array.BYTES_PER_ELEMENT),n=i*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=pe(a,e,s,o,n);for(let c=0;c<=a.length-4*n;c+=2*n)l(c),l(c+2*n),l(c+1*n),l(c+2*n),l(c+1*n),l(c+3*n)}}function pe(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t){return(e/2+Je)*t}function*ue(e,t,r,i,s){const a=i.get("position").data,l=me(r,i)?a.length-2:a.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,a[0]+c,a[1]+p);for(let m=3;m<l+3;m+=3){const r=m%a.length;o(t,a[r]+c,a[r+1]+p),yield m/3,n(e,t)}}function fe(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function de(e,t){const r=t?1:0;switch(e){case"miter":case"bevel":return r;case"round":return ee+r}}const ge=new H,_e=P(),be=P(),Se=l(),Pe=l(),ye=P(),ve=P(),we=P(),Te=P(),Ee=P(),xe=P(),je=r(),Le=r(),ze=i(),Ae=i(),Me=P(),Ce=P(),Re=A(),Oe=A(),Ve=P(),Be=P(),Fe=P(),Ue=w(),Ie=[r(),r(),r(),r()],Ne=[P(),P(),P(),P()],ke=O(),We=O(),De=O(),Ye=O(),Je=4,qe=[P(),P()];export{le as Parameters,ne as RibbonLineMaterial};
|
|
2
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as o,set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as v}from"../../../../geometry/support/float16.js";import{create as w,fromPoints as E,distance2 as x,closestLineSegmentPoint as T,projectPoint as j,projectPointFraction as L}from"../../../../geometry/support/lineSegment.js";import{create as z,fromPoints as C,signedDistance as A,getNormal as M}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as R,BufferViewFloat as V,BufferViewVec4Unorm8 as F,BufferViewVec4f16 as O,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as U,isColor as I,isDepth as N,isColorHighlightOLIDOrDepth as W,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as D}from"../effects/geometry/olidUtils.js";import Y from"../lib/GLMaterial.js";import{Material as J}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as q,screenPolygonIntersectsBufferedSegment as X}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as H}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as K}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as Q,assert as Z}from"../lib/Util.js";import{isImagePattern as $}from"./lineStippleUtils.js";import{VisualVariablePassParameters as ee}from"./VisualVariablePassParameters.js";import{writeOlidColor as te}from"./internal/bufferWriterUtils.js";import{r as re}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as se}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ne}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as oe}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class le extends J{constructor(e,t){super(e,pe),this.produces=new Map([[2,e=>U(e)||I(e)&&8===this.parameters.renderOccluded],[3,e=>N(e)],[10,e=>W(e)&&8===this.parameters.renderOccluded],[11,e=>W(e)&&8===this.parameters.renderOccluded],[4,e=>I(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>I(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new oe(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,r=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,i=r&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=_e(this.parameters.join,r),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&ge(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!i,this._configuration.worldSizedImagePattern=i}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:r},i,s,n,o){if(!i.options.selectionMode)return;const a=this._getLineSize(e,!0),l=s[0],c=s[1],p=fe(a,r);let u=Number.MAX_VALUE,m=0;for(const h of de(ye,ve,this.parameters,e)){const e=l-ye[0],r=c-ye[1],i=ve[0]-ye[0],s=ve[1]-ye[1],n=t((i*e+s*r)/(i*i+s*s),0,1),o=i*n-e,a=s*n-r,p=o*o+a*a;p<u&&(u=p,m=h)}u<p*p&&n(o.distance,o.normal,m)}intersectRay(t,r,i,s,n,a){const{options:l,camera:_,rayBegin:b,rayEnd:S}=i;if(!l.selectionMode||!t.visible||!_)return;if(!Q(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,v=this._getLineSize(P),w=Le;o(w,i.point);const j=v*_.pixelRatio,L=Je*_.pixelRatio,z=j/2+L;c(Ie[0],w[0]-z,w[1]+z,0),c(Ie[1],w[0]+z,w[1]+z,0),c(Ie[2],w[0]+z,w[1]-z,0),c(Ie[3],w[0]-z,w[1]-z,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ie[e],Ne[e]))return;C(_.eye,Ne[0],Ne[1],We),C(_.eye,Ne[1],Ne[2],ke),C(_.eye,Ne[2],Ne[3],De),C(_.eye,Ne[3],Ne[0],Ye);let R=Number.MAX_VALUE,V=0;for(const e of this._forEachTransformedLineSegment(Se,Pe,y,r,he(this.parameters,P))){if(A(We,Se)<0&&A(We,Pe)<0||A(ke,Se)<0&&A(ke,Pe)<0||A(De,Se)<0&&A(De,Pe)<0||A(Ye,Se)<0&&A(Ye,Pe)<0)continue;const t=_.projectToRenderScreen(Se,ze),r=_.projectToRenderScreen(Pe,Ce);if(null==t||null==r)continue;if(t[2]<0&&r[2]>0){p(Te,Se,Pe);const e=_.frustum,r=-A(e[4],Se)/u(Te,M(e[4]));if(m(Te,Te,r),h(Se,Se,Te),!_.projectToRenderScreen(Se,t))continue}else if(t[2]>0&&r[2]<0){p(Te,Pe,Se);const e=_.frustum,t=-A(e[4],Pe)/u(Te,M(e[4]));if(m(Te,Te,t),h(Pe,Pe,Te),!_.projectToRenderScreen(Pe,r))continue}else if(t[2]<0&&r[2]<0)continue;t[2]=0,r[2]=0;const i=E(t,r,Fe),s=x(i,w);if(!(s>=R)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(i,Se,Pe,w,_,v,L);if(s>=e*e)continue}R=s,f(Re,Se),f(Ve,Pe),V=e}}if(R<z*z){let e=Number.MAX_VALUE;if(T(E(Re,Ve,Fe),E(b,S,Oe),je)){p(je,je,b);const t=d(je);m(je,je,1/t),e=t/g(b,S)}a(e,je,V)}}intersectScreenPolygon(t,r,i,s){const{options:n,camera:o,screenPolygonPrimitiveProcessor:a}=i;if(!n.selectionMode||!t.visible)return null;if(!Q(r))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Je,m=u*o.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(Se,Pe,c,r,he(this.parameters,l)))for(const[t,r]of a.processLineSegment(qe,Se,Pe)){if(!q(o,t,r,ze,Ce))continue;const i=E(ze,Ce,Fe);let n=p/2+u;this.parameters.screenSizePerspective&&(_(Le,ze,Ce,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(i,t,r,Le,o,p,m)/o.pixelRatio)),o.renderToScreen(ze,Ae),o.renderToScreen(Ce,Me),X(s,Ae,Me,n)&&(j(E(t,r,Oe),o.eye,we),h.updateIfCloserFromValues(g(o.eye,we),e,we,null))}return h}intersectScreenPolygonDraped({attributes:e,screenToWorldRatio:t},r,i,s){if(!i.options.selectionMode)return null;const n=fe(this._getLineSize(e,!0),t);for(const o of de(ye,ve,this.parameters,e,r))if(X(s,ye,ve,n))return new H(o);return null}createBufferWriter(){return new ue(ie(this.parameters),se(this.parameters),this.parameters)}createGLMaterial(e){return new ce(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,r,i,s,n,o){const a=L(e,i);_(we,t,r,a),b(Ee,we,s.viewMatrix);const l=d(Ee),c=this.computeCameraAbsCosAngle(we,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,r){return r?S(je,e):c(je,0,0,1),p(xe,e,t.eye),S(xe,xe),Math.abs(u(je,xe))}_getLineSize(e,r=!1){let i=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?r&&(i*=this.parameters.vvSize.fallback[0]):i*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(i*=e.get("size").data[0]);return i}*_forEachTransformedLineSegment(e,t,r,i,s){const n=s?r.length-2:r.length-5;for(let o=0;o<n;o+=3){e[0]=r[o]+i[12],e[1]=r[o+1]+i[13],e[2]=r[o+2]+i[14];const s=(o+3)%r.length;t[0]=r[s]+i[12],t[1]=r[s+1]+i[13],t[2]=r[s+2]+i[14],yield o/3}}}class ce extends Y{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ne,e)}}class pe extends ee{constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return $(this.stipplePattern)&&null!=this.stippleTexture}}class ue{constructor(e,t,r){this.layout=e,this.textureBufferLayout=t,this._parameters=r,this.numJoinSubdivisions=_e(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return he(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,r=e.get("position").indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,n,o){null!=o&&this._writeTextureBuffer(e,r,i,o),null!=s&&this._writeVertexBuffer(e,r,i,s,n)}_writeTextureBuffer(e,t,r,i){const s=t.get("position"),n=s.data.length/3,o=this._isClosed(t),{buffer:a,offset:l}=i,c=a.getField("position",R),p=a.getField("u0",V),u=a.getField("sizeFeatureAttribute",V),m=a.getField("size",V),h=a.getField("colorFeatureAttribute",V),d=a.getField("color",F),_=a.getField("olidColor",F),b=a.getField("timeStamps",O),S=a.getField("opacityFeatureAttribute",V),P=t.get("sizeFeatureAttribute")?.data,y=t.get("size")?.data,v=t.get("colorFeatureAttribute")?.data,w=t.get("color")?.data,E=t.get("opacityFeatureAttribute")?.data,x=t.get("distanceToStart")?.data,T=t.get("timeStamps");Z(null!==c,"Expected valid position field in texture buffer"),Z(null!==p,"Expected valid u0 field in texture buffer");let j=0;for(let L=0;L<n;++L){this._getTransformedPosition(Ue,s.data,L,e),L>0&&(null!=x?j=x[L]??j:j+=g(Be,Ue));const t=l+L+1;if(c.setVec(t,Ue),p.set(t,j),f(Be,Ue),u&&u.set(t,1===P?.length?P[0]:P?.[L]??0),m&&m.set(t,1===y?.length?y[0]:y?.[L]??1),h&&h.set(t,1===v?.length?v[0]:v?.[L]??0),d)if(null!=w){const e=Math.min(4*L,w.length-4);d.setValues(t,w[e],w[e+1],w[e+2],w[e+3])}else d.setValues(t,1,1,1,1);S&&S.set(t,1===E?.length?E[0]:E?.[L]??0)}if(null!=b&&null!=T){Z(4===T.size);const e=T.data;for(let t=0;t<n;++t){const r=4*t,i=l+t+1;b.set(i,0,e[r]),b.set(i,1,e[r+1]),b.set(i,2,e[r+2]),b.set(i,3,e[r+3])}}if(o){const e=l,t=l+1,r=l+2,i=l+n,s=i+1,o=i+2;a.copyItem(i,e),a.copyItem(t,s),a.copyItem(r,o),c.getVec(i,Be),c.getVec(t,Ue);const u=j+g(Be,Ue);p.set(s,u)}else{const e=l,t=l+1,r=l+n,i=r+1;a.copyItem(t,e),a.copyItem(r,i)}D()&&null!=r&&null!=_&&te(r,_,n+(o?3:2),l)}_writeVertexBuffer(e,t,r,i,s){const{buffer:n,offset:o}=i,{layout:a}=this,l=t.get("position"),c=l.indices,p=l.data.length/3,u=this._isClosed(t),m=p+(u?3:2);c&&c.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const h=n.getField("textureElementIndex",B);Z(null!=h,"Missing texture buffer index field"),Z(null!=s,"Using a texture layout, but the texture range for this instance was not provided");const f=s.from;Z(s.numElements===m,"Expected number of elements in TextureBuffer to equal number of points");const d=new Float32Array(n.buffer),g=v(n.buffer),_=new Uint32Array(n.buffer),b=a.stride/4;let S=o*b;const P=S,y=d.BYTES_PER_ELEMENT/g.BYTES_PER_ELEMENT,w=(e,t,r)=>{const i=r+1;_[S]=f+i,S++;let s=S*y;g[s++]=e,g[s++]=t,S=Math.ceil(s/y)};S+=b;let E=0,x=0;u?(E=0,x=p):(w(1,-4,0),w(1,4,0),E=1,x=p-1);for(let v=E;v<x;v++){w(0,-1,v),w(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const r=(t+1)/(e+1);w(r,-1,v),w(r,1,v)}w(1,-2,v),w(1,2,v)}u?(w(0,-1,x),w(0,1,x)):(w(0,-5,x),w(0,5,x)),me(d,P+b,d,P,b);S=me(d,S-b,d,S,b),this._parameters.wireframe&&this._addWireframeVertices(n,P,S,b)}_getTransformedPosition(e,t,r,i){const s=3*r;c(e,t[s+0],t[s+1],t[s+2]),i&&b(e,e,i)}_addWireframeVertices(e,t,r,i){const s=new Uint8Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(r-t)*Float32Array.BYTES_PER_ELEMENT),o=i*Float32Array.BYTES_PER_ELEMENT;let a=0;const l=e=>a=me(n,e,s,a,o);for(let c=0;c<=n.length-4*o;c+=2*o)l(c),l(c+2*o),l(c+1*o),l(c+2*o),l(c+1*o),l(c+3*o)}}function me(e,t,r,i,s){for(let n=0;n<s;n++)r[i++]=e[t++];return i}function he(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function fe(e,t){return(e/2+Je)*t}function*de(e,t,r,i,s){const n=i.get("position").data,l=he(r,i)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;a(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const r=u%n.length;a(t,n[r]+c,n[r+1]+p),yield u/3,o(e,t)}}function ge(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function _e(e,t){const r=t?1:0;switch(e){case"miter":case"bevel":return r;case"round":return re+r}}const be=new K,Se=P(),Pe=P(),ye=l(),ve=l(),we=P(),Ee=P(),xe=P(),Te=P(),je=P(),Le=P(),ze=r(),Ce=r(),Ae=i(),Me=i(),Re=P(),Ve=P(),Fe=w(),Oe=w(),Be=P(),Ue=P(),Ie=[r(),r(),r(),r()],Ne=[P(),P(),P(),P()],We=z(),ke=z(),De=z(),Ye=z(),Je=4,qe=[P(),P()];export{pe as Parameters,le as RibbonLineMaterial};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fadeInTime as e,fadeOutTime as i}from"../../support/flow/constants.js";import{Float2PassUniform as o}from"../core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import{set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fadeInTime as e,fadeOutTime as i}from"../../support/flow/constants.js";import{Float2PassUniform as o}from"../core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as m}from"../core/shaderModules/FloatPassUniform.js";import{glsl as l}from"../core/shaderModules/glsl.js";function n(a,n){const{hasAnimation:s,animation:T}=n;if(!s)return;const{attributes:f,varyings:p,vertex:u,fragment:c}=a,h=n.timeStampsExpr??"timeStamps";null==n.timeStampsExpr&&f.add("timeStamps","vec4"),p.add("vTimeStamp","float"),p.add("vFirstTime","float"),p.add("vLastTime","float"),p.add("vTransitionType","float"),u.main.add(l`
|
|
3
|
+
vec4 animatedLineTimeStamps = ${h};
|
|
4
|
+
vTimeStamp = animatedLineTimeStamps.x;
|
|
5
|
+
vFirstTime = animatedLineTimeStamps.y;
|
|
6
|
+
vLastTime = animatedLineTimeStamps.z;
|
|
7
|
+
vTransitionType = animatedLineTimeStamps.w;
|
|
8
|
+
`),3===T&&c.constants.add("decayRate","float",2.3),c.code.add(l`
|
|
6
9
|
float getTrailOpacity(float x) {
|
|
7
10
|
if (x < 0.0) {
|
|
8
11
|
return 0.0;
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
${d(T)}
|
|
12
|
-
}`),c.uniforms.add(new
|
|
15
|
+
}`),c.uniforms.add(new m("timeElapsed",t=>t.timeElapsed),new m("trailLength",t=>t.trailLength),new m("speed",t=>t.animationSpeed),new o("startEndTime",a=>t(r,a.startTime,a.endTime))),c.constants.add("fadeInTime","float",e),c.constants.add("fadeOutTime","float",i),c.constants.add("incomingTransition","int",0),c.constants.add("outgoingTransition","int",2),c.code.add(l`float fadeIn(float x) {
|
|
13
16
|
return smoothstep(0.0, fadeInTime, x);
|
|
14
17
|
}
|
|
15
18
|
float fadeOut(float x) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/
|
|
2
|
+
import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"./alphaCutoff.glsl.js";import"./AnimatedLine.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"./RibbonLineTextureBuffer.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build,r as ribbonlineNumRoundJoinSubdivisions}from"../../../../chunks/RibbonLine.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function o(
|
|
2
|
+
import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function o(t){return e().u32("textureElementIndex",{integer:!0}).vec2f16("lineParameters")}const u=[{type:"vec3f32",name:"position"},{type:"f32",name:"u0"}];function n(e){const o=[...u];return e.hasVVColor?o.push({type:"f32",name:"colorFeatureAttribute"}):o.push({type:"vec4unorm8",name:"color"}),e.hasVVSize?o.push({type:"f32",name:"sizeFeatureAttribute"}):o.push({type:"f32",name:"size"}),e.hasVVOpacity&&o.push({type:"f32",name:"opacityFeatureAttribute"}),t()&&o.push({type:"vec4unorm8",name:"olidColor"}),e.hasAnimation&&o.push({type:"vec4f16",name:"timeStamps"}),new r(o)}export{o as getLayout,n as getTextureBufferLayout};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as i}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{ReloadableShader as r}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as s,depthTest as n,blending as o}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as c,stencilBaseAllZeros as p,stencilWriteMaskOn as u,stencilToolTransparentOccluder as a,depthCompareAlways as d,stencilToolMaskOccluder as h,stencilWriteMaskOff as m,depthCompareLess as f}from"../lib/StencilUtils.js";import{getRibbonLineLayerPolygonOffset as g}from"../materials/PolygonOffset.js";import{R as b}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as P}from"./RibbonLineLayouts.js";import{PrimitiveType as T}from"../../../webgl/enums.js";import{makePipelineState as W,defaultColorWrite as j,unpremultipliedAlphaToPremultipliedAlpha as _}from"../../../webgl/renderState.js";let O=class extends l{constructor(e,i){super(e,i,t(P(
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as i}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{ReloadableShader as r}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as s,depthTest as n,blending as o}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as c,stencilBaseAllZeros as p,stencilWriteMaskOn as u,stencilToolTransparentOccluder as a,depthCompareAlways as d,stencilToolMaskOccluder as h,stencilWriteMaskOff as m,depthCompareLess as f}from"../lib/StencilUtils.js";import{getRibbonLineLayerPolygonOffset as g}from"../materials/PolygonOffset.js";import{R as b}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as P}from"./RibbonLineLayouts.js";import{PrimitiveType as T}from"../../../webgl/enums.js";import{makePipelineState as W,defaultColorWrite as j,unpremultipliedAlphaToPremultipliedAlpha as _}from"../../../webgl/renderState.js";let O=class extends l{constructor(e,i){super(e,i,t(P())),this.shader=new r(b,()=>import("./RibbonLine.glsl.js")),this.ignoreUnused=!0,this.primitiveType=i.wireframe?T.LINES:T.TRIANGLE_STRIP}_makePipelineState(e,i){const{output:t,hasOccludees:r}=e;return W({blending:o(t,!1,e.emissionDimmingPass),depthTest:n(t),depthWrite:s(e),colorWrite:j,stencilWrite:r?u:null,stencilTest:r?i?c:p:null,polygonOffset:g(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:i}=e;this._occluderPipelineTransparent=W({blending:_,polygonOffset:g(e),depthTest:d,depthWrite:null,colorWrite:j,stencilWrite:null,stencilTest:i?a:null}),this._occluderPipelineOpaque=W({blending:_,polygonOffset:g(e),depthTest:i?d:f,depthWrite:null,colorWrite:j,stencilWrite:i?m:null,stencilTest:i?h:null}),this._occluderPipelineMaskWrite=W({blending:null,polygonOffset:g(e),depthTest:f,depthWrite:null,colorWrite:null,stencilWrite:i?u:null,stencilTest:i?c:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,i,t){if(t)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e,i,t);case 10:return this._occluderPipelineOpaque??super.getPipeline(e,i,t);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e,i,t)}}};O=e([i("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],O);export{O as RibbonLineTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{TextureBackedBufferModule as e}from"../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Texture2DUintDrawUniform as r}from"../core/shaderModules/Texture2DUintDrawUniform.js";import{
|
|
2
|
+
import{TextureBackedBufferModule as e}from"../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Texture2DUintDrawUniform as r}from"../core/shaderModules/Texture2DUintDrawUniform.js";import{getTextureBufferLayout as o}from"./RibbonLineLayouts.js";const t=new r("componentTextureBuffer",e=>e.textureBuffer);function n(r){return new e({layout:o(r),itemIndexExpression:"textureElementIndex",bufferUniform:t})}export{n as getTextureBackedBufferModule};
|