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