@xeokit/xeokit-sdk 2.6.5 → 2.6.6

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.
@@ -3326,7 +3326,7 @@ _this19._initMarkerDiv();_this19._onMouseHoverSurface=null;_this19._onHoverNothi
3326
3326
  *
3327
3327
  */var AngleMeasurementsTouchControl=/*#__PURE__*/function(_AngleMeasurementsCon2){_inherits(AngleMeasurementsTouchControl,_AngleMeasurementsCon2);var _super9=_createSuper(AngleMeasurementsTouchControl);/**
3328
3328
  * Creates a AngleMeasurementsTouchControl bound to the given AngleMeasurementsPlugin.
3329
- */function AngleMeasurementsTouchControl(angleMeasurementsPlugin){var _this23;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,AngleMeasurementsTouchControl);_this23=_super9.call(this,angleMeasurementsPlugin.viewer.scene);_this23.pointerLens=cfg.pointerLens;_this23.pointerCircle=new PointerCircle(angleMeasurementsPlugin.viewer);_this23._active=false;var markerDiv=document.createElement('div');var canvas=_this23.scene.canvas.canvas;canvas.parentNode.insertBefore(markerDiv,canvas);markerDiv.style.background="black";markerDiv.style.border="2px solid blue";markerDiv.style.borderRadius="10px";markerDiv.style.width="5px";markerDiv.style.height="5px";markerDiv.style.margin="-200px -200px";markerDiv.style.zIndex="100";markerDiv.style.position="absolute";markerDiv.style.pointerEvents="none";_this23.markerDiv=markerDiv;_this23._currentAngleMeasurement=null;_this23._onCanvasTouchStart=null;_this23._onCanvasTouchEnd=null;_this23._longTouchTimeoutMs=300;_this23._snapToEdge=cfg.snapToEdge!==false;_this23._snapToVertex=cfg.snapToVertex!==false;_this23._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;_this23._attachPlugin(angleMeasurementsPlugin,cfg);return _this23;}_createClass(AngleMeasurementsTouchControl,[{key:"_attachPlugin",value:function _attachPlugin(angleMeasurementsPlugin){/**
3329
+ */function AngleMeasurementsTouchControl(angleMeasurementsPlugin){var _this23;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,AngleMeasurementsTouchControl);_this23=_super9.call(this,angleMeasurementsPlugin.viewer.scene);_this23.pointerLens=cfg.pointerLens;_this23.pointerCircle=new PointerCircle(angleMeasurementsPlugin.viewer);_this23._active=false;var markerDiv=document.createElement('div');var canvas=_this23.scene.canvas.canvas;canvas.parentNode.insertBefore(markerDiv,canvas);markerDiv.style.background="black";markerDiv.style.border="2px solid blue";markerDiv.style.borderRadius="10px";markerDiv.style.width="5px";markerDiv.style.height="5px";markerDiv.style.margin="-200px -200px";markerDiv.style.zIndex="100";markerDiv.style.position="absolute";markerDiv.style.pointerEvents="none";_this23.markerDiv=markerDiv;_this23._currentAngleMeasurement=null;_this23._onCanvasTouchStart=null;_this23._onCanvasTouchEnd=null;_this23._longTouchTimeoutMs=300;_this23._snapping=cfg.snapping!==false;_this23._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;_this23._attachPlugin(angleMeasurementsPlugin,cfg);return _this23;}_createClass(AngleMeasurementsTouchControl,[{key:"_attachPlugin",value:function _attachPlugin(angleMeasurementsPlugin){/**
3330
3330
  * The {@link AngleMeasurementsPlugin} that owns this AngleMeasurementsTouchControl.
3331
3331
  * @type {AngleMeasurementsPlugin}
3332
3332
  */this.angleMeasurementsPlugin=angleMeasurementsPlugin;/**
@@ -3336,25 +3336,25 @@ _this19._initMarkerDiv();_this19._onMouseHoverSurface=null;_this19._onHoverNothi
3336
3336
  *
3337
3337
  * @returns {Boolean}
3338
3338
  */},{key:"active",get:function get(){return this._active;}/**
3339
- * Sets whether snap-to-vertex is enabled for this AngleMeasurementsTouchControl.
3340
- * This is `true` by default.
3341
- * @param snapToVertex
3342
- */},{key:"snapToVertex",get:/**
3343
- * Gets whether snap-to-vertex is enabled for this AngleMeasurementsTouchControl.
3344
- * This is `true` by default.
3345
- * @returns {*}
3346
- */function get(){return this._snapToVertex;}/**
3347
- * Sets whether snap-to-edge is enabled for this AngleMeasurementsTouchControl.
3339
+ * Sets whether snap-to-vertex and snap-to-edge are enabled for this AngleMeasurementsMouseControl.
3340
+ *
3348
3341
  * This is `true` by default.
3349
- * @param snapToEdge
3350
- */,set:function set(snapToVertex){this._snapToVertex=snapToVertex;}},{key:"snapToEdge",get:/**
3351
- * Gets whether snap-to-edge is enabled for this AngleMeasurementsTouchControl.
3342
+ *
3343
+ * Internally, this deactivates then activates the AngleMeasurementsMouseControl when changed, which means that
3344
+ * it will destroy any AngleMeasurements currently under construction, and incurs some overhead, since it unbinds
3345
+ * and rebinds various input handlers.
3346
+ *
3347
+ * @param {boolean} snapping Whether to enable snap-to-vertex and snap-edge for this AngleMeasurementsMouseControl.
3348
+ */},{key:"snapping",get:/**
3349
+ * Gets whether snap-to-vertex and snap-to-edge are enabled for this AngleMeasurementsMouseControl.
3350
+ *
3352
3351
  * This is `true` by default.
3353
- * @returns {*}
3354
- */function get(){return this._snapToEdge;}/**
3352
+ *
3353
+ * @returns {boolean} Whether snap-to-vertex and snap-to-edge are enabled for this AngleMeasurementsMouseControl.
3354
+ */function get(){return this._snapping;}/**
3355
3355
  * Activates this AngleMeasurementsTouchControl, ready to respond to input.
3356
- */,set:function set(snapToEdge){this._snapToEdge=snapToEdge;}},{key:"activate",value:function activate(){var _this24=this;if(this._active){return;}var plugin=this.plugin;var scene=this.scene;var canvas=scene.canvas.canvas;plugin.pointerLens;var pointerWorldPos=math.vec3();var touchTolerance=20;var longTouchTimeout=null;this._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;var touchStartCanvasPos=math.vec2();var touchMoveCanvasPos=math.vec2();var touchEndCanvasPos=math.vec2();var touchId=null;var disableCameraMouseControl=function disableCameraMouseControl(){_this24.plugin.viewer.cameraControl.active=false;};var enableCameraMouseControl=function enableCameraMouseControl(){_this24.plugin.viewer.cameraControl.active=true;};var cancel=function cancel(){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}if(_this24._currentAngleMeasurement){_this24._currentAngleMeasurement.destroy();_this24._currentAngleMeasurement=null;}enableCameraMouseControl();_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;};canvas.addEventListener("touchstart",this._onCanvasTouchStart=function(event){var currentNumTouches=event.touches.length;if(currentNumTouches!==1){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}return;}var touch=event.touches[0];var touchX=touch.clientX;var touchY=touch.clientY;touchStartCanvasPos.set([touchX,touchY]);touchMoveCanvasPos.set([touchX,touchY]);switch(_this24._touchState){case WAITING_FOR_ORIGIN_TOUCH_START$1:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
3357
- cancel();return;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapToVertex,snapToEdge:_this24._snapToEdge});if(snapPickResult&&snapPickResult.snapped){pointerWorldPos.set(snapPickResult.worldPos);_this24.pointerCircle.start(snapPickResult.snappedCanvasPos);}else{var pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){pointerWorldPos.set(pickResult.worldPos);_this24.pointerCircle.start(pickResult.canvasPos);}else{return;}}longTouchTimeout=setTimeout(function(){if(currentNumTouches!==1||touchMoveCanvasPos[0]>touchStartCanvasPos[0]+touchTolerance||touchMoveCanvasPos[0]<touchStartCanvasPos[0]-touchTolerance||touchMoveCanvasPos[1]>touchStartCanvasPos[1]+touchTolerance||touchMoveCanvasPos[1]<touchStartCanvasPos[1]-touchTolerance){return;// Has moved
3356
+ */,set:function set(snapping){if(snapping!==this._snapping){this._snapping=snapping;this.deactivate();this.activate();}else{this._snapping=snapping;}}},{key:"activate",value:function activate(){var _this24=this;if(this._active){return;}var plugin=this.plugin;var scene=this.scene;var canvas=scene.canvas.canvas;plugin.pointerLens;var pointerWorldPos=math.vec3();var touchTolerance=20;var longTouchTimeout=null;this._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;var touchStartCanvasPos=math.vec2();var touchMoveCanvasPos=math.vec2();var touchEndCanvasPos=math.vec2();var touchId=null;var disableCameraNavigation=function disableCameraNavigation(){_this24.plugin.viewer.cameraControl.active=false;};var enableCameraNavigation=function enableCameraNavigation(){_this24.plugin.viewer.cameraControl.active=true;};var cancel=function cancel(){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}if(_this24._currentAngleMeasurement){_this24._currentAngleMeasurement.destroy();_this24._currentAngleMeasurement=null;}enableCameraNavigation();_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;};canvas.addEventListener("touchstart",this._onCanvasTouchStart=function(event){var currentNumTouches=event.touches.length;if(currentNumTouches!==1){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}return;}var touch=event.touches[0];var touchX=touch.clientX;var touchY=touch.clientY;touchStartCanvasPos.set([touchX,touchY]);touchMoveCanvasPos.set([touchX,touchY]);switch(_this24._touchState){case WAITING_FOR_ORIGIN_TOUCH_START$1:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
3357
+ cancel();return;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapping,snapToEdge:_this24._snapping});if(snapPickResult&&snapPickResult.snapped){pointerWorldPos.set(snapPickResult.worldPos);_this24.pointerCircle.start(snapPickResult.snappedCanvasPos);}else{var pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){pointerWorldPos.set(pickResult.worldPos);_this24.pointerCircle.start(pickResult.canvasPos);}else{return;}}longTouchTimeout=setTimeout(function(){if(currentNumTouches!==1||touchMoveCanvasPos[0]>touchStartCanvasPos[0]+touchTolerance||touchMoveCanvasPos[0]<touchStartCanvasPos[0]-touchTolerance||touchMoveCanvasPos[1]>touchStartCanvasPos[1]+touchTolerance||touchMoveCanvasPos[1]<touchStartCanvasPos[1]-touchTolerance){return;// Has moved
3358
3358
  }// Long touch
3359
3359
  if(_this24.pointerLens){_this24.pointerLens.visible=true;_this24.pointerLens.canvasPos=touchStartCanvasPos;_this24.pointerLens.cursorPos=touchStartCanvasPos;}if(_this24.pointerLens){_this24.pointerLens.canvasPos=touchMoveCanvasPos;_this24.pointerLens.snapped=false;}if(_this24.pointerLens){_this24.pointerLens.cursorPos=snapPickResult.canvasPos;_this24.pointerLens.snapped=true;}// pointerWorldPos.set(snapPickResult.worldPos);
3360
3360
  if(!_this24._currentAngleMeasurement){_this24._currentAngleMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:snapPickResult.worldPos,entity:snapPickResult.entity},corner:{worldPos:snapPickResult.worldPos,entity:snapPickResult.entity},target:{worldPos:snapPickResult.worldPos,entity:snapPickResult.entity}});_this24._currentAngleMeasurement.clickable=false;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=false;_this24._currentAngleMeasurement.cornerVisible=false;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;}else{_this24._currentAngleMeasurement.origin.worldPos=pointerWorldPos;}_this24.angleMeasurementsPlugin.fire("measurementStart",_this24._currentAngleMeasurement);// if (this.pointerLens) {
@@ -3362,36 +3362,36 @@ if(!_this24._currentAngleMeasurement){_this24._currentAngleMeasurement=plugin.cr
3362
3362
  // this.pointerLens.snapped = false;
3363
3363
  // }
3364
3364
  _this24._touchState=WAITING_FOR_ORIGIN_LONG_TOUCH_END$1;// console.log("touchstart: this._touchState= WAITING_FOR_ORIGIN_TOUCH_START -> WAITING_FOR_ORIGIN_LONG_TOUCH_END")
3365
- disableCameraMouseControl();},_this24._longTouchTimeoutMs);_this24._touchState=WAITING_FOR_ORIGIN_QUICK_TOUCH_END$1;//console.log("touchstart: this._touchState= WAITING_FOR_ORIGIN_TOUCH_START -> WAITING_FOR_ORIGIN_QUICK_TOUCH_END")
3365
+ disableCameraNavigation();},_this24._longTouchTimeoutMs);_this24._touchState=WAITING_FOR_ORIGIN_QUICK_TOUCH_END$1;//console.log("touchstart: this._touchState= WAITING_FOR_ORIGIN_TOUCH_START -> WAITING_FOR_ORIGIN_QUICK_TOUCH_END")
3366
3366
  touchId=touch.identifier;break;case WAITING_FOR_CORNER_TOUCH_START:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
3367
3367
  clearTimeout(longTouchTimeout);longTouchTimeout=null;return;}if(currentNumTouches===1){// One finger down
3368
3368
  longTouchTimeout=setTimeout(function(){longTouchTimeout=null;if(currentNumTouches!==1||touchMoveCanvasPos[0]>touchStartCanvasPos[0]+touchTolerance||touchMoveCanvasPos[0]<touchStartCanvasPos[0]-touchTolerance||touchMoveCanvasPos[1]>touchStartCanvasPos[1]+touchTolerance||touchMoveCanvasPos[1]<touchStartCanvasPos[1]-touchTolerance){// Has moved
3369
3369
  return;}// Long touch
3370
- if(_this24.pointerLens){_this24.pointerLens.visible=true;_this24.pointerLens.canvasPos=touchStartCanvasPos;_this24.pointerLens.snapped=false;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapToVertex,snapToEdge:_this24._snapToEdge});if(snapPickResult&&snapPickResult.snapped){if(_this24.pointerLens){_this24.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}_this24.pointerCircle.start(snapPickResult.snappedCanvasPos);pointerWorldPos.set(snapPickResult.worldPos);_this24._currentAngleMeasurement.corner.worldPos=snapPickResult.worldPos;_this24._currentAngleMeasurement.corner.entity=snapPickResult.entity;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;_this24.angleMeasurementsPlugin.fire("measurementStart",_this24._currentAngleMeasurement);}else{var _pickResult2=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult2&&_pickResult2.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=_pickResult2.canvasPos;_this24.pointerLens.snapped=false;}_this24.pointerCircle.start(_pickResult2.canvasPos);pointerWorldPos.set(_pickResult2.worldPos);_this24._currentAngleMeasurement.corner.worldPos=_pickResult2.worldPos;_this24._currentAngleMeasurement.corner.entity=_pickResult2.entity;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;_this24.angleMeasurementsPlugin.fire("measurementStart",_this24._currentAngleMeasurement);}else{if(_this24.pointerLens){_this24.pointerLens.cursorPos=null;_this24.pointerLens.snapped=false;}}}_this24._touchState=WAITING_FOR_CORNER_LONG_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_CORNER_TOUCH_START -> WAITING_FOR_CORNER_LONG_TOUCH_END")
3371
- disableCameraMouseControl();},_this24._longTouchTimeoutMs);_this24._touchState=WAITING_FOR_CORNER_QUICK_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_CORNER_TOUCH_START -> WAITING_FOR_CORNER_QUICK_TOUCH_END")
3370
+ if(_this24.pointerLens){_this24.pointerLens.visible=true;_this24.pointerLens.canvasPos=touchStartCanvasPos;_this24.pointerLens.snapped=false;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapping,snapToEdge:_this24._snapping});if(snapPickResult&&snapPickResult.snapped){if(_this24.pointerLens){_this24.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}_this24.pointerCircle.start(snapPickResult.snappedCanvasPos);pointerWorldPos.set(snapPickResult.worldPos);_this24._currentAngleMeasurement.corner.worldPos=snapPickResult.worldPos;_this24._currentAngleMeasurement.corner.entity=snapPickResult.entity;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;_this24.angleMeasurementsPlugin.fire("measurementStart",_this24._currentAngleMeasurement);}else{var _pickResult2=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult2&&_pickResult2.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=_pickResult2.canvasPos;_this24.pointerLens.snapped=false;}_this24.pointerCircle.start(_pickResult2.canvasPos);pointerWorldPos.set(_pickResult2.worldPos);_this24._currentAngleMeasurement.corner.worldPos=_pickResult2.worldPos;_this24._currentAngleMeasurement.corner.entity=_pickResult2.entity;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;_this24.angleMeasurementsPlugin.fire("measurementStart",_this24._currentAngleMeasurement);}else{if(_this24.pointerLens){_this24.pointerLens.cursorPos=null;_this24.pointerLens.snapped=false;}}}_this24._touchState=WAITING_FOR_CORNER_LONG_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_CORNER_TOUCH_START -> WAITING_FOR_CORNER_LONG_TOUCH_END")
3371
+ disableCameraNavigation();},_this24._longTouchTimeoutMs);_this24._touchState=WAITING_FOR_CORNER_QUICK_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_CORNER_TOUCH_START -> WAITING_FOR_CORNER_QUICK_TOUCH_END")
3372
3372
  }touchId=touch.identifier;break;case WAITING_FOR_TARGET_TOUCH_START$1:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
3373
3373
  clearTimeout(longTouchTimeout);longTouchTimeout=null;return;}if(currentNumTouches===1){// One finger down
3374
3374
  longTouchTimeout=setTimeout(function(){longTouchTimeout=null;if(currentNumTouches!==1||touchMoveCanvasPos[0]>touchStartCanvasPos[0]+touchTolerance||touchMoveCanvasPos[0]<touchStartCanvasPos[0]-touchTolerance||touchMoveCanvasPos[1]>touchStartCanvasPos[1]+touchTolerance||touchMoveCanvasPos[1]<touchStartCanvasPos[1]-touchTolerance){// Has moved
3375
3375
  return;}// Long touch
3376
- if(_this24.pointerLens){_this24.pointerLens.visible=true;_this24.pointerLens.canvasPos=touchStartCanvasPos;_this24.pointerLens.snapped=false;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapToVertex,snapToEdge:_this24._snapToEdge});if(snapPickResult&&snapPickResult.snapped){if(_this24.pointerLens){_this24.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}_this24.pointerCircle.start(snapPickResult.snappedCanvasPos);pointerWorldPos.set(snapPickResult.worldPos);_this24._currentAngleMeasurement.target.worldPos=snapPickResult.worldPos;_this24._currentAngleMeasurement.target.entity=snapPickResult.entity;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;_this24.angleMeasurementsPlugin.fire("measurementStart",_this24._currentAngleMeasurement);}else{var _pickResult3=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult3&&_pickResult3.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=_pickResult3.canvasPos;_this24.pointerLens.snapped=false;}_this24.pointerCircle.start(_pickResult3.canvasPos);pointerWorldPos.set(_pickResult3.worldPos);_this24._currentAngleMeasurement.target.worldPos=_pickResult3.worldPos;_this24._currentAngleMeasurement.target.entity=_pickResult3.entity;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;_this24.angleMeasurementsPlugin.fire("measurementStart",_this24._currentAngleMeasurement);}else{if(_this24.pointerLens){_this24.pointerLens.cursorPos=null;_this24.pointerLens.snapped=false;}}}_this24._touchState=WAITING_FOR_TARGET_LONG_TOUCH_END$1;// console.log("touchstart: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_TARGET_LONG_TOUCH_END")
3377
- disableCameraMouseControl();},_this24._longTouchTimeoutMs);_this24._touchState=WAITING_FOR_TARGET_QUICK_TOUCH_END$1;// console.log("touchstart: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_TARGET_QUICK_TOUCH_END")
3376
+ if(_this24.pointerLens){_this24.pointerLens.visible=true;_this24.pointerLens.canvasPos=touchStartCanvasPos;_this24.pointerLens.snapped=false;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapping,snapToEdge:_this24._snapping});if(snapPickResult&&snapPickResult.snapped){if(_this24.pointerLens){_this24.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}_this24.pointerCircle.start(snapPickResult.snappedCanvasPos);pointerWorldPos.set(snapPickResult.worldPos);_this24._currentAngleMeasurement.target.worldPos=snapPickResult.worldPos;_this24._currentAngleMeasurement.target.entity=snapPickResult.entity;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;_this24.angleMeasurementsPlugin.fire("measurementStart",_this24._currentAngleMeasurement);}else{var _pickResult3=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult3&&_pickResult3.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=_pickResult3.canvasPos;_this24.pointerLens.snapped=false;}_this24.pointerCircle.start(_pickResult3.canvasPos);pointerWorldPos.set(_pickResult3.worldPos);_this24._currentAngleMeasurement.target.worldPos=_pickResult3.worldPos;_this24._currentAngleMeasurement.target.entity=_pickResult3.entity;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;_this24.angleMeasurementsPlugin.fire("measurementStart",_this24._currentAngleMeasurement);}else{if(_this24.pointerLens){_this24.pointerLens.cursorPos=null;_this24.pointerLens.snapped=false;}}}_this24._touchState=WAITING_FOR_TARGET_LONG_TOUCH_END$1;// console.log("touchstart: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_TARGET_LONG_TOUCH_END")
3377
+ disableCameraNavigation();},_this24._longTouchTimeoutMs);_this24._touchState=WAITING_FOR_TARGET_QUICK_TOUCH_END$1;// console.log("touchstart: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_TARGET_QUICK_TOUCH_END")
3378
3378
  }touchId=touch.identifier;break;default:if(longTouchTimeout!==null){clearTimeout(longTouchTimeout);longTouchTimeout=null;}_this24._touchState=TOUCH_CANCELING$1;// console.log("touchstart: this._touchState= default -> TOUCH_CANCELING")
3379
- return;}},{passive:true});canvas.addEventListener("touchmove",function(event){_this24.pointerCircle.stop();var currentNumTouches=event.touches.length;if(currentNumTouches!==1||event.changedTouches.length!==1){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}return;}var touch=event.touches[0];var touchX=touch.clientX;var touchY=touch.clientY;if(touch.identifier!==touchId){return;}touchMoveCanvasPos.set([touchX,touchY]);var snapPickResult;var pickResult;switch(_this24._touchState){case WAITING_FOR_ORIGIN_LONG_TOUCH_END$1:if(_this24.pointerLens){_this24.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapToVertex,snapToEdge:_this24._snapToEdge});if(snapPickResult&&snapPickResult.snapped){if(_this24.pointerLens){_this24.pointerLens.snappedCanvasPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}pointerWorldPos.set(snapPickResult.worldPos);_this24._currentAngleMeasurement.origin.worldPos=snapPickResult.worldPos;}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=pickResult.canvasPos;_this24.pointerLens.snapped=false;}pointerWorldPos.set(pickResult.worldPos);_this24._currentAngleMeasurement.origin.worldPos=pickResult.worldPos;}else{if(_this24.pointerLens){_this24.pointerLens.cursorPos=null;_this24.pointerLens.snapped=false;}}}_this24._touchState=WAITING_FOR_ORIGIN_LONG_TOUCH_END$1;// console.log("touchmove: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END -> WAITING_FOR_ORIGIN_LONG_TOUCH_END")
3379
+ return;}},{passive:true});canvas.addEventListener("touchmove",function(event){_this24.pointerCircle.stop();var currentNumTouches=event.touches.length;if(currentNumTouches!==1||event.changedTouches.length!==1){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}return;}var touch=event.touches[0];var touchX=touch.clientX;var touchY=touch.clientY;if(touch.identifier!==touchId){return;}touchMoveCanvasPos.set([touchX,touchY]);var snapPickResult;var pickResult;switch(_this24._touchState){case WAITING_FOR_ORIGIN_LONG_TOUCH_END$1:if(_this24.pointerLens){_this24.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapping,snapToEdge:_this24._snapping});if(snapPickResult&&snapPickResult.snapped){if(_this24.pointerLens){_this24.pointerLens.snappedCanvasPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}pointerWorldPos.set(snapPickResult.worldPos);_this24._currentAngleMeasurement.origin.worldPos=snapPickResult.worldPos;}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=pickResult.canvasPos;_this24.pointerLens.snapped=false;}pointerWorldPos.set(pickResult.worldPos);_this24._currentAngleMeasurement.origin.worldPos=pickResult.worldPos;}else{if(_this24.pointerLens){_this24.pointerLens.cursorPos=null;_this24.pointerLens.snapped=false;}}}_this24._touchState=WAITING_FOR_ORIGIN_LONG_TOUCH_END$1;// console.log("touchmove: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END -> WAITING_FOR_ORIGIN_LONG_TOUCH_END")
3380
3380
  break;case WAITING_FOR_CORNER_LONG_TOUCH_END:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
3381
3381
  clearTimeout(longTouchTimeout);longTouchTimeout=null;if(_this24.pointerLens){_this24.pointerLens.visible=false;}_this24._touchState=TOUCH_CANCELING$1;// console.log("touchmove: this._touchState= QUICK_TOUCH_FINDING_CORNER -> TOUCH_CANCELING")
3382
- return;}if(_this24.pointerLens){_this24.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapToVertex,snapToEdge:_this24._snapToEdge});if(snapPickResult&&snapPickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}_this24._currentAngleMeasurement.corner.worldPos=snapPickResult.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=pickResult.canvasPos;_this24.pointerLens.snapped=false;}_this24._currentAngleMeasurement.corner.worldPos=pickResult.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;}}_this24._touchState=WAITING_FOR_CORNER_LONG_TOUCH_END;break;case WAITING_FOR_TARGET_LONG_TOUCH_END$1:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
3382
+ return;}if(_this24.pointerLens){_this24.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapping,snapToEdge:_this24._snapping});if(snapPickResult&&snapPickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}_this24._currentAngleMeasurement.corner.worldPos=snapPickResult.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=pickResult.canvasPos;_this24.pointerLens.snapped=false;}_this24._currentAngleMeasurement.corner.worldPos=pickResult.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;}}_this24._touchState=WAITING_FOR_CORNER_LONG_TOUCH_END;break;case WAITING_FOR_TARGET_LONG_TOUCH_END$1:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
3383
3383
  clearTimeout(longTouchTimeout);longTouchTimeout=null;if(_this24.pointerLens){_this24.pointerLens.visible=false;}_this24._touchState=TOUCH_CANCELING$1;// console.log("touchmove: this._touchState= QUICK_TOUCH_FINDING_TARGET -> TOUCH_CANCELING")
3384
- return;}if(_this24.pointerLens){_this24.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapToVertex,snapToEdge:_this24._snapToEdge});if(snapPickResult&&snapPickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}_this24._currentAngleMeasurement.target.worldPos=snapPickResult.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=pickResult.canvasPos;_this24.pointerLens.snapped=false;}_this24._currentAngleMeasurement.target.worldPos=pickResult.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;}}_this24._touchState=WAITING_FOR_TARGET_LONG_TOUCH_END$1;break;}},{passive:true});canvas.addEventListener("touchend",this._onCanvasTouchEnd=function(event){_this24.pointerCircle.stop();var numChangedTouches=event.changedTouches.length;if(numChangedTouches!==1){return;}var touch=event.changedTouches[0];var touchX=touch.clientX;var touchY=touch.clientY;if(touch.identifier!==touchId){return;}if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}touchEndCanvasPos.set([touchX,touchY]);switch(_this24._touchState){case WAITING_FOR_ORIGIN_QUICK_TOUCH_END$1:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;return;}var pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){_this24._currentAngleMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:pickResult.worldPos},corner:{worldPos:pickResult.worldPos},target:{worldPos:pickResult.worldPos}});_this24._currentAngleMeasurement.clickable=false;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=false;_this24._currentAngleMeasurement.cornerVisible=false;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;_this24._touchState=WAITING_FOR_CORNER_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_QUICK_TOUCH_END -> WAITING_FOR_CORNER_TOUCH_START")
3384
+ return;}if(_this24.pointerLens){_this24.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this24._snapping,snapToEdge:_this24._snapping});if(snapPickResult&&snapPickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this24.pointerLens.snapped=true;}_this24._currentAngleMeasurement.target.worldPos=snapPickResult.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this24.pointerLens){_this24.pointerLens.cursorPos=pickResult.canvasPos;_this24.pointerLens.snapped=false;}_this24._currentAngleMeasurement.target.worldPos=pickResult.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;}}_this24._touchState=WAITING_FOR_TARGET_LONG_TOUCH_END$1;break;}},{passive:true});canvas.addEventListener("touchend",this._onCanvasTouchEnd=function(event){_this24.pointerCircle.stop();var numChangedTouches=event.changedTouches.length;if(numChangedTouches!==1){return;}var touch=event.changedTouches[0];var touchX=touch.clientX;var touchY=touch.clientY;if(touch.identifier!==touchId){return;}if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}touchEndCanvasPos.set([touchX,touchY]);switch(_this24._touchState){case WAITING_FOR_ORIGIN_QUICK_TOUCH_END$1:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;return;}var pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){_this24._currentAngleMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:pickResult.worldPos},corner:{worldPos:pickResult.worldPos},target:{worldPos:pickResult.worldPos}});_this24._currentAngleMeasurement.clickable=false;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=false;_this24._currentAngleMeasurement.cornerVisible=false;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;_this24._touchState=WAITING_FOR_CORNER_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_QUICK_TOUCH_END -> WAITING_FOR_CORNER_TOUCH_START")
3385
3385
  }else{if(_this24._currentAngleMeasurement){_this24._currentAngleMeasurement.destroy();_this24._currentAngleMeasurement=null;}_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_QUICK_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
3386
- }}enableCameraMouseControl();break;case WAITING_FOR_ORIGIN_LONG_TOUCH_END$1:if(_this24.pointerLens){_this24.pointerLens.visible=false;}if(!_this24._currentAngleMeasurement){if(_this24.pointerLens){_this24.pointerLens.snapped=false;_this24.pointerLens.visible=false;}_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END (no measurement) -> WAITING_FOR_ORIGIN_TOUCH_START")
3386
+ }}enableCameraNavigation();break;case WAITING_FOR_ORIGIN_LONG_TOUCH_END$1:if(_this24.pointerLens){_this24.pointerLens.visible=false;}if(!_this24._currentAngleMeasurement){if(_this24.pointerLens){_this24.pointerLens.snapped=false;_this24.pointerLens.visible=false;}_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END (no measurement) -> WAITING_FOR_ORIGIN_TOUCH_START")
3387
3387
  }else{_this24._touchState=WAITING_FOR_CORNER_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END (picked, begin measurement) -> WAITING_FOR_CORNER_TOUCH_START")
3388
- }enableCameraMouseControl();break;case WAITING_FOR_CORNER_QUICK_TOUCH_END:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this24._touchState=WAITING_FOR_CORNER_TOUCH_START;return;}var _pickResult4=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult4&&_pickResult4.worldPos){_this24._currentAngleMeasurement.corner.worldPos=_pickResult4.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;_this24._touchState=WAITING_FOR_TARGET_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_CORNER_TOUCH_START -> WAITING_FOR_ORIGIN_TOUCH_START")
3388
+ }enableCameraNavigation();break;case WAITING_FOR_CORNER_QUICK_TOUCH_END:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this24._touchState=WAITING_FOR_CORNER_TOUCH_START;return;}var _pickResult4=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult4&&_pickResult4.worldPos){_this24._currentAngleMeasurement.corner.worldPos=_pickResult4.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=false;_this24._currentAngleMeasurement.targetVisible=false;_this24._currentAngleMeasurement.targetWireVisible=false;_this24._currentAngleMeasurement.angleVisible=false;_this24._touchState=WAITING_FOR_TARGET_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_CORNER_TOUCH_START -> WAITING_FOR_ORIGIN_TOUCH_START")
3389
3389
  }else{if(_this24._currentAngleMeasurement){_this24._currentAngleMeasurement.destroy();_this24._currentAngleMeasurement=null;}_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_CORNER_TOUCH_START -> WAITING_FOR_ORIGIN_TOUCH_START")
3390
- }}enableCameraMouseControl();break;case WAITING_FOR_CORNER_LONG_TOUCH_END:if(_this24.pointerLens){_this24.pointerLens.visible=false;}_this24._touchState=WAITING_FOR_TARGET_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_CORNER_LONG_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
3391
- enableCameraMouseControl();break;case WAITING_FOR_TARGET_QUICK_TOUCH_END$1:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this24._touchState=WAITING_FOR_TARGET_TOUCH_START$1;return;}var _pickResult5=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult5&&_pickResult5.worldPos){_this24._currentAngleMeasurement.target.worldPos=_pickResult5.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;_this24.angleMeasurementsPlugin.fire("measurementEnd",_this24._currentAngleMeasurement);_this24._currentAngleMeasurement=null;}else{if(_this24._currentAngleMeasurement){_this24._currentAngleMeasurement.destroy();_this24._currentAngleMeasurement=null;}}_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_ORIGIN_TOUCH_START")
3392
- }enableCameraMouseControl();break;case WAITING_FOR_TARGET_LONG_TOUCH_END$1:if(_this24.pointerLens){_this24.pointerLens.visible=false;}if(!_this24._currentAngleMeasurement||!_this24._currentAngleMeasurement.targetVisible){if(_this24._currentAngleMeasurement){_this24._currentAngleMeasurement.destroy();_this24._currentAngleMeasurement=null;}_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_LONG_TOUCH_END (no target found) -> WAITING_FOR_ORIGIN_TOUCH_START")
3390
+ }}enableCameraNavigation();break;case WAITING_FOR_CORNER_LONG_TOUCH_END:if(_this24.pointerLens){_this24.pointerLens.visible=false;}_this24._touchState=WAITING_FOR_TARGET_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_CORNER_LONG_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
3391
+ enableCameraNavigation();break;case WAITING_FOR_TARGET_QUICK_TOUCH_END$1:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this24._touchState=WAITING_FOR_TARGET_TOUCH_START$1;return;}var _pickResult5=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult5&&_pickResult5.worldPos){_this24._currentAngleMeasurement.target.worldPos=_pickResult5.worldPos;_this24._currentAngleMeasurement.originVisible=true;_this24._currentAngleMeasurement.originWireVisible=true;_this24._currentAngleMeasurement.cornerVisible=true;_this24._currentAngleMeasurement.cornerWireVisible=true;_this24._currentAngleMeasurement.targetVisible=true;_this24._currentAngleMeasurement.targetWireVisible=true;_this24._currentAngleMeasurement.angleVisible=true;_this24.angleMeasurementsPlugin.fire("measurementEnd",_this24._currentAngleMeasurement);_this24._currentAngleMeasurement=null;}else{if(_this24._currentAngleMeasurement){_this24._currentAngleMeasurement.destroy();_this24._currentAngleMeasurement=null;}}_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_ORIGIN_TOUCH_START")
3392
+ }enableCameraNavigation();break;case WAITING_FOR_TARGET_LONG_TOUCH_END$1:if(_this24.pointerLens){_this24.pointerLens.visible=false;}if(!_this24._currentAngleMeasurement||!_this24._currentAngleMeasurement.targetVisible){if(_this24._currentAngleMeasurement){_this24._currentAngleMeasurement.destroy();_this24._currentAngleMeasurement=null;}_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_LONG_TOUCH_END (no target found) -> WAITING_FOR_ORIGIN_TOUCH_START")
3393
3393
  }else{_this24._currentAngleMeasurement.clickable=true;_this24.angleMeasurementsPlugin.fire("measurementEnd",_this24._currentAngleMeasurement);_this24._currentAngleMeasurement=null;_this24._touchState=WAITING_FOR_ORIGIN_TOUCH_START$1;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_LONG_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
3394
- }enableCameraMouseControl();break;}},{passive:true});this._active=true;}/**
3394
+ }enableCameraNavigation();break;}},{passive:true});this._active=true;}/**
3395
3395
  * Deactivates this AngleMeasurementsTouchControl, making it unresponsive to input.
3396
3396
  *
3397
3397
  * Destroys any {@link AngleMeasurement} under construction.
@@ -16791,7 +16791,7 @@ var edgeIndex=void 0;if((edgeIndex=edgeSearch(ii0,ii1))>=0){if(alreadyOutputEdge
16791
16791
  * Unique ID of this SceneModelTransform.
16792
16792
  *
16793
16793
  * The SceneModelTransform is registered against this ID in {@link SceneModel#transforms}.
16794
- */this.id=cfg.id;this._parentTransform=cfg.parent;this._childTransforms=[];this._meshes=[];this._scale=new Float32Array([1,1,1]);this._quaternion=math.identityQuaternion(new Float32Array(4));this._rotation=new Float32Array(3);this._position=new Float32Array(3);this._localMatrix=math.identityMat4(new Float32Array(16));this._worldMatrix=math.identityMat4(new Float32Array(16));this._localMatrixDirty=true;this._worldMatrixDirty=true;if(cfg.matrix){this.matrix=cfg.matrix;}else{this.scale=cfg.scale;this.position=cfg.position;if(cfg.quaternion);else{this.rotation=cfg.rotation;}}if(cfg.parent){cfg.parent._addChildTransform(this);}}_createClass(SceneModelTransform,[{key:"_addChildTransform",value:function _addChildTransform(childTransform){this._childTransforms.push(childTransform);childTransform._parentTransform=this;childTransform._transformDirty();childTransform._setAABBDirty();}},{key:"_addMesh",value:function _addMesh(mesh){this._meshes.push(mesh);mesh.transform=this;// childTransform._setWorldMatrixDirty();
16794
+ */this.id=cfg.id;this._parentTransform=cfg.parent;this._childTransforms=[];this._meshes=[];this._scale=new Float32Array([1,1,1]);this._quaternion=math.identityQuaternion(new Float32Array(4));this._rotation=new Float32Array(3);this._position=new Float32Array(3);this._localMatrix=math.identityMat4(new Float32Array(16));this._worldMatrix=math.identityMat4(new Float32Array(16));this._localMatrixDirty=true;this._worldMatrixDirty=true;if(cfg.matrix){this.matrix=cfg.matrix;}else{this.scale=cfg.scale;this.position=cfg.position;if(cfg.quaternion);else{this.rotation=cfg.rotation;}}if(cfg.parent){cfg.parent._addChildTransform(this);}}_createClass(SceneModelTransform,[{key:"_addChildTransform",value:function _addChildTransform(childTransform){this._childTransforms.push(childTransform);childTransform._parentTransform=this;childTransform._transformDirty();childTransform._setSubtreeAABBsDirty(this);}},{key:"_addMesh",value:function _addMesh(mesh){this._meshes.push(mesh);mesh.transform=this;// childTransform._setWorldMatrixDirty();
16795
16795
  // childTransform._setAABBDirty();
16796
16796
  }/**
16797
16797
  * The optional parent SceneModelTransform.
@@ -19392,13 +19392,12 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
19392
19392
  * it will destroy any DistanceMeasurements currently under construction, and incurs some overhead, since it unbinds
19393
19393
  * and rebinds various input handlers.
19394
19394
  *
19395
- * @param {boolean} snapping Whether to enable snap-to-vertex and snap-edge for this DistanceMeasurementsMouseControl.
19395
+ * @param snapping
19396
19396
  */},{key:"snapping",get:/**
19397
19397
  * Gets whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsMouseControl.
19398
19398
  *
19399
19399
  * This is `true` by default.
19400
- *
19401
- * @returns {boolean} Whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsMouseControl.
19400
+ * @returns {*}
19402
19401
  */function get(){return this._snapping;}/**
19403
19402
  * Activates this DistanceMeasurementsMouseControl, ready to respond to input.
19404
19403
  */,set:function set(snapping){if(snapping!==this._snapping){this._snapping=snapping;this.deactivate();this.activate();}else{this._snapping=snapping;}}},{key:"activate",value:function activate(){var _this85=this;if(this._active){return;}if(!this._markerDiv){this._initMarkerDiv();}this.fire("activated",true);var distanceMeasurementsPlugin=this.distanceMeasurementsPlugin;var scene=this.scene;var cameraControl=distanceMeasurementsPlugin.viewer.cameraControl;var canvas=scene.canvas.canvas;scene.input;var mouseHovering=false;var pointerWorldPos=math.vec3();var pointerCanvasPos=math.vec2();var pointerDownCanvasX;var pointerDownCanvasY;var clickTolerance=20;var hoveredEntity=null;this._mouseState=MOUSE_FIRST_CLICK_EXPECTED;var getTop=function getTop(el){return el.offsetTop+(el.offsetParent&&getTop(el.offsetParent));};var getLeft=function getLeft(el){return el.offsetLeft+(el.offsetParent&&getLeft(el.offsetParent));};var pagePos=math.vec2();this._onCameraControlHoverSnapOrSurface=cameraControl.on(this._snapping?"hoverSnapOrSurface":"hoverSurface",function(event){var canvasPos=event.snappedCanvasPos||event.canvasPos;mouseHovering=true;pointerWorldPos.set(event.worldPos);pointerCanvasPos.set(event.canvasPos);if(_this85._mouseState===MOUSE_FIRST_CLICK_EXPECTED){if(_this85._canvasToPagePos){_this85._canvasToPagePos(canvas,canvasPos,pagePos);_this85._markerDiv.style.left="".concat(pagePos[0]-5,"px");_this85._markerDiv.style.top="".concat(pagePos[1]-5,"px");}else{_this85._markerDiv.style.left="".concat(getLeft(canvas)+canvasPos[0]-5,"px");_this85._markerDiv.style.top="".concat(getTop(canvas)+canvasPos[1]-5,"px");}_this85._markerDiv.style.background="pink";if(event.snappedToVertex||event.snappedToEdge){if(_this85.pointerLens){_this85.pointerLens.visible=true;_this85.pointerLens.canvasPos=event.canvasPos;_this85.pointerLens.snappedCanvasPos=event.snappedCanvasPos||event.canvasPos;_this85.pointerLens.snapped=true;}_this85._markerDiv.style.background="greenyellow";_this85._markerDiv.style.border="2px solid green";}else{if(_this85.pointerLens){_this85.pointerLens.visible=true;_this85.pointerLens.canvasPos=event.canvasPos;_this85.pointerLens.snappedCanvasPos=event.canvasPos;_this85.pointerLens.snapped=false;}_this85._markerDiv.style.background="pink";_this85._markerDiv.style.border="2px solid red";}hoveredEntity=event.entity;}else{_this85._markerDiv.style.left="-10000px";_this85._markerDiv.style.top="-10000px";}canvas.style.cursor="pointer";if(_this85._currentDistanceMeasurement){_this85._currentDistanceMeasurement.wireVisible=_this85._currentDistanceMeasurementInitState.wireVisible;_this85._currentDistanceMeasurement.axisVisible=_this85._currentDistanceMeasurementInitState.axisVisible&&_this85.distanceMeasurementsPlugin.defaultAxisVisible;_this85._currentDistanceMeasurement.xAxisVisible=_this85._currentDistanceMeasurementInitState.xAxisVisible&&_this85.distanceMeasurementsPlugin.defaultXAxisVisible;_this85._currentDistanceMeasurement.yAxisVisible=_this85._currentDistanceMeasurementInitState.yAxisVisible&&_this85.distanceMeasurementsPlugin.defaultYAxisVisible;_this85._currentDistanceMeasurement.zAxisVisible=_this85._currentDistanceMeasurementInitState.zAxisVisible&&_this85.distanceMeasurementsPlugin.defaultZAxisVisible;_this85._currentDistanceMeasurement.targetVisible=_this85._currentDistanceMeasurementInitState.targetVisible;_this85._currentDistanceMeasurement.target.worldPos=pointerWorldPos.slice();_this85._markerDiv.style.left="-10000px";_this85._markerDiv.style.top="-10000px";}});canvas.addEventListener('mousedown',this._onMouseDown=function(e){if(e.which!==1){return;}pointerDownCanvasX=e.clientX;pointerDownCanvasY=e.clientY;});canvas.addEventListener("mouseup",this._onMouseUp=function(e){if(e.which!==1){return;}if(e.clientX>pointerDownCanvasX+clickTolerance||e.clientX<pointerDownCanvasX-clickTolerance||e.clientY>pointerDownCanvasY+clickTolerance||e.clientY<pointerDownCanvasY-clickTolerance){return;}if(_this85._currentDistanceMeasurement){if(mouseHovering){_this85._currentDistanceMeasurement.target.entity=hoveredEntity;hoveredEntity=null;_this85._currentDistanceMeasurement.clickable=true;_this85.distanceMeasurementsPlugin.fire("measurementEnd",_this85._currentDistanceMeasurement);_this85._currentDistanceMeasurement=null;}else{_this85._currentDistanceMeasurement.destroy();_this85.distanceMeasurementsPlugin.fire("measurementCancel",_this85._currentDistanceMeasurement);_this85._currentDistanceMeasurement=null;hoveredEntity=null;}}else{if(mouseHovering){_this85._currentDistanceMeasurement=distanceMeasurementsPlugin.createMeasurement({id:math.createUUID(),origin:{worldPos:pointerWorldPos.slice(),entity:hoveredEntity},target:{worldPos:pointerWorldPos.slice(),entity:hoveredEntity},approximate:true});_this85._currentDistanceMeasurementInitState.axisVisible=_this85._currentDistanceMeasurement.axisVisible&&_this85.distanceMeasurementsPlugin.defaultAxisVisible;_this85._currentDistanceMeasurementInitState.xAxisVisible=_this85._currentDistanceMeasurement.xAxisVisible&&_this85.distanceMeasurementsPlugin.defaultXAxisVisible;_this85._currentDistanceMeasurementInitState.yAxisVisible=_this85._currentDistanceMeasurement.yAxisVisible&&_this85.distanceMeasurementsPlugin.defaultYAxisVisible;_this85._currentDistanceMeasurementInitState.zAxisVisible=_this85._currentDistanceMeasurement.zAxisVisible&&_this85.distanceMeasurementsPlugin.defaultZAxisVisible;_this85._currentDistanceMeasurementInitState.wireVisible=_this85._currentDistanceMeasurement.wireVisible;_this85._currentDistanceMeasurementInitState.targetVisible=_this85._currentDistanceMeasurement.targetVisible;_this85._currentDistanceMeasurement.clickable=false;_this85._currentDistanceMeasurement.origin.entity=hoveredEntity;hoveredEntity=null;_this85.distanceMeasurementsPlugin.fire("measurementStart",_this85._currentDistanceMeasurement);}}});this._onCameraControlHoverSnapOrSurfaceOff=cameraControl.on(this._snapping?"hoverSnapOrSurfaceOff":"hoverOff",function(event){if(_this85.pointerLens){_this85.pointerLens.visible=true;_this85.pointerLens.canvasPos=event.canvasPos;_this85.pointerLens.snappedCanvasPos=event.snappedCanvasPos||event.canvasPos;}mouseHovering=false;_this85._markerDiv.style.left="-100px";_this85._markerDiv.style.top="-100px";if(_this85._currentDistanceMeasurement){_this85._currentDistanceMeasurement.wireVisible=false;_this85._currentDistanceMeasurement.targetVisible=false;_this85._currentDistanceMeasurement.axisVisible=false;}canvas.style.cursor="default";});this._active=true;}/**
@@ -19776,7 +19775,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
19776
19775
  *
19777
19776
  */var DistanceMeasurementsTouchControl=/*#__PURE__*/function(_DistanceMeasurements2){_inherits(DistanceMeasurementsTouchControl,_DistanceMeasurements2);var _super120=_createSuper(DistanceMeasurementsTouchControl);/**
19778
19777
  * Creates a DistanceMeasurementsTouchControl bound to the given DistanceMeasurementsPlugin.
19779
- */function DistanceMeasurementsTouchControl(distanceMeasurementsPlugin){var _this88;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DistanceMeasurementsTouchControl);_this88=_super120.call(this,distanceMeasurementsPlugin.viewer.scene);_this88.pointerLens=cfg.pointerLens;_this88.pointerCircle=new PointerCircle(distanceMeasurementsPlugin.viewer);_this88._active=false;var markerDiv=document.createElement('div');var canvas=_this88.scene.canvas.canvas;canvas.parentNode.insertBefore(markerDiv,canvas);markerDiv.style.background="black";markerDiv.style.border="2px solid blue";markerDiv.style.borderRadius="10px";markerDiv.style.width="5px";markerDiv.style.height="5px";markerDiv.style.margin="-200px -200px";markerDiv.style.zIndex="100";markerDiv.style.position="absolute";markerDiv.style.pointerEvents="none";_this88.markerDiv=markerDiv;_this88._currentDistanceMeasurement=null;_this88._currentDistanceMeasurementInitState={wireVisible:null,axisVisible:null,xAxisVisible:null,yaxisVisible:null,zAxisVisible:null,targetVisible:null};_this88._onCanvasTouchStart=null;_this88._onCanvasTouchEnd=null;_this88._longTouchTimeoutMs=300;_this88._snapToEdge=cfg.snapToEdge!==false;_this88._snapToVertex=cfg.snapToVertex!==false;_this88._touchState=WAITING_FOR_ORIGIN_TOUCH_START;_this88._attachPlugin(distanceMeasurementsPlugin,cfg);return _this88;}_createClass(DistanceMeasurementsTouchControl,[{key:"_attachPlugin",value:function _attachPlugin(distanceMeasurementsPlugin){/**
19778
+ */function DistanceMeasurementsTouchControl(distanceMeasurementsPlugin){var _this88;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DistanceMeasurementsTouchControl);_this88=_super120.call(this,distanceMeasurementsPlugin.viewer.scene);_this88.pointerLens=cfg.pointerLens;_this88.pointerCircle=new PointerCircle(distanceMeasurementsPlugin.viewer);_this88._active=false;var markerDiv=document.createElement('div');var canvas=_this88.scene.canvas.canvas;canvas.parentNode.insertBefore(markerDiv,canvas);markerDiv.style.background="black";markerDiv.style.border="2px solid blue";markerDiv.style.borderRadius="10px";markerDiv.style.width="5px";markerDiv.style.height="5px";markerDiv.style.margin="-200px -200px";markerDiv.style.zIndex="100";markerDiv.style.position="absolute";markerDiv.style.pointerEvents="none";_this88.markerDiv=markerDiv;_this88._currentDistanceMeasurement=null;_this88._currentDistanceMeasurementInitState={wireVisible:null,axisVisible:null,xAxisVisible:null,yaxisVisible:null,zAxisVisible:null,targetVisible:null};_this88._onCanvasTouchStart=null;_this88._onCanvasTouchEnd=null;_this88._longTouchTimeoutMs=300;_this88._snapping=cfg.snapping!==false;_this88._touchState=WAITING_FOR_ORIGIN_TOUCH_START;_this88._attachPlugin(distanceMeasurementsPlugin,cfg);return _this88;}_createClass(DistanceMeasurementsTouchControl,[{key:"_attachPlugin",value:function _attachPlugin(distanceMeasurementsPlugin){/**
19780
19779
  * The {@link DistanceMeasurementsPlugin} that owns this DistanceMeasurementsTouchControl.
19781
19780
  * @type {DistanceMeasurementsPlugin}
19782
19781
  */this.distanceMeasurementsPlugin=distanceMeasurementsPlugin;/**
@@ -19786,25 +19785,25 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
19786
19785
  *
19787
19786
  * @returns {Boolean}
19788
19787
  */},{key:"active",get:function get(){return this._active;}/**
19789
- * Sets whether snap-to-vertex is enabled for this DistanceMeasurementsTouchControl.
19790
- * This is `true` by default.
19791
- * @param snapToVertex
19792
- */},{key:"snapToVertex",get:/**
19793
- * Gets whether snap-to-vertex is enabled for this DistanceMeasurementsTouchControl.
19794
- * This is `true` by default.
19795
- * @returns {*}
19796
- */function get(){return this._snapToVertex;}/**
19797
- * Sets whether snap-to-edge is enabled for this DistanceMeasurementsTouchControl.
19788
+ * Sets whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsTouchControl.
19789
+ *
19798
19790
  * This is `true` by default.
19799
- * @param snapToEdge
19800
- */,set:function set(snapToVertex){this._snapToVertex=snapToVertex;}},{key:"snapToEdge",get:/**
19801
- * Gets whether snap-to-edge is enabled for this DistanceMeasurementsTouchControl.
19791
+ *
19792
+ * Internally, this deactivates then activates the DistanceMeasurementsTouchControl when changed, which means that
19793
+ * it will destroy any DistanceMeasurements currently under construction, and incurs some overhead, since it unbinds
19794
+ * and rebinds various input handlers.
19795
+ *
19796
+ * @param {boolean} snapping Whether to enable snap-to-vertex and snap-edge for this DistanceMeasurementsTouchControl.
19797
+ */},{key:"snapping",get:/**
19798
+ * Gets whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsTouchControl.
19799
+ *
19802
19800
  * This is `true` by default.
19803
- * @returns {*}
19804
- */function get(){return this._snapToEdge;}/**
19801
+ *
19802
+ * @returns {boolean} Whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsTouchControl.
19803
+ */function get(){return this._snapping;}/**
19805
19804
  * Activates this DistanceMeasurementsTouchControl, ready to respond to input.
19806
- */,set:function set(snapToEdge){this._snapToEdge=snapToEdge;}},{key:"activate",value:function activate(){var _this89=this;if(this._active){return;}var plugin=this.plugin;var scene=this.scene;var canvas=scene.canvas.canvas;plugin.pointerLens;var pointerWorldPos=math.vec3();var touchTolerance=20;var longTouchTimeout=null;this._touchState=WAITING_FOR_ORIGIN_TOUCH_START;var touchStartCanvasPos=math.vec2();var touchMoveCanvasPos=math.vec2();var touchEndCanvasPos=math.vec2();var touchId=null;var disableCameraMouseControl=function disableCameraMouseControl(){_this89.plugin.viewer.cameraControl.active=false;};var enableCameraMouseControl=function enableCameraMouseControl(){_this89.plugin.viewer.cameraControl.active=true;};var cancel=function cancel(){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}if(_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement.destroy();_this89._currentDistanceMeasurement=null;}enableCameraMouseControl();_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;};canvas.addEventListener("touchstart",this._onCanvasTouchStart=function(event){var currentNumTouches=event.touches.length;if(currentNumTouches!==1){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}return;}var touch=event.touches[0];var touchX=touch.clientX;var touchY=touch.clientY;touchStartCanvasPos.set([touchX,touchY]);touchMoveCanvasPos.set([touchX,touchY]);switch(_this89._touchState){case WAITING_FOR_ORIGIN_TOUCH_START:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
19807
- cancel();return;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this89._snapToVertex,snapToEdge:_this89._snapToEdge});if(snapPickResult&&snapPickResult.snapped){pointerWorldPos.set(snapPickResult.worldPos);_this89.pointerCircle.start(snapPickResult.snappedCanvasPos);}else{var pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){pointerWorldPos.set(pickResult.worldPos);_this89.pointerCircle.start(pickResult.canvasPos);}else{return;}}longTouchTimeout=setTimeout(function(){if(currentNumTouches!==1||touchMoveCanvasPos[0]>touchStartCanvasPos[0]+touchTolerance||touchMoveCanvasPos[0]<touchStartCanvasPos[0]-touchTolerance||touchMoveCanvasPos[1]>touchStartCanvasPos[1]+touchTolerance||touchMoveCanvasPos[1]<touchStartCanvasPos[1]-touchTolerance){return;// Has moved
19805
+ */,set:function set(snapping){if(snapping!==this._snapping){this._snapping=snapping;this.deactivate();this.activate();}else{this._snapping=snapping;}}},{key:"activate",value:function activate(){var _this89=this;if(this._active){return;}var plugin=this.plugin;var scene=this.scene;var canvas=scene.canvas.canvas;plugin.pointerLens;var pointerWorldPos=math.vec3();var touchTolerance=20;var longTouchTimeout=null;this._touchState=WAITING_FOR_ORIGIN_TOUCH_START;var touchStartCanvasPos=math.vec2();var touchMoveCanvasPos=math.vec2();var touchEndCanvasPos=math.vec2();var touchId=null;var disableCameraNavigation=function disableCameraNavigation(){_this89.plugin.viewer.cameraControl.active=false;};var enableCameraNavigation=function enableCameraNavigation(){_this89.plugin.viewer.cameraControl.active=true;};var cancel=function cancel(){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}if(_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement.destroy();_this89._currentDistanceMeasurement=null;}enableCameraNavigation();_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;};canvas.addEventListener("touchstart",this._onCanvasTouchStart=function(event){var currentNumTouches=event.touches.length;if(currentNumTouches!==1){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}return;}var touch=event.touches[0];var touchX=touch.clientX;var touchY=touch.clientY;touchStartCanvasPos.set([touchX,touchY]);touchMoveCanvasPos.set([touchX,touchY]);switch(_this89._touchState){case WAITING_FOR_ORIGIN_TOUCH_START:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
19806
+ cancel();return;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapping:_this89._snapping,snapToEdge:_this89._snapping});if(snapPickResult&&snapPickResult.snapped){pointerWorldPos.set(snapPickResult.worldPos);_this89.pointerCircle.start(snapPickResult.snappedCanvasPos);}else{var pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){pointerWorldPos.set(pickResult.worldPos);_this89.pointerCircle.start(pickResult.canvasPos);}else{return;}}longTouchTimeout=setTimeout(function(){if(currentNumTouches!==1||touchMoveCanvasPos[0]>touchStartCanvasPos[0]+touchTolerance||touchMoveCanvasPos[0]<touchStartCanvasPos[0]-touchTolerance||touchMoveCanvasPos[1]>touchStartCanvasPos[1]+touchTolerance||touchMoveCanvasPos[1]<touchStartCanvasPos[1]-touchTolerance){return;// Has moved
19808
19807
  }// Long touch
19809
19808
  if(_this89.pointerLens){_this89.pointerLens.visible=true;_this89.pointerLens.canvasPos=touchStartCanvasPos;_this89.pointerLens.cursorPos=touchStartCanvasPos;}if(_this89.pointerLens){_this89.pointerLens.canvasPos=touchMoveCanvasPos;_this89.pointerLens.snapped=false;}if(_this89.pointerLens){_this89.pointerLens.cursorPos=snapPickResult.canvasPos;_this89.pointerLens.snapped=true;}// pointerWorldPos.set(snapPickResult.snappedWorldPos);
19810
19809
  if(!_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:pointerWorldPos,entity:snapPickResult.entity},target:{worldPos:pointerWorldPos,entity:snapPickResult.entity}});_this89._currentDistanceMeasurement.labelsVisible=false;_this89._currentDistanceMeasurement.xAxisVisible=false;_this89._currentDistanceMeasurement.yAxisVisible=false;_this89._currentDistanceMeasurement.zAxisVisible=false;_this89._currentDistanceMeasurement.wireVisible=false;_this89._currentDistanceMeasurement.originVisible=true;_this89._currentDistanceMeasurement.targetVisible=false;_this89._currentDistanceMeasurement.clickable=false;}else{_this89._currentDistanceMeasurement.origin.worldPos=pointerWorldPos;}_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);// if (this.pointerLens) {
@@ -19812,29 +19811,29 @@ if(!_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement=plu
19812
19811
  // this.pointerLens.snapped = false;
19813
19812
  // }
19814
19813
  _this89._touchState=WAITING_FOR_ORIGIN_LONG_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_ORIGIN_TOUCH_START -> WAITING_FOR_ORIGIN_LONG_TOUCH_END")
19815
- disableCameraMouseControl();},_this89._longTouchTimeoutMs);_this89._touchState=WAITING_FOR_ORIGIN_QUICK_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_ORIGIN_TOUCH_START -> WAITING_FOR_ORIGIN_QUICK_TOUCH_END")
19814
+ disableCameraNavigation();},_this89._longTouchTimeoutMs);_this89._touchState=WAITING_FOR_ORIGIN_QUICK_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_ORIGIN_TOUCH_START -> WAITING_FOR_ORIGIN_QUICK_TOUCH_END")
19816
19815
  touchId=touch.identifier;break;case WAITING_FOR_TARGET_TOUCH_START:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
19817
19816
  clearTimeout(longTouchTimeout);longTouchTimeout=null;return;}if(currentNumTouches===1){// One finger down
19818
19817
  longTouchTimeout=setTimeout(function(){longTouchTimeout=null;if(currentNumTouches!==1||touchMoveCanvasPos[0]>touchStartCanvasPos[0]+touchTolerance||touchMoveCanvasPos[0]<touchStartCanvasPos[0]-touchTolerance||touchMoveCanvasPos[1]>touchStartCanvasPos[1]+touchTolerance||touchMoveCanvasPos[1]<touchStartCanvasPos[1]-touchTolerance){// Has moved
19819
19818
  return;}// Long touch
19820
- if(_this89.pointerLens){_this89.pointerLens.visible=true;_this89.pointerLens.canvasPos=touchStartCanvasPos;_this89.pointerLens.snapped=false;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this89._snapToVertex,snapToEdge:_this89._snapToEdge});if(snapPickResult&&snapPickResult.snapped){if(_this89.pointerLens){_this89.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this89.pointerLens.snapped=true;}_this89.pointerCircle.start(snapPickResult.snappedCanvasPos);pointerWorldPos.set(snapPickResult.worldPos);_this89._currentDistanceMeasurement.target.worldPos=snapPickResult.worldPos;_this89._currentDistanceMeasurement.target.entity=snapPickResult.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);}else{var _pickResult6=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult6&&_pickResult6.worldPos){if(_this89.pointerLens){_this89.pointerLens.cursorPos=_pickResult6.canvasPos;_this89.pointerLens.snapped=false;}_this89.pointerCircle.start(_pickResult6.canvasPos);pointerWorldPos.set(_pickResult6.worldPos);_this89._currentDistanceMeasurement.target.worldPos=_pickResult6.worldPos;_this89._currentDistanceMeasurement.target.entity=_pickResult6.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);}else{if(_this89.pointerLens){_this89.pointerLens.cursorPos=null;_this89.pointerLens.snapped=false;}}}_this89._touchState=WAITING_FOR_TARGET_LONG_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_TARGET_LONG_TOUCH_END")
19821
- disableCameraMouseControl();},_this89._longTouchTimeoutMs);_this89._touchState=WAITING_FOR_TARGET_QUICK_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_TARGET_QUICK_TOUCH_END")
19819
+ if(_this89.pointerLens){_this89.pointerLens.visible=true;_this89.pointerLens.canvasPos=touchStartCanvasPos;_this89.pointerLens.snapped=false;}var snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this89._snapping,snapToEdge:_this89._snapping});if(snapPickResult&&snapPickResult.snapped){if(_this89.pointerLens){_this89.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this89.pointerLens.snapped=true;}_this89.pointerCircle.start(snapPickResult.snappedCanvasPos);pointerWorldPos.set(snapPickResult.worldPos);_this89._currentDistanceMeasurement.target.worldPos=snapPickResult.worldPos;_this89._currentDistanceMeasurement.target.entity=snapPickResult.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);}else{var _pickResult6=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult6&&_pickResult6.worldPos){if(_this89.pointerLens){_this89.pointerLens.cursorPos=_pickResult6.canvasPos;_this89.pointerLens.snapped=false;}_this89.pointerCircle.start(_pickResult6.canvasPos);pointerWorldPos.set(_pickResult6.worldPos);_this89._currentDistanceMeasurement.target.worldPos=_pickResult6.worldPos;_this89._currentDistanceMeasurement.target.entity=_pickResult6.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);}else{if(_this89.pointerLens){_this89.pointerLens.cursorPos=null;_this89.pointerLens.snapped=false;}}}_this89._touchState=WAITING_FOR_TARGET_LONG_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_TARGET_LONG_TOUCH_END")
19820
+ disableCameraNavigation();},_this89._longTouchTimeoutMs);_this89._touchState=WAITING_FOR_TARGET_QUICK_TOUCH_END;// console.log("touchstart: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_TARGET_QUICK_TOUCH_END")
19822
19821
  }touchId=touch.identifier;break;default:if(longTouchTimeout!==null){clearTimeout(longTouchTimeout);longTouchTimeout=null;}_this89._touchState=TOUCH_CANCELING;// console.log("touchstart: this._touchState= default -> TOUCH_CANCELING")
19823
- return;}},{passive:true});canvas.addEventListener("touchmove",function(event){_this89.pointerCircle.stop();var currentNumTouches=event.touches.length;if(currentNumTouches!==1||event.changedTouches.length!==1){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}return;}var touch=event.touches[0];var touchX=touch.clientX;var touchY=touch.clientY;if(touch.identifier!==touchId){return;}touchMoveCanvasPos.set([touchX,touchY]);var snapPickResult;var pickResult;switch(_this89._touchState){case WAITING_FOR_ORIGIN_LONG_TOUCH_END:if(_this89.pointerLens){_this89.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this89._snapToVertex,snapToEdge:_this89._snapToEdge});if(snapPickResult&&snapPickResult.snapped){if(_this89.pointerLens){_this89.pointerLens.snappedCanvasPos=snapPickResult.snappedCanvasPos;_this89.pointerLens.snapped=true;}pointerWorldPos.set(snapPickResult.worldPos);if(!_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:snapPickResult.worldPos,entity:snapPickResult.entity},target:{worldPos:snapPickResult.worldPos,entity:snapPickResult.entity}});_this89._currentDistanceMeasurement.labelsVisible=false;_this89._currentDistanceMeasurement.xAxisVisible=false;_this89._currentDistanceMeasurement.yAxisVisible=false;_this89._currentDistanceMeasurement.zAxisVisible=false;_this89._currentDistanceMeasurement.wireVisible=false;_this89._currentDistanceMeasurement.originVisible=true;_this89._currentDistanceMeasurement.targetVisible=false;_this89._currentDistanceMeasurement.clickable=false;}else{_this89._currentDistanceMeasurement.origin.worldPos=snapPickResult.worldPos;}_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this89.pointerLens){_this89.pointerLens.cursorPos=pickResult.canvasPos;_this89.pointerLens.snapped=false;}pointerWorldPos.set(pickResult.worldPos);if(!_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:pickResult.worldPos,entity:pickResult.entity},target:{worldPos:pickResult.worldPos,entity:pickResult.entity}});_this89._currentDistanceMeasurement.labelsVisible=false;_this89._currentDistanceMeasurement.xAxisVisible=false;_this89._currentDistanceMeasurement.yAxisVisible=false;_this89._currentDistanceMeasurement.zAxisVisible=false;_this89._currentDistanceMeasurement.wireVisible=false;_this89._currentDistanceMeasurement.originVisible=true;_this89._currentDistanceMeasurement.targetVisible=false;_this89._currentDistanceMeasurement.clickable=false;}else{_this89._currentDistanceMeasurement.origin.worldPos=pickResult.worldPos;}_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);}else{if(_this89.pointerLens){_this89.pointerLens.cursorPos=null;_this89.pointerLens.snapped=false;}}}_this89._touchState=WAITING_FOR_ORIGIN_LONG_TOUCH_END;// console.log("touchmove: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END -> WAITING_FOR_ORIGIN_LONG_TOUCH_END")
19822
+ return;}},{passive:true});canvas.addEventListener("touchmove",function(event){_this89.pointerCircle.stop();var currentNumTouches=event.touches.length;if(currentNumTouches!==1||event.changedTouches.length!==1){if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}return;}var touch=event.touches[0];var touchX=touch.clientX;var touchY=touch.clientY;if(touch.identifier!==touchId){return;}touchMoveCanvasPos.set([touchX,touchY]);var snapPickResult;var pickResult;switch(_this89._touchState){case WAITING_FOR_ORIGIN_LONG_TOUCH_END:if(_this89.pointerLens){_this89.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this89._snapping,snapToEdge:_this89._snapping});if(snapPickResult&&snapPickResult.snapped){if(_this89.pointerLens){_this89.pointerLens.snappedCanvasPos=snapPickResult.snappedCanvasPos;_this89.pointerLens.snapped=true;}pointerWorldPos.set(snapPickResult.worldPos);if(!_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:snapPickResult.worldPos,entity:snapPickResult.entity},target:{worldPos:snapPickResult.worldPos,entity:snapPickResult.entity}});_this89._currentDistanceMeasurement.labelsVisible=false;_this89._currentDistanceMeasurement.xAxisVisible=false;_this89._currentDistanceMeasurement.yAxisVisible=false;_this89._currentDistanceMeasurement.zAxisVisible=false;_this89._currentDistanceMeasurement.wireVisible=false;_this89._currentDistanceMeasurement.originVisible=true;_this89._currentDistanceMeasurement.targetVisible=false;_this89._currentDistanceMeasurement.clickable=false;}else{_this89._currentDistanceMeasurement.origin.worldPos=snapPickResult.worldPos;}_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this89.pointerLens){_this89.pointerLens.cursorPos=pickResult.canvasPos;_this89.pointerLens.snapped=false;}pointerWorldPos.set(pickResult.worldPos);if(!_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:pickResult.worldPos,entity:pickResult.entity},target:{worldPos:pickResult.worldPos,entity:pickResult.entity}});_this89._currentDistanceMeasurement.labelsVisible=false;_this89._currentDistanceMeasurement.xAxisVisible=false;_this89._currentDistanceMeasurement.yAxisVisible=false;_this89._currentDistanceMeasurement.zAxisVisible=false;_this89._currentDistanceMeasurement.wireVisible=false;_this89._currentDistanceMeasurement.originVisible=true;_this89._currentDistanceMeasurement.targetVisible=false;_this89._currentDistanceMeasurement.clickable=false;}else{_this89._currentDistanceMeasurement.origin.worldPos=pickResult.worldPos;}_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);}else{if(_this89.pointerLens){_this89.pointerLens.cursorPos=null;_this89.pointerLens.snapped=false;}}}_this89._touchState=WAITING_FOR_ORIGIN_LONG_TOUCH_END;// console.log("touchmove: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END -> WAITING_FOR_ORIGIN_LONG_TOUCH_END")
19824
19823
  break;// case WAITING_FOR_TARGET_TOUCH_START:
19825
19824
  // this._touchState = WAITING_FOR_TARGET_TOUCH_START;
19826
19825
  // console.log("touchmove: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_TARGET_TOUCH_START")
19827
19826
  // break;
19828
19827
  case WAITING_FOR_TARGET_LONG_TOUCH_END:if(currentNumTouches!==1&&longTouchTimeout!==null){// Two or more fingers down
19829
19828
  clearTimeout(longTouchTimeout);longTouchTimeout=null;if(_this89.pointerLens){_this89.pointerLens.visible=false;}_this89._touchState=TOUCH_CANCELING;// console.log("touchmove: this._touchState= QUICK_TOUCH_FINDING_TARGET -> TOUCH_CANCELING")
19830
- return;}if(_this89.pointerLens){_this89.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this89._snapToVertex,snapToEdge:_this89._snapToEdge});if(snapPickResult&&snapPickResult.worldPos){if(_this89.pointerLens){_this89.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this89.pointerLens.snapped=true;}_this89._currentDistanceMeasurement.target.worldPos=snapPickResult.worldPos;_this89._currentDistanceMeasurement.target.entity=snapPickResult.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this89.pointerLens){_this89.pointerLens.cursorPos=pickResult.canvasPos;_this89.pointerLens.snapped=false;}_this89._currentDistanceMeasurement.target.worldPos=pickResult.worldPos;_this89._currentDistanceMeasurement.target.entity=pickResult.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;}}_this89._touchState=WAITING_FOR_TARGET_LONG_TOUCH_END;break;}},{passive:true});canvas.addEventListener("touchend",this._onCanvasTouchEnd=function(event){_this89.pointerCircle.stop();var numChangedTouches=event.changedTouches.length;if(numChangedTouches!==1){return;}var touch=event.changedTouches[0];var touchX=touch.clientX;var touchY=touch.clientY;if(touch.identifier!==touchId){return;}if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}touchEndCanvasPos.set([touchX,touchY]);switch(_this89._touchState){case WAITING_FOR_ORIGIN_QUICK_TOUCH_END:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;return;}var pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){_this89._currentDistanceMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:pickResult.worldPos,entity:pickResult.entity},target:{worldPos:pickResult.worldPos,entity:pickResult.entity}});_this89._currentDistanceMeasurement.labelsVisible=false;_this89._currentDistanceMeasurement.xAxisVisible=false;_this89._currentDistanceMeasurement.yAxisVisible=false;_this89._currentDistanceMeasurement.zAxisVisible=false;_this89._currentDistanceMeasurement.wireVisible=false;_this89._currentDistanceMeasurement.originVisible=true;_this89._currentDistanceMeasurement.targetVisible=false;_this89._currentDistanceMeasurement.clickable=false;_this89._touchState=WAITING_FOR_TARGET_TOUCH_START;_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_QUICK_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
19829
+ return;}if(_this89.pointerLens){_this89.pointerLens.canvasPos=touchMoveCanvasPos;}snapPickResult=scene.pick({canvasPos:touchMoveCanvasPos,snapToVertex:_this89._snapping,snapToEdge:_this89._snapping});if(snapPickResult&&snapPickResult.worldPos){if(_this89.pointerLens){_this89.pointerLens.cursorPos=snapPickResult.snappedCanvasPos;_this89.pointerLens.snapped=true;}_this89._currentDistanceMeasurement.target.worldPos=snapPickResult.worldPos;_this89._currentDistanceMeasurement.target.entity=snapPickResult.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;}else{pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){if(_this89.pointerLens){_this89.pointerLens.cursorPos=pickResult.canvasPos;_this89.pointerLens.snapped=false;}_this89._currentDistanceMeasurement.target.worldPos=pickResult.worldPos;_this89._currentDistanceMeasurement.target.entity=pickResult.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;}}_this89._touchState=WAITING_FOR_TARGET_LONG_TOUCH_END;break;}},{passive:true});canvas.addEventListener("touchend",this._onCanvasTouchEnd=function(event){_this89.pointerCircle.stop();var numChangedTouches=event.changedTouches.length;if(numChangedTouches!==1){return;}var touch=event.changedTouches[0];var touchX=touch.clientX;var touchY=touch.clientY;if(touch.identifier!==touchId){return;}if(longTouchTimeout){clearTimeout(longTouchTimeout);longTouchTimeout=null;}touchEndCanvasPos.set([touchX,touchY]);switch(_this89._touchState){case WAITING_FOR_ORIGIN_QUICK_TOUCH_END:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;return;}var pickResult=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(pickResult&&pickResult.worldPos){_this89._currentDistanceMeasurement=plugin.createMeasurement({id:math.createUUID(),origin:{worldPos:pickResult.worldPos,entity:pickResult.entity},target:{worldPos:pickResult.worldPos,entity:pickResult.entity}});_this89._currentDistanceMeasurement.labelsVisible=false;_this89._currentDistanceMeasurement.xAxisVisible=false;_this89._currentDistanceMeasurement.yAxisVisible=false;_this89._currentDistanceMeasurement.zAxisVisible=false;_this89._currentDistanceMeasurement.wireVisible=false;_this89._currentDistanceMeasurement.originVisible=true;_this89._currentDistanceMeasurement.targetVisible=false;_this89._currentDistanceMeasurement.clickable=false;_this89._touchState=WAITING_FOR_TARGET_TOUCH_START;_this89.distanceMeasurementsPlugin.fire("measurementStart",_this89._currentDistanceMeasurement);// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_QUICK_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
19831
19830
  }else{if(_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement.destroy();}_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_QUICK_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
19832
- }}enableCameraMouseControl();break;case WAITING_FOR_ORIGIN_LONG_TOUCH_END:if(_this89.pointerLens){_this89.pointerLens.visible=false;}if(!_this89._currentDistanceMeasurement){if(_this89.pointerLens){_this89.pointerLens.snapped=false;_this89.pointerLens.visible=false;}_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END (no measurement) -> WAITING_FOR_ORIGIN_TOUCH_START")
19831
+ }}enableCameraNavigation();break;case WAITING_FOR_ORIGIN_LONG_TOUCH_END:if(_this89.pointerLens){_this89.pointerLens.visible=false;}if(!_this89._currentDistanceMeasurement){if(_this89.pointerLens){_this89.pointerLens.snapped=false;_this89.pointerLens.visible=false;}_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END (no measurement) -> WAITING_FOR_ORIGIN_TOUCH_START")
19833
19832
  }else{_this89._touchState=WAITING_FOR_TARGET_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_LONG_TOUCH_END (picked, begin measurement) -> WAITING_FOR_TARGET_TOUCH_START")
19834
- }enableCameraMouseControl();break;case WAITING_FOR_TARGET_QUICK_TOUCH_END:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this89._touchState=WAITING_FOR_TARGET_TOUCH_START;return;}var _pickResult7=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult7&&_pickResult7.worldPos){_this89._currentDistanceMeasurement.target.worldPos=_pickResult7.worldPos;_this89._currentDistanceMeasurement.target.entity=_pickResult7.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;_this89.distanceMeasurementsPlugin.fire("measurementEnd",_this89._currentDistanceMeasurement);_this89._currentDistanceMeasurement=null;}else{if(_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement.destroy();_this89._currentDistanceMeasurement=null;}}_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_ORIGIN_TOUCH_START")
19835
- }enableCameraMouseControl();break;case WAITING_FOR_TARGET_LONG_TOUCH_END:if(_this89.pointerLens){_this89.pointerLens.visible=false;}if(!_this89._currentDistanceMeasurement||!_this89._currentDistanceMeasurement.targetVisible){if(_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement.destroy();_this89._currentDistanceMeasurement=null;}_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_LONG_TOUCH_END (no target found) -> WAITING_FOR_ORIGIN_TOUCH_START")
19833
+ }enableCameraNavigation();break;case WAITING_FOR_TARGET_QUICK_TOUCH_END:{if(numChangedTouches!==1||touchX>touchStartCanvasPos[0]+touchTolerance||touchX<touchStartCanvasPos[0]-touchTolerance||touchY>touchStartCanvasPos[1]+touchTolerance||touchY<touchStartCanvasPos[1]-touchTolerance){_this89._touchState=WAITING_FOR_TARGET_TOUCH_START;return;}var _pickResult7=scene.pick({canvasPos:touchMoveCanvasPos,pickSurface:true});if(_pickResult7&&_pickResult7.worldPos){_this89._currentDistanceMeasurement.target.worldPos=_pickResult7.worldPos;_this89._currentDistanceMeasurement.target.entity=_pickResult7.entity;_this89._currentDistanceMeasurement.targetVisible=true;_this89._currentDistanceMeasurement.wireVisible=true;_this89._currentDistanceMeasurement.labelsVisible=true;_this89.distanceMeasurementsPlugin.fire("measurementEnd",_this89._currentDistanceMeasurement);_this89._currentDistanceMeasurement=null;}else{if(_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement.destroy();_this89._currentDistanceMeasurement=null;}}_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_TOUCH_START -> WAITING_FOR_ORIGIN_TOUCH_START")
19834
+ }enableCameraNavigation();break;case WAITING_FOR_TARGET_LONG_TOUCH_END:if(_this89.pointerLens){_this89.pointerLens.visible=false;}if(!_this89._currentDistanceMeasurement||!_this89._currentDistanceMeasurement.targetVisible){if(_this89._currentDistanceMeasurement){_this89._currentDistanceMeasurement.destroy();_this89._currentDistanceMeasurement=null;}_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_LONG_TOUCH_END (no target found) -> WAITING_FOR_ORIGIN_TOUCH_START")
19836
19835
  }else{_this89._currentDistanceMeasurement.clickable=true;_this89.distanceMeasurementsPlugin.fire("measurementEnd",_this89._currentDistanceMeasurement);_this89._currentDistanceMeasurement=null;_this89._touchState=WAITING_FOR_ORIGIN_TOUCH_START;// console.log("touchend: this._touchState= WAITING_FOR_TARGET_LONG_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
19837
- }enableCameraMouseControl();break;}},{passive:true});this._active=true;}/**
19836
+ }enableCameraNavigation();break;}},{passive:true});this._active=true;}/**
19838
19837
  * Deactivates this DistanceMeasurementsTouchControl, making it unresponsive to input.
19839
19838
  *
19840
19839
  * Destroys any {@link DistanceMeasurement} under construction.