UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) 2.56 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{CloudsParameters as e}from"../../environment/CloudsParameters.js";import h from"../../webgl/RenderCamera.js";import{OITPolygonOffsetLimit as s}from"./OrderIndependentTransparency.js";import{SceneLighting as n}from"../lighting/SceneLighting.js";class r{constructor(i,t){this.width=i,this.height=t}}class l{constructor(i,s){this.emptyTexture=i,this.shadowMap=s,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.hasEmission=!1,this.enableFillLights=!0,this.oitPass=0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new h,this._inverseViewport=t(),this._oldLighting=new n,this._newLighting=new n,this._fadedLighting=new n,this._lighting=this._newLighting,this.ssr=new g,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=t(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new e,this.shadowHighlightsVisible=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=null,this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null}get camera(){return this._camera}set camera(i){this._camera=i,this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3]}get enableOffset(){return 1===this.oitPass&&this.camera.relativeElevation<s}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(i,t,e,h){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=e,this._newLighting.set(i),this._oldLighting.updateLegacy(),1===h&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get occluder(){return 11===this.slot||12===this.slot?this.slot:null}}class g{constructor(){this.fadeFactor=1,this.reprojectionMatrix=i()}}export{l as BindParameters,r as ViewportSize};