@xeokit/xeokit-sdk 2.3.0-beta-25 → 2.3.0-beta-28

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.
@@ -8873,7 +8873,7 @@ function worldToRTCPos(worldPos, rtcCenter, rtcPos) {
8873
8873
  * ````false````, we can safely ignore the data returned in ````rtcPositions```` and ````rtcCenter````,
8874
8874
  * since ````rtcCenter```` will equal ````[0,0,0]````, and ````rtcPositions```` will contain identical values to ````positions````.
8875
8875
  */
8876
- function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize = 1000000) {
8876
+ function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize = 1000) {
8877
8877
 
8878
8878
  const center = math.getPositionsCenter(worldPositions, tempVec3a$14);
8879
8879
 
@@ -9600,21 +9600,34 @@ class AngleMeasurement extends Component {
9600
9600
 
9601
9601
  this._originDot = new Dot(this._container, {
9602
9602
  fillColor: this._color,
9603
- zIndex: plugin.zIndex + 1
9603
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
9604
9604
  });
9605
9605
  this._cornerDot = new Dot(this._container, {
9606
9606
  fillColor: this._color,
9607
- zIndex: plugin.zIndex + 1
9607
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
9608
9608
  });
9609
9609
  this._targetDot = new Dot(this._container, {
9610
9610
  fillColor: this._color,
9611
- zIndex: plugin.zIndex + 1
9611
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
9612
9612
  });
9613
9613
 
9614
- this._originWire = new Wire(this._container, {color: this._color || "blue", thickness: 1, zIndex: plugin.zIndex});
9615
- this._targetWire = new Wire(this._container, {color: this._color || "red", thickness: 1, zIndex: plugin.zIndex});
9614
+ this._originWire = new Wire(this._container, {
9615
+ color: this._color || "blue",
9616
+ thickness: 1,
9617
+ zIndex: plugin.zIndex
9618
+ });
9619
+ this._targetWire = new Wire(this._container, {
9620
+ color: this._color || "red",
9621
+ thickness: 1,
9622
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
9623
+ });
9616
9624
 
9617
- this._angleLabel = new Label(this._container, {fillColor: this._color || "#00BBFF", prefix: "", text: "", zIndex: plugin.zIndex + 2});
9625
+ this._angleLabel = new Label(this._container, {
9626
+ fillColor: this._color || "#00BBFF",
9627
+ prefix: "",
9628
+ text: "",
9629
+ zIndex: plugin.zIndex + 2
9630
+ });
9618
9631
 
9619
9632
  this._wpDirty = false;
9620
9633
  this._vpDirty = false;
@@ -10137,12 +10150,6 @@ class AngleMeasurementsControl extends Component {
10137
10150
  return;
10138
10151
  }
10139
10152
 
10140
- this.startDot = new Dot(this.plugin._container,
10141
- {
10142
- fillColor: this.plugin.defaultColor,
10143
- zIndex: this.plugin.zIndex + 1
10144
- });
10145
-
10146
10153
  const plugin = this.plugin;
10147
10154
  const scene = this.scene;
10148
10155
  const cameraControl = plugin.viewer.cameraControl;
@@ -10212,7 +10219,7 @@ class AngleMeasurementsControl extends Component {
10212
10219
  const pickResult = scene.pick({
10213
10220
  canvasPos: mouseHoverCanvasPos,
10214
10221
  pickSurface: true,
10215
- pickSurfacePrecision: true
10222
+ pickSurfacePrecision: pickSurfacePrecisionEnabled
10216
10223
  });
10217
10224
  if (pickResult && pickResult.worldPos) {
10218
10225
  worldPos.set(pickResult.worldPos);
@@ -10300,9 +10307,7 @@ class AngleMeasurementsControl extends Component {
10300
10307
  });
10301
10308
 
10302
10309
  this._onHoverNothing = cameraControl.on("hoverOff", event => {
10303
- if (this.startDot) {
10304
- this.startDot.setVisible(false);
10305
- }
10310
+
10306
10311
  isMouseHoveringEntity = false;
10307
10312
  if (this._currentAngleMeasurement) {
10308
10313
  switch (this._state) {
@@ -10422,11 +10427,6 @@ class AngleMeasurementsControl extends Component {
10422
10427
  return;
10423
10428
  }
10424
10429
 
10425
- if (this.startDot) {
10426
- this.startDot.destroy();
10427
- this.startDot = null;
10428
- }
10429
-
10430
10430
  this.reset();
10431
10431
 
10432
10432
  const input = this.plugin.viewer.scene.input;
@@ -10644,7 +10644,7 @@ class AngleMeasurementsPlugin extends Plugin {
10644
10644
  this._measurements = {};
10645
10645
 
10646
10646
  this.defaultColor = cfg.defaultColor;
10647
- this.zIndex = cfg.zIndex;
10647
+ this.zIndex = cfg.zIndex || 10000;
10648
10648
  }
10649
10649
 
10650
10650
  /**
@@ -46202,64 +46202,64 @@ class DistanceMeasurement extends Component {
46202
46202
 
46203
46203
  this._originDot = new Dot(this._container, {
46204
46204
  fillColor: this._color,
46205
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46205
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46206
46206
  });
46207
46207
 
46208
46208
  this._targetDot = new Dot(this._container, {
46209
46209
  fillColor: this._color,
46210
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46210
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46211
46211
  });
46212
46212
 
46213
46213
  this._lengthWire = new Wire(this._container, {
46214
46214
  color: this._color,
46215
46215
  thickness: 2,
46216
- zIndex: plugin.zIndex
46216
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46217
46217
  });
46218
46218
 
46219
46219
  this._xAxisWire = new Wire(this._container, {
46220
46220
  color: "red",
46221
46221
  thickness: 1,
46222
- zIndex: plugin.zIndex
46222
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46223
46223
  });
46224
46224
 
46225
46225
  this._yAxisWire = new Wire(this._container, {
46226
46226
  color: "green",
46227
46227
  thickness: 1,
46228
- zIndex: plugin.zIndex
46228
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46229
46229
  });
46230
46230
 
46231
46231
  this._zAxisWire = new Wire(this._container, {
46232
46232
  color: "blue",
46233
46233
  thickness: 1,
46234
- zIndex: plugin.zIndex
46234
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46235
46235
  });
46236
46236
 
46237
46237
  this._lengthLabel = new Label(this._container, {
46238
46238
  fillColor: this._color,
46239
46239
  prefix: "",
46240
46240
  text: "",
46241
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46241
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 4: undefined
46242
46242
  });
46243
46243
 
46244
46244
  this._xAxisLabel = new Label(this._container, {
46245
46245
  fillColor: "red",
46246
46246
  prefix: "X",
46247
46247
  text: "",
46248
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46248
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3: undefined
46249
46249
  });
46250
46250
 
46251
46251
  this._yAxisLabel = new Label(this._container, {
46252
46252
  fillColor: "green",
46253
46253
  prefix: "Y",
46254
46254
  text: "",
46255
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46255
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3: undefined
46256
46256
  });
46257
46257
 
46258
46258
  this._zAxisLabel = new Label(this._container, {
46259
46259
  fillColor: "blue",
46260
46260
  prefix: "Z",
46261
46261
  text: "",
46262
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46262
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3: undefined
46263
46263
  });
46264
46264
 
46265
46265
  this._wpDirty = false;
@@ -86753,7 +86753,7 @@ class DistanceMeasurementsControl extends Component {
86753
86753
  const pickResult = scene.pick({
86754
86754
  canvasPos: touchEndCanvasPos,
86755
86755
  pickSurface: true,
86756
- pickSurfacePrecision: false
86756
+ pickSurfacePrecision: pickSurfacePrecisionEnabled
86757
86757
  });
86758
86758
  if (pickResult && pickResult.worldPos) {
86759
86759
  switch (touchState) {
@@ -86776,7 +86776,7 @@ class DistanceMeasurementsControl extends Component {
86776
86776
  entity: mouseHoverEntity,
86777
86777
  worldPos: pickResult.worldPos
86778
86778
  },
86779
- approximate: true
86779
+ approximate: (!pickSurfacePrecisionEnabled)
86780
86780
  });
86781
86781
  touchState = FIRST_TOUCH_EXPECTED;
86782
86782
  break;
@@ -87039,7 +87039,7 @@ class DistanceMeasurementsPlugin extends Plugin {
87039
87039
  this.defaultWireVisible = cfg.defaultWireVisible !== false;
87040
87040
  this.defaultAxisVisible = cfg.defaultAxisVisible !== false;
87041
87041
  this.defaultColor = cfg.defaultColor !== undefined ? cfg.defaultColor : "#00BBFF";
87042
- this.zIndex = cfg.zIndex;
87042
+ this.zIndex = cfg.zIndex || 10000;
87043
87043
  }
87044
87044
 
87045
87045
  /**
@@ -8869,7 +8869,7 @@ function worldToRTCPos(worldPos, rtcCenter, rtcPos) {
8869
8869
  * ````false````, we can safely ignore the data returned in ````rtcPositions```` and ````rtcCenter````,
8870
8870
  * since ````rtcCenter```` will equal ````[0,0,0]````, and ````rtcPositions```` will contain identical values to ````positions````.
8871
8871
  */
8872
- function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize = 1000000) {
8872
+ function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize = 1000) {
8873
8873
 
8874
8874
  const center = math.getPositionsCenter(worldPositions, tempVec3a$14);
8875
8875
 
@@ -9596,21 +9596,34 @@ class AngleMeasurement extends Component {
9596
9596
 
9597
9597
  this._originDot = new Dot(this._container, {
9598
9598
  fillColor: this._color,
9599
- zIndex: plugin.zIndex + 1
9599
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
9600
9600
  });
9601
9601
  this._cornerDot = new Dot(this._container, {
9602
9602
  fillColor: this._color,
9603
- zIndex: plugin.zIndex + 1
9603
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
9604
9604
  });
9605
9605
  this._targetDot = new Dot(this._container, {
9606
9606
  fillColor: this._color,
9607
- zIndex: plugin.zIndex + 1
9607
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
9608
9608
  });
9609
9609
 
9610
- this._originWire = new Wire(this._container, {color: this._color || "blue", thickness: 1, zIndex: plugin.zIndex});
9611
- this._targetWire = new Wire(this._container, {color: this._color || "red", thickness: 1, zIndex: plugin.zIndex});
9610
+ this._originWire = new Wire(this._container, {
9611
+ color: this._color || "blue",
9612
+ thickness: 1,
9613
+ zIndex: plugin.zIndex
9614
+ });
9615
+ this._targetWire = new Wire(this._container, {
9616
+ color: this._color || "red",
9617
+ thickness: 1,
9618
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
9619
+ });
9612
9620
 
9613
- this._angleLabel = new Label(this._container, {fillColor: this._color || "#00BBFF", prefix: "", text: "", zIndex: plugin.zIndex + 2});
9621
+ this._angleLabel = new Label(this._container, {
9622
+ fillColor: this._color || "#00BBFF",
9623
+ prefix: "",
9624
+ text: "",
9625
+ zIndex: plugin.zIndex + 2
9626
+ });
9614
9627
 
9615
9628
  this._wpDirty = false;
9616
9629
  this._vpDirty = false;
@@ -10133,12 +10146,6 @@ class AngleMeasurementsControl extends Component {
10133
10146
  return;
10134
10147
  }
10135
10148
 
10136
- this.startDot = new Dot(this.plugin._container,
10137
- {
10138
- fillColor: this.plugin.defaultColor,
10139
- zIndex: this.plugin.zIndex + 1
10140
- });
10141
-
10142
10149
  const plugin = this.plugin;
10143
10150
  const scene = this.scene;
10144
10151
  const cameraControl = plugin.viewer.cameraControl;
@@ -10208,7 +10215,7 @@ class AngleMeasurementsControl extends Component {
10208
10215
  const pickResult = scene.pick({
10209
10216
  canvasPos: mouseHoverCanvasPos,
10210
10217
  pickSurface: true,
10211
- pickSurfacePrecision: true
10218
+ pickSurfacePrecision: pickSurfacePrecisionEnabled
10212
10219
  });
10213
10220
  if (pickResult && pickResult.worldPos) {
10214
10221
  worldPos.set(pickResult.worldPos);
@@ -10296,9 +10303,7 @@ class AngleMeasurementsControl extends Component {
10296
10303
  });
10297
10304
 
10298
10305
  this._onHoverNothing = cameraControl.on("hoverOff", event => {
10299
- if (this.startDot) {
10300
- this.startDot.setVisible(false);
10301
- }
10306
+
10302
10307
  isMouseHoveringEntity = false;
10303
10308
  if (this._currentAngleMeasurement) {
10304
10309
  switch (this._state) {
@@ -10418,11 +10423,6 @@ class AngleMeasurementsControl extends Component {
10418
10423
  return;
10419
10424
  }
10420
10425
 
10421
- if (this.startDot) {
10422
- this.startDot.destroy();
10423
- this.startDot = null;
10424
- }
10425
-
10426
10426
  this.reset();
10427
10427
 
10428
10428
  const input = this.plugin.viewer.scene.input;
@@ -10640,7 +10640,7 @@ class AngleMeasurementsPlugin extends Plugin {
10640
10640
  this._measurements = {};
10641
10641
 
10642
10642
  this.defaultColor = cfg.defaultColor;
10643
- this.zIndex = cfg.zIndex;
10643
+ this.zIndex = cfg.zIndex || 10000;
10644
10644
  }
10645
10645
 
10646
10646
  /**
@@ -46198,64 +46198,64 @@ class DistanceMeasurement extends Component {
46198
46198
 
46199
46199
  this._originDot = new Dot(this._container, {
46200
46200
  fillColor: this._color,
46201
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46201
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46202
46202
  });
46203
46203
 
46204
46204
  this._targetDot = new Dot(this._container, {
46205
46205
  fillColor: this._color,
46206
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46206
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46207
46207
  });
46208
46208
 
46209
46209
  this._lengthWire = new Wire(this._container, {
46210
46210
  color: this._color,
46211
46211
  thickness: 2,
46212
- zIndex: plugin.zIndex
46212
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46213
46213
  });
46214
46214
 
46215
46215
  this._xAxisWire = new Wire(this._container, {
46216
46216
  color: "red",
46217
46217
  thickness: 1,
46218
- zIndex: plugin.zIndex
46218
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46219
46219
  });
46220
46220
 
46221
46221
  this._yAxisWire = new Wire(this._container, {
46222
46222
  color: "green",
46223
46223
  thickness: 1,
46224
- zIndex: plugin.zIndex
46224
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46225
46225
  });
46226
46226
 
46227
46227
  this._zAxisWire = new Wire(this._container, {
46228
46228
  color: "blue",
46229
46229
  thickness: 1,
46230
- zIndex: plugin.zIndex
46230
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined
46231
46231
  });
46232
46232
 
46233
46233
  this._lengthLabel = new Label(this._container, {
46234
46234
  fillColor: this._color,
46235
46235
  prefix: "",
46236
46236
  text: "",
46237
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46237
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 4: undefined
46238
46238
  });
46239
46239
 
46240
46240
  this._xAxisLabel = new Label(this._container, {
46241
46241
  fillColor: "red",
46242
46242
  prefix: "X",
46243
46243
  text: "",
46244
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46244
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3: undefined
46245
46245
  });
46246
46246
 
46247
46247
  this._yAxisLabel = new Label(this._container, {
46248
46248
  fillColor: "green",
46249
46249
  prefix: "Y",
46250
46250
  text: "",
46251
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46251
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3: undefined
46252
46252
  });
46253
46253
 
46254
46254
  this._zAxisLabel = new Label(this._container, {
46255
46255
  fillColor: "blue",
46256
46256
  prefix: "Z",
46257
46257
  text: "",
46258
- zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined
46258
+ zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3: undefined
46259
46259
  });
46260
46260
 
46261
46261
  this._wpDirty = false;
@@ -86749,7 +86749,7 @@ class DistanceMeasurementsControl extends Component {
86749
86749
  const pickResult = scene.pick({
86750
86750
  canvasPos: touchEndCanvasPos,
86751
86751
  pickSurface: true,
86752
- pickSurfacePrecision: false
86752
+ pickSurfacePrecision: pickSurfacePrecisionEnabled
86753
86753
  });
86754
86754
  if (pickResult && pickResult.worldPos) {
86755
86755
  switch (touchState) {
@@ -86772,7 +86772,7 @@ class DistanceMeasurementsControl extends Component {
86772
86772
  entity: mouseHoverEntity,
86773
86773
  worldPos: pickResult.worldPos
86774
86774
  },
86775
- approximate: true
86775
+ approximate: (!pickSurfacePrecisionEnabled)
86776
86776
  });
86777
86777
  touchState = FIRST_TOUCH_EXPECTED;
86778
86778
  break;
@@ -87035,7 +87035,7 @@ class DistanceMeasurementsPlugin extends Plugin {
87035
87035
  this.defaultWireVisible = cfg.defaultWireVisible !== false;
87036
87036
  this.defaultAxisVisible = cfg.defaultAxisVisible !== false;
87037
87037
  this.defaultColor = cfg.defaultColor !== undefined ? cfg.defaultColor : "#00BBFF";
87038
- this.zIndex = cfg.zIndex;
87038
+ this.zIndex = cfg.zIndex || 10000;
87039
87039
  }
87040
87040
 
87041
87041
  /**