@vertexvis/viewer 0.13.2-canary.4 → 0.13.2-canary.7

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.
Files changed (136) hide show
  1. package/dist/cjs/{browser.esm-c51162f8.js → browser.esm-075810bf.js} +1 -1
  2. package/dist/cjs/{bundle.esm-1b8b1f36.js → bundle.esm-618a5fe9.js} +47 -29
  3. package/dist/cjs/{config-74a42c43.js → config-fb124bac.js} +2 -2
  4. package/dist/cjs/{cursors-14827f58.js → cursors-d71f6a74.js} +1 -1
  5. package/dist/cjs/{dom-c697cf99.js → dom-57ef84e9.js} +1 -1
  6. package/dist/cjs/{entities-4e61087e.js → entities-90f1347a.js} +3 -3
  7. package/dist/cjs/index.cjs.js +12 -12
  8. package/dist/cjs/{mapper-1aafd2e8.js → mapper-80ee2957.js} +2 -2
  9. package/dist/cjs/{markup-835f2e83.js → markup-7f7de5f2.js} +2 -2
  10. package/dist/cjs/{measurement-8e0ce89a.js → measurement-f1ae9248.js} +2 -2
  11. package/dist/cjs/{model-78241d4f.js → model-55abd9ab.js} +1 -1
  12. package/dist/cjs/{overlays-06786e52.js → overlays-68e8eff2.js} +2 -2
  13. package/dist/cjs/{png-decoder-01b76242.js → png-decoder-076131d8.js} +1 -1
  14. package/dist/cjs/{results-7a694238.js → results-e9496869.js} +1 -1
  15. package/dist/cjs/{scene-91da8d7b.js → scene-92728420.js} +29 -24
  16. package/dist/cjs/{streamAttributes-2061be12.js → streamAttributes-81eb52f2.js} +90 -28
  17. package/dist/cjs/{utils-5cc32a26.js → utils-463cd52e.js} +1 -1
  18. package/dist/cjs/{utils-4a02e54b.js → utils-6397efca.js} +1 -1
  19. package/dist/cjs/vertex-scene-tree-search_3.cjs.entry.js +1 -1
  20. package/dist/cjs/vertex-scene-tree.cjs.entry.js +4 -4
  21. package/dist/cjs/vertex-viewer-dom-element_3.cjs.entry.js +8 -7
  22. package/dist/cjs/vertex-viewer-markup-arrow_3.cjs.entry.js +3 -3
  23. package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js +4 -4
  24. package/dist/cjs/vertex-viewer-markup.cjs.entry.js +4 -4
  25. package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +3 -3
  26. package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +20 -15
  27. package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +6 -6
  28. package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +10 -10
  29. package/dist/cjs/vertex-viewer-measurement-tool.cjs.entry.js +5 -5
  30. package/dist/cjs/vertex-viewer-measurements.cjs.entry.js +8 -8
  31. package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +3 -3
  32. package/dist/cjs/vertex-viewer.cjs.entry.js +96 -9
  33. package/dist/cjs/{viewport-052809c7.js → viewport-54b1389d.js} +34 -2
  34. package/dist/collection/components/viewer/viewer.js +3 -2
  35. package/dist/collection/components/viewer-dom-renderer/renderer3d.js +4 -2
  36. package/dist/collection/components/viewer-dom-renderer/viewer-dom-renderer.js +2 -3
  37. package/dist/collection/components/viewer-measurement-distance/hitTest.js +9 -4
  38. package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js +2 -2
  39. package/dist/collection/lib/interactions/interactionApi.js +1 -1
  40. package/dist/collection/lib/interactions/interactionApiOrthographic.js +88 -2
  41. package/dist/collection/lib/rendering/vectors.js +7 -0
  42. package/dist/collection/lib/scenes/camera.js +29 -23
  43. package/dist/collection/lib/types/clippingPlanes.js +11 -20
  44. package/dist/collection/lib/types/depthBuffer.js +32 -3
  45. package/dist/collection/lib/types/frame.js +35 -3
  46. package/dist/collection/lib/types/frameCamera.js +9 -5
  47. package/dist/collection/lib/types/viewport.js +34 -2
  48. package/dist/collection/testing/fixtures.js +7 -7
  49. package/dist/custom-elements/index.js +301 -93
  50. package/dist/esm/{browser.esm-48f051a3.js → browser.esm-e72d80ad.js} +1 -1
  51. package/dist/esm/{bundle.esm-df3a8a42.js → bundle.esm-8ceccb91.js} +47 -30
  52. package/dist/esm/{config-7f4ced8e.js → config-fb7cd8ff.js} +2 -2
  53. package/dist/esm/{cursors-45f23dfe.js → cursors-fc2deed7.js} +1 -1
  54. package/dist/esm/{dom-18d9ac79.js → dom-2cd18856.js} +1 -1
  55. package/dist/esm/{entities-4ca10ddf.js → entities-78557270.js} +3 -3
  56. package/dist/esm/index.js +12 -12
  57. package/dist/esm/index.mjs +12 -12
  58. package/dist/esm/{mapper-58106502.js → mapper-da36de17.js} +2 -2
  59. package/dist/esm/{markup-accb6b5c.js → markup-c313d99c.js} +2 -2
  60. package/dist/esm/{measurement-6cd457a6.js → measurement-544b69d5.js} +2 -2
  61. package/dist/esm/{model-4982c15d.js → model-2a34b443.js} +1 -1
  62. package/dist/esm/{overlays-1783a61a.js → overlays-354e275c.js} +2 -2
  63. package/dist/esm/{png-decoder-f35def4c.js → png-decoder-07de80d1.js} +1 -1
  64. package/dist/esm/{results-93d45acc.js → results-4d0c3568.js} +1 -1
  65. package/dist/esm/{scene-a86ff83b.js → scene-2bfcce74.js} +30 -25
  66. package/dist/esm/{streamAttributes-232037fe.js → streamAttributes-d0b384b3.js} +92 -31
  67. package/dist/esm/{utils-ed2346c0.js → utils-3ea0acdd.js} +1 -1
  68. package/dist/esm/{utils-9f4b25ec.js → utils-e0941c61.js} +1 -1
  69. package/dist/esm/vertex-scene-tree-search_3.entry.js +1 -1
  70. package/dist/esm/vertex-scene-tree.entry.js +4 -4
  71. package/dist/esm/vertex-viewer-dom-element_3.entry.js +8 -7
  72. package/dist/esm/vertex-viewer-markup-arrow_3.entry.js +3 -3
  73. package/dist/esm/vertex-viewer-markup-tool.entry.js +4 -4
  74. package/dist/esm/vertex-viewer-markup.entry.js +4 -4
  75. package/dist/esm/vertex-viewer-measurement-details.entry.js +3 -3
  76. package/dist/esm/vertex-viewer-measurement-distance.entry.js +20 -15
  77. package/dist/esm/vertex-viewer-measurement-line_2.entry.js +6 -6
  78. package/dist/esm/vertex-viewer-measurement-precise.entry.js +10 -10
  79. package/dist/esm/vertex-viewer-measurement-tool.entry.js +5 -5
  80. package/dist/esm/vertex-viewer-measurements.entry.js +8 -8
  81. package/dist/esm/vertex-viewer-view-cube.entry.js +3 -3
  82. package/dist/esm/vertex-viewer.entry.js +96 -9
  83. package/dist/esm/{viewport-6d4c0af0.js → viewport-5cc7b128.js} +34 -2
  84. package/dist/types/components/viewer-measurement-distance/hitTest.d.ts +3 -2
  85. package/dist/types/lib/interactions/interactionApi.d.ts +14 -5
  86. package/dist/types/lib/interactions/interactionApiOrthographic.d.ts +16 -2
  87. package/dist/types/lib/rendering/vectors.d.ts +2 -0
  88. package/dist/types/lib/scenes/camera.d.ts +1 -1
  89. package/dist/types/lib/types/depthBuffer.d.ts +24 -2
  90. package/dist/types/lib/types/frame.d.ts +22 -0
  91. package/dist/types/lib/types/frameCamera.d.ts +2 -2
  92. package/dist/types/lib/types/viewport.d.ts +22 -1
  93. package/dist/types/testing/fixtures.d.ts +4 -3
  94. package/dist/viewer/index.esm.js +1 -1
  95. package/dist/viewer/{p-f50c6c28.entry.js → p-0a189e62.entry.js} +1 -1
  96. package/dist/viewer/{p-fa7f2d0c.entry.js → p-1ca95f9a.entry.js} +1 -1
  97. package/dist/viewer/{p-6120a219.js → p-3561d910.js} +1 -1
  98. package/dist/viewer/p-388a43f7.js +4 -0
  99. package/dist/viewer/{p-9fd5fc8e.js → p-3f0f83ad.js} +1 -1
  100. package/dist/viewer/{p-8de749a5.entry.js → p-41028d3b.entry.js} +1 -1
  101. package/dist/viewer/{p-b8f027eb.js → p-487e054a.js} +1 -1
  102. package/dist/viewer/p-5212dd2b.entry.js +4 -0
  103. package/dist/viewer/{p-25dfee48.js → p-5b342e97.js} +1 -1
  104. package/dist/viewer/{p-121f2b40.js → p-661f0612.js} +1 -1
  105. package/dist/viewer/{p-049e395f.js → p-69058178.js} +1 -1
  106. package/dist/viewer/{p-e74aac0b.entry.js → p-73a5eacc.entry.js} +1 -1
  107. package/dist/viewer/p-77be081a.js +4 -0
  108. package/dist/viewer/{p-fc4da417.js → p-809d09d9.js} +1 -1
  109. package/dist/viewer/{p-9434dfdf.entry.js → p-858bd2c7.entry.js} +1 -1
  110. package/dist/viewer/{p-19238260.entry.js → p-89b66838.entry.js} +1 -1
  111. package/dist/viewer/p-a93a63a9.js +4 -0
  112. package/dist/viewer/{p-e8f6cba6.entry.js → p-b043b076.entry.js} +1 -1
  113. package/dist/viewer/{p-1f24f73d.entry.js → p-b0ac6b3c.entry.js} +1 -1
  114. package/dist/viewer/{p-62d7468a.js → p-b8774c9c.js} +1 -1
  115. package/dist/viewer/{p-463151e0.js → p-bcb66f97.js} +1 -1
  116. package/dist/viewer/p-bcde5521.entry.js +4 -0
  117. package/dist/viewer/{p-38c06c25.js → p-d1584404.js} +1 -1
  118. package/dist/viewer/p-d32b54cb.js +4 -0
  119. package/dist/viewer/p-d3a20af4.entry.js +4 -0
  120. package/dist/viewer/{p-81ae0d6c.entry.js → p-d9f99f4d.entry.js} +1 -1
  121. package/dist/viewer/p-e38458da.js +4 -0
  122. package/dist/viewer/{p-546ae240.js → p-e75bba97.js} +2 -2
  123. package/dist/viewer/{p-d71a3bbb.entry.js → p-ebd55df7.entry.js} +1 -1
  124. package/dist/viewer/{p-65cd9cdd.entry.js → p-f0411993.entry.js} +1 -1
  125. package/dist/viewer/{p-ce0fe8be.js → p-fa9a0bed.js} +1 -1
  126. package/dist/viewer/{p-9b1ecc71.js → p-ffdeb08c.js} +1 -1
  127. package/dist/viewer/viewer.esm.js +1 -1
  128. package/package.json +7 -7
  129. package/dist/viewer/p-014561cd.js +0 -4
  130. package/dist/viewer/p-4be36b12.js +0 -4
  131. package/dist/viewer/p-58c3206a.entry.js +0 -4
  132. package/dist/viewer/p-8df35eee.js +0 -4
  133. package/dist/viewer/p-b11fb20d.js +0 -4
  134. package/dist/viewer/p-c2201bb2.entry.js +0 -4
  135. package/dist/viewer/p-d939ecd3.entry.js +0 -4
  136. package/dist/viewer/p-e3fff448.js +0 -4
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const bundle_esm = require('./bundle.esm-1b8b1f36.js');
6
+ const bundle_esm = require('./bundle.esm-618a5fe9.js');
7
7
 
8
8
  /**
9
9
  * Adds a listener to the given `target`, and returns a promise that
@@ -151,7 +151,7 @@ function lerp$2(a, b, t) {
151
151
  /**
152
152
  * Returns a new `Point` with the given horizontal and vertical position.
153
153
  */
154
- function create$b(x, y) {
154
+ function create$c(x, y) {
155
155
  if (x === void 0) { x = 0; }
156
156
  if (y === void 0) { y = 0; }
157
157
  return { x: x, y: y };
@@ -162,7 +162,7 @@ function create$b(x, y) {
162
162
  function polar(length, radians) {
163
163
  var x = Math.cos(radians) * length;
164
164
  var y = Math.sin(radians) * length;
165
- return create$b(x, y);
165
+ return create$c(x, y);
166
166
  }
167
167
  /**
168
168
  * Returns the distance between two points.
@@ -208,7 +208,7 @@ function lerp$1(a, b, t) {
208
208
  * Returns a new `Point` where `x` and `y` are inverted.
209
209
  */
210
210
  function negate$1(pt) {
211
- return create$b(-pt.x, -pt.y);
211
+ return create$c(-pt.x, -pt.y);
212
212
  }
213
213
  /**
214
214
  * Returns a new `Point` where `x` and `y` are multiplied by the given scale
@@ -230,17 +230,17 @@ function fromJson$4(json) {
230
230
  var obj = JSON.parse(json);
231
231
  if (Array.isArray(obj)) {
232
232
  var x = obj[0], y = obj[1];
233
- return create$b(x, y);
233
+ return create$c(x, y);
234
234
  }
235
235
  else {
236
236
  var x = obj.x, y = obj.y;
237
- return create$b(x, y);
237
+ return create$c(x, y);
238
238
  }
239
239
  }
240
240
 
241
241
  var point = /*#__PURE__*/Object.freeze({
242
242
  __proto__: null,
243
- create: create$b,
243
+ create: create$c,
244
244
  polar: polar,
245
245
  distance: distance$2,
246
246
  subtract: subtract$1,
@@ -565,7 +565,7 @@ function makeOrthographic(left, right, bottom, top, near, far) {
565
565
  var d = 1.0 / (far - near);
566
566
  var x = (right + left) * w;
567
567
  var y = (top + bottom) * h;
568
- var z = (far + near) / d;
568
+ var z = (far + near) * d;
569
569
  /* eslint-disable prettier/prettier */
570
570
  return [
571
571
  2 * w, 0, 0, -x,
@@ -848,7 +848,7 @@ var matrix4 = /*#__PURE__*/Object.freeze({
848
848
  isType: isType$2
849
849
  });
850
850
 
851
- function create$a() {
851
+ function create$b() {
852
852
  var _a, _b, _c, _d, _e, _f;
853
853
  var args = [];
854
854
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -912,11 +912,11 @@ function fromJson$3(json) {
912
912
  var obj = JSON.parse(json);
913
913
  if (Array.isArray(obj)) {
914
914
  var x = obj[0], y = obj[1], z = obj[2];
915
- return create$a(x, y, z);
915
+ return create$b(x, y, z);
916
916
  }
917
917
  else {
918
918
  var x = obj.x, y = obj.y, z = obj.z;
919
- return create$a(x, y, z);
919
+ return create$b(x, y, z);
920
920
  }
921
921
  }
922
922
  /**
@@ -931,7 +931,7 @@ function fromArray(nums, offset) {
931
931
  var x = nums[offset];
932
932
  var y = nums[offset + 1];
933
933
  var z = nums[offset + 2];
934
- return create$a(x, y, z);
934
+ return create$b(x, y, z);
935
935
  }
936
936
  /**
937
937
  * Converts a Vector3 to an array where the values of the vector will be
@@ -948,43 +948,43 @@ function toArray(_a) {
948
948
  * Returns a directional vector on the positive x axis, Vector3(1, 0, 0).
949
949
  */
950
950
  function right() {
951
- return create$a(1, 0, 0);
951
+ return create$b(1, 0, 0);
952
952
  }
953
953
  /**
954
954
  * Returns a directional vector on the positive y axis, Vector3(0, 1, 0).
955
955
  */
956
956
  function up() {
957
- return create$a(0, 1, 0);
957
+ return create$b(0, 1, 0);
958
958
  }
959
959
  /**
960
960
  * Returns a directional vector on the positive z axis, Vector3(0, 0, -1).
961
961
  */
962
962
  function forward() {
963
- return create$a(0, 0, -1);
963
+ return create$b(0, 0, -1);
964
964
  }
965
965
  /**
966
966
  * Returns a directional vector on the negative x axis, Vector3(-1, 0, 0).
967
967
  */
968
968
  function left() {
969
- return create$a(-1, 0, 0);
969
+ return create$b(-1, 0, 0);
970
970
  }
971
971
  /**
972
972
  * Returns a directional vector on the negative y axis, Vector3(0, -1, 0).
973
973
  */
974
974
  function down() {
975
- return create$a(0, -1, 0);
975
+ return create$b(0, -1, 0);
976
976
  }
977
977
  /**
978
978
  * Returns a directional vector on the negative z axis, Vector3(0, 0, 1).
979
979
  */
980
980
  function back() {
981
- return create$a(0, 0, 1);
981
+ return create$b(0, 0, 1);
982
982
  }
983
983
  /**
984
984
  * Returns a vector at the origin, Vector3(0, 0, 0).
985
985
  */
986
986
  function origin() {
987
- return create$a(0, 0, 0);
987
+ return create$b(0, 0, 0);
988
988
  }
989
989
  /**
990
990
  * Returns a vector with that will have a magnitude of 1.
@@ -1167,13 +1167,13 @@ function isEqual$2(a, b) {
1167
1167
  * Returns a vector that contains the largest components of `a` and `b`.
1168
1168
  */
1169
1169
  function max(a, b) {
1170
- return create$a(Math.max(a.x, b.x), Math.max(a.y, b.y), Math.max(a.z, b.z));
1170
+ return create$b(Math.max(a.x, b.x), Math.max(a.y, b.y), Math.max(a.z, b.z));
1171
1171
  }
1172
1172
  /**
1173
1173
  * Returns a vector that contains the smallest components of `a` and `b`.
1174
1174
  */
1175
1175
  function min(a, b) {
1176
- return create$a(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.min(a.z, b.z));
1176
+ return create$b(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.min(a.z, b.z));
1177
1177
  }
1178
1178
  /**
1179
1179
  * Returns a vector that each of its component negated.
@@ -1211,7 +1211,7 @@ function transformNdcToWorldSpace(ndc, worldMatrix, projectionMatrixInverse) {
1211
1211
 
1212
1212
  var vector3 = /*#__PURE__*/Object.freeze({
1213
1213
  __proto__: null,
1214
- create: create$a,
1214
+ create: create$b,
1215
1215
  isValid: isValid,
1216
1216
  fromMatrixScale: fromMatrixScale,
1217
1217
  fromMatrixPosition: fromMatrixPosition,
@@ -1251,7 +1251,7 @@ var vector3 = /*#__PURE__*/Object.freeze({
1251
1251
  /**
1252
1252
  * Returns a `BoundingBox` with the given min and max points.
1253
1253
  */
1254
- var create$9 = function (min, max) {
1254
+ var create$a = function (min, max) {
1255
1255
  return { min: min, max: max };
1256
1256
  };
1257
1257
  /**
@@ -1259,7 +1259,7 @@ var create$9 = function (min, max) {
1259
1259
  * are contained by the bounding box.
1260
1260
  */
1261
1261
  var fromVectors = function (vectors) {
1262
- return union.apply(void 0, vectors.map(function (v) { return create$9(v, v); }));
1262
+ return union.apply(void 0, vectors.map(function (v) { return create$a(v, v); }));
1263
1263
  };
1264
1264
  /**
1265
1265
  * Returns the center point of the given `BoundingBox`.
@@ -1274,19 +1274,36 @@ function union(box) {
1274
1274
  }
1275
1275
  var boxes = __spreadArray([box], rest, true);
1276
1276
  return boxes.reduce(function (a, b) {
1277
- return create$9(min(a.min, b.min), max(a.max, b.max));
1277
+ return create$a(min(a.min, b.min), max(a.max, b.max));
1278
1278
  });
1279
1279
  }
1280
1280
  /* eslint-enable padding-line-between-statements */
1281
1281
 
1282
1282
  var boundingBox = /*#__PURE__*/Object.freeze({
1283
1283
  __proto__: null,
1284
- create: create$9,
1284
+ create: create$a,
1285
1285
  fromVectors: fromVectors,
1286
1286
  center: center$3,
1287
1287
  union: union
1288
1288
  });
1289
1289
 
1290
+ /**
1291
+ * Returns a `BoundingSphere` that encompasses the provided `BoundingBox`.
1292
+ */
1293
+ var create$9 = function (boundingBox$1) {
1294
+ var boundingBoxCenter = center$3(boundingBox$1);
1295
+ var centerToBoundingPlane = subtract(boundingBox$1.max, boundingBoxCenter);
1296
+ var radius = magnitude(centerToBoundingPlane);
1297
+ var length = Math.max(radius, magnitude(boundingBoxCenter));
1298
+ var epsilon = length === 0 ? 1.0 : length * 1e-6;
1299
+ return { center: boundingBoxCenter, radius: radius, epsilon: epsilon };
1300
+ };
1301
+
1302
+ var boundingSphere = /*#__PURE__*/Object.freeze({
1303
+ __proto__: null,
1304
+ create: create$9
1305
+ });
1306
+
1290
1307
  /**
1291
1308
  * Returns a new `Rectangle` with the given position and size.
1292
1309
  */
@@ -1408,13 +1425,13 @@ function center$2(rect) {
1408
1425
  * Returns the top-left position of the rectangle, as a point.
1409
1426
  */
1410
1427
  function topLeft(rect) {
1411
- return create$b(rect.x, rect.y);
1428
+ return create$c(rect.x, rect.y);
1412
1429
  }
1413
1430
  /**
1414
1431
  * Returns the bottom-right position of the rectangle, as a point.
1415
1432
  */
1416
1433
  function bottomRight(rect) {
1417
- return create$b(rect.x + rect.width, rect.y + rect.height);
1434
+ return create$c(rect.x + rect.width, rect.y + rect.height);
1418
1435
  }
1419
1436
  /**
1420
1437
  * Returns `true` if the given rectangle has a portrait aspect ratio.
@@ -1619,7 +1636,7 @@ var fitToRatio = function (ratio, dimensions) {
1619
1636
  * Converts a dimension to a rectangle, with an optional position.
1620
1637
  */
1621
1638
  function toRectangle(dimensions, position) {
1622
- if (position === void 0) { position = create$b(); }
1639
+ if (position === void 0) { position = create$c(); }
1623
1640
  return fromPointAndDimensions(position, dimensions);
1624
1641
  }
1625
1642
 
@@ -1921,7 +1938,7 @@ var translate = function (dx, dy, matrix) {
1921
1938
  var transformPoint = function (matrix, pt) {
1922
1939
  var x = matrix.a * pt.x + matrix.c * pt.y + matrix.tx;
1923
1940
  var y = matrix.b * pt.x + matrix.d * pt.y + matrix.ty;
1924
- return create$b(x, y);
1941
+ return create$c(x, y);
1925
1942
  };
1926
1943
 
1927
1944
  var matrix = /*#__PURE__*/Object.freeze({
@@ -2321,6 +2338,7 @@ exports.__rest = __rest;
2321
2338
  exports.__spreadArray = __spreadArray;
2322
2339
  exports.angle = angle;
2323
2340
  exports.boundingBox = boundingBox;
2341
+ exports.boundingSphere = boundingSphere;
2324
2342
  exports.clamp = clamp;
2325
2343
  exports.dimensions = dimensions;
2326
2344
  exports.euler = euler;
@@ -3,8 +3,8 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const browser_esm = require('./browser.esm-c51162f8.js');
7
- require('./streamAttributes-2061be12.js');
6
+ const browser_esm = require('./browser.esm-075810bf.js');
7
+ require('./streamAttributes-81eb52f2.js');
8
8
 
9
9
  const DEFAULT_ANIMATION_DURATION = 500;
10
10
  const defaultAnimationConfig = {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const browser_esm = require('./browser.esm-c51162f8.js');
6
+ const browser_esm = require('./browser.esm-075810bf.js');
7
7
 
8
8
  /**
9
9
  * The cursor manager maintains a prioritized list of cursors for the viewer.
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const bundle_esm = require('./bundle.esm-1b8b1f36.js');
6
+ const bundle_esm = require('./bundle.esm-618a5fe9.js');
7
7
 
8
8
  function getMouseClientPosition(event, offsets) {
9
9
  const pt = bundle_esm.point.create(event.clientX, event.clientY);
@@ -3,10 +3,10 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const mapper = require('./mapper-1aafd2e8.js');
6
+ const mapper = require('./mapper-80ee2957.js');
7
7
  const grpcWebClient_umd = require('./grpc-web-client.umd-60a79aae.js');
8
- const streamAttributes = require('./streamAttributes-2061be12.js');
9
- const browser_esm = require('./browser.esm-c51162f8.js');
8
+ const streamAttributes = require('./streamAttributes-81eb52f2.js');
9
+ const browser_esm = require('./browser.esm-075810bf.js');
10
10
 
11
11
  function requestUnary(caller) {
12
12
  return new Promise((resolve, reject) => {
@@ -5,18 +5,18 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const scene = require('./scene-91da8d7b.js');
9
- const cursors = require('./cursors-14827f58.js');
10
- const entities = require('./entities-4e61087e.js');
11
- const model = require('./model-78241d4f.js');
12
- const overlays = require('./overlays-06786e52.js');
13
- const results = require('./results-7a694238.js');
14
- const streamAttributes = require('./streamAttributes-2061be12.js');
15
- const markup = require('./markup-835f2e83.js');
16
- const viewport = require('./viewport-052809c7.js');
17
- require('./browser.esm-c51162f8.js');
18
- require('./bundle.esm-1b8b1f36.js');
19
- require('./mapper-1aafd2e8.js');
8
+ const scene = require('./scene-92728420.js');
9
+ const cursors = require('./cursors-d71f6a74.js');
10
+ const entities = require('./entities-90f1347a.js');
11
+ const model = require('./model-55abd9ab.js');
12
+ const overlays = require('./overlays-68e8eff2.js');
13
+ const results = require('./results-e9496869.js');
14
+ const streamAttributes = require('./streamAttributes-81eb52f2.js');
15
+ const markup = require('./markup-7f7de5f2.js');
16
+ const viewport = require('./viewport-54b1389d.js');
17
+ require('./browser.esm-075810bf.js');
18
+ require('./bundle.esm-618a5fe9.js');
19
+ require('./mapper-80ee2957.js');
20
20
  require('./_commonjsHelpers-537d719a.js');
21
21
  require('./grpc-web-client.umd-60a79aae.js');
22
22
 
@@ -5,8 +5,8 @@
5
5
 
6
6
  const _commonjsHelpers = require('./_commonjsHelpers-537d719a.js');
7
7
  const grpcWebClient_umd = require('./grpc-web-client.umd-60a79aae.js');
8
- const browser_esm = require('./browser.esm-c51162f8.js');
9
- const streamAttributes = require('./streamAttributes-2061be12.js');
8
+ const browser_esm = require('./browser.esm-075810bf.js');
9
+ const streamAttributes = require('./streamAttributes-81eb52f2.js');
10
10
 
11
11
  var uuid_pb = _commonjsHelpers.createCommonjsModule(function (module, exports) {
12
12
  /**
@@ -3,8 +3,8 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const bundle_esm = require('./bundle.esm-1b8b1f36.js');
7
- const browser_esm = require('./browser.esm-c51162f8.js');
6
+ const bundle_esm = require('./bundle.esm-618a5fe9.js');
7
+ const browser_esm = require('./browser.esm-075810bf.js');
8
8
 
9
9
  class ArrowMarkup {
10
10
  constructor(init) {
@@ -3,8 +3,8 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const bundle_esm = require('./bundle.esm-1b8b1f36.js');
7
- const browser_esm = require('./browser.esm-c51162f8.js');
6
+ const bundle_esm = require('./bundle.esm-618a5fe9.js');
7
+ const browser_esm = require('./browser.esm-075810bf.js');
8
8
 
9
9
  class DistanceMeasurement {
10
10
  constructor(init) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const browser_esm = require('./browser.esm-c51162f8.js');
6
+ const browser_esm = require('./browser.esm-075810bf.js');
7
7
 
8
8
  /**
9
9
  * A model representing the state of measurement.
@@ -3,8 +3,8 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const bundle_esm = require('./bundle.esm-1b8b1f36.js');
7
- const browser_esm = require('./browser.esm-c51162f8.js');
6
+ const bundle_esm = require('./bundle.esm-618a5fe9.js');
7
+ const browser_esm = require('./browser.esm-075810bf.js');
8
8
 
9
9
  class MeasurementOverlayManager {
10
10
  constructor() {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const bundle_esm = require('./bundle.esm-1b8b1f36.js');
6
+ const bundle_esm = require('./bundle.esm-618a5fe9.js');
7
7
  const _commonjsHelpers = require('./_commonjsHelpers-537d719a.js');
8
8
 
9
9
  const DefaultErrorSerializer = {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const bundle_esm = require('./bundle.esm-1b8b1f36.js');
6
+ const bundle_esm = require('./bundle.esm-618a5fe9.js');
7
7
 
8
8
  /**
9
9
  * Constructs a new measurement result from the given points.
@@ -3,9 +3,9 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const browser_esm = require('./browser.esm-c51162f8.js');
7
- const bundle_esm = require('./bundle.esm-1b8b1f36.js');
8
- const streamAttributes = require('./streamAttributes-2061be12.js');
6
+ const browser_esm = require('./browser.esm-075810bf.js');
7
+ const bundle_esm = require('./bundle.esm-618a5fe9.js');
8
+ const streamAttributes = require('./streamAttributes-81eb52f2.js');
9
9
 
10
10
  const defaultColor = {
11
11
  opacity: 100,
@@ -608,15 +608,7 @@ class Camera {
608
608
  this.decodeFrame = decodeFrame;
609
609
  this.flyToOptions = flyToOptions;
610
610
  }
611
- fitCameraToBoundingBox(boundingBox, fovVertical, viewVector) {
612
- const radius = 1.1 *
613
- bundle_esm.vector3.magnitude(bundle_esm.vector3.subtract(boundingBox.max, bundle_esm.boundingBox.center(boundingBox)));
614
- // ratio of the height of the frustum to the distance along the view vector
615
- let hOverD = Math.tan(fovVertical * PI_OVER_360);
616
- if (this.aspect < 1.0) {
617
- hOverD *= this.aspect;
618
- }
619
- const distance = Math.abs(radius / hOverD);
611
+ fitCameraToBoundingBox(boundingBox, distance, viewVector) {
620
612
  const vvec = bundle_esm.vector3.scale(distance, bundle_esm.vector3.normalize(viewVector));
621
613
  const lookAt = bundle_esm.boundingBox.center(boundingBox);
622
614
  const position = bundle_esm.vector3.subtract(lookAt, vvec);
@@ -714,6 +706,7 @@ class Camera {
714
706
  standardView(standardView) {
715
707
  return this.update({
716
708
  position: standardView.position,
709
+ viewVector: bundle_esm.vector3.subtract(bundle_esm.vector3.origin(), standardView.position),
717
710
  lookAt: bundle_esm.vector3.origin(),
718
711
  up: standardView.up,
719
712
  });
@@ -765,7 +758,15 @@ class PerspectiveCamera extends Camera {
765
758
  }
766
759
  fitToBoundingBox(boundingBox) {
767
760
  var _a;
768
- return super.fitCameraToBoundingBox(boundingBox, (_a = this.fovY) !== null && _a !== void 0 ? _a : 45, this.viewVector);
761
+ const radius = 1.1 *
762
+ bundle_esm.vector3.magnitude(bundle_esm.vector3.subtract(boundingBox.max, bundle_esm.boundingBox.center(boundingBox)));
763
+ // ratio of the height of the frustum to the distance along the view vector
764
+ let hOverD = Math.tan(((_a = this.fovY) !== null && _a !== void 0 ? _a : 45) * PI_OVER_360);
765
+ if (this.aspect < 1.0) {
766
+ hOverD *= this.aspect;
767
+ }
768
+ const distance = Math.abs(radius / hOverD);
769
+ return super.fitCameraToBoundingBox(boundingBox, distance, this.viewVector);
769
770
  }
770
771
  update(camera) {
771
772
  return new PerspectiveCamera(this.stream, this.aspect, Object.assign(Object.assign({}, this.perspectiveData), camera), this.boundingBox, this.decodeFrame, this.flyToOptions);
@@ -837,30 +838,34 @@ class OrthographicCamera extends Camera {
837
838
  * axis.
838
839
  */
839
840
  moveBy(delta) {
840
- const updatedLookAt = bundle_esm.vector3.add(this.lookAt, delta);
841
841
  return this.update({
842
- viewVector: bundle_esm.vector3.subtract(updatedLookAt, bundle_esm.vector3.add(this.position, delta)),
843
- lookAt: updatedLookAt,
842
+ lookAt: bundle_esm.vector3.add(this.lookAt, delta),
844
843
  });
845
844
  }
846
845
  rotateAroundAxisAtPoint(angleInRadians, point, axis) {
847
- const newLookAt = bundle_esm.vector3.rotateAboutAxis(angleInRadians, this.lookAt, axis, point);
848
- const newUp = bundle_esm.vector3.rotateAboutAxis(angleInRadians, this.up, axis, bundle_esm.vector3.origin());
849
- const newViewVector = bundle_esm.vector3.subtract(bundle_esm.vector3.rotateAboutAxis(angleInRadians, this.position, axis, point), newLookAt);
846
+ const updatedLookAt = bundle_esm.vector3.rotateAboutAxis(angleInRadians, this.lookAt, axis, point);
847
+ const updatedPosition = bundle_esm.vector3.rotateAboutAxis(angleInRadians, this.position, axis, point);
848
+ const viewVector = streamAttributes.constrainViewVector(bundle_esm.vector3.subtract(updatedLookAt, updatedPosition), bundle_esm.boundingSphere.create(this.boundingBox));
850
849
  return this.update({
851
- viewVector: newViewVector,
852
- lookAt: newLookAt,
853
- up: newUp,
850
+ viewVector: viewVector,
851
+ lookAt: updatedLookAt,
852
+ up: bundle_esm.vector3.rotateAboutAxis(angleInRadians, this.up, axis, bundle_esm.vector3.origin()),
854
853
  });
855
854
  }
856
855
  fitToBoundingBox(boundingBox) {
857
- return super.fitCameraToBoundingBox(boundingBox, this.fovHeight, this.viewVector);
856
+ const boundingSphere = bundle_esm.boundingSphere.create(boundingBox);
857
+ const fitAll = super.fitCameraToBoundingBox(boundingBox, boundingSphere.radius, this.viewVector);
858
+ return this.update({
859
+ lookAt: fitAll.lookAt,
860
+ viewVector: fitAll.viewVector,
861
+ fovHeight: boundingSphere.radius * 2,
862
+ });
858
863
  }
859
864
  update(camera) {
860
865
  return new OrthographicCamera(this.stream, this.aspect, Object.assign(Object.assign({}, this.orthographicData), camera), this.boundingBox, this.decodeFrame, this.flyToOptions);
861
866
  }
862
867
  toFrameCamera() {
863
- return new streamAttributes.FrameOrthographicCamera(this.viewVector, this.lookAt, this.up, this.near, this.far, this.aspectRatio, this.fovHeight);
868
+ return new streamAttributes.FrameOrthographicCamera(streamAttributes.constrainViewVector(this.viewVector, bundle_esm.boundingSphere.create(this.boundingBox)), this.lookAt, this.up, this.near, this.far, this.aspectRatio, this.fovHeight);
864
869
  }
865
870
  get viewVector() {
866
871
  return Object.assign({}, this.orthographicData.viewVector);