@arcgis/core 5.2.0-next.109 → 5.2.0-next.110
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/analysis/featureReferenceUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{7eb929beb691694da2db.js → abcda435bc83ef4240f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{62c03ffda779df11892b.js → c2684fcde2923c9830e0.js} +1 -1
- package/assets/esri/core/workers/chunks/fc622f9e33e3b48113c8.js +1 -0
- package/assets/esri/views/3d/environment/resources/milkyway-band.ktx2 +0 -0
- package/chunks/DeepSky.glsl.js +14 -41
- package/package.json +3 -3
- package/support/revision.js +1 -1
- package/symbols/Symbol3DLayer.d.ts +2 -2
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/input/handlers/KeyPan.js +1 -1
- package/views/2d/navigation/MapViewNavigation.js +1 -1
- package/views/3d/camera/constraintUtils/altitude.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/input/handlers/ground/GroundNavigation.js +2 -0
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +2 -0
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
- package/views/3d/state/controllers/momentum/{RopePullMomentumController.js → GroundNavigationMomentumController.js} +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +2 -0
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +2 -20
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +13 -26
- package/views/3d/webgl-engine/effects/stars/DeepSky.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/stars/DeepSkyTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/affectsGeometry.js +2 -0
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +10 -8
- package/views/MapView.d.ts +1 -0
- package/views/SceneView.d.ts +1 -0
- package/views/SceneView.js +1 -1
- package/views/navigation/{RopePullMomentumEstimator.js → GroundNavigationMomentumEstimator.js} +1 -1
- package/assets/esri/core/workers/chunks/208caecab10a48506723.js +0 -1
- package/views/3d/input/handlers/RopePullNavigation.js +0 -2
- package/views/3d/state/controllers/RopePullController.js +0 -2
- package/views/3d/state/utils/ropePullUtils.js +0 -2
- package/views/3d/webgl-engine/lib/VertexAttribute.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{__decorate as t}from"tslib";import{prefersReducedMotion as i}from"../../../../core/a11yUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as n,distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as a,dot as h,crossAndNormalize as m,scale as l,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as d,fromPositionAndNormal as u}from"../../../../geometry/support/plane.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as C,applyAll as P}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as f}from"./InteractiveController.js";import{GroundNavigationMomentumController as w}from"./momentum/GroundNavigationMomentumController.js";import{groundNavigationConstants as z,findSphereHorizonY as S,computeHorizonPaddingLimits as b,findPlaneHorizonY as j,findGroundNavigationGrabLocation as y}from"../utils/groundNavigationUtils.js";import H from"../../webgl/RenderCamera.js";import{GroundNavigationMomentumEstimator as E}from"../../../navigation/GroundNavigationMomentumEstimator.js";let M=class extends f{constructor(t){super(t),this._validState=!0,this._adjustedScenePoint=c(),this._momentumEstimator=new E,this._referenceSphere=new g,this._referencePlane=d(),this._tmp3d=c(),this._screenPointArray=e(),this._forwardRopeComponent=c(),this._sidewaysRopeComponent=c(),this._ropeTranslation=c(),this._beginScreenPoint=e(),this._screenPickPoint=e(),this._horizonY=null,this._horizonPadding=null,this._ropeScreenHeight=1,this._ropePlane=d(),this._pointerOverHorizonVelocityAdjustment=1,this._pointerCount=0,this._beginCamera=new H,this._constraintOptions=new v(15,6,0,this._beginCamera)}get isGlobalMode(){return 1===this.view.state.viewingMode}get momentumEnabled(){return this.view.navigation.momentumEnabled&&this.view.animationsEnabled&&!i()}begin(t){this.running&&(this._pointerCount=t.pointers.size,r(t.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),n(this._beginScreenPoint,this._screenPickPoint),this.startCamera.relativeElevation>z.maxElevation?this._validState=!1:(this._prepareGroundNavigation(),this._beginCamera.copyFrom(this.startCamera)))}update(t){this.running&&this._validState&&(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(t),this.commitCamera())}end(t){return t.pointers.size===this._pointerCount&&this.update(t),this.finishController(),this.createMomentum()}_initHorizonValues(){this.isGlobalMode?this._globalInitHorizonValues():this._localInitHorizonValues()}_globalInitHorizonValues(){this._referenceSphere.radius=_(this.view.spatialReference).radius,this._horizonY=S(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=null!=this._horizonY?b(this.startCamera,this._horizonY):null}_localInitHorizonValues(){const t=c();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=c();a(i,this.startCamera.eye,t,-this.startCamera.relativeElevation),u(i,t,this._referencePlane),this._horizonY=j(this.startCamera,this._referencePlane),this._horizonPadding=b(this.startCamera,this._horizonY)}_prepareGroundNavigation(){if(this._initHorizonValues(),!this._horizonY||!this._horizonPadding)return;this._momentumEstimator.reset(),this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio;if(!y({view:this.view,originalScreenPoint:this._beginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint}))return void(this._validState=!1);const t=c();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=this.startCamera.viewRight,e=h(this._ropeTranslation,i),r=m(c(),t,i),o=h(this._ropeTranslation,r);l(this._forwardRopeComponent,r,o),l(this._sidewaysRopeComponent,i,e),u(this._adjustedScenePoint,t,this._ropePlane);const n=this._ropeScreenHeight-this._beginScreenPoint[1],s=this._ropeScreenHeight-this._horizonPadding[0];this._pointerOverHorizonVelocityAdjustment=Math.max(n/s,1)}_panningRopePull(t){if(!this._horizonY||!this._horizonPadding)return;const i=r(t.center,this._screenPointArray),e=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,o=(this._ropeScreenHeight-i[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),n=1-o,h=(i[0]-e)/(this._beginScreenPoint[0]-e),m=n*z.ySpeedMultiplier*this._pointerOverHorizonVelocityAdjustment,c=(n*z.xSpeedMultiplier+o*((1-h)*z.xSpeedMultiplier))*this._pointerOverHorizonVelocityAdjustment;l(this._ropeTranslation,this._forwardRopeComponent,m),a(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,c),this.currentCamera.eye=p(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=p(this._tmp3d,this.startCamera.center,this._ropeTranslation),this.momentumEnabled&&this._momentumEstimator.update(i,this._ropeTranslation,.001*t.timestamp),this._constraintOptions.interactionFactor=C(s(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this._ropeTranslation,P(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}createMomentum(){const t=this.momentumEnabled&&this._momentumEstimator.createMomentum();return t?new w({view:this.view,momentum:t}):null}};M=t([o("esri.views.3d.state.controllers.GroundNavigationController")],M);export{M as GroundNavigationController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as m,negate as h,length as c,subtract as _,normalize as p,add as u,scale as l,dot as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as P}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../geometry/support/axisAngle.js";import{create as w,fromPositionAndNormal as C,getNormal as M}from"../../../../geometry/support/plane.js";import{Sphere as b}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as S,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as E}from"../../input/util.js";import{InteractiveController as y}from"./InteractiveController.js";import{PanPlanarMomentumController as x}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as A}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as O}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as R}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as z}from"./momentum/ZoomSphericalMomentumController.js";import{pickPointAndInitSphere as k,excludeTerrain as F,inferNavigationMode as H,sphereOrPlanePointFromScreenPoint as D,maxPanDistanceModifier as U,minPinchAndPanCameraHeight as T,pivotSearchAreaSize as G,intersectPlaneFromScreenPointAtEye as I,applyZoomOnSphere as Z,shouldPreserveHeading as V,applyPanSphericalPreserveHeading as q,applyPanSphericalDirectRotation as B,normalizeRotationDelta as J,applyRotation as K,applyPanPlanar as L,applyZoomToPoint as N}from"../utils/navigationUtils.js";import Q from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as W}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as X}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as Y}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as $}from"../../../navigation/ZoomMomentumEstimator.js";let tt=class extends y{constructor(t){super(t),this._smoothRotation=new E(.05),this._rotationAxis=g(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=w(),this._beginRadius=0,this._smoothScaling=new E(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new $,this._rotationMomentumEstimator=new Y,this._panSphericalMomentumEstimator=new X,this._panPlanarMomentumEstimator=new W,this._adjustedSphere=new b,this._tmp3d=g(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=g(),this._screenPickPoint=n(),this._scenePickPoint=g(),this._navigationMode=1,this._sphere=new b,this._pointerCount=0,this._tmpInteractionDirection=g(),this._beginCamera=new Q,this._constraintOptions=new j(15,0,0,this._beginCamera)}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._beginAngle=t.angle,this._pointerCount=t.pointers.size,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),a(this._beginScreenPoint,this._screenPickPoint);const n=k(this.view,this.startCamera,this._screenPickPoint,P(this.view.spatialReference).radius,1,this.view.groundView.invisible?F:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,m(this._beginScenePoint,this._scenePickPoint),this._navigationMode=H(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),0===this._navigationMode&&this._preparePlanarPanMode(t,n.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navigationMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navigationMode?new z({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere.radius}):new R({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new O({view:this.view,momentum:e,center:this._sphere.center,axis:this._rotationAxis});if(1===this._navigationMode){const t=this.view.animationsEnabled&&this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new A({view:this.view,momentum:t})}else{const t=this.view.animationsEnabled&&this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=h(this._tmp3d,this.startCamera.viewForward);C(this._scenePickPoint,e,this._panningPlane);const o=n(this._screenPickPoint[0],0),a=g(),r=c(this.startCamera.eye);this._adjustedSphere.radius=r<this._sphere.radius?r-100:this._sphere.radius,D(this._adjustedSphere,this.startCamera,o,a);const P=g(),v=g(),w=g();_(P,this._scenePickPoint,this.currentCamera.eye);const b=c(P);p(P,P);const S=U*Math.max(Math.abs(this.view.camera.position.z),T),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,G);let j=null!=f?f:S;i&&(j=Math.min(j,b)),m(w,u(v,this.currentCamera.eye,l(v,P,j))),this._panningPlane[3]=-d(M(this._panningPlane),w),this.startCamera.center=u(v,this.startCamera.eye,l(v,this.startCamera.viewForward,j));const E=s(t.center,this._tmpScreenPointArray);I(this._panningPlane,this.startCamera,E,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),Z(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=S(t.radius-this._beginRadius),f(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);D(this._sphere,this.currentCamera,i,this._tmp3d),V(this._beginScenePoint,d(this.currentCamera.up,this._beginScenePoint),this._sphere.radius,this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(q(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(B(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere.radius,this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=S(r(this._screenPickPoint,i)),f(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){p(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+J(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),K(this.currentCamera,this._sphere.center,v(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=S(t.radius*e),f(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);I(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(L(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=S(r(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),f(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),N(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=S(t.radius-this._beginRadius),f(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){m(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=J(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),K(this.currentCamera,this._sphere.center,v(this._rotationAxis,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=S(t.radius*o),f(this.view,this.currentCamera,this._constraintOptions)}};tt=t([o("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],tt);export{tt as PinchAndPanControllerGlobal};
|
|
2
|
+
import{__decorate as t}from"tslib";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as m,negate as h,length as c,subtract as _,normalize as p,add as u,scale as l,dot as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as P}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../geometry/support/axisAngle.js";import{create as w,fromPositionAndNormal as C,getNormal as M}from"../../../../geometry/support/plane.js";import{Sphere as b}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as S,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as E}from"../../input/util.js";import{InteractiveController as y}from"./InteractiveController.js";import{PanPlanarMomentumController as x}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as A}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as O}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as R}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as z}from"./momentum/ZoomSphericalMomentumController.js";import{pickPointAndInitSphere as k,excludeTerrain as F,inferNavigationMode as H,sphereOrPlanePointFromScreenPoint as D,maxPanDistanceModifier as U,minPinchAndPanCameraHeight as T,searchAreaSize as G,intersectPlaneFromScreenPointAtEye as I,applyZoomOnSphere as Z,shouldPreserveHeading as V,applyPanSphericalPreserveHeading as q,applyPanSphericalDirectRotation as B,normalizeRotationDelta as J,applyRotation as K,applyPanPlanar as L,applyZoomToPoint as N}from"../utils/navigationUtils.js";import Q from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as W}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as X}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as Y}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as $}from"../../../navigation/ZoomMomentumEstimator.js";let tt=class extends y{constructor(t){super(t),this._smoothRotation=new E(.05),this._rotationAxis=g(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=w(),this._beginRadius=0,this._smoothScaling=new E(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new $,this._rotationMomentumEstimator=new Y,this._panSphericalMomentumEstimator=new X,this._panPlanarMomentumEstimator=new W,this._adjustedSphere=new b,this._tmp3d=g(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=g(),this._screenPickPoint=n(),this._scenePickPoint=g(),this._navigationMode=1,this._sphere=new b,this._pointerCount=0,this._tmpInteractionDirection=g(),this._beginCamera=new Q,this._constraintOptions=new j(15,0,0,this._beginCamera)}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._beginAngle=t.angle,this._pointerCount=t.pointers.size,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),a(this._beginScreenPoint,this._screenPickPoint);const n=k(this.view,this.startCamera,this._screenPickPoint,P(this.view.spatialReference).radius,1,this.view.groundView.invisible?F:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,m(this._beginScenePoint,this._scenePickPoint),this._navigationMode=H(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),0===this._navigationMode&&this._preparePlanarPanMode(t,n.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navigationMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navigationMode?new z({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere.radius}):new R({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new O({view:this.view,momentum:e,center:this._sphere.center,axis:this._rotationAxis});if(1===this._navigationMode){const t=this.view.animationsEnabled&&this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new A({view:this.view,momentum:t})}else{const t=this.view.animationsEnabled&&this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=h(this._tmp3d,this.startCamera.viewForward);C(this._scenePickPoint,e,this._panningPlane);const o=n(this._screenPickPoint[0],0),a=g(),r=c(this.startCamera.eye);this._adjustedSphere.radius=r<this._sphere.radius?r-100:this._sphere.radius,D(this._adjustedSphere,this.startCamera,o,a);const P=g(),v=g(),w=g();_(P,this._scenePickPoint,this.currentCamera.eye);const b=c(P);p(P,P);const S=U*Math.max(Math.abs(this.view.camera.position.z),T),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,G);let j=null!=f?f:S;i&&(j=Math.min(j,b)),m(w,u(v,this.currentCamera.eye,l(v,P,j))),this._panningPlane[3]=-d(M(this._panningPlane),w),this.startCamera.center=u(v,this.startCamera.eye,l(v,this.startCamera.viewForward,j));const E=s(t.center,this._tmpScreenPointArray);I(this._panningPlane,this.startCamera,E,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),Z(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=S(t.radius-this._beginRadius),f(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);D(this._sphere,this.currentCamera,i,this._tmp3d),V(this._beginScenePoint,d(this.currentCamera.up,this._beginScenePoint),this._sphere.radius,this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(q(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(B(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere.radius,this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=S(r(this._screenPickPoint,i)),f(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){p(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+J(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),K(this.currentCamera,this._sphere.center,v(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=S(t.radius*e),f(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);I(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(L(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=S(r(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),f(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),N(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=S(t.radius-this._beginRadius),f(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){m(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=J(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),K(this.currentCamera,this._sphere.center,v(this._rotationAxis,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=S(t.radius*o),f(this.view,this.currentCamera,this._constraintOptions)}};tt=t([o("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],tt);export{tt as PinchAndPanControllerGlobal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators.js";import{distance as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{negate as s,copy as a,dot as r,subtract as m,length as h,normalize as l,scale as c,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as d}from"../../../../geometry/support/axisAngle.js";import{create as g,fromNormalAndOffset as C,setOffsetFromPoint as v,negate as b,getNormal as w}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as M,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as V}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as P}from"../../input/util.js";import{getVoxelWasm as z}from"../../layers/VoxelWasm.js";import{InteractiveController as S}from"./InteractiveController.js";import{PanPlanarMomentumController as j}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as E}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as H}from"./momentum/ZoomPlanarMomentumController.js";import{inferNavigationMode as x,excludeTerrain as y,getTiltScaleFactor as O,maxPanDistanceModifier as F,minPinchAndPanCameraHeight as R,
|
|
2
|
+
import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators.js";import{distance as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{negate as s,copy as a,dot as r,subtract as m,length as h,normalize as l,scale as c,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as d}from"../../../../geometry/support/axisAngle.js";import{create as g,fromNormalAndOffset as C,setOffsetFromPoint as v,negate as b,getNormal as w}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as M,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as V}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as P}from"../../input/util.js";import{getVoxelWasm as z}from"../../layers/VoxelWasm.js";import{InteractiveController as S}from"./InteractiveController.js";import{PanPlanarMomentumController as j}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as E}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as H}from"./momentum/ZoomPlanarMomentumController.js";import{inferNavigationMode as x,excludeTerrain as y,getTiltScaleFactor as O,maxPanDistanceModifier as F,minPinchAndPanCameraHeight as R,searchAreaSize as A,centroid as U,applyZoomToPoint as T,applyPanPlanar as D,normalizeRotationDelta as I,applyRotation as Z,intersectPlaneFromScreenPointAtEye as k}from"../utils/navigationUtils.js";import G from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as L}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as W}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as q}from"../../../navigation/ZoomMomentumEstimator.js";const B=u(0,0,1);let J=class extends S{constructor(t){super(t),this._rotationValueSmooth=new P(.05),this._scalingValueSmooth=new P(.05),this._planeHorizontal=g(),this._planeVertical=g(),this._rotationMomentumEstimator=new W,this._panMomentumEstimator=new L(300,12,.9),this._zoomMomentumEstimator=new q,this._beginRadius=0,this._beginCenter=_(),this._beginAngle=0,this._tmpPoints=[],this._navigationMode=1,this._beginCenterScreen=i(),this._tmpCentroid3d=_(),this._tmpCentroid2d=i(),this._tmp2d=i(),this._pointerCount=0,this._beginCamera=new G,this._constraintOptions=new V(15,0,0,this._beginCamera)}begin(t){if(!this.running)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panMomentumEstimator.enabled=i,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),e(t.center,this._beginCenterScreen),C(B,0,this._planeHorizontal);const n=_();s(n,this.startCamera.viewForward);const o=_();a(o,B);const u=r(n,o);this._navigationMode=x(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);const d=_(),g=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,d,this.view.groundView.invisible?y:{}),M=O(o,this.startCamera.viewForward,F)*Math.max(Math.abs(this.view.camera.position.z),R);v(this._planeHorizontal,this._planeHorizontal,d),this.startCamera.aboveGround||b(this._planeHorizontal,this._planeHorizontal);const f=_(),V=_(),P=_();m(f,d,this.currentCamera.eye);const S=h(f);if(l(f,f),0===this._navigationMode){c(o,o,u),m(w(this._planeVertical),n,o),l(w(this._planeVertical),w(this._planeVertical)),v(this._planeVertical,this._planeVertical,d);const i=this.view.stage.renderView.getMinimalDepthForArea(z(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,A);let e=null!=i?i:M;g&&(e=Math.min(e,S)),a(P,p(V,this.currentCamera.eye,c(V,f,e))),this._planeVertical[3]=-r(w(this._planeVertical),P),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),U(this._tmpPoints,this._beginCenter)}else{const i=g?S:M;a(P,p(V,this.currentCamera.eye,c(V,f,i))),this._planeHorizontal[3]=-r(w(this._planeHorizontal),P),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),U(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,n=1===this._navigationMode?this._planeHorizontal:this._planeVertical,s=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),T(this.currentCamera,s,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=M(Math.abs(t.radius-this._beginRadius)),f(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(t.pointers,n,this.currentCamera,this._tmpPoints),U(this._tmpPoints,this._tmpCentroid3d),e(t.center,this._tmpCentroid2d),D(this.currentCamera,s,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=M(o(this._beginCenterScreen,this._tmpCentroid2d)),f(this.view,this.currentCamera,this._constraintOptions),i){const i=s,e=this._rotationValueSmooth.value,n=e+I(t.angle-e),o=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=o,this._rotationValueSmooth.update(n);const a=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(a,.001*t.timestamp);const r=w(this._planeHorizontal);Z(this.currentCamera,i,d(r,a)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=M(Math.abs(t.radius*a)),f(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return new H({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new E({view:this.view,momentum:e,center:this._beginCenter,axis:w(this._planeHorizontal)});const n=this.view.animationsEnabled&&this._panMomentumEstimator.evaluateMomentum();return n?new j({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const o=this._tmp2d;let s=0;return t.forEach(t=>{o[0]=t.x,o[1]=t.y,void 0===n[s]&&(n[s]=_()),k(i,e,o,n[s]),s+=1}),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};J=t([n("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],J);export{J as PinchAndPanControllerLocal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as i}from"tslib";import{property as t,subclass as e}from"../../../../core/accessorSupport/decorators.js";import{distance as n,add as o,scale as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../ViewAnimation.js";import{Animation as m}from"../../animation/pointToPoint/Animation.js";import{AnimationController as l}from"./AnimationController.js";import{
|
|
2
|
+
import{__decorate as i}from"tslib";import{property as t,subclass as e}from"../../../../core/accessorSupport/decorators.js";import{distance as n,add as o,scale as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../ViewAnimation.js";import{Animation as m}from"../../animation/pointToPoint/Animation.js";import{AnimationController as l}from"./AnimationController.js";import{searchAreaSize as c}from"../utils/navigationUtils.js";import h from"../../webgl/RenderCamera.js";import{Intersector as p}from"../../webgl-engine/lib/Intersector.js";import{EasingFunctions as u}from"../../../animation/easing.js";let f=class extends l{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(i){super(i),this.type="point-to-point",this.mode="interaction",this._target=null}initialize(){this.animation=new m(this.view.state.viewingMode),this.viewAnimation="interaction"===this.mode?null:new a}get isInteractive(){return"interaction"===this.mode}begin(i,t){this._target=i.clone(),this.stepController=(i,t)=>{this.animation.step(i,t),this.animation.finished&&this.finishController()};const e=this.animationSettings(t);d.copyFrom(this.view.state.camera);const s=this.view.stage.renderView.getMinimalDepthForArea(null,d.fullWidth/d.pixelRatio*.5,d.fullHeight/d.pixelRatio*.5,d,c),a=new p(this.view.state.viewingMode);let m;this._intersectionHelper.intersectRay(d.ray,a,g)&&(m=n(d.eye,g));const l=null!=s&&null!=m?Math.min(s,m):s??m;o(g,d.eye,r(g,d.viewForward,l??0)),d.center=g,this.animation.update(d,i,e),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}onControllerEnd(i){if(this.stepController){this.animation.currentTime/this.animation.time>=1&&this._target?i.copyFrom(this._target):this.animation.cameraAt(this.animation.currentTime/this.animation.time,i),this.animation.currentTime=this.animation.time}super.onControllerEnd(i),this.stepController=void 0}animationSettings(i={}){return{apex:i.liftOffDisabled?void 0:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...i,easing:"string"==typeof i.easing?u[i.easing]:i.easing}}};i([t({constructOnly:!0})],f.prototype,"mode",void 0),i([t({readOnly:!0})],f.prototype,"isInteractive",null),f=i([e("esri.views.3d.state.controllers.PointToPointAnimationController")],f);let d=new h;const g=s();function v(){d=new h}function w(i){return null!=i&&"type"in i&&"point-to-point"===i.type}export{f as PointToPointAnimationController,v as cleanupPointToPointAnimationController,w as isPointToPointAnimationController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as e,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as c,copy as l,subtract as _,length as v,normalize as P,add as f,scale as w,dot as u,cross as C,transformMat4 as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as x}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as j}from"../../layers/VoxelWasm.js";import{TiltRange as b}from"../Constraints.js";import{InteractiveController as R}from"./InteractiveController.js";import{excludeTerrain as M,normalizeCoordinate as V,getTiltScaleFactor as U,maxRotatePivotDistanceModifier as D,minRotatePivotDistance as O,inferNavigationMode as T,
|
|
2
|
+
import{__decorate as t}from"tslib";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as e,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as c,copy as l,subtract as _,length as v,normalize as P,add as f,scale as w,dot as u,cross as C,transformMat4 as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as x}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as j}from"../../layers/VoxelWasm.js";import{TiltRange as b}from"../Constraints.js";import{InteractiveController as R}from"./InteractiveController.js";import{excludeTerrain as M,normalizeCoordinate as V,getTiltScaleFactor as U,maxRotatePivotDistanceModifier as D,minRotatePivotDistance as O,inferNavigationMode as T,searchAreaSize as A}from"../utils/navigationUtils.js";let H=class extends R{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.pivot=0,this._rotScale=0,this._lastPoint=m(),this._tmpWorldUp=g(),this._tmpViewDir=g(),this._tmpRotCurPoint=m(),this._tmpTransf=h(),this._tmpAxis=g(),this._tmpPivotPoint=g(),this._pivotPos=g(),this._constraintOptions=new y(15,2,0,this.startCamera)}initialize(){this._rotScale=0===this.pivot?3:1.5}begin(t){if(this.running){switch(this.pivot){case 1:l(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=3,this._constraintOptions.tiltMode=1,this._constraintOptions.selection=0;break;case 0:{const i=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,this.view.groundView.invisible?M:{})&&!c(this.startCamera.eye,this._pivotPos);i||l(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(t,i),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=2,this._constraintOptions.tiltMode=0,this._constraintOptions.selection=11;break}}V(this.startCamera,t,this._lastPoint)}}_constrainPivotPoint(t,i){const s=this.startCamera,e=g();_(e,this._pivotPos,s.eye);const o=v(e),a=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(s.eye,F);let n=Math.max(U(F,s.viewForward,D)*a,O);i&&(n=Math.min(o,n));const h=r(s.width/s.pixelRatio*.5,s.height/s.pixelRatio*.5),p=T(this.startCamera,h,this.view.renderCoordsHelper,this.view.viewingMode);let m=this.view.stage.renderView.getMinimalDepthForArea(j(this.view),s.fullWidth/s.pixelRatio*.5,s.fullHeight/s.pixelRatio*.5,s,2.5*A,A),c=this.view.stage.renderView.getMinimalDepthForArea(j(this.view),t[0],t[1],s,A);null==m&&null==c||(m=m??c??0,c=null==c||1===p?m:c,n=m>c?c:m,n=i?Math.min(n,o):n),P(e,e),l(this._pivotPos,f(this._tmpPivotPoint,s.eye,w(this._tmpPivotPoint,e,n)))}update(t){if(this.running){switch(this.pivot){case 1:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this._pivotPos);break;case 0:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this._pivotPos)}x(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.running&&this.finishController()}_applyRotation(t,r,e,o){this.view.renderCoordsHelper.worldUpAtPosition(o,this._tmpWorldUp),V(t,r,this._tmpRotCurPoint);let h=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale,m=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;_(this._tmpViewDir,e,o);const c=v(this._tmpViewDir),l=i(u(this._tmpViewDir,this._tmpWorldUp)/c);if(1===this.pivot){h*=-.5;const t=.5*Math.PI-l,i=.5*Math.PI*.99;h=t-Math.max(-i,Math.min(i,t+h))}return h=s(h+l,b.min,b.max)-l,C(this._tmpAxis,t.up,this._tmpViewDir),0===this.pivot&&(m=-m),a(this._tmpTransf,m,this._tmpWorldUp),n(this._tmpTransf,this._tmpTransf,h,this._tmpAxis),d(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),t.up=d(W,t.up,this._tmpTransf),f(W,o,this._tmpViewDir),p(this._lastPoint,this._tmpRotCurPoint),W}};t([e()],H.prototype,"pivot",void 0),H=t([o("esri.views.3d.state.controllers.RotateController")],H);const W=g(),F=g();export{H as RotateController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{subclass as e}from"../../../../core/accessorSupport/decorators.js";import{copy as s,distance as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{normalize as o,subtract as h,length as c,scale as m,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as u,fromPoints as P}from"../../../../geometry/support/axisAngle.js";import{Sphere as y}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as C,applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as d}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as f}from"../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as v}from"./InteractiveController.js";import{normalizeCoordinate as R,pickPointAndInitSphere as w,excludeTerrain as D,inferNavigationMode as k,zoomPivotDistanceClamp as j,getTiltScaleFactor as A,
|
|
2
|
+
import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{subclass as e}from"../../../../core/accessorSupport/decorators.js";import{copy as s,distance as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{normalize as o,subtract as h,length as c,scale as m,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as u,fromPoints as P}from"../../../../geometry/support/axisAngle.js";import{Sphere as y}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as C,applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as d}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as f}from"../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as v}from"./InteractiveController.js";import{normalizeCoordinate as R,pickPointAndInitSphere as w,excludeTerrain as D,inferNavigationMode as k,zoomPivotDistanceClamp as j,getTiltScaleFactor as A,searchAreaSize as b,distanceComparisonTolerance as x,sphereOrPlanePointFromScreenPoint as M,applyRotation as O,maxZoomPivotDistanceModifier as U}from"../utils/navigationUtils.js";import{fromScreenAtEye as z}from"../../support/geometryUtils/ray.js";const B=12;let S=class extends v{constructor(){super(...arguments),this._pickPoint=l(),this._tmpP0=a(),this._panAxisAngle=u(),this._tmpRayDir=l(),this._tmpRayDirPick=l(),this._targetOnSphere=l(),this._navigationMode=1,this._tmpRay={origin:l(),direction:l()},this.dragBeginPoint=r(),this._normalizedAnchorPoint=a(),this._constraintOptions=new d(7,1,0,this.startCamera),this._sphere=new y,this._hasPickPoint=!1}begin(t){if(!this.running)return;s(this.dragBeginPoint,t),R(this.startCamera,t,this._normalizedAnchorPoint);const r=_(this.view.spatialReference),e=w(this.view,this.startCamera,t,r.radius,0,this.view.groundView.invisible?D:{});if(this._navigationMode=k(this.startCamera,t,this.view.renderCoordsHelper,this.view.viewingMode),1===this._navigationMode)this._hasPickPoint=!!e.scenePickPoint,this._pickPoint=e.scenePickPoint??this._pickPoint,this._sphere=e.sphere;else{let r;z(this.startCamera,t,this._tmpRay),o(this._tmpRay.direction,this._tmpRay.direction),null!=e.scenePickPoint&&(h(this._tmpRayDirPick,this.startCamera.eye,e.scenePickPoint),r=c(this._tmpRayDirPick));const s=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,H);const n=i(A(H,this._tmpRay.direction,U)*s,j[0],j[1]),a=this.view.stage.renderView.getMinimalDepthForArea(null,t[0],t[1],this.view.state.camera,b);let l=null!=a?a:n;null!=r&&(l=Math.min(l,r)),this._hasPickPoint=!0,m(this._tmpRay.direction,this._tmpRay.direction,l),p(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}update(t){if(this.running){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,1===this._navigationMode){h(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=c(this._tmpRayDir);R(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*B;let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<x)return;if(this._hasPickPoint&&e<i){const t=1-(1-e/i)*(1-this._sphere.radius/c(this.currentCamera.center));this.currentCamera.center=m(F,this.currentCamera.center,t)}m(this._tmpRayDir,this._tmpRayDir,-e/i),this.currentCamera.eye=p(F,this.currentCamera.center,this._tmpRayDir),this._constraintOptions.interactionFactor=C(n(this.dragBeginPoint,t)),g(this.view,this.currentCamera,this._constraintOptions),this._hasPickPoint&&(M(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),P(this._pickPoint,this._targetOnSphere,this._panAxisAngle),O(this.currentCamera,this._sphere.center,this._panAxisAngle))}else{const i=c(this._tmpRay.direction);R(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*B;let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<x)return;m(this._tmpRayDir,this._tmpRay.direction,1-e/i),this.currentCamera.eye=p(F,this.currentCamera.eye,this._tmpRayDir),this.currentCamera.center=p(F,this.currentCamera.center,this._tmpRayDir),o(this._tmpRayDir,this._tmpRayDir),this._constraintOptions.interactionDirection=this._tmpRayDir,g(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}f(this.view,null,this.currentCamera),this.commitCamera()}}finish(){this.running&&this.finishController()}};S=t([e("esri.views.3d.state.controllers.ZoomControllerGlobal")],S);const F=l(),H=l();export{S as ZoomControllerGlobal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{subclass as s}from"../../../../core/accessorSupport/decorators.js";import{copy as e,distance as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{subtract as o,length as m,normalize as h,scale as c,add as p,negate as _,copy as l,lerp as P}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,fromValues as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as C,fromPositionAndNormal as f}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as D,applyAll as v}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as d}from"../../layers/VoxelWasm.js";import{InteractiveController as j}from"./InteractiveController.js";import{normalizeCoordinate as w,excludeTerrain as b,zoomPivotDistanceClamp as x,getTiltScaleFactor as N,maxZoomPivotDistanceModifier as O,
|
|
2
|
+
import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{subclass as s}from"../../../../core/accessorSupport/decorators.js";import{copy as e,distance as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{subtract as o,length as m,normalize as h,scale as c,add as p,negate as _,copy as l,lerp as P}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,fromValues as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as C,fromPositionAndNormal as f}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as D,applyAll as v}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as d}from"../../layers/VoxelWasm.js";import{InteractiveController as j}from"./InteractiveController.js";import{normalizeCoordinate as w,excludeTerrain as b,zoomPivotDistanceClamp as x,getTiltScaleFactor as N,maxZoomPivotDistanceModifier as O,searchAreaSize as M,intersectPlaneFromScreenPoint as R,distanceComparisonTolerance as z}from"../utils/navigationUtils.js";let A=class extends j{constructor(){super(...arguments),this._tmpP=u(),this._tmpDir=u(),this._tmpN=u(),this._tmpP0=a(),this._tmpPoi=u(),this._tmpRayDir=u(),this.dragBeginPoint=r(),this._normalizedAnchorPoint=a(),this._constraintOptions=new y(15,1,0,this.startCamera,u()),this._plane=C()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;e(this.dragBeginPoint,t),w(this.startCamera,t,this._normalizedAnchorPoint);const r=this._intersectionHelper.intersectScreenFreePointFallback(t,this._tmpP,this.view.groundView.invisible?b:{});o(this._tmpDir,this._tmpP,this.startCamera.eye);const s=m(this._tmpDir);h(this._tmpDir,this._tmpDir);const n=Math.abs(this.view.camera.position.z),a=i(N(B,this._tmpDir,O)*n,x[0],x[1]),l=this.view.stage.renderView.getMinimalDepthForArea(d(this.view),t[0],t[1],this.view.state.camera,M);let P=null!=l?l:a;r&&(P=Math.min(P,s)),c(this._tmpDir,this._tmpDir,P),p(this._tmpP,this.startCamera.eye,this._tmpDir),o(this._tmpN,this.startCamera.eye,this.startCamera.center),h(this._tmpN,this._tmpN),this._tmpN[1]<0&&_(this._tmpN,this._tmpN),f(this._tmpP,this._tmpN,this._plane)}update(t){if(!this.running)return;R(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||l(this._tmpPoi,this.currentCamera.center),w(this.currentCamera,t,this._tmpP0);let i=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e(this._normalizedAnchorPoint,this._tmpP0),o(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);const r=m(this._tmpRayDir);let s=r*(1-i);this._constraintOptions.interactionDirection&&(l(this._constraintOptions.interactionDirection,this._tmpRayDir),c(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(i)/r));const a=this.view.state.constraints.minimumPoiDistance;i>=0&&s<a&&(s=a,i=-(s-r)/r),Math.abs(r-s)<z||(c(this._tmpRayDir,this._tmpRayDir,i),this.currentCamera.eye=p(U,this.currentCamera.eye,this._tmpRayDir),P(U,this.currentCamera.center,this._tmpPoi,i),this._tmpPoi[2]>this.startCamera.center[2]?U[2]=Math.max(this.startCamera.center[2],U[2]):U[2]=Math.min(this.startCamera.center[2],U[2]),this.currentCamera.center=U,this._constraintOptions.interactionFactor=D(n(this.dragBeginPoint,t)),v(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}finish(){this.running&&this.finishController()}};A=t([s("esri.views.3d.state.controllers.ZoomControllerLocal")],A);const U=u(),B=g(0,0,1);export{A as ZoomControllerLocal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../../../../core/accessorSupport/decorators.js";import{scale as r,add as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as
|
|
2
|
+
import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../../../../core/accessorSupport/decorators.js";import{scale as r,add as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MomentumController as n}from"./MomentumController.js";let s=class extends n{constructor(t){super(t),this.interactionType=6,this._tmpPan=i()}momentumStep(t,o){const e=this.momentum.value(t);r(this._tmpPan,this.momentum.direction,e),o.eye=m(c,o.eye,this._tmpPan),o.center=m(c,o.center,this._tmpPan),this.constraintOptions.interactionDirection=this._tmpPan}};t([o({constructOnly:!0})],s.prototype,"momentum",void 0),s=t([e("esri.views.3d.state.controllers.momentum.GroundNavigationMomentumController")],s);const c=i();export{s as GroundNavigationMomentumController};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{distance as t,normalize as n,cross as r,add as o,crossAndNormalize as i,subtract as a,dot as s,scaleAndAdd as c,scale as l,copy as u,length as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{create as f,fromPositionAndNormal as h,distance as g,projectPoint as P,projectVector as S}from"../../../../geometry/support/plane.js";import{create as j}from"../../../../geometry/support/ray.js";import{Sphere as w}from"../../../../geometry/support/sphere.js";import{getVoxelWasm as v}from"../../layers/VoxelWasm.js";import{pickPointAndInitSphere as I,searchAreaSize as y,sphereOrPlanePointFromScreenPoint as z,intersectPlaneFromScreenPoint as b}from"./navigationUtils.js";import{fromScreenAtEye as M}from"../../support/geometryUtils/ray.js";import{Intersector as x}from"../../webgl-engine/lib/Intersector.js";const k=1.5,T={xSpeedMultiplier:k,ySpeedMultiplier:k,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12},H=d(),A=d(),F=e(),N=d(),G=f(),O=d(),q=d(),Y=d(),R=d(),U=d(),C=d(),D=d(),E=d(),V=d(),L=d(),_=e(),W=j(),B=new w,J=d(),K=f(),Q=d();function X(e,t){return S(t,e.viewForward,H),o(A,e.eye,H),e.projectToScreen(A,F),F[1]}function Z(e,u,m){const d=e.eye;if(t(u.center,d)<u.radius)return n(U,d),r(C,U,e.viewRight),o(A,d,C),e.projectToScreen(A,_),_[1];const p=e.up;M(e,m,W);const f=u.radius;if(i(N,p,W.direction),h(d,N,G),g(G,u.center)>f)return null;P(G,u.center,O);const S=t(u.center,O),j=Math.sqrt(f**2-S**2);a(q,d,O),n(Y,q),i(R,N,Y);const w=s(q,Y),v=s(q,R),I=Math.sqrt(w**2+v**2),y=j**2/I**2,z=j/I**2*Math.sqrt(I**2-j**2),b=y*w,x=z*-v,k=y*v,T=z*w,H=b-x,F=k+T,B=k-T;o(D,O,c(D,l(D,Y,b+x),R,F)),o(E,O,c(E,l(E,Y,H),R,B)),a(V,D,d),n(V,V),a(L,E,d),n(L,L);return s(e.viewForward,V)>=s(e.viewForward,L)?e.projectToScreen(D,_):e.projectToScreen(E,_),_[1]}function $(e,t,n=!0){return n?e<t:e<=t}function ee(e,t,n=!0){return n?e>t:e>=t}function te(e,t,n){return t?e>n:e<n}function ne(e,t){const n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(T.minimumHorizonPadding,T.relativeHorizonPadding*r)}function re(e,t){return[oe(e,t),ie(e,t)]}function oe(e,t){const n=e.fullHeight/e.pixelRatio;return Math.min(n,t+ne(e,t))}function ie(e,t){return Math.max(0,t-ne(e,t))}function ae(e,t,n){const r={translation:e,location:t};return n&&(r.normal=n),r}function se(e){const{view:t}=e;return"global"===t.viewingMode?ce(e):le(e)}function ce(e){const{view:r,originalScreenPoint:o,horizonY:i,horizonPadding:a,outTranslation:s,outGrabLocation:c,outGrabNormal:l,intersectionOptions:m,depthSearchSize:d}=e,f=r.state.camera,h=ae(s,c,l);B.radius=p(r.spatialReference).radius;const g=I(r,f,o,B.radius,1,m);if(null==g.scenePickPoint)return!1;const P=g.hasGeometryIntersection;u(J,g.scenePickPoint),u(h.location,J);const S=g.sphere;h.normal&&g.normal&&u(h.normal,g.normal);const j=me(o,i,a,P),w=P?t(J,f.eye):Number.POSITIVE_INFINITY;if(j.wasAdjusted){pe({view:r,screenAdjustment:j,intersector:de(r),fallbackCheck:(e,t,r)=>{const o=z(S,f,e,t);return o&&r&&n(r,t),o},output:h,intersectionOptions:m})}return he({view:r,screenPoint:j.adjustedScreenPoint,camera:f,initialDistance:w,depthSearchSize:d??y,output:h}),!0}function le(e){const{view:r,originalScreenPoint:o,horizonY:i,horizonPadding:a,outTranslation:s,outGrabLocation:l,outGrabNormal:m,intersectionOptions:d,depthSearchSize:p}=e,f=r.sceneIntersectionHelper,g=r.state.camera,P=de(r),S=ae(s,l,m);f.intersectIntersectorScreen(o,P,d);const j=P.results.min.getIntersectionPoint(J),w=j?t(J,g.eye):Number.POSITIVE_INFINITY;j&&(u(S.location,J),S.normal&&u(S.normal,P.results.min.normal)),r.renderCoordsHelper.worldUpAtPosition(g.eye,U),c(Q,g.eye,U,-g.relativeElevation),h(Q,U,K);const v=me(o,i,a,j);if(v.wasAdjusted){pe({view:r,screenAdjustment:v,intersector:P,fallbackCheck:(e,t,r)=>{const o=b(K,g,e,t);return o&&r&&n(r,U),o},output:S,intersectionOptions:d})}return he({view:r,screenPoint:v.adjustedScreenPoint,camera:g,initialDistance:w,depthSearchSize:p??y,output:S}),!0}function ue(e,t,n,r){return!r&&$(e,t)||r&&te(e,!1,n[0])?n[0]:!r&&ee(e,t,!1)?n[1]:null}function me(t,n,r,o){const i=ue(t[1],n,r,o);return{originalScreenPoint:t,adjustedScreenPoint:e(t[0],i??t[1]),horizonY:n,horizonPadding:r,wasAdjusted:null!==i}}function de(e){const t=new x(e.state.viewingMode);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function pe(e){const{view:t,screenAdjustment:n,fallbackCheck:r,intersector:o,output:i,intersectionOptions:a}=e,s=t.sceneIntersectionHelper;s.intersectIntersectorScreen(n.adjustedScreenPoint,o,{...a,requiresGroundFeedback:!0});let c=o.results.min.getIntersectionPoint(i.location);if(c)return void(i.normal&&u(i.normal,o.results.min.normal));const l=fe(n);s.intersectIntersectorScreen(l,o,{...a,requiresGroundFeedback:!0}),c=o.results.min.getIntersectionPoint(i.location),c?i.normal&&u(i.normal,o.results.min.normal):(c=r(n.adjustedScreenPoint,i.location,i.normal),c||r(l,i.location,i.normal))}function fe(t){const{originalScreenPoint:n,adjustedScreenPoint:r,horizonY:o,horizonPadding:i}=t,a=ee(r[1],o)?Math.min(i[1],n[1]):Math.max(i[0],n[1]);return e(r[0],a)}function he(e){const{view:t,screenPoint:r,camera:i,initialDistance:s,depthSearchSize:c,output:u}=e,d=c>0?t.stage.renderView.getMinimalDepthForArea(v(t),r[0],r[1],i,c):null;a(u.translation,u.location,i.eye);let p=Math.min(m(u.translation),s);d&&d<=p&&(p=d),n(u.translation,u.translation),l(u.translation,u.translation,p),o(u.location,u.translation,i.eye)}export{ne as computeHorizonPadding,re as computeHorizonPaddingLimits,se as findGroundNavigationGrabLocation,X as findPlaneHorizonY,Z as findSphereHorizonY,T as groundNavigationConstants,$ as isAboveHorizon,ee as isBelowHorizon,te as shouldClampScreenY};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as s,exactEquals as a,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as h,length as M,dot as g,subtract as y,normalize as d,squaredDistance as b,copy as x,transformMat4 as j,add as v,distance as P,cross as w,scale as I,lerp as z,set as A}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as T,create as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as S,axis as U,fromPoints as q,wrapAxisAngle as E}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as G,vectorCoordinates as H}from"../../../../geometry/support/coordinateSystem.js";import{create as k,fromNormalAndOffset as C,intersectRay as F}from"../../../../geometry/support/plane.js";import{Sphere as O}from"../../../../geometry/support/sphere.js";import{sm4d as W,sv3d as B}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as D,fromScreen as J}from"../../support/geometryUtils/ray.js";import{intersectScreen as K}from"../../support/geometryUtils/sphere.js";import L from"../../webgl/RenderCamera.js";import{Intersector as N}from"../../webgl-engine/lib/Intersector.js";import{terrainId as Q}from"../../webgl-engine/lib/verticalOffsetUtils.js";const V=30,X=[1,3e8],Y=8,Z=[200,1508e5],$=5,_=50,tt=5,et=10,nt=
|
|
2
|
+
import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as s,exactEquals as a,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as h,length as M,dot as g,subtract as y,normalize as d,squaredDistance as b,copy as x,transformMat4 as j,add as v,distance as P,cross as w,scale as I,lerp as z,set as A}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as T,create as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as S,axis as U,fromPoints as q,wrapAxisAngle as E}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as G,vectorCoordinates as H}from"../../../../geometry/support/coordinateSystem.js";import{create as k,fromNormalAndOffset as C,intersectRay as F}from"../../../../geometry/support/plane.js";import{Sphere as O}from"../../../../geometry/support/sphere.js";import{sm4d as W,sv3d as B}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as D,fromScreen as J}from"../../support/geometryUtils/ray.js";import{intersectScreen as K}from"../../support/geometryUtils/sphere.js";import L from"../../webgl/RenderCamera.js";import{Intersector as N}from"../../webgl-engine/lib/Intersector.js";import{terrainId as Q}from"../../webgl-engine/lib/verticalOffsetUtils.js";const V=30,X=[1,3e8],Y=8,Z=[200,1508e5],$=5,_=50,tt=5,et=10,nt=90,ot=1e-6,rt={exclude:new Set([Q])};function it(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function st(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function at(t,e,n){const o=s(W.get(),n[3],U(n));null==o||a(o,m)||(y(re,t.eye,e),j(re,re,o),t.eye=v(re,re,e),y(re,t.center,e),j(re,re,o),t.center=v(re,re,e),t.up=j(re,t.up,o))}function ct(t,e,n,o){return F(t,J(e,n,me),o)}function lt(t,e,n,o){return F(t,D(e,n,me),o)}function mt(t,e,n,o){const r=B.get();let i=1-n;y(r,e,t.eye);const s=M(r);let a=s*(1-i);i>=0&&a<o&&(a=o,i=-(a-s)/s),Math.abs(s-a)<ot||(I(r,r,i),t.eye=v(re,t.eye,r),t.center=z(re,t.center,e,i))}function ut(t,e,n){e.getScreenCenter(pt),K(t,e,pt,re)&&(e.center=re);const o=e.distance,r=o*n;if(Math.abs(o-r)<ot)return;const i=I(B.get(),e.viewForward,r);e.eye=y(re,e.center,i)}const pt=i();function ft(t,e){A(e,0,0,0);for(const n of t)v(e,e,n);I(e,e,1/t.length)}function ht(t,e,n,o){return Math.sin(t/M(e))*(n+o.radius)}function Mt(t,e,n,o){return ht(Math.PI/2,e,n,o)+(t-Math.PI/2)}const gt={Elevation:3e4,Angle:e(16)},yt=e(80);function dt(t,e,n,o,r,i){const s=t.sceneIntersectionHelper,a=new N(t.state.viewingMode);a.options.selectionMode=!0,a.options.store=0,a.options.hud=!1,a.options.normalRequired=!0;let c=null;const l=R(),m=new O;let u=!0,p=!0;const{eye:f}=e;s.intersectIntersectorScreen(n,a,i);const g=a.results.min;return g.getIntersectionPoint(l)&&!h(f,l)&&Jt(f,l,o)?(c=T(g.normal),m.radius=M(l)):(p=!1,e.aboveGround&&0!==r?m.radius=Math.max(M(e.center),.9*o):m.radius=M(e.eye)-e.relativeElevation,1===r?vt(m,e,n,l):u=K(m,e,n,l)),{sphere:m,scenePickPoint:u?l:null,hasGeometryIntersection:p,intersectorType:g.intersector,normal:c}}function bt(t,e,n,o){const r=t.relativeElevation;if(r>gt.Elevation&&"global"===o)return 1;D(t,e,ue);const i=Math.sign(r),s=n.worldUpAtPosition(t.eye,re);return-i*g(s,ue.direction)<Math.sin(gt.Angle)*M(ue.direction)?0:1}function xt(t,e,n){y(jt,n,e),t.eye=y(re,t.eye,jt),t.center=y(re,t.center,jt)}const jt=R();function vt(t,e,n,o){const r=D(e,n,me);return null!=r&&(t.closestPointOnSilhouette(r,Pt),t.intersectRay(r,o)?!(b(Pt,r.origin)<b(o,r.origin))||(x(o,Pt),!1):(y(wt,e.eye,e.center),d(wt,wt),C(wt,-g(d(wt,wt),Pt),It),F(It,r,o),!1))}const Pt=R(),wt=R(),It=k();function zt(i,s,a,c,l,m){let u=0;if(w(ae,i,s),y(ie,i,s),M(i)<=l||!c.aboveGround){w(a,ie,c.eye);const p=g(i,s)/(M(i)*M(s));if(p<.9999)u=o(p);else{const t=M(w(R(),i,s))/(M(i)*M(s));u=r(t)}const f=Math.cos(n(t.normalize(e(m)),0,yt));u=-u-Math.max(0,M(s)-l)/(f*l)}else y(At,c.eye,c.center),w(a,ie,At),u=-M(ie)/l;return d(a,a),I(a,a,M(ae)),u}const At=R();function Tt(r,i,s,a){let c,l;const m=Math.cos(n(t.normalize(e(a)),0,yt));return c=i>s?-(i-s)/(m*s):i<-s?Math.PI-(i+s)/(m*s):o(i/s),l=r>s?-(r-s)/(m*s):r<-s?Math.PI-(r+s)/(m*s):o(r/s),(l-c)*s}function Rt(t,e,n,o,r,i,s,a,c,l){const m=Tt(t[2],e[2],i.radius,a),u=c?Tt(t[0],e[0],i.radius,180):e[0]-t[0],f=Math.sin(s)*u-Math.cos(s)*m,h=Math.cos(s)*u+Math.sin(s)*m;d(re,r);const M=c?f/Math.sqrt(Math.abs(i.radius**2-g(n,re)**2)):f/i.radius,y=h/Math.sqrt(Math.abs(i.radius**2-g(n,o)**2));p(l,M,y)}function St(t,e,n,o,r,i,s,a,c,l){w(ae,t,e),G(i.up,i.eye,Qt,Vt,Xt),G([0,0,1],i.eye,Kt,Lt,Nt),x(n,Lt),x(o,Kt),d(n,n),I(n,n,M(ae)),H(t,d(Vt,Vt),d(Xt,Xt),d(Qt,Qt),Yt),H(e,Vt,Xt,Qt,Zt),Rt(Yt,Zt,t,Kt,Lt,s,a,c,l,r)}function Ut(t,e,n,o,r,i,a){s(te,r,o),s(ee,a,i),l(ne,te,ee),y(e,t,n),j(e,e,ne),v(e,e,n)}function qt(t,e,n,o,r,i){s(te,o,n),s(ee,i,r),l(ne,te,ee),y(re,t.eye,e),j(re,re,ne),t.eye=v(re,re,e),y(re,t.center,e),j(re,re,ne),t.center=v(re,re,e),y(re,t.up,e),j(re,re,ne),t.up=v(re,re,e)}const Et={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let Gt=!1;function Ht(t,e,n,o,r,i){const s=Math.abs(o)>Math.PI-Et.Angle||Math.abs(o)<Et.Angle,a=(Math.abs(t[2])<n*Et.Pole||Math.abs(e)>n)&&i;return s&&a?!Gt&&r<Et.Tilt-Et.TiltHysteresisMargin?Gt=!0:Gt&&r>Et.Tilt+Et.TiltHysteresisMargin&&(Gt=!1):Gt=!1,Gt}function kt(t,e,n,o,r,i){if(i)q(n,o,_t),at(e,t.center,_t);else{const i=zt(n,o,ce,e,t.radius,r);at(e,t.center,E(ce,i))}}function Ct(t,e,n,o,r,i,s){const a=s?20:1,c=1e-12;let l,m;x(oe,o),se.copyFrom(e);for(let u=0;u<a&&b(n,oe)>c&&(l=b(n,oe),St(n,oe,Lt,Kt,$t,se,t,r,i,s),qt(se,t.center,Kt,$t[1],Lt,$t[0]),Ut(oe,oe,t.center,Kt,$t[1],Lt,$t[0]),m=b(n,oe),m<l||0===u);u++)e.copyFrom(se)}function Ft(n,o,r,i,s,a,c){Ht(r,g(o.up,r),n.radius,-t.normalize(e(s)),a,o.aboveGround)?Ct(n,o,r,i,-t.normalize(e(s)),a,c):kt(n,o,r,i,a,c)}function Ot(t,e,n,o,r,i){const{eye:s}=t;G([0,0,1],s,Kt,Lt,Nt);const a=e.translation[0]*n.pan,l="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-g(t.center,Kt)**2/M(t.center)**2)),.5),u=(Math.sin(i)*l+Math.cos(i)*a)/m,p=-Math.cos(i)*l+Math.sin(i)*a;switch(c(o.pan.matrix,o.pan.matrix,u,Kt),o.pan.enabled=!0,r.mode){case"pan":c(o.pan.matrix,o.pan.matrix,p,Lt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Wt(t,e,n,o,r){const{eye:i,viewRight:s}=t,a=w(B.get(),s,i),l=e.translation[0]*n.pan;switch(0!==l&&(c(o.pan.matrix,o.pan.matrix,-l,a),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(o.pan.matrix,o.pan.matrix,t,s),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(n,o,r,i,s,a,c,l,m){Ht(n.center,g(n.up,n.center),M(n.center),-t.normalize(e(a)),c,o.aboveGround)?Ot(o,r,i,l,m,-t.normalize(e(s))):Wt(o,r,i,l,m)}function Dt(t,e,n=1/0){const o=Math.abs(g(t,e));return Math.min(n,1/o)}function Jt(t,e,n){const o=P(t,e),r=M(t);return o<Math.max(r,n)}const Kt=R(),Lt=R(),Nt=R(),Qt=R(),Vt=R(),Xt=R(),Yt=R(),Zt=R(),$t=f(),_t=S(),te=u(),ee=u(),ne=u(),oe=R(),re=R(),ie=R();let se=new L;const ae=R(),ce=R();function le(){se=new L}const me={origin:R(),direction:R()},ue={origin:R(),direction:R()};export{yt as TiltThresholdPanningSpeed,gt as VerticalPanTresholds,xt as applyPanPlanar,kt as applyPanSphericalDirectRotation,Ct as applyPanSphericalPreserveHeading,at as applyRotation,qt as applyRotationWithTwoAxes,ut as applyZoomOnSphere,mt as applyZoomToPoint,ft as centroid,le as cleanupNavigationUtils,ot as distanceComparisonTolerance,rt as excludeTerrain,Dt as getTiltScaleFactor,bt as inferNavigationMode,ct as intersectPlaneFromScreenPoint,lt as intersectPlaneFromScreenPointAtEye,Jt as isHitOnSamePlanetSide,Tt as lengthFromPoints,$ as maxPanDistanceModifier,tt as maxRotatePivotDistanceModifier,V as maxZoomPivotDistanceModifier,Y as maxZoomStepDistanceModifier,_ as minPinchAndPanCameraHeight,et as minRotatePivotDistance,it as normalizeCoordinate,st as normalizeRotationDelta,Mt as offSurfaceTiltToEyeTiltGlobal,ht as onSurfaceTiltToEyeTiltGlobal,Bt as panMotionToRotationMatrix,Ft as panToPosition,dt as pickPointAndInitSphere,Et as preservingHeadingThresholds,Ut as rotatePointAroundTwoAxes,zt as rotationAngleAndAxisDirectRotation,St as rotationAnglesAndAxesHeadingPreserving,Rt as rotationAnglesHeadingPreserving,nt as searchAreaSize,Ht as shouldPreserveHeading,vt as sphereOrPlanePointFromScreenPoint,X as zoomPivotDistanceClamp,Z as zoomStepDistanceClamp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{isScreenRect as e,createScreenPoint as r}from"../../../core/screenUtils.js";import{isIntegratedMeshLayer as t,isTiledLayer as a,isLayerWithFlowRenderer as s}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as i}from"../../support/hitTestSelectUtils.js";import{isScaleRangeActive as n,scaleBoundsPredicate as l}from"../../support/layerViewUtils.js";async function o(o,f){const u=await i(o,f),{results:d}=u,m=u.ground,w=e(f)?o.toMap(r(f.x+f.width/2,f.y+f.height/2)):m.mapPoint,g=(!m.layer||!t(m.layer))&&w,h=[],V=p(o),S=g?c(o,V):y;let U=0,T=0;const b=()=>{const e=S.layerViews[T++];if(!g||!e||!("fetchPopupFeaturesAtTarget"in e))return;const r=w,t=e.layer;if(a(t)&&"effectiveScaleRange"in t){const{minScale:e,maxScale:a}=t.effectiveScaleRange;if(n(e,a)){if(s(t)&&!l(o.scale,e,a))return;const i=o.basemapTerrain.getScale(r);if(!l(i,e,a))return}}h.push({geometry:r,layerView:e})};let j=null;for(;U<d.length||T<S.layerViews.length;){const e=d[U];if(e&&"graphic"!==e.type)++U;else if("scene"!==e?.layer?.type||e?.layer?.parent!==o?.map?.basemap)if(e){const r=e.layer?.uid,t=S.layerUids.has(r)&&e.distance===m.distance,a=V.get(e.layer?.uid);if(j??=e.mapPoint,T<S.layerViews.length&&(t||(e.distance??0)>m.distance)&&S.layerViews[T]!==a){b();continue}h.push({graphic:e.graphic,layerView:a}),++U}else b();else++U}return j??=w,{hits:h,location:j}}function c(e,r){const t=new Set,a=new Set;for(let i=e.basemapTerrain.numLayers(1)-1;i>=0;i--){const r=e.basemapTerrain.layerViewByIndex(i,1);t.add(r.layer.uid),a.add(r)}const s=e.overlayManager.renderer.layers;for(const{uid:i}of s){const e=r.get(i);e&&(t.add(i),a.add(e))}return{layerUids:t,layerViews:Array.from(a).reverse()}}const y={layerUids:new Set,layerViews:[]};function p(e){const r=new Map;for(const t of e.allLayerViews){const e=t.layer.uid;r.set(e,t)}return r}export{o as popupHitTest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{glsl as
|
|
2
|
+
import{glsl as a}from"../../shaderModules/glsl.js";function e(e){e.code.add(a`float computeGaussianCovarianceDeterminant(vec3 covariance2D) {
|
|
3
3
|
return covariance2D.x * covariance2D.z - covariance2D.y * covariance2D.y;
|
|
4
4
|
}
|
|
5
5
|
vec2 computeGaussianCovarianceEigenvalues(vec3 covariance2D) {
|
|
@@ -7,9 +7,6 @@ float mid = 0.5 * (covariance2D.x + covariance2D.z);
|
|
|
7
7
|
float radius = length(vec2((covariance2D.x - covariance2D.z) * 0.5, covariance2D.y));
|
|
8
8
|
return vec2(mid + radius, mid - radius);
|
|
9
9
|
}
|
|
10
|
-
vec2 computeGaussianAxisLengths(vec2 eigenvalues, float gaussianEllipseThreshold) {
|
|
11
|
-
return ceil(sqrt(eigenvalues * gaussianEllipseThreshold));
|
|
12
|
-
}
|
|
13
10
|
float computeGaussianEllipseThreshold(float gaussianLogAlphaCutoff) {
|
|
14
11
|
return max(0.0, -2.0 * gaussianLogAlphaCutoff);
|
|
15
12
|
}
|
|
@@ -23,24 +20,9 @@ bool rejectGaussianByScreenBounds(vec2 ndcPosition, vec2 screenRadii, vec2 clipS
|
|
|
23
20
|
vec2 radiusNDC = screenRadii * clipSpacePixelScale;
|
|
24
21
|
return any(greaterThan(abs(ndcPosition) - radiusNDC, vec2(1.0)));
|
|
25
22
|
}
|
|
26
|
-
vec2 computeGaussianMajorAxisDirection(vec3 covariance2D, float majorEigenvalue) {
|
|
27
|
-
if (covariance2D.y == 0.0) {
|
|
28
|
-
return covariance2D.x >= covariance2D.z ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
|
|
29
|
-
}
|
|
30
|
-
return normalize(vec2(covariance2D.y, majorEigenvalue - covariance2D.x));
|
|
31
|
-
}
|
|
32
23
|
vec2 computeGaussianUnitQuadCorner(int vertexID) {
|
|
33
24
|
return vec2((vertexID << 1) & 2, vertexID & 2) - 1.0;
|
|
34
25
|
}
|
|
35
|
-
vec2 computeGaussianQuadOffset(vec3 covariance2D, vec2 eigenvalues, vec2 axisLengths, vec2 corner) {
|
|
36
|
-
vec2 majorAxisDirection = computeGaussianMajorAxisDirection(covariance2D, eigenvalues.x);
|
|
37
|
-
vec2 majorAxis = axisLengths.x * majorAxisDirection;
|
|
38
|
-
vec2 minorAxis = axisLengths.y * vec2(majorAxisDirection.y, -majorAxisDirection.x);
|
|
39
|
-
return corner.x * majorAxis + corner.y * minorAxis;
|
|
40
|
-
}
|
|
41
|
-
vec2 computeGaussianCanonicalCoordinates(vec2 corner, vec2 eigenvalues, vec2 axisLengths) {
|
|
42
|
-
return corner * axisLengths * inversesqrt(eigenvalues);
|
|
43
|
-
}
|
|
44
26
|
float evaluateGaussianExponent(vec2 canonicalCoordinates) {
|
|
45
27
|
return -0.5 * dot(canonicalCoordinates, canonicalCoordinates);
|
|
46
|
-
}`)}export{
|
|
28
|
+
}`)}export{e as GaussianSplatEvaluation};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float3PassUniform as e}from"../../shaderModules/Float3PassUniform.js";import{glsl as
|
|
2
|
+
import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float3PassUniform as e}from"../../shaderModules/Float3PassUniform.js";import{glsl as o}from"../../shaderModules/glsl.js";import{NoParameters as i}from"../../../../../webgl/NoParameters.js";class t extends i{constructor(){super(...arguments),this.tileCameraPosition=a(),this.cameraDelta=a()}}function n(a){a.code.add(o`float unpackOpacity(uvec4 packedGaussian) {
|
|
3
3
|
return float((packedGaussian.w >> 24u) & 0xffu) / 255.0;
|
|
4
4
|
}
|
|
5
5
|
vec4 unpackColor(uvec4 packedGaussian) {
|
|
@@ -9,39 +9,26 @@ color.g = float((packedGaussian.w >> 9u) & 0xffu);
|
|
|
9
9
|
color.b = float((packedGaussian.w >> 16u) & 0xfeu);
|
|
10
10
|
color.a = float((packedGaussian.w >> 24u) & 0xffu);
|
|
11
11
|
return color / 255.0;
|
|
12
|
-
}`),a.code.add(
|
|
12
|
+
}`),a.code.add(o`vec3 unpackScale(uvec4 packedGaussian) {
|
|
13
13
|
uint sx = (packedGaussian.z >> 10u) & 0xffu;
|
|
14
14
|
uint sy = (packedGaussian.z >> 18u) & 0xffu;
|
|
15
15
|
uint szLow = (packedGaussian.z >> 26u) & 0x3fu;
|
|
16
16
|
uint szHigh = packedGaussian.a & 0x3u;
|
|
17
17
|
uint sz = szLow | (szHigh << 6u);
|
|
18
18
|
return exp(vec3(sx, sy, sz) / 16.0 - 10.0);
|
|
19
|
-
}`),a.code.add(
|
|
19
|
+
}`),a.code.add(o`const uint MASK_9_BITS = 0x1FFu;
|
|
20
20
|
const float SQRT_HALF = 0.7071067811865476;
|
|
21
|
-
const ivec3 COMPONENT_ORDER[4] = ivec3[4](
|
|
22
|
-
ivec3(3, 2, 1),
|
|
23
|
-
ivec3(3, 2, 0),
|
|
24
|
-
ivec3(3, 1, 0),
|
|
25
|
-
ivec3(2, 1, 0)
|
|
26
|
-
);
|
|
27
21
|
vec4 unpackQuaternion(uvec4 packedGaussian) {
|
|
28
22
|
uint packedRotation = packedGaussian.x;
|
|
29
23
|
uint largestComponent = packedRotation >> 30u;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
float value = SQRT_HALF * float(magnitude) / float(MASK_9_BITS);
|
|
39
|
-
quaternion[index] = signBit == 1u ? -value : value;
|
|
40
|
-
sumSquares += value * value;
|
|
41
|
-
}
|
|
42
|
-
quaternion[int(largestComponent)] = sqrt(1.0 - sumSquares);
|
|
43
|
-
return quaternion;
|
|
44
|
-
}`),a.code.add(i`vec3 unpackTileOriginRelativePosition(uvec4 packedGaussian) {
|
|
24
|
+
uvec3 bitfields = uvec3(packedRotation) >> uvec3(0u, 10u, 20u);
|
|
25
|
+
vec3 components = SQRT_HALF * vec3(bitfields & uvec3(MASK_9_BITS)) / float(MASK_9_BITS);
|
|
26
|
+
components = mix(components, -components, notEqual((bitfields >> 9u) & uvec3(1u), uvec3(0u)));
|
|
27
|
+
vec4 quaternion = vec4(components, sqrt(1.0 - dot(components, components)));
|
|
28
|
+
return largestComponent == 0u ? quaternion.wzyx :
|
|
29
|
+
largestComponent == 1u ? quaternion.zwyx :
|
|
30
|
+
largestComponent == 2u ? quaternion.zywx : quaternion.zyxw;
|
|
31
|
+
}`),a.code.add(o`vec3 unpackTileOriginRelativePosition(uvec4 packedGaussian) {
|
|
45
32
|
uint packedPositionLow = packedGaussian.y;
|
|
46
33
|
uint packedPositionHigh = packedGaussian.z;
|
|
47
34
|
uint x = packedPositionLow & 0x3FFFu;
|
|
@@ -50,10 +37,10 @@ uint zLow = (packedPositionLow >> 28u) & 0xFu;
|
|
|
50
37
|
uint zHigh = packedPositionHigh & 0x3FFu;
|
|
51
38
|
uint z = zLow | (zHigh << 4u);
|
|
52
39
|
return vec3(float(x), float(y), float(z));
|
|
53
|
-
}`),a.uniforms.add(new e("tileCameraPosition",a=>a.tileCameraPosition),new e("cameraDelta",a=>a.cameraDelta)).code.add(
|
|
40
|
+
}`),a.uniforms.add(new e("tileCameraPosition",a=>a.tileCameraPosition),new e("cameraDelta",a=>a.cameraDelta)).code.add(o`vec3 unpackCameraRelativeGaussianPosition(uvec4 packedHeader, highp vec3 position) {
|
|
54
41
|
vec3 tileOrigin = uintBitsToFloat(packedHeader.xyz);
|
|
55
42
|
float invPosScale = 1.0 / exp2(float(packedHeader.w & 0xfu));
|
|
56
43
|
vec3 delta = tileOrigin.xyz - tileCameraPosition;
|
|
57
44
|
vec3 cameraRelativePosition = position * invPosScale + delta * 2.048 - cameraDelta;
|
|
58
45
|
return cameraRelativePosition;
|
|
59
|
-
}`)}export{
|
|
46
|
+
}`)}export{n as GaussianSplatUnpacking,t as GaussianSplatUnpackingPassParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Matrix4PassUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/DeepSky.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReloadableShader as t}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReloadableShader as t}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../../core/shaderTechnique/ShaderTechnique.js";import{D as o}from"../../../../../chunks/DeepSky.glsl.js";import{NoParameters as a}from"../../../../webgl/NoParameters.js";import{makePipelineState as n,defaultColorWrite as l,simpleBlendingParams as c}from"../../../../webgl/renderState.js";class d extends a{constructor(){super(...arguments),this.inverseModelMatrix=s(),this.bandTexture=null,this.heightAboveSeaLevelSquared=0,this.radiusCloseToGround=0,this.radiusBrightnessTransitionEnd=0}}let h=class extends i{constructor(){super(...arguments),this.shader=new t(o,()=>import("./DeepSky.glsl.js"))}initializePipeline(){return n({blending:c(770,771),depthTest:{func:515},colorWrite:l})}};h=e([r("esri.views.3d.webgl-engine.effects.stars.DeepSkyTechnique")],h);export{d as DeepSkyPassParameters,h as DeepSkyTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import a from"../../../../../core/Logger.js";import{abortMaybe as i,disposeMaybe as n}from"../../../../../core/maybe.js";import{isAbortError as o,throwIfAborted as f}from"../../../../../core/promiseUtils.js";import{watch as d,initial as h,syncAndInitial as
|
|
2
|
+
import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import a from"../../../../../core/Logger.js";import{abortMaybe as i,disposeMaybe as n}from"../../../../../core/maybe.js";import{isAbortError as o,throwIfAborted as f}from"../../../../../core/promiseUtils.js";import{watch as d,initial as h,syncAndInitial as m}from"../../../../../core/reactiveUtils.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,rotateZ as l,multiply as p,invertOrIdentity as b}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as g}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as T}from"../../../webgl.js";import{cloudsHeight as w}from"../../../environment/weather.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as P}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as x,DeepSkyTechnique as v}from"./DeepSkyTechnique.js";import{StarPassParameters as k,StarsTechnique as j,layout as D}from"./StarsTechnique.js";import{getDailyRotationCoefficient as M,computeDayDuration as S,eq2ec as q,ec2eq as L}from"./starsUtils.js";import{createTextureKTX2 as U}from"../../lib/BasisUtil.js";import{VertexArrayObject as A}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as B,PrimitiveType as R}from"../../../../webgl/enums.js";import{TextureDescriptor as E}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";let C=class extends P{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new k,this._deepSkyPassParameters=new x}initialize(){this.addHandles([d(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),h),d(()=>"virtual"===this.view.environment.lighting.type?null:this.view.environment.lighting.date,e=>this._update(e),m)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=i(this._bandTextureTask),this._bandTexture=n(this._bandTexture),this._loadDataTask=i(this._loadDataTask),this._numPoints=0,this._vao=n(this._vao),this._starData=null}render(e){const t=e.find(({name:e})=>e===T.OPAQUE_ENVIRONMENT),s=this.techniques.getCompiled(j),r=this.techniques.getCompiled(v);if(this.loading||!s||!r)return this.requestRender(1),t;const a=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,this._deepSkyPassParameters.heightAboveSeaLevelSquared=_(this.bindParameters.camera.eye),a.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),a.setDrawBuffers([B]),a.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),a.bindTechnique(s,this.bindParameters,this._passParameters),a.setDrawBuffers([B]),a.bindVAO(this._vao),a.drawArrays(R.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/H;const t=new Float32Array(e,0,2*this._numPoints),s=new Uint8Array(e,2*this._numPoints*4,this._numPoints);return O(this.renderingContext,t,s,this._numPoints)}_update(e){const t=g(this.view.spatialReference).radius,s=.03*t;if(this._deepSkyPassParameters.radiusCloseToGround=(t+w)**2,this._deepSkyPassParameters.radiusBrightnessTransitionEnd=(t+w+s)**2,!e)return;const r=M(e),a=2*S(e),i=u(this._passParameters.modelMatrix,q);l(i,i,-a*Math.PI),p(i,L,i),l(i,i,-r*Math.PI),b(this._deepSkyPassParameters.inverseModelMatrix,i),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;const e=s(async e=>{const{data:s}=await t(z,{responseType:"array-buffer",signal:e});F(s),this._starData=s});return e.promise.catch(e=>{o(e)||a.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;const e=s(async e=>{const{data:s}=await t(W,{responseType:"array-buffer",signal:e});f(e);const a=new E;a.wrapMode=33071,a.hasMipmap=!0,a.maxAnisotropy=8;const i=await U(this.renderingContext,a,s);if(e.aborted&&(i?.dispose(),f(e)),!i)throw new r("stars:invalid-band-texture","Failed to transcode Milky Way band texture.");this._bandTexture=i});return e.promise.catch(e=>{o(e)||a.getLogger(this).warn("Failed to load Milky Way band texture.",e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};function O(e,t,s,r){const a=D.createBuffer(r),i=a.position,n=a.color,o=a.size;for(let f=0;f<r;f++){const e=t[2*f],r=t[2*f+1];i.set(f,0,-Math.cos(e)*Math.sin(r)),i.set(f,1,-Math.sin(e)*Math.sin(r)),i.set(f,2,-Math.cos(r));const a=V(s[f]),d=N(G[a[1]]);n.set(f,0,d[0]),n.set(f,1,d[1]),n.set(f,2,d[2]),n.set(f,3,255),o.set(f,a[0])}return new A(e,new I(e,y(D),a.buffer))}function F(e){if(!e)throw new r("stars:no-data-received","Failed to create stars because star catalogue is missing");const t=e.byteLength/H;if(t%1!=0||t>5e4||t<5e3)throw new r("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}function N(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function V(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}C=e([c("esri.views.3d.webgl-engine.effects.stars.Stars")],C);const z="esri/views/3d/environment/resources/stars.wsv",W="esri/views/3d/environment/resources/milkyway-band.ktx2",G=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],H=9;export{C as Stars};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{add as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{getContinuousIndexArray as t}from"../../../../geometry/support/Indices.js";import{NullSphere as e,Sphere as n}from"../../../../geometry/support/sphere.js";import{
|
|
2
|
+
import{add as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{getContinuousIndexArray as t}from"../../../../geometry/support/Indices.js";import{NullSphere as e,Sphere as n}from"../../../../geometry/support/sphere.js";import{affectsGeometry as s}from"./affectsGeometry.js";import{BoundingInfo as h}from"./BoundingInfo.js";import{BufferGeometryBaseInstance as o}from"./BufferGeometryBaseInstance.js";import{Object3DHighlightStateID as r}from"./Object3DStateID.js";import{assert as l}from"./Util.js";class u extends o{constructor(i,t,e,n=null,s=null){super(t),this.material=i,this.localOrigin=e,this.mapPositions=n,this.baseGeometry=s,this.layerViewUid=null,this.graphicUid=null,this.castShadow=!1,this._readPrimitivePosition=null,this._boundingInfo=null,this._boundingSphere=null,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0;const h=i?.useIndexing??!1,o=null!=t.index,r=null!=s;l(!r||!h&&null==s.buffers.index&&!o,"Instancing for index materials is not supported"),l(!r||1===t.vertex.count,"Instanced BufferGeometry requires exactly one instance"),l(h===o,"Material index requirement and BufferGeometry.buffers.index must match")}get indexCount(){return this.baseGeometry?.buffers.indexCount??this._buffers.indexCount??0}get faceCount(){return this.indexCount/3}get readPrimitivePosition(){return this._readPrimitivePosition??=this.material.createPrimitivePositionReader(this.buffers,this.baseGeometry?.buffers),this._readPrimitivePosition}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}get boundingSphere(){const t=this.boundingInfo?.sphere;if(null==t)return e;if(null==this._boundingSphere){const e=new n;e.copyFrom(t),i(e.center,e.center,this.localOrigin.vec3),this._boundingSphere=e}return this._boundingSphere}_calculateBoundingInfo(){const i=this.indexCount;if(0===i)return null;const e=this.material.primitiveVertexCount;l(i%e===0,"Indexing error: "+i+" not divisible by "+e);const n=t(i/e);return new h(n,e,this.readPrimitivePosition)}invalidateBoundingInfo(){this._boundingInfo=null,this._boundingSphere=null}getMutableVertexField(i,t){const e=this._buffers.vertex.getField(i,t);return null!=e&&s(i)&&this._invalidatePositionCaches(),e}getMutableStorageField(i,t){const e=this._buffers.storage?.getField(i,t);return null!=e&&s(i)&&this._invalidatePositionCaches(),e}_invalidatePositionCaches(){this._readPrimitivePosition=null,this.invalidateBoundingInfo()}computeAttachmentOrigin(t){return!!this.material.computeAttachmentOrigin(t,this.readPrimitivePosition,this.indexCount)&&(i(t,t,this.localOrigin.vec3),!0)}get highlights(){return this._highlights||g}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(i){this._highlightOptionsCounts?.forEach((t,e)=>i(e))}allocateIdAndHighlight(i){const t=new r(i);return this.addHighlight(t)}addHighlight(i){this._ensureHighlights().add(i);const{highlightName:t}=i,e=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,e),i}_ensureHighlights(){let i=this._highlights;return i||(i=new Set,this._highlights=i),i}_ensureHighlightOptionsCounts(){let i=this._highlightOptionsCounts;return i||(i=new Map,this._highlightOptionsCounts=i),i}removeHighlight(i){if(this._highlights?.delete(i)){const{highlightName:t}=i,e=this._highlightOptionsCounts?.get(t)??0;e<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,e-1)}}}const g=new Set;export{u as BufferGeometry};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import{generateUID as e}from"../../../../core/uid.js";import{identity as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t,IDENTITY as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r,empty as n,copy as h,offset as l,expandWithAABB as a,center as
|
|
2
|
+
import{generateUID as e}from"../../../../core/uid.js";import{identity as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t,IDENTITY as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r,empty as n,copy as h,offset as l,expandWithAABB as a,center as m}from"../../../../geometry/support/aaBoundingBox.js";import{affectsGeometry as g}from"./affectsGeometry.js";import{BoundingVolume as d}from"./BoundingVolume.js";import{Object3DOccludeeStateID as u,Object3DHighlightStateID as c}from"./Object3DStateID.js";import{assert as f}from"./Util.js";import{addObject3DStateID as _,removeObject3DStateID as b}from"../materials/renderers/utils.js";class p{constructor(i){this.id=e(),this.type=1,this.lastValidElevationBB=void 0,this._layer=null,this._visible=!0,this._highlightIds=new Set,this._boundingVolume=null,this._geometries=Array.from(i.geometries),this.castShadow=i.castShadow??!1,this.graphicUid=i.graphicUid,this.layerViewUid=i.layerViewUid;for(const e of this._geometries)e.castShadow=this.castShadow,e.graphicUid=this.graphicUid,e.layerViewUid=this.layerViewUid;i.isElevationSource&&(this.lastValidElevationBB=n())}dispose(){this._geometries.length=0}get geometries(){return this._geometries}get layer(){return this._layer}set layer(e){f(null==this._layer||null==e,"BufferObject3D can only be added to a single Layer"),this._layer=e}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(const e of this._geometries)e.visible=this._visible;this._emit("visibilityChanged",this)}}_emit(e,i){this.layer?.events.emit(e,i)}maskOccludee(){const e=new u;for(const i of this._geometries)i.occludees=_(i.occludees,e);return this._emit("occlusionChanged",this),e}removeOcclude(e){for(const i of this._geometries)i.occludees=b(i.occludees,e);this._emit("occlusionChanged",this)}highlight(e){const i=new c(e);for(const t of this._geometries)t.addHighlight(i);return this._highlightIds.add(i),this._emit("highlightChanged",this),i}removeHighlight(e){if(this._highlightIds.delete(e)){for(const i of this._geometries)i.removeHighlight(e);this._emit("highlightChanged",this)}}removeStateID(e){0===e.channel?this.removeHighlight(e):this.removeOcclude(e)}getCombinedStaticTransformation(e,t){return i(t)}getCombinedShaderTransformation(e,o=t()){return i(o)}get boundingVolumeWorldSpace(){return this._boundingVolume||(this._boundingVolume=new d,this._validateBoundingVolume(this._boundingVolume)),this._boundingVolume}get boundingVolumeObjectSpace(){return this.boundingVolumeWorldSpace}_validateBoundingVolume(e){for(const i of this._geometries){const{boundingInfo:t,localOrigin:o}=i;if(null==t)continue;const[s,r,n]=o.vec3;h(v,t.box),l(v,s,r,n),a(e.box,v)}m(e.box,e.sphere.center);for(const i of this._geometries){const{boundingInfo:t,boundingSphere:o}=i;if(null==t)continue;const r=s(o.center,e.sphere.center);e.sphere.radius=Math.max(e.sphere.radius,r+t.sphere.radius)}}get transformation(){return o}get shaderTransformation(){return null}get effectiveTransformation(){return o}geometryVertexAttributeUpdated(e,i,t=!1){g(i)&&this._invalidateBoundingVolume(),this._emit("attributesChanged",{object:this,geometry:e,attribute:i,sync:t})}_invalidateBoundingVolume(){const e=this._boundingVolume?.sphere;this._boundingVolume=void 0,this.layer&&e&&this.layer.notifyObjectBBChanged(this,e)}}const v=r();export{p as BufferObject3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as e,copy as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s,IDENTITY as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as r,distance as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as
|
|
2
|
+
import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as e,copy as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s,IDENTITY as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as r,distance as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as n,center as m}from"../../../../geometry/support/aaBoundingBox.js";import{maxScale as l}from"../../support/mathUtils.js";import{affectsGeometry as g}from"./affectsGeometry.js";import{BoundingVolume as d,expandWithTransformedBox as c}from"./BoundingVolume.js";import{Object3DOccludeeStateID as f,Object3DHighlightStateID as u}from"./Object3DStateID.js";import{assert as _}from"./Util.js";import{addObject3DStateID as b,removeObject3DStateID as v}from"../materials/renderers/utils.js";class p{constructor(e={}){this.id=t(),this.type=0,this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=e.castShadow??!0,this.usesVerticalDistanceToGround=e.usesVerticalDistanceToGround??!1,this.graphicUid=e.graphicUid,this.layerViewUid=e.layerViewUid,e.isElevationSource&&(this.lastValidElevationBB=n()),this._geometries=e.geometries?Array.from(e.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(t){_(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 e of this._highlightIds)t.addHighlight(e);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const e=this._geometries.splice(t,1)[0];if(e){for(const t of this._highlightIds)e.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:e}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,e,i=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:e,sync:i}),g(e)&&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 f;for(const e of this._geometries)e.occludees=b(e.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometries)e.occludees=v(e.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const e=new u(t);for(const i of this._geometries)i.addHighlight(e);return this._emit("highlightChanged",this),this._highlightIds.add(e),e}removeHighlight(t){this._highlightIds.delete(t);for(const e of this._geometries)e.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){0===t.channel?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,i){return e(i,this.transformation,t.transformation)}getCombinedShaderTransformation(t,i=s()){return e(i,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new d,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new d,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(t,e){const i=1===e;for(const s of this._geometries){const e=s.boundingInfo;e&&c(t.box,e.box,i?s.transformation:this.getCombinedShaderTransformation(s))}m(t.box,t.sphere.center);for(const s of this._geometries){const e=s.boundingInfo;if(null==e)continue;const o=i?s.transformation:this.getCombinedShaderTransformation(s),a=l(o);r(y,e.sphere.center,o);const n=h(y,t.sphere.center),m=e.sphere.radius*a;t.sphere.radius=Math.max(t.sphere.radius,n+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.sphere;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&t&&this.layer.notifyObjectBBChanged(this,t)}_emit(t,e){this.layer?.events.emit(t,e)}get geometries(){return this._geometries}get transformation(){return this._transformation??o}set transformation(t){this._transformation=i(this._transformation??s(),t),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(t){this._shaderTransformation=t?i(this._shaderTransformation??s(),t):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}const y=a();export{p as Object3D};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
function t(t){return e.has(t)}const e=new Set(["position","normal","normalCompressed","uv0","size","rotation","offset","perspectiveDivide","centerOffset","groundDistance","previousDelta","lineParameters","sizeFeatureAttribute","profileRight","profileUp","pathVertexInfo","profileRotation","pathRotationUp","pathMaxStretchDistance","featureAttribute","position","size","sizeFeatureAttribute","profileRight","profileUp","profileRotation","pathRotationUp","pathMaxStretchDistance"]);export{t as affectsGeometry};
|