@xeokit/xeokit-sdk 2.3.0-beta-20 → 2.3.0-beta-24

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.
@@ -12733,7 +12733,6 @@ class PickResult {
12733
12733
 
12734
12734
  /**
12735
12735
  * @private
12736
- * @param value
12737
12736
  */
12738
12737
  constructor() {
12739
12738
 
@@ -12770,6 +12769,12 @@ class PickResult {
12770
12769
  */
12771
12770
  this.pickSurfacePrecision = false;
12772
12771
 
12772
+ /**
12773
+ * True when picked from touch input, else false when from mouse input.
12774
+ * @type {boolean}
12775
+ */
12776
+ this.touchInput = false;
12777
+
12773
12778
  this._canvasPos = new Int16Array([0, 0]);
12774
12779
  this._origin = new Float64Array([0, 0, 0]);
12775
12780
  this._direction = new Float64Array([0, 0, 0]);
@@ -13047,6 +13052,7 @@ class PickResult {
13047
13052
  this._gotBary = false;
13048
13053
  this._gotWorldNormal = false;
13049
13054
  this._gotUV = false;
13055
+ this.touchInput = false;
13050
13056
  }
13051
13057
  }
13052
13058
 
@@ -15950,6 +15956,19 @@ const Renderer = function (scene, options) {
15950
15956
 
15951
15957
  //------------------------------------------------------------------------------------------------------
15952
15958
  // Render deferred bins
15959
+ //
15960
+ // Order:
15961
+ //
15962
+ // 1. Opaque color fill
15963
+ // 2. Opaque edges
15964
+ // 3. Opaque X-ray fill
15965
+ // 4. Opaque X-ray edges
15966
+ // 5. Opaque highlight
15967
+ // 6. Transparent highlight
15968
+ // 7. Selected opaque
15969
+ // 8. Selected transparent
15970
+ // 9. Normal transparent
15971
+ // 10. X-rayed transparent
15953
15972
  //------------------------------------------------------------------------------------------------------
15954
15973
 
15955
15974
  // Opaque color with SAO
@@ -15985,66 +16004,6 @@ const Renderer = function (scene, options) {
15985
16004
  }
15986
16005
  }
15987
16006
 
15988
- // Transparent
15989
-
15990
- if (xrayedFillTransparentBinLen > 0 || xrayEdgesTransparentBinLen > 0 || normalFillTransparentBinLen > 0 || normalEdgesTransparentBinLen > 0) {
15991
- gl.enable(gl.CULL_FACE);
15992
- gl.enable(gl.BLEND);
15993
- if (canvasTransparent) {
15994
- gl.blendEquation(gl.FUNC_ADD);
15995
- gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
15996
- } else {
15997
- gl.blendEquation(gl.FUNC_ADD);
15998
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
15999
- }
16000
- frameCtx.backfaces = false;
16001
- if (!alphaDepthMask) {
16002
- gl.depthMask(false);
16003
- }
16004
-
16005
- // Transparent color edges
16006
-
16007
- if (normalFillTransparentBinLen > 0 || normalEdgesTransparentBinLen > 0) {
16008
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
16009
- }
16010
- if (normalEdgesTransparentBinLen > 0) {
16011
- for (i = 0; i < normalEdgesTransparentBinLen; i++) {
16012
- drawable = normalEdgesTransparentBin[i];
16013
- drawable.drawEdgesColorTransparent(frameCtx);
16014
- }
16015
- }
16016
-
16017
- // Transparent color fill
16018
-
16019
- if (normalFillTransparentBinLen > 0) {
16020
- for (i = 0; i < normalFillTransparentBinLen; i++) {
16021
- drawable = normalFillTransparentBin[i];
16022
- drawable.drawColorTransparent(frameCtx);
16023
- }
16024
- }
16025
-
16026
- // Transparent X-ray edges
16027
-
16028
- if (xrayEdgesTransparentBinLen > 0) {
16029
- for (i = 0; i < xrayEdgesTransparentBinLen; i++) {
16030
- xrayEdgesTransparentBin[i].drawEdgesXRayed(frameCtx);
16031
- }
16032
- }
16033
-
16034
- // Transparent X-ray fill
16035
-
16036
- if (xrayedFillTransparentBinLen > 0) {
16037
- for (i = 0; i < xrayedFillTransparentBinLen; i++) {
16038
- xrayedFillTransparentBin[i].drawSilhouetteXRayed(frameCtx);
16039
- }
16040
- }
16041
-
16042
- gl.disable(gl.BLEND);
16043
- if (!alphaDepthMask) {
16044
- gl.depthMask(true);
16045
- }
16046
- }
16047
-
16048
16007
  // Opaque highlight
16049
16008
 
16050
16009
  if (highlightedFillOpaqueBinLen > 0 || highlightedEdgesOpaqueBinLen > 0) {
@@ -16163,6 +16122,66 @@ const Renderer = function (scene, options) {
16163
16122
  gl.disable(gl.BLEND);
16164
16123
  }
16165
16124
 
16125
+ // Transparent
16126
+
16127
+ if (xrayedFillTransparentBinLen > 0 || xrayEdgesTransparentBinLen > 0 || normalFillTransparentBinLen > 0 || normalEdgesTransparentBinLen > 0) {
16128
+ gl.enable(gl.CULL_FACE);
16129
+ gl.enable(gl.BLEND);
16130
+ if (canvasTransparent) {
16131
+ gl.blendEquation(gl.FUNC_ADD);
16132
+ gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
16133
+ } else {
16134
+ gl.blendEquation(gl.FUNC_ADD);
16135
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
16136
+ }
16137
+ frameCtx.backfaces = false;
16138
+ if (!alphaDepthMask) {
16139
+ gl.depthMask(false);
16140
+ }
16141
+
16142
+ // Transparent color edges
16143
+
16144
+ if (normalFillTransparentBinLen > 0 || normalEdgesTransparentBinLen > 0) {
16145
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
16146
+ }
16147
+ if (normalEdgesTransparentBinLen > 0) {
16148
+ for (i = 0; i < normalEdgesTransparentBinLen; i++) {
16149
+ drawable = normalEdgesTransparentBin[i];
16150
+ drawable.drawEdgesColorTransparent(frameCtx);
16151
+ }
16152
+ }
16153
+
16154
+ // Transparent color fill
16155
+
16156
+ if (normalFillTransparentBinLen > 0) {
16157
+ for (i = 0; i < normalFillTransparentBinLen; i++) {
16158
+ drawable = normalFillTransparentBin[i];
16159
+ drawable.drawColorTransparent(frameCtx);
16160
+ }
16161
+ }
16162
+
16163
+ // Transparent X-ray edges
16164
+
16165
+ if (xrayEdgesTransparentBinLen > 0) {
16166
+ for (i = 0; i < xrayEdgesTransparentBinLen; i++) {
16167
+ xrayEdgesTransparentBin[i].drawEdgesXRayed(frameCtx);
16168
+ }
16169
+ }
16170
+
16171
+ // Transparent X-ray fill
16172
+
16173
+ if (xrayedFillTransparentBinLen > 0) {
16174
+ for (i = 0; i < xrayedFillTransparentBinLen; i++) {
16175
+ xrayedFillTransparentBin[i].drawSilhouetteXRayed(frameCtx);
16176
+ }
16177
+ }
16178
+
16179
+ gl.disable(gl.BLEND);
16180
+ if (!alphaDepthMask) {
16181
+ gl.depthMask(true);
16182
+ }
16183
+ }
16184
+
16166
16185
  const endTime = Date.now();
16167
16186
  const frameStats = stats.frame;
16168
16187
 
@@ -45085,18 +45104,33 @@ const tempVec3c$6 = math.vec3();
45085
45104
  /**
45086
45105
  * {@link Viewer} plugin that saves and loads BCF viewpoints as JSON objects.
45087
45106
  *
45088
- * BCF is a format for managing issues on a BIM project. This plugin's viewpoints conform to
45089
- * the <a href="https://github.com/buildingSMART/BCF-API">BCF Version 2.1</a> specification.
45107
+ * [<img src="http://xeokit.github.io/xeokit-sdk/assets/images/BCFViewpointsPlugin.png">](http://xeokit.github.io/xeokit-sdk/examples/#BCF_SaveViewpoint)
45108
+ *
45109
+ * * [[Example 1: Saving viewer state to a BCF viewpoint](https://xeokit.github.io/xeokit-sdk/examples/#BCF_SaveViewpoint)]
45110
+ * * [[Example 2: Loading viewer state from a BCF viewpoint](https://xeokit.github.io/xeokit-sdk/examples/#BCF_LoadViewpoint)]
45111
+ *
45112
+ * ## Overview
45113
+ *
45114
+ * BCF is an open standard that enables workflow communications between BIM software tools. An XML schema, called
45115
+ * Building Collaboration Format (BCF), encodes messages that inform one BIM tool of issues found by another.
45116
+ *
45117
+ * A BCF viewpoint captures a viewpoint of a model that highlights an issue. The viewpoint can then be loaded by another
45118
+ * viewer to examine the issue.
45119
+ *
45120
+ * Using this plugin, a xeokit {@link Viewer} can exchange BCF-encoded viewpoints with other BIM software,
45121
+ * allowing us to use the Viewer to report and view issues in BIM models.
45122
+ *
45123
+ * This plugin's viewpoints conform to the <a href="https://github.com/buildingSMART/BCF-API">BCF Version 2.1</a> specification.
45090
45124
  *
45091
45125
  * ## Supported BCF Elements
45092
45126
  *
45093
- * A BCF viewpoint saves and loads the following state into a xeokit {@link Viewer}:
45127
+ * BCFViewpointsPlugin saves and loads the following state in BCF viewpoints:
45094
45128
  *
45095
45129
  * * {@link Camera} position, orientation and projection
45130
+ * * {@link Entity} visibilities and selection states
45096
45131
  * * {@link SectionPlane}s to slice the model
45097
45132
  * * {@link LineSet}s to show 3D lines
45098
45133
  * * {@link Bitmap}s to show images
45099
- * * {@link Entity} visibilities and selection states
45100
45134
  *
45101
45135
  * ## Saving a BCF Viewpoint
45102
45136
  *
@@ -45105,7 +45139,7 @@ const tempVec3c$6 = math.vec3();
45105
45139
  * plan view using a {@link Bitmap}, then use a {@link BCFViewpointsPlugin#getViewpoint}
45106
45140
  * to save a viewpoint to JSON, which we'll log to the JavaScript developer console.
45107
45141
  *
45108
- * * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#BCF_SaveViewpoint)]
45142
+ * * [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#BCF_SaveViewpoint)]
45109
45143
  *
45110
45144
  * ````javascript
45111
45145
  * import {Viewer, XKTLoaderPlugin, SectionPlanesPlugin,
@@ -46598,7 +46632,7 @@ class DistanceMeasurementsControl extends Component {
46598
46632
  this._active = false;
46599
46633
 
46600
46634
  this._currentDistMeasurement = null;
46601
- // Keep initial measurement state values to do not force values but put the default ones.
46635
+
46602
46636
  this._currentDistMeasurementInitState = {
46603
46637
  wireVisible: null,
46604
46638
  axisVisible: null,
@@ -46631,7 +46665,7 @@ class DistanceMeasurementsControl extends Component {
46631
46665
  }
46632
46666
 
46633
46667
  const cameraControl = this.plugin.viewer.cameraControl;
46634
-
46668
+ const canvas = this.scene.canvas.canvas;
46635
46669
  let hoveredEntity = null;
46636
46670
  const worldPos = math.vec3();
46637
46671
  const hoverCanvasPos = math.vec2();
@@ -46664,18 +46698,18 @@ class DistanceMeasurementsControl extends Component {
46664
46698
  }
46665
46699
  });
46666
46700
 
46667
- let lastX;
46668
- let lastY;
46669
- const tolerance = 5;
46701
+ let lastMouseCanvasX;
46702
+ let lastMouseCanvasY;
46703
+ const mouseCanvasTolerance = 5;
46670
46704
 
46671
46705
  this._onInputMouseDown = this.plugin.viewer.scene.input.on("mousedown", (coords) => {
46672
- lastX = coords[0];
46673
- lastY = coords[1];
46706
+ lastMouseCanvasX = coords[0];
46707
+ lastMouseCanvasY = coords[1];
46674
46708
  });
46675
46709
 
46676
46710
  this._onInputMouseUp = this.plugin.viewer.scene.input.on("mouseup", (coords) => {
46677
46711
 
46678
- if (coords[0] > lastX + tolerance || coords[0] < lastX - tolerance || coords[1] > lastY + tolerance || coords[1] < lastY - tolerance) {
46712
+ if (coords[0] > lastMouseCanvasX + mouseCanvasTolerance || coords[0] < lastMouseCanvasX - mouseCanvasTolerance || coords[1] > lastMouseCanvasY + mouseCanvasTolerance || coords[1] < lastMouseCanvasY - mouseCanvasTolerance) {
46679
46713
  return;
46680
46714
  }
46681
46715
 
@@ -46752,78 +46786,195 @@ class DistanceMeasurementsControl extends Component {
46752
46786
  this.plugin.viewer.scene.canvas.canvas.style.cursor = "default";
46753
46787
  });
46754
46788
 
46789
+ math.vec3();
46790
+ math.vec3();
46791
+
46792
+ let state = 0;
46793
+
46755
46794
  this._onPickedNothing = cameraControl.on("pickedNothing", e => {
46795
+ console.log("pick nothing");
46756
46796
  if (this._currentDistMeasurement) {
46757
46797
  this._currentDistMeasurement.destroy();
46758
46798
  this._currentDistMeasurement = null;
46759
46799
  }
46800
+ if (this.startDot) {
46801
+ this.startDot.setVisible(false);
46802
+ }
46803
+ state = 0;
46760
46804
  });
46761
46805
 
46762
- //-------------------------------------------------------------------------------------------------------------
46806
+ const tapStartCanvasPos = math.vec2();
46807
+ math.vec2();
46808
+ math.vec2();
46809
+ math.vec2();
46763
46810
 
46764
- // const canvas = this.scene.canvas.canvas;
46765
- // const tapStartCanvasPos = math.vec2();
46766
- // const tapCanvasPos0 = math.vec2();
46767
- // const tapCanvasPos1 = math.vec2();
46768
- // const touch0Vec = math.vec2();
46769
- // const lastCanvasTouchPosList = [];
46770
- // let numTouches = 0;
46771
- // let waitForTick = false;
46772
- //
46773
- // this._onTick = scene.on("tick", () => {
46774
- // waitForTick = false;
46811
+ const startWorldPos = math.vec3();
46812
+ math.vec3();
46813
+
46814
+ const lastCanvasTouchPosList = [];
46815
+
46816
+ this._onTick = scene.on("tick", () => {
46817
+ });
46818
+
46819
+ canvas.addEventListener("touchstart", this._canvasTouchStartHandler = (event) => {
46820
+
46821
+ console.log("touchStart");
46822
+
46823
+ event.preventDefault();
46824
+
46825
+ const touches = event.touches;
46826
+ const changedTouches = event.changedTouches;
46827
+
46828
+ if (touches.length === 1 && changedTouches.length === 1) {
46829
+
46830
+ getCanvasPosFromEvent$4(touches[0], tapStartCanvasPos);
46831
+
46832
+ const pickResult = this.plugin.viewer.scene.pick({
46833
+ canvasPos: tapStartCanvasPos,
46834
+ pickSurface: true,
46835
+ // pickSurfacePrecision: true
46836
+ });
46837
+
46838
+ if (pickResult && pickResult.worldPos) {
46839
+
46840
+ console.log("Finger is down over an object");
46841
+ if (state === 0) {
46842
+ if (this.startDot) {
46843
+ this.startDot.setVisible(true);
46844
+ this.startDot.setPos(tapStartCanvasPos[0], tapStartCanvasPos[1]);
46845
+ }
46846
+ startWorldPos.set(pickResult.worldPos);
46847
+ state = 1;
46848
+ } else {
46849
+ if (this.startDot) {
46850
+ this.startDot.setVisible(false);
46851
+ }
46852
+ }
46853
+ } else {
46854
+ const pickResult = this.plugin.viewer.scene.pick({
46855
+ canvasPos: tapStartCanvasPos,
46856
+ pickSurface: true,
46857
+ pickSurfacePrecision: true
46858
+ });
46859
+ if (pickResult && pickResult.worldPos) {
46860
+ this._currentDistMeasurement = this.plugin.createMeasurement({
46861
+ id: math.createUUID(),
46862
+ origin: {
46863
+ entity: hoveredEntity,
46864
+ worldPos: startWorldPos
46865
+ },
46866
+ target: {
46867
+ entity: hoveredEntity,
46868
+ worldPos: pickResult.worldPos
46869
+ },
46870
+ approximate: true
46871
+ });
46872
+ }
46873
+ if (this.startDot) {
46874
+ this.startDot.setVisible(false);
46875
+ }
46876
+ state = 0;
46877
+ }
46878
+ }
46879
+ while (lastCanvasTouchPosList.length < touches.length) {
46880
+ lastCanvasTouchPosList.push(math.vec2());
46881
+ }
46882
+ for (let i = 0, len = touches.length; i < len; ++i) {
46883
+ getCanvasPosFromEvent$4(touches[i], lastCanvasTouchPosList[i]);
46884
+ }
46885
+ });
46886
+
46887
+ // canvas.addEventListener("touchmove", this._canvasTouchMoveHandler = (event) => {
46888
+ // // event.stopPropagation();
46889
+ // event.preventDefault();
46890
+ // if (this.startDot) {
46891
+ // this.startDot.setVisible(false);
46892
+ // }
46893
+ // state = 0;
46775
46894
  // });
46895
+
46896
+ // canvas.addEventListener("touchend", this._canvasTouchEndHandler = (event) => {
46776
46897
  //
46777
- // canvas.addEventListener("touchstart", this._canvasTouchStartHandler = (event) => {
46898
+ // event.stopPropagation();
46778
46899
  // event.preventDefault();
46900
+ //
46901
+ // const currentTime = Date.now();
46779
46902
  // const touches = event.touches;
46780
46903
  // const changedTouches = event.changedTouches;
46781
- // if (touches.length === 1 && changedTouches.length === 1) {
46782
- // getCanvasPosFromEvent(touches[0], tapStartCanvasPos);
46783
46904
  //
46784
- // if (pickSurfacePrecisionEnabled) {
46785
- // const pickResult = this.plugin.viewer.scene.pick({
46786
- // canvasPos: tapStartCanvasPos,
46787
- // pickSurface: true,
46788
- // // pickSurfacePrecision: true
46789
- // });
46790
- // if (pickResult && pickResult.worldPos) {
46791
- // // this._currentDistMeasurement.target.worldPos = pickResult.worldPos;
46905
+ // if (touches.length === 0 && changedTouches.length === 1) {
46906
+ //
46907
+ // if (tapStartTime > -1 && currentTime - tapStartTime < TAP_INTERVAL) {
46908
+ //
46909
+ // if (lastTapTime > -1 && tapStartTime - lastTapTime < DBL_TAP_INTERVAL) {
46910
+ //
46911
+ // // Double-tap
46912
+ //
46913
+ // getCanvasPosFromEvent(changedTouches[0], pickController.pickCursorPos);
46914
+ // pickController.schedulePickEntity = true;
46915
+ // pickController.schedulePickSurface = pickedSurfaceSubs;
46916
+ //
46917
+ // pickController.update();
46918
+ //
46919
+ // if (pickController.pickResult) {
46920
+ //
46921
+ // cameraControl.fire("doublePicked", pickController.pickResult);
46922
+ //
46923
+ // if (pickController.pickedSurface) {
46924
+ // cameraControl.fire("doublePickedSurface", pickController.pickResult);
46925
+ // }
46926
+ //
46927
+ // if (configs.doublePickFlyTo) {
46928
+ // flyCameraTo(pickController.pickResult);
46929
+ // }
46930
+ // } else {
46931
+ // cameraControl.fire("doublePickedNothing");
46932
+ // if (configs.doublePickFlyTo) {
46933
+ // flyCameraTo();
46934
+ // }
46935
+ // }
46936
+ //
46937
+ // lastTapTime = -1;
46938
+ //
46939
+ // } else if (math.distVec2(activeTouches[0], tapStartPos) < TAP_DISTANCE_THRESHOLD) {
46940
+ //
46941
+ // // Single-tap
46942
+ //
46943
+ // getCanvasPosFromEvent(changedTouches[0], pickController.pickCursorPos);
46944
+ // pickController.schedulePickEntity = true;
46945
+ // pickController.schedulePickSurface = pickedSurfaceSubs;
46946
+ //
46947
+ // pickController.update();
46948
+ //
46949
+ // if (pickController.pickResult) {
46950
+ //
46951
+ // cameraControl.fire("picked", pickController.pickResult);
46952
+ //
46953
+ // if (pickController.pickedSurface) {
46954
+ // cameraControl.fire("pickedSurface", pickController.pickResult);
46955
+ // }
46956
+ //
46957
+ // } else {
46958
+ // cameraControl.fire("pickedNothing");
46959
+ // }
46960
+ //
46961
+ // lastTapTime = currentTime;
46792
46962
  // }
46793
- // // this._currentDistMeasurement.approximate = false;
46794
- // }
46795
46963
  //
46796
- // // TODO: Create start of measurement
46797
- // }
46798
- // while (lastCanvasTouchPosList.length < touches.length) {
46799
- // lastCanvasTouchPosList.push(math.vec2());
46964
+ // tapStartTime = -1
46965
+ // }
46800
46966
  // }
46967
+ //
46968
+ // activeTouches.length = touches.length;
46969
+ //
46801
46970
  // for (let i = 0, len = touches.length; i < len; ++i) {
46802
- // getCanvasPosFromEvent(touches[i], lastCanvasTouchPosList[i]);
46971
+ // activeTouches[i][0] = touches[i].pageX;
46972
+ // activeTouches[i][1] = touches[i].pageY;
46803
46973
  // }
46804
- // numTouches = touches.length;
46805
- // });
46806
46974
  //
46807
- // canvas.addEventListener("touchmove", this._canvasTouchMoveHandler = (event) => {
46808
46975
  // event.stopPropagation();
46809
- // event.preventDefault();
46810
- // if (waitForTick) { // Limit changes detection to one per frame
46811
- // return;
46812
- // }
46813
- // waitForTick = true;
46814
- // const touches = event.touches;
46815
- // if (event.touches.length !== numTouches) {
46816
- // // Two fingers were pressed, then one of them is removed
46817
- // return;
46818
- // }
46819
- // if (numTouches === 1) {
46820
- // getCanvasPosFromEvent(touches[0], tapCanvasPos0);
46821
- // // TODO: update end of distance measurement
46822
- // }
46823
- // for (let i = 0; i < numTouches; ++i) {
46824
- // getCanvasPosFromEvent(touches[i], lastCanvasTouchPosList[i]);
46825
- // }
46826
- // });
46976
+ //
46977
+ // }, {passive: true});
46827
46978
 
46828
46979
  //-------------------------------------------------------------------------------------------------------------
46829
46980
 
@@ -46890,9 +47041,28 @@ class DistanceMeasurementsControl extends Component {
46890
47041
  this.deactivate();
46891
47042
  super.destroy();
46892
47043
  }
46893
-
46894
47044
  }
46895
47045
 
47046
+ const getCanvasPosFromEvent$4 = function (event, canvasPos) {
47047
+ if (!event) {
47048
+ event = window.event;
47049
+ canvasPos[0] = event.x;
47050
+ canvasPos[1] = event.y;
47051
+ } else {
47052
+ let element = event.target;
47053
+ let totalOffsetLeft = 0;
47054
+ let totalOffsetTop = 0;
47055
+ while (element.offsetParent) {
47056
+ totalOffsetLeft += element.offsetLeft;
47057
+ totalOffsetTop += element.offsetTop;
47058
+ element = element.offsetParent;
47059
+ }
47060
+ canvasPos[0] = event.pageX - totalOffsetLeft;
47061
+ canvasPos[1] = event.pageY - totalOffsetTop;
47062
+ }
47063
+ return canvasPos;
47064
+ };
47065
+
46896
47066
  /**
46897
47067
  * {@link Viewer} plugin for measuring point-to-point distances.
46898
47068
  *
@@ -155929,8 +156099,9 @@ class MousePanRotateDollyHandler {
155929
156099
  // Scaling drag-rotate to canvas boundary
155930
156100
 
155931
156101
  const canvasBoundary = scene.canvas.boundary;
155932
- const canvasWidth = canvasBoundary[2] - canvasBoundary[0];
155933
- const canvasHeight = canvasBoundary[3] - canvasBoundary[1];
156102
+
156103
+ const canvasWidth = canvasBoundary[2];
156104
+ const canvasHeight = canvasBoundary[3];
155934
156105
  const x = states.pointerCanvasPos[0];
155935
156106
  const y = states.pointerCanvasPos[1];
155936
156107
 
@@ -157255,8 +157426,8 @@ class TouchPanRotateAndDollyHandler {
157255
157426
  // Scaling drag-rotate to canvas boundary
157256
157427
 
157257
157428
  const canvasBoundary = scene.canvas.boundary;
157258
- const canvasWidth = canvasBoundary[2] - canvasBoundary[0];
157259
- const canvasHeight = canvasBoundary[3] - canvasBoundary[1];
157429
+ const canvasWidth = canvasBoundary[2];
157430
+ const canvasHeight = canvasBoundary[3];
157260
157431
 
157261
157432
  const touches = event.touches;
157262
157433
 
@@ -157532,6 +157703,8 @@ class TouchPickHandler {
157532
157703
 
157533
157704
  if (pickController.pickResult) {
157534
157705
 
157706
+ pickController.pickResult.touchInput = true;
157707
+
157535
157708
  cameraControl.fire("doublePicked", pickController.pickResult);
157536
157709
 
157537
157710
  if (pickController.pickedSurface) {
@@ -157562,6 +157735,8 @@ class TouchPickHandler {
157562
157735
 
157563
157736
  if (pickController.pickResult) {
157564
157737
 
157738
+ pickController.pickResult.touchInput = true;
157739
+
157565
157740
  cameraControl.fire("picked", pickController.pickResult);
157566
157741
 
157567
157742
  if (pickController.pickedSurface) {
@@ -157586,7 +157761,7 @@ class TouchPickHandler {
157586
157761
  activeTouches[i][1] = touches[i].pageY;
157587
157762
  }
157588
157763
 
157589
- e.stopPropagation();
157764
+ // e.stopPropagation();
157590
157765
 
157591
157766
  }, {passive: true});
157592
157767
 
@@ -159737,7 +159912,6 @@ class PropertySet {
159737
159912
  *
159738
159913
  * * Located in {@link Viewer#metaScene}.
159739
159914
  * * Contains {@link MetaModel}s and {@link MetaObject}s.
159740
- * * [Scene Graphs user guide](https://github.com/xeokit/xeokit-sdk/wiki/Scene-Graphs)
159741
159915
  * * [Scene graph example with metadata](http://xeokit.github.io/xeokit-sdk/examples/#sceneRepresentation_SceneGraph_metadata)
159742
159916
  */
159743
159917
  class MetaScene {