@vertexvis/viewer 0.13.1 → 0.13.2-canary.10

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 (177) hide show
  1. package/dist/cjs/{browser.esm-31b03292.js → browser.esm-075810bf.js} +1 -1
  2. package/dist/cjs/{bundle.esm-dc0a8361.js → bundle.esm-618a5fe9.js} +80 -28
  3. package/dist/cjs/{config-90ee43d5.js → config-fb124bac.js} +2 -2
  4. package/dist/cjs/{cursors-ad2fd395.js → cursors-d71f6a74.js} +1 -1
  5. package/dist/cjs/{dom-dd265f48.js → dom-57ef84e9.js} +1 -1
  6. package/dist/cjs/{entities-aa59890e.js → entities-90f1347a.js} +3 -3
  7. package/dist/cjs/index.cjs.js +14 -12
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{mapper-f6e6cafe.js → mapper-80ee2957.js} +2 -2
  10. package/dist/cjs/{markup-fb1553b1.js → markup-7f7de5f2.js} +2 -2
  11. package/dist/cjs/{measurement-aba1e0e8.js → measurement-f1ae9248.js} +2 -2
  12. package/dist/cjs/{model-4ec0c36e.js → model-55abd9ab.js} +1 -1
  13. package/dist/cjs/{overlays-40c6cbc7.js → overlays-68e8eff2.js} +2 -2
  14. package/dist/cjs/{png-decoder-27d25eed.js → png-decoder-076131d8.js} +1 -1
  15. package/dist/cjs/{results-bc325974.js → results-e9496869.js} +1 -1
  16. package/dist/cjs/{scene-d420fd26.js → scene-92728420.js} +188 -90
  17. package/dist/cjs/{streamAttributes-d6236448.js → streamAttributes-81eb52f2.js} +1508 -43
  18. package/dist/cjs/{utils-545b1865.js → utils-463cd52e.js} +1 -1
  19. package/dist/cjs/{utils-f80be307.js → utils-6397efca.js} +1 -1
  20. package/dist/cjs/vertex-scene-tree-search_3.cjs.entry.js +1 -1
  21. package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js +1 -1
  22. package/dist/cjs/vertex-scene-tree.cjs.entry.js +4 -4
  23. package/dist/cjs/vertex-viewer-dom-element_3.cjs.entry.js +8 -7
  24. package/dist/cjs/vertex-viewer-markup-arrow_3.cjs.entry.js +3 -3
  25. package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js +4 -4
  26. package/dist/cjs/vertex-viewer-markup.cjs.entry.js +4 -4
  27. package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +3 -3
  28. package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +20 -15
  29. package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +6 -6
  30. package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +10 -10
  31. package/dist/cjs/vertex-viewer-measurement-tool.cjs.entry.js +5 -5
  32. package/dist/cjs/vertex-viewer-measurements.cjs.entry.js +8 -8
  33. package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +3 -3
  34. package/dist/cjs/vertex-viewer.cjs.entry.js +287 -80
  35. package/dist/cjs/viewer.cjs.js +1 -1
  36. package/dist/cjs/{viewport-8c39089f.js → viewport-54b1389d.js} +34 -2
  37. package/dist/collection/components/scene-tree-table-cell/scene-tree-table-cell.css +1 -1
  38. package/dist/collection/components/viewer/viewer.js +68 -4
  39. package/dist/collection/components/viewer-dom-renderer/renderer2d.js +1 -1
  40. package/dist/collection/components/viewer-dom-renderer/renderer3d.js +4 -2
  41. package/dist/collection/components/viewer-dom-renderer/viewer-dom-renderer.js +5 -6
  42. package/dist/collection/components/viewer-measurement-distance/hitTest.js +9 -4
  43. package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js +5 -5
  44. package/dist/collection/components/viewer-measurement-overlays/viewer-measurement-overlays.js +3 -3
  45. package/dist/collection/index.js +2 -2
  46. package/dist/collection/lib/errors.js +8 -1
  47. package/dist/collection/lib/interactions/index.js +3 -1
  48. package/dist/collection/lib/interactions/interactionApi.js +4 -25
  49. package/dist/collection/lib/interactions/interactionApiOrthographic.js +136 -0
  50. package/dist/collection/lib/interactions/interactionApiPerspective.js +51 -0
  51. package/dist/collection/lib/interactions/multiTouchInteractionHandler.js +3 -2
  52. package/dist/collection/lib/mappers/frameStreaming.js +27 -5
  53. package/dist/collection/lib/rendering/matrices.js +13 -4
  54. package/dist/collection/lib/rendering/vectors.js +7 -0
  55. package/dist/collection/lib/scenes/__mocks__/mocks.js +2 -2
  56. package/dist/collection/lib/scenes/camera.js +163 -83
  57. package/dist/collection/lib/scenes/mapper.js +3 -2
  58. package/dist/collection/lib/scenes/scene.js +22 -9
  59. package/dist/collection/lib/types/clippingPlanes.js +48 -20
  60. package/dist/collection/lib/types/depthBuffer.js +32 -3
  61. package/dist/collection/lib/types/frame.js +133 -24
  62. package/dist/collection/lib/types/frameCamera.js +87 -6
  63. package/dist/collection/lib/types/viewport.js +34 -2
  64. package/dist/collection/testing/fixtures.js +28 -15
  65. package/dist/collection/testing/viewer.js +5 -3
  66. package/dist/custom-elements/index.js +2135 -283
  67. package/dist/esm/{browser.esm-59e914f6.js → browser.esm-e72d80ad.js} +1 -1
  68. package/dist/esm/{bundle.esm-d899b2d5.js → bundle.esm-8ceccb91.js} +80 -29
  69. package/dist/esm/{config-604c644e.js → config-fb7cd8ff.js} +2 -2
  70. package/dist/esm/{cursors-a7ec4adb.js → cursors-fc2deed7.js} +1 -1
  71. package/dist/esm/{dom-780d25be.js → dom-2cd18856.js} +1 -1
  72. package/dist/esm/{entities-759d97cd.js → entities-78557270.js} +3 -3
  73. package/dist/esm/index.js +12 -12
  74. package/dist/esm/index.mjs +12 -12
  75. package/dist/esm/loader.js +1 -1
  76. package/dist/esm/loader.mjs +1 -1
  77. package/dist/esm/{mapper-4b815e31.js → mapper-da36de17.js} +2 -2
  78. package/dist/esm/{markup-1d177b4a.js → markup-c313d99c.js} +2 -2
  79. package/dist/esm/{measurement-12cdbf5c.js → measurement-544b69d5.js} +2 -2
  80. package/dist/esm/{model-e5a4f00f.js → model-2a34b443.js} +1 -1
  81. package/dist/esm/{overlays-1919b192.js → overlays-354e275c.js} +2 -2
  82. package/dist/esm/{png-decoder-3f1fa486.js → png-decoder-07de80d1.js} +1 -1
  83. package/dist/esm/{results-994bdb50.js → results-4d0c3568.js} +1 -1
  84. package/dist/esm/{scene-2c2460d5.js → scene-2bfcce74.js} +188 -90
  85. package/dist/esm/{streamAttributes-d623bb60.js → streamAttributes-d0b384b3.js} +1502 -44
  86. package/dist/esm/{utils-83a19677.js → utils-3ea0acdd.js} +1 -1
  87. package/dist/esm/{utils-5e57bf24.js → utils-e0941c61.js} +1 -1
  88. package/dist/esm/vertex-scene-tree-search_3.entry.js +1 -1
  89. package/dist/esm/vertex-scene-tree-table-cell.entry.js +1 -1
  90. package/dist/esm/vertex-scene-tree.entry.js +4 -4
  91. package/dist/esm/vertex-viewer-dom-element_3.entry.js +8 -7
  92. package/dist/esm/vertex-viewer-markup-arrow_3.entry.js +3 -3
  93. package/dist/esm/vertex-viewer-markup-tool.entry.js +4 -4
  94. package/dist/esm/vertex-viewer-markup.entry.js +4 -4
  95. package/dist/esm/vertex-viewer-measurement-details.entry.js +3 -3
  96. package/dist/esm/vertex-viewer-measurement-distance.entry.js +20 -15
  97. package/dist/esm/vertex-viewer-measurement-line_2.entry.js +6 -6
  98. package/dist/esm/vertex-viewer-measurement-precise.entry.js +10 -10
  99. package/dist/esm/vertex-viewer-measurement-tool.entry.js +5 -5
  100. package/dist/esm/vertex-viewer-measurements.entry.js +8 -8
  101. package/dist/esm/vertex-viewer-view-cube.entry.js +3 -3
  102. package/dist/esm/vertex-viewer.entry.js +287 -80
  103. package/dist/esm/viewer.js +1 -1
  104. package/dist/esm/{viewport-01c886ea.js → viewport-5cc7b128.js} +34 -2
  105. package/dist/types/components/scene-tree-table-cell/scene-tree-table-cell.d.ts +1 -1
  106. package/dist/types/components/viewer/viewer.d.ts +8 -0
  107. package/dist/types/components/viewer-dom-renderer/renderer2d.d.ts +2 -2
  108. package/dist/types/components/viewer-dom-renderer/renderer3d.d.ts +3 -3
  109. package/dist/types/components/viewer-dom-renderer/viewer-dom-renderer.d.ts +2 -2
  110. package/dist/types/components/viewer-measurement-distance/hitTest.d.ts +3 -2
  111. package/dist/types/components/viewer-measurement-distance/utils.d.ts +2 -2
  112. package/dist/types/components/viewer-measurement-distance/viewer-measurement-distance.d.ts +2 -2
  113. package/dist/types/components/viewer-measurement-overlays/viewer-measurement-overlays-components.d.ts +2 -2
  114. package/dist/types/components/viewer-measurement-overlays/viewer-measurement-overlays.d.ts +2 -2
  115. package/dist/types/components.d.ts +15 -7
  116. package/dist/types/index.d.ts +1 -1
  117. package/dist/types/lib/errors.d.ts +3 -0
  118. package/dist/types/lib/interactions/index.d.ts +2 -0
  119. package/dist/types/lib/interactions/interactionApi.d.ts +34 -26
  120. package/dist/types/lib/interactions/interactionApiOrthographic.d.ts +35 -0
  121. package/dist/types/lib/interactions/interactionApiPerspective.d.ts +21 -0
  122. package/dist/types/lib/mappers/frameStreaming.d.ts +2 -0
  123. package/dist/types/lib/rendering/vectors.d.ts +2 -0
  124. package/dist/types/lib/scenes/__mocks__/mocks.d.ts +2 -2
  125. package/dist/types/lib/scenes/camera.d.ts +101 -38
  126. package/dist/types/lib/scenes/scene.d.ts +1 -1
  127. package/dist/types/lib/types/clippingPlanes.d.ts +3 -1
  128. package/dist/types/lib/types/depthBuffer.d.ts +28 -6
  129. package/dist/types/lib/types/frame.d.ts +80 -11
  130. package/dist/types/lib/types/frameCamera.d.ts +22 -3
  131. package/dist/types/lib/types/viewport.d.ts +24 -4
  132. package/dist/types/testing/fixtures.d.ts +8 -5
  133. package/dist/viewer/index.esm.js +1 -1
  134. package/dist/viewer/{p-f8d01b8a.entry.js → p-0a189e62.entry.js} +1 -1
  135. package/dist/viewer/{p-e07377fa.entry.js → p-1ca95f9a.entry.js} +1 -1
  136. package/dist/viewer/{p-d00e9203.js → p-3561d910.js} +1 -1
  137. package/dist/viewer/p-388a43f7.js +4 -0
  138. package/dist/viewer/{p-3810c24d.js → p-3f0f83ad.js} +1 -1
  139. package/dist/viewer/{p-8decee06.entry.js → p-41028d3b.entry.js} +1 -1
  140. package/dist/viewer/{p-439220c6.js → p-487e054a.js} +1 -1
  141. package/dist/viewer/p-49d36e94.entry.js +4 -0
  142. package/dist/viewer/{p-da2f4a56.js → p-5b342e97.js} +1 -1
  143. package/dist/viewer/p-661f0612.js +18 -0
  144. package/dist/viewer/{p-364ce21c.js → p-69058178.js} +1 -1
  145. package/dist/viewer/{p-353cfc7a.entry.js → p-73a5eacc.entry.js} +1 -1
  146. package/dist/viewer/p-77be081a.js +4 -0
  147. package/dist/viewer/{p-a0df0e0c.js → p-809d09d9.js} +1 -1
  148. package/dist/viewer/{p-d90f2f6d.entry.js → p-858bd2c7.entry.js} +1 -1
  149. package/dist/viewer/{p-25eaab00.entry.js → p-89b66838.entry.js} +1 -1
  150. package/dist/viewer/p-a93a63a9.js +4 -0
  151. package/dist/viewer/{p-df292b56.entry.js → p-b043b076.entry.js} +1 -1
  152. package/dist/viewer/{p-915d95ad.entry.js → p-b0ac6b3c.entry.js} +1 -1
  153. package/dist/viewer/{p-fec1a8d0.entry.js → p-b7624ff2.entry.js} +1 -1
  154. package/dist/viewer/{p-f7cb7e59.js → p-b8774c9c.js} +1 -1
  155. package/dist/viewer/{p-67446e35.js → p-bcb66f97.js} +1 -1
  156. package/dist/viewer/p-bcde5521.entry.js +4 -0
  157. package/dist/viewer/{p-7cad9bf4.js → p-d1584404.js} +1 -1
  158. package/dist/viewer/p-d32b54cb.js +4 -0
  159. package/dist/viewer/{p-f755af5a.entry.js → p-d3a20af4.entry.js} +1 -1
  160. package/dist/viewer/{p-c62cb926.entry.js → p-d9f99f4d.entry.js} +1 -1
  161. package/dist/viewer/p-e38458da.js +4 -0
  162. package/dist/viewer/{p-301660cf.js → p-e75bba97.js} +2 -2
  163. package/dist/viewer/{p-6e80f8b0.entry.js → p-ebd55df7.entry.js} +1 -1
  164. package/dist/viewer/{p-671c113c.entry.js → p-f0411993.entry.js} +1 -1
  165. package/dist/viewer/{p-2cefb1b0.js → p-fa9a0bed.js} +1 -1
  166. package/dist/viewer/p-ffdeb08c.js +4 -0
  167. package/dist/viewer/viewer.esm.js +1 -1
  168. package/package.json +8 -8
  169. package/dist/viewer/p-081e6873.js +0 -4
  170. package/dist/viewer/p-085e908a.js +0 -4
  171. package/dist/viewer/p-0aba71fd.js +0 -18
  172. package/dist/viewer/p-3f6ac74f.js +0 -4
  173. package/dist/viewer/p-423410be.js +0 -4
  174. package/dist/viewer/p-432267bc.entry.js +0 -4
  175. package/dist/viewer/p-4985fad5.js +0 -4
  176. package/dist/viewer/p-e2297df2.entry.js +0 -4
  177. package/dist/viewer/p-fe11d694.js +0 -4
@@ -3,8 +3,8 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const bundle_esm = require('./bundle.esm-dc0a8361.js');
7
- const browser_esm = require('./browser.esm-31b03292.js');
6
+ const bundle_esm = require('./bundle.esm-618a5fe9.js');
7
+ const browser_esm = require('./browser.esm-075810bf.js');
8
8
  const _commonjsHelpers = require('./_commonjsHelpers-537d719a.js');
9
9
 
10
10
  const fromPbUuid = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.requiredProp('hex')), ([uuid]) => uuid);
@@ -2688,6 +2688,522 @@ const vertexvis$1 = $root$1.vertexvis = (() => {
2688
2688
  */
2689
2689
  const stream = {};
2690
2690
 
2691
+ stream.PerspectiveCamera = (function() {
2692
+
2693
+ /**
2694
+ * Properties of a PerspectiveCamera.
2695
+ * @memberof vertexvis.protobuf.stream
2696
+ * @interface IPerspectiveCamera
2697
+ * @property {vertexvis.protobuf.core.IVector3f|null} [position] PerspectiveCamera position
2698
+ * @property {vertexvis.protobuf.core.IVector3f|null} [lookAt] PerspectiveCamera lookAt
2699
+ * @property {vertexvis.protobuf.core.IVector3f|null} [up] PerspectiveCamera up
2700
+ */
2701
+
2702
+ /**
2703
+ * Constructs a new PerspectiveCamera.
2704
+ * @memberof vertexvis.protobuf.stream
2705
+ * @classdesc Represents a PerspectiveCamera.
2706
+ * @implements IPerspectiveCamera
2707
+ * @constructor
2708
+ * @param {vertexvis.protobuf.stream.IPerspectiveCamera=} [properties] Properties to set
2709
+ */
2710
+ function PerspectiveCamera(properties) {
2711
+ if (properties)
2712
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2713
+ if (properties[keys[i]] != null)
2714
+ this[keys[i]] = properties[keys[i]];
2715
+ }
2716
+
2717
+ /**
2718
+ * PerspectiveCamera position.
2719
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} position
2720
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2721
+ * @instance
2722
+ */
2723
+ PerspectiveCamera.prototype.position = null;
2724
+
2725
+ /**
2726
+ * PerspectiveCamera lookAt.
2727
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} lookAt
2728
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2729
+ * @instance
2730
+ */
2731
+ PerspectiveCamera.prototype.lookAt = null;
2732
+
2733
+ /**
2734
+ * PerspectiveCamera up.
2735
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} up
2736
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2737
+ * @instance
2738
+ */
2739
+ PerspectiveCamera.prototype.up = null;
2740
+
2741
+ /**
2742
+ * Creates a new PerspectiveCamera instance using the specified properties.
2743
+ * @function create
2744
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2745
+ * @static
2746
+ * @param {vertexvis.protobuf.stream.IPerspectiveCamera=} [properties] Properties to set
2747
+ * @returns {vertexvis.protobuf.stream.PerspectiveCamera} PerspectiveCamera instance
2748
+ */
2749
+ PerspectiveCamera.create = function create(properties) {
2750
+ return new PerspectiveCamera(properties);
2751
+ };
2752
+
2753
+ /**
2754
+ * Encodes the specified PerspectiveCamera message. Does not implicitly {@link vertexvis.protobuf.stream.PerspectiveCamera.verify|verify} messages.
2755
+ * @function encode
2756
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2757
+ * @static
2758
+ * @param {vertexvis.protobuf.stream.IPerspectiveCamera} message PerspectiveCamera message or plain object to encode
2759
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2760
+ * @returns {$protobuf.Writer} Writer
2761
+ */
2762
+ PerspectiveCamera.encode = function encode(message, writer) {
2763
+ if (!writer)
2764
+ writer = $Writer$1.create();
2765
+ if (message.position != null && Object.hasOwnProperty.call(message, "position"))
2766
+ $root$1.vertexvis.protobuf.core.Vector3f.encode(message.position, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
2767
+ if (message.lookAt != null && Object.hasOwnProperty.call(message, "lookAt"))
2768
+ $root$1.vertexvis.protobuf.core.Vector3f.encode(message.lookAt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
2769
+ if (message.up != null && Object.hasOwnProperty.call(message, "up"))
2770
+ $root$1.vertexvis.protobuf.core.Vector3f.encode(message.up, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
2771
+ return writer;
2772
+ };
2773
+
2774
+ /**
2775
+ * Encodes the specified PerspectiveCamera message, length delimited. Does not implicitly {@link vertexvis.protobuf.stream.PerspectiveCamera.verify|verify} messages.
2776
+ * @function encodeDelimited
2777
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2778
+ * @static
2779
+ * @param {vertexvis.protobuf.stream.IPerspectiveCamera} message PerspectiveCamera message or plain object to encode
2780
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2781
+ * @returns {$protobuf.Writer} Writer
2782
+ */
2783
+ PerspectiveCamera.encodeDelimited = function encodeDelimited(message, writer) {
2784
+ return this.encode(message, writer).ldelim();
2785
+ };
2786
+
2787
+ /**
2788
+ * Decodes a PerspectiveCamera message from the specified reader or buffer.
2789
+ * @function decode
2790
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2791
+ * @static
2792
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2793
+ * @param {number} [length] Message length if known beforehand
2794
+ * @returns {vertexvis.protobuf.stream.PerspectiveCamera} PerspectiveCamera
2795
+ * @throws {Error} If the payload is not a reader or valid buffer
2796
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2797
+ */
2798
+ PerspectiveCamera.decode = function decode(reader, length) {
2799
+ if (!(reader instanceof $Reader$1))
2800
+ reader = $Reader$1.create(reader);
2801
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root$1.vertexvis.protobuf.stream.PerspectiveCamera();
2802
+ while (reader.pos < end) {
2803
+ let tag = reader.uint32();
2804
+ switch (tag >>> 3) {
2805
+ case 1:
2806
+ message.position = $root$1.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
2807
+ break;
2808
+ case 2:
2809
+ message.lookAt = $root$1.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
2810
+ break;
2811
+ case 3:
2812
+ message.up = $root$1.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
2813
+ break;
2814
+ default:
2815
+ reader.skipType(tag & 7);
2816
+ break;
2817
+ }
2818
+ }
2819
+ return message;
2820
+ };
2821
+
2822
+ /**
2823
+ * Decodes a PerspectiveCamera message from the specified reader or buffer, length delimited.
2824
+ * @function decodeDelimited
2825
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2826
+ * @static
2827
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2828
+ * @returns {vertexvis.protobuf.stream.PerspectiveCamera} PerspectiveCamera
2829
+ * @throws {Error} If the payload is not a reader or valid buffer
2830
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2831
+ */
2832
+ PerspectiveCamera.decodeDelimited = function decodeDelimited(reader) {
2833
+ if (!(reader instanceof $Reader$1))
2834
+ reader = new $Reader$1(reader);
2835
+ return this.decode(reader, reader.uint32());
2836
+ };
2837
+
2838
+ /**
2839
+ * Verifies a PerspectiveCamera message.
2840
+ * @function verify
2841
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2842
+ * @static
2843
+ * @param {Object.<string,*>} message Plain object to verify
2844
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2845
+ */
2846
+ PerspectiveCamera.verify = function verify(message) {
2847
+ if (typeof message !== "object" || message === null)
2848
+ return "object expected";
2849
+ if (message.position != null && message.hasOwnProperty("position")) {
2850
+ let error = $root$1.vertexvis.protobuf.core.Vector3f.verify(message.position);
2851
+ if (error)
2852
+ return "position." + error;
2853
+ }
2854
+ if (message.lookAt != null && message.hasOwnProperty("lookAt")) {
2855
+ let error = $root$1.vertexvis.protobuf.core.Vector3f.verify(message.lookAt);
2856
+ if (error)
2857
+ return "lookAt." + error;
2858
+ }
2859
+ if (message.up != null && message.hasOwnProperty("up")) {
2860
+ let error = $root$1.vertexvis.protobuf.core.Vector3f.verify(message.up);
2861
+ if (error)
2862
+ return "up." + error;
2863
+ }
2864
+ return null;
2865
+ };
2866
+
2867
+ /**
2868
+ * Creates a PerspectiveCamera message from a plain object. Also converts values to their respective internal types.
2869
+ * @function fromObject
2870
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2871
+ * @static
2872
+ * @param {Object.<string,*>} object Plain object
2873
+ * @returns {vertexvis.protobuf.stream.PerspectiveCamera} PerspectiveCamera
2874
+ */
2875
+ PerspectiveCamera.fromObject = function fromObject(object) {
2876
+ if (object instanceof $root$1.vertexvis.protobuf.stream.PerspectiveCamera)
2877
+ return object;
2878
+ let message = new $root$1.vertexvis.protobuf.stream.PerspectiveCamera();
2879
+ if (object.position != null) {
2880
+ if (typeof object.position !== "object")
2881
+ throw TypeError(".vertexvis.protobuf.stream.PerspectiveCamera.position: object expected");
2882
+ message.position = $root$1.vertexvis.protobuf.core.Vector3f.fromObject(object.position);
2883
+ }
2884
+ if (object.lookAt != null) {
2885
+ if (typeof object.lookAt !== "object")
2886
+ throw TypeError(".vertexvis.protobuf.stream.PerspectiveCamera.lookAt: object expected");
2887
+ message.lookAt = $root$1.vertexvis.protobuf.core.Vector3f.fromObject(object.lookAt);
2888
+ }
2889
+ if (object.up != null) {
2890
+ if (typeof object.up !== "object")
2891
+ throw TypeError(".vertexvis.protobuf.stream.PerspectiveCamera.up: object expected");
2892
+ message.up = $root$1.vertexvis.protobuf.core.Vector3f.fromObject(object.up);
2893
+ }
2894
+ return message;
2895
+ };
2896
+
2897
+ /**
2898
+ * Creates a plain object from a PerspectiveCamera message. Also converts values to other types if specified.
2899
+ * @function toObject
2900
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2901
+ * @static
2902
+ * @param {vertexvis.protobuf.stream.PerspectiveCamera} message PerspectiveCamera
2903
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2904
+ * @returns {Object.<string,*>} Plain object
2905
+ */
2906
+ PerspectiveCamera.toObject = function toObject(message, options) {
2907
+ if (!options)
2908
+ options = {};
2909
+ let object = {};
2910
+ if (options.defaults) {
2911
+ object.position = null;
2912
+ object.lookAt = null;
2913
+ object.up = null;
2914
+ }
2915
+ if (message.position != null && message.hasOwnProperty("position"))
2916
+ object.position = $root$1.vertexvis.protobuf.core.Vector3f.toObject(message.position, options);
2917
+ if (message.lookAt != null && message.hasOwnProperty("lookAt"))
2918
+ object.lookAt = $root$1.vertexvis.protobuf.core.Vector3f.toObject(message.lookAt, options);
2919
+ if (message.up != null && message.hasOwnProperty("up"))
2920
+ object.up = $root$1.vertexvis.protobuf.core.Vector3f.toObject(message.up, options);
2921
+ return object;
2922
+ };
2923
+
2924
+ /**
2925
+ * Converts this PerspectiveCamera to JSON.
2926
+ * @function toJSON
2927
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
2928
+ * @instance
2929
+ * @returns {Object.<string,*>} JSON object
2930
+ */
2931
+ PerspectiveCamera.prototype.toJSON = function toJSON() {
2932
+ return this.constructor.toObject(this, minimal$2.util.toJSONOptions);
2933
+ };
2934
+
2935
+ return PerspectiveCamera;
2936
+ })();
2937
+
2938
+ stream.OrthographicCamera = (function() {
2939
+
2940
+ /**
2941
+ * Properties of an OrthographicCamera.
2942
+ * @memberof vertexvis.protobuf.stream
2943
+ * @interface IOrthographicCamera
2944
+ * @property {vertexvis.protobuf.core.IVector3f|null} [viewVector] OrthographicCamera viewVector
2945
+ * @property {vertexvis.protobuf.core.IVector3f|null} [lookAt] OrthographicCamera lookAt
2946
+ * @property {vertexvis.protobuf.core.IVector3f|null} [up] OrthographicCamera up
2947
+ * @property {number|null} [fovHeight] OrthographicCamera fovHeight
2948
+ */
2949
+
2950
+ /**
2951
+ * Constructs a new OrthographicCamera.
2952
+ * @memberof vertexvis.protobuf.stream
2953
+ * @classdesc Represents an OrthographicCamera.
2954
+ * @implements IOrthographicCamera
2955
+ * @constructor
2956
+ * @param {vertexvis.protobuf.stream.IOrthographicCamera=} [properties] Properties to set
2957
+ */
2958
+ function OrthographicCamera(properties) {
2959
+ if (properties)
2960
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2961
+ if (properties[keys[i]] != null)
2962
+ this[keys[i]] = properties[keys[i]];
2963
+ }
2964
+
2965
+ /**
2966
+ * OrthographicCamera viewVector.
2967
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} viewVector
2968
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
2969
+ * @instance
2970
+ */
2971
+ OrthographicCamera.prototype.viewVector = null;
2972
+
2973
+ /**
2974
+ * OrthographicCamera lookAt.
2975
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} lookAt
2976
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
2977
+ * @instance
2978
+ */
2979
+ OrthographicCamera.prototype.lookAt = null;
2980
+
2981
+ /**
2982
+ * OrthographicCamera up.
2983
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} up
2984
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
2985
+ * @instance
2986
+ */
2987
+ OrthographicCamera.prototype.up = null;
2988
+
2989
+ /**
2990
+ * OrthographicCamera fovHeight.
2991
+ * @member {number} fovHeight
2992
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
2993
+ * @instance
2994
+ */
2995
+ OrthographicCamera.prototype.fovHeight = 0;
2996
+
2997
+ /**
2998
+ * Creates a new OrthographicCamera instance using the specified properties.
2999
+ * @function create
3000
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
3001
+ * @static
3002
+ * @param {vertexvis.protobuf.stream.IOrthographicCamera=} [properties] Properties to set
3003
+ * @returns {vertexvis.protobuf.stream.OrthographicCamera} OrthographicCamera instance
3004
+ */
3005
+ OrthographicCamera.create = function create(properties) {
3006
+ return new OrthographicCamera(properties);
3007
+ };
3008
+
3009
+ /**
3010
+ * Encodes the specified OrthographicCamera message. Does not implicitly {@link vertexvis.protobuf.stream.OrthographicCamera.verify|verify} messages.
3011
+ * @function encode
3012
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
3013
+ * @static
3014
+ * @param {vertexvis.protobuf.stream.IOrthographicCamera} message OrthographicCamera message or plain object to encode
3015
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3016
+ * @returns {$protobuf.Writer} Writer
3017
+ */
3018
+ OrthographicCamera.encode = function encode(message, writer) {
3019
+ if (!writer)
3020
+ writer = $Writer$1.create();
3021
+ if (message.viewVector != null && Object.hasOwnProperty.call(message, "viewVector"))
3022
+ $root$1.vertexvis.protobuf.core.Vector3f.encode(message.viewVector, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3023
+ if (message.lookAt != null && Object.hasOwnProperty.call(message, "lookAt"))
3024
+ $root$1.vertexvis.protobuf.core.Vector3f.encode(message.lookAt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
3025
+ if (message.up != null && Object.hasOwnProperty.call(message, "up"))
3026
+ $root$1.vertexvis.protobuf.core.Vector3f.encode(message.up, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
3027
+ if (message.fovHeight != null && Object.hasOwnProperty.call(message, "fovHeight"))
3028
+ writer.uint32(/* id 4, wireType 5 =*/37).float(message.fovHeight);
3029
+ return writer;
3030
+ };
3031
+
3032
+ /**
3033
+ * Encodes the specified OrthographicCamera message, length delimited. Does not implicitly {@link vertexvis.protobuf.stream.OrthographicCamera.verify|verify} messages.
3034
+ * @function encodeDelimited
3035
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
3036
+ * @static
3037
+ * @param {vertexvis.protobuf.stream.IOrthographicCamera} message OrthographicCamera message or plain object to encode
3038
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3039
+ * @returns {$protobuf.Writer} Writer
3040
+ */
3041
+ OrthographicCamera.encodeDelimited = function encodeDelimited(message, writer) {
3042
+ return this.encode(message, writer).ldelim();
3043
+ };
3044
+
3045
+ /**
3046
+ * Decodes an OrthographicCamera message from the specified reader or buffer.
3047
+ * @function decode
3048
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
3049
+ * @static
3050
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3051
+ * @param {number} [length] Message length if known beforehand
3052
+ * @returns {vertexvis.protobuf.stream.OrthographicCamera} OrthographicCamera
3053
+ * @throws {Error} If the payload is not a reader or valid buffer
3054
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3055
+ */
3056
+ OrthographicCamera.decode = function decode(reader, length) {
3057
+ if (!(reader instanceof $Reader$1))
3058
+ reader = $Reader$1.create(reader);
3059
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root$1.vertexvis.protobuf.stream.OrthographicCamera();
3060
+ while (reader.pos < end) {
3061
+ let tag = reader.uint32();
3062
+ switch (tag >>> 3) {
3063
+ case 1:
3064
+ message.viewVector = $root$1.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
3065
+ break;
3066
+ case 2:
3067
+ message.lookAt = $root$1.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
3068
+ break;
3069
+ case 3:
3070
+ message.up = $root$1.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
3071
+ break;
3072
+ case 4:
3073
+ message.fovHeight = reader.float();
3074
+ break;
3075
+ default:
3076
+ reader.skipType(tag & 7);
3077
+ break;
3078
+ }
3079
+ }
3080
+ return message;
3081
+ };
3082
+
3083
+ /**
3084
+ * Decodes an OrthographicCamera message from the specified reader or buffer, length delimited.
3085
+ * @function decodeDelimited
3086
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
3087
+ * @static
3088
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3089
+ * @returns {vertexvis.protobuf.stream.OrthographicCamera} OrthographicCamera
3090
+ * @throws {Error} If the payload is not a reader or valid buffer
3091
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3092
+ */
3093
+ OrthographicCamera.decodeDelimited = function decodeDelimited(reader) {
3094
+ if (!(reader instanceof $Reader$1))
3095
+ reader = new $Reader$1(reader);
3096
+ return this.decode(reader, reader.uint32());
3097
+ };
3098
+
3099
+ /**
3100
+ * Verifies an OrthographicCamera message.
3101
+ * @function verify
3102
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
3103
+ * @static
3104
+ * @param {Object.<string,*>} message Plain object to verify
3105
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
3106
+ */
3107
+ OrthographicCamera.verify = function verify(message) {
3108
+ if (typeof message !== "object" || message === null)
3109
+ return "object expected";
3110
+ if (message.viewVector != null && message.hasOwnProperty("viewVector")) {
3111
+ let error = $root$1.vertexvis.protobuf.core.Vector3f.verify(message.viewVector);
3112
+ if (error)
3113
+ return "viewVector." + error;
3114
+ }
3115
+ if (message.lookAt != null && message.hasOwnProperty("lookAt")) {
3116
+ let error = $root$1.vertexvis.protobuf.core.Vector3f.verify(message.lookAt);
3117
+ if (error)
3118
+ return "lookAt." + error;
3119
+ }
3120
+ if (message.up != null && message.hasOwnProperty("up")) {
3121
+ let error = $root$1.vertexvis.protobuf.core.Vector3f.verify(message.up);
3122
+ if (error)
3123
+ return "up." + error;
3124
+ }
3125
+ if (message.fovHeight != null && message.hasOwnProperty("fovHeight"))
3126
+ if (typeof message.fovHeight !== "number")
3127
+ return "fovHeight: number expected";
3128
+ return null;
3129
+ };
3130
+
3131
+ /**
3132
+ * Creates an OrthographicCamera message from a plain object. Also converts values to their respective internal types.
3133
+ * @function fromObject
3134
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
3135
+ * @static
3136
+ * @param {Object.<string,*>} object Plain object
3137
+ * @returns {vertexvis.protobuf.stream.OrthographicCamera} OrthographicCamera
3138
+ */
3139
+ OrthographicCamera.fromObject = function fromObject(object) {
3140
+ if (object instanceof $root$1.vertexvis.protobuf.stream.OrthographicCamera)
3141
+ return object;
3142
+ let message = new $root$1.vertexvis.protobuf.stream.OrthographicCamera();
3143
+ if (object.viewVector != null) {
3144
+ if (typeof object.viewVector !== "object")
3145
+ throw TypeError(".vertexvis.protobuf.stream.OrthographicCamera.viewVector: object expected");
3146
+ message.viewVector = $root$1.vertexvis.protobuf.core.Vector3f.fromObject(object.viewVector);
3147
+ }
3148
+ if (object.lookAt != null) {
3149
+ if (typeof object.lookAt !== "object")
3150
+ throw TypeError(".vertexvis.protobuf.stream.OrthographicCamera.lookAt: object expected");
3151
+ message.lookAt = $root$1.vertexvis.protobuf.core.Vector3f.fromObject(object.lookAt);
3152
+ }
3153
+ if (object.up != null) {
3154
+ if (typeof object.up !== "object")
3155
+ throw TypeError(".vertexvis.protobuf.stream.OrthographicCamera.up: object expected");
3156
+ message.up = $root$1.vertexvis.protobuf.core.Vector3f.fromObject(object.up);
3157
+ }
3158
+ if (object.fovHeight != null)
3159
+ message.fovHeight = Number(object.fovHeight);
3160
+ return message;
3161
+ };
3162
+
3163
+ /**
3164
+ * Creates a plain object from an OrthographicCamera message. Also converts values to other types if specified.
3165
+ * @function toObject
3166
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
3167
+ * @static
3168
+ * @param {vertexvis.protobuf.stream.OrthographicCamera} message OrthographicCamera
3169
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
3170
+ * @returns {Object.<string,*>} Plain object
3171
+ */
3172
+ OrthographicCamera.toObject = function toObject(message, options) {
3173
+ if (!options)
3174
+ options = {};
3175
+ let object = {};
3176
+ if (options.defaults) {
3177
+ object.viewVector = null;
3178
+ object.lookAt = null;
3179
+ object.up = null;
3180
+ object.fovHeight = 0;
3181
+ }
3182
+ if (message.viewVector != null && message.hasOwnProperty("viewVector"))
3183
+ object.viewVector = $root$1.vertexvis.protobuf.core.Vector3f.toObject(message.viewVector, options);
3184
+ if (message.lookAt != null && message.hasOwnProperty("lookAt"))
3185
+ object.lookAt = $root$1.vertexvis.protobuf.core.Vector3f.toObject(message.lookAt, options);
3186
+ if (message.up != null && message.hasOwnProperty("up"))
3187
+ object.up = $root$1.vertexvis.protobuf.core.Vector3f.toObject(message.up, options);
3188
+ if (message.fovHeight != null && message.hasOwnProperty("fovHeight"))
3189
+ object.fovHeight = options.json && !isFinite(message.fovHeight) ? String(message.fovHeight) : message.fovHeight;
3190
+ return object;
3191
+ };
3192
+
3193
+ /**
3194
+ * Converts this OrthographicCamera to JSON.
3195
+ * @function toJSON
3196
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
3197
+ * @instance
3198
+ * @returns {Object.<string,*>} JSON object
3199
+ */
3200
+ OrthographicCamera.prototype.toJSON = function toJSON() {
3201
+ return this.constructor.toObject(this, minimal$2.util.toJSONOptions);
3202
+ };
3203
+
3204
+ return OrthographicCamera;
3205
+ })();
3206
+
2691
3207
  stream.Camera = (function() {
2692
3208
 
2693
3209
  /**
@@ -2697,6 +3213,8 @@ const vertexvis$1 = $root$1.vertexvis = (() => {
2697
3213
  * @property {vertexvis.protobuf.core.IVector3f|null} [position] Camera position
2698
3214
  * @property {vertexvis.protobuf.core.IVector3f|null} [lookAt] Camera lookAt
2699
3215
  * @property {vertexvis.protobuf.core.IVector3f|null} [up] Camera up
3216
+ * @property {vertexvis.protobuf.stream.IPerspectiveCamera|null} [perspective] Camera perspective
3217
+ * @property {vertexvis.protobuf.stream.IOrthographicCamera|null} [orthographic] Camera orthographic
2700
3218
  */
2701
3219
 
2702
3220
  /**
@@ -2738,6 +3256,36 @@ const vertexvis$1 = $root$1.vertexvis = (() => {
2738
3256
  */
2739
3257
  Camera.prototype.up = null;
2740
3258
 
3259
+ /**
3260
+ * Camera perspective.
3261
+ * @member {vertexvis.protobuf.stream.IPerspectiveCamera|null|undefined} perspective
3262
+ * @memberof vertexvis.protobuf.stream.Camera
3263
+ * @instance
3264
+ */
3265
+ Camera.prototype.perspective = null;
3266
+
3267
+ /**
3268
+ * Camera orthographic.
3269
+ * @member {vertexvis.protobuf.stream.IOrthographicCamera|null|undefined} orthographic
3270
+ * @memberof vertexvis.protobuf.stream.Camera
3271
+ * @instance
3272
+ */
3273
+ Camera.prototype.orthographic = null;
3274
+
3275
+ // OneOf field names bound to virtual getters and setters
3276
+ let $oneOfFields;
3277
+
3278
+ /**
3279
+ * Camera type.
3280
+ * @member {"perspective"|"orthographic"|undefined} type
3281
+ * @memberof vertexvis.protobuf.stream.Camera
3282
+ * @instance
3283
+ */
3284
+ Object.defineProperty(Camera.prototype, "type", {
3285
+ get: $util$1.oneOfGetter($oneOfFields = ["perspective", "orthographic"]),
3286
+ set: $util$1.oneOfSetter($oneOfFields)
3287
+ });
3288
+
2741
3289
  /**
2742
3290
  * Creates a new Camera instance using the specified properties.
2743
3291
  * @function create
@@ -2768,6 +3316,10 @@ const vertexvis$1 = $root$1.vertexvis = (() => {
2768
3316
  $root$1.vertexvis.protobuf.core.Vector3f.encode(message.lookAt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
2769
3317
  if (message.up != null && Object.hasOwnProperty.call(message, "up"))
2770
3318
  $root$1.vertexvis.protobuf.core.Vector3f.encode(message.up, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
3319
+ if (message.perspective != null && Object.hasOwnProperty.call(message, "perspective"))
3320
+ $root$1.vertexvis.protobuf.stream.PerspectiveCamera.encode(message.perspective, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
3321
+ if (message.orthographic != null && Object.hasOwnProperty.call(message, "orthographic"))
3322
+ $root$1.vertexvis.protobuf.stream.OrthographicCamera.encode(message.orthographic, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
2771
3323
  return writer;
2772
3324
  };
2773
3325
 
@@ -2811,6 +3363,12 @@ const vertexvis$1 = $root$1.vertexvis = (() => {
2811
3363
  case 3:
2812
3364
  message.up = $root$1.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
2813
3365
  break;
3366
+ case 4:
3367
+ message.perspective = $root$1.vertexvis.protobuf.stream.PerspectiveCamera.decode(reader, reader.uint32());
3368
+ break;
3369
+ case 5:
3370
+ message.orthographic = $root$1.vertexvis.protobuf.stream.OrthographicCamera.decode(reader, reader.uint32());
3371
+ break;
2814
3372
  default:
2815
3373
  reader.skipType(tag & 7);
2816
3374
  break;
@@ -2846,6 +3404,7 @@ const vertexvis$1 = $root$1.vertexvis = (() => {
2846
3404
  Camera.verify = function verify(message) {
2847
3405
  if (typeof message !== "object" || message === null)
2848
3406
  return "object expected";
3407
+ let properties = {};
2849
3408
  if (message.position != null && message.hasOwnProperty("position")) {
2850
3409
  let error = $root$1.vertexvis.protobuf.core.Vector3f.verify(message.position);
2851
3410
  if (error)
@@ -2861,6 +3420,24 @@ const vertexvis$1 = $root$1.vertexvis = (() => {
2861
3420
  if (error)
2862
3421
  return "up." + error;
2863
3422
  }
3423
+ if (message.perspective != null && message.hasOwnProperty("perspective")) {
3424
+ properties.type = 1;
3425
+ {
3426
+ let error = $root$1.vertexvis.protobuf.stream.PerspectiveCamera.verify(message.perspective);
3427
+ if (error)
3428
+ return "perspective." + error;
3429
+ }
3430
+ }
3431
+ if (message.orthographic != null && message.hasOwnProperty("orthographic")) {
3432
+ if (properties.type === 1)
3433
+ return "type: multiple values";
3434
+ properties.type = 1;
3435
+ {
3436
+ let error = $root$1.vertexvis.protobuf.stream.OrthographicCamera.verify(message.orthographic);
3437
+ if (error)
3438
+ return "orthographic." + error;
3439
+ }
3440
+ }
2864
3441
  return null;
2865
3442
  };
2866
3443
 
@@ -2891,6 +3468,16 @@ const vertexvis$1 = $root$1.vertexvis = (() => {
2891
3468
  throw TypeError(".vertexvis.protobuf.stream.Camera.up: object expected");
2892
3469
  message.up = $root$1.vertexvis.protobuf.core.Vector3f.fromObject(object.up);
2893
3470
  }
3471
+ if (object.perspective != null) {
3472
+ if (typeof object.perspective !== "object")
3473
+ throw TypeError(".vertexvis.protobuf.stream.Camera.perspective: object expected");
3474
+ message.perspective = $root$1.vertexvis.protobuf.stream.PerspectiveCamera.fromObject(object.perspective);
3475
+ }
3476
+ if (object.orthographic != null) {
3477
+ if (typeof object.orthographic !== "object")
3478
+ throw TypeError(".vertexvis.protobuf.stream.Camera.orthographic: object expected");
3479
+ message.orthographic = $root$1.vertexvis.protobuf.stream.OrthographicCamera.fromObject(object.orthographic);
3480
+ }
2894
3481
  return message;
2895
3482
  };
2896
3483
 
@@ -2918,6 +3505,16 @@ const vertexvis$1 = $root$1.vertexvis = (() => {
2918
3505
  object.lookAt = $root$1.vertexvis.protobuf.core.Vector3f.toObject(message.lookAt, options);
2919
3506
  if (message.up != null && message.hasOwnProperty("up"))
2920
3507
  object.up = $root$1.vertexvis.protobuf.core.Vector3f.toObject(message.up, options);
3508
+ if (message.perspective != null && message.hasOwnProperty("perspective")) {
3509
+ object.perspective = $root$1.vertexvis.protobuf.stream.PerspectiveCamera.toObject(message.perspective, options);
3510
+ if (options.oneofs)
3511
+ object.type = "perspective";
3512
+ }
3513
+ if (message.orthographic != null && message.hasOwnProperty("orthographic")) {
3514
+ object.orthographic = $root$1.vertexvis.protobuf.stream.OrthographicCamera.toObject(message.orthographic, options);
3515
+ if (options.oneofs)
3516
+ object.type = "orthographic";
3517
+ }
2921
3518
  return object;
2922
3519
  };
2923
3520
 
@@ -35820,25 +36417,125 @@ class Token {
35820
36417
  }
35821
36418
  }
35822
36419
 
35823
- function fromBoundingBoxAndLookAtCamera(boundingBox, camera) {
36420
+ function isPerspectiveFrameCamera(camera) {
36421
+ return (camera.position != null &&
36422
+ camera.fovHeight == null);
36423
+ }
36424
+ function isOrthographicFrameCamera(camera) {
36425
+ const asOrtho = camera;
36426
+ return asOrtho.viewVector != null && asOrtho.fovHeight != null;
36427
+ }
36428
+ function withPositionAndViewVector(camera) {
36429
+ if (isOrthographicFrameCamera(camera)) {
36430
+ return Object.assign(Object.assign({}, camera), { position: bundle_esm.vector3.add(camera.lookAt, bundle_esm.vector3.negate(camera.viewVector)) });
36431
+ }
36432
+ else {
36433
+ return Object.assign(Object.assign({}, camera), { viewVector: bundle_esm.vector3.subtract(camera.lookAt, camera.position) });
36434
+ }
36435
+ }
36436
+ function toOrthographic(data, boundingBox) {
36437
+ var _a;
36438
+ const viewVector = bundle_esm.vector3.subtract(data.lookAt, data.position);
35824
36439
  const boundingBoxCenter = bundle_esm.boundingBox.center(boundingBox);
35825
- const cameraToCenter = bundle_esm.vector3.subtract(camera.position, boundingBoxCenter);
35826
36440
  const centerToBoundingPlane = bundle_esm.vector3.subtract(boundingBox.max, boundingBoxCenter);
35827
- const distanceToCenterAlongViewVec = Math.abs(bundle_esm.vector3.dot(bundle_esm.vector3.subtract(camera.lookAt, camera.position), cameraToCenter)) / bundle_esm.vector3.magnitude(bundle_esm.vector3.subtract(camera.lookAt, camera.position));
35828
- const radius = 1.1 * bundle_esm.vector3.magnitude(centerToBoundingPlane);
35829
- let far = distanceToCenterAlongViewVec + radius;
35830
- let near = far * 0.01;
35831
- if (near > distanceToCenterAlongViewVec - radius) {
35832
- if (near > 1000) {
35833
- const difference = near - 1000;
35834
- near = 1000;
35835
- far -= difference;
35836
- }
36441
+ const radius = bundle_esm.vector3.magnitude(centerToBoundingPlane);
36442
+ const scale = radius / bundle_esm.vector3.magnitude(viewVector);
36443
+ return {
36444
+ viewVector: bundle_esm.vector3.scale(scale, viewVector),
36445
+ up: data.up,
36446
+ lookAt: data.lookAt,
36447
+ fovHeight: 2 *
36448
+ bundle_esm.vector3.magnitude(viewVector) *
36449
+ Math.tan(bundle_esm.angle.toRadians(((_a = data.fovY) !== null && _a !== void 0 ? _a : 45) / 2.0)),
36450
+ };
36451
+ }
36452
+ function toPerspective(data, fovY = 45) {
36453
+ const expectedMagnitude = data.fovHeight / (2 * Math.tan(bundle_esm.angle.toRadians(fovY / 2.0)));
36454
+ const receivedMagnitude = bundle_esm.vector3.magnitude(data.viewVector);
36455
+ const magnitudeScale = expectedMagnitude / receivedMagnitude;
36456
+ return {
36457
+ position: bundle_esm.vector3.add(data.lookAt, bundle_esm.vector3.negate(bundle_esm.vector3.scale(magnitudeScale, data.viewVector))),
36458
+ up: data.up,
36459
+ lookAt: data.lookAt,
36460
+ fovY,
36461
+ };
36462
+ }
36463
+ function toProtobuf(camera) {
36464
+ if (isOrthographicFrameCamera(camera)) {
36465
+ return {
36466
+ orthographic: {
36467
+ viewVector: Object.assign({}, camera.viewVector),
36468
+ lookAt: Object.assign({}, camera.lookAt),
36469
+ up: Object.assign({}, camera.up),
36470
+ fovHeight: camera.fovHeight,
36471
+ },
36472
+ };
36473
+ }
36474
+ else if (isPerspectiveFrameCamera(camera)) {
36475
+ return {
36476
+ perspective: {
36477
+ position: Object.assign({}, camera.position),
36478
+ lookAt: Object.assign({}, camera.lookAt),
36479
+ up: Object.assign({}, camera.up),
36480
+ },
36481
+ position: Object.assign({}, camera.position),
36482
+ lookAt: Object.assign({}, camera.lookAt),
36483
+ up: Object.assign({}, camera.up),
36484
+ };
35837
36485
  }
35838
36486
  else {
35839
- near = distanceToCenterAlongViewVec - radius;
36487
+ return Object.assign({}, camera);
35840
36488
  }
35841
- return { far, near };
36489
+ }
36490
+
36491
+ function fromBoundingBoxAndLookAtCamera(boundingBox, camera) {
36492
+ return isOrthographicFrameCamera(camera)
36493
+ ? fromBoundingBoxAndOrthographicCamera(boundingBox)
36494
+ : fromBoundingBoxAndPerspectiveCamera(boundingBox, camera);
36495
+ }
36496
+ // Logic pulled from https://github.com/Vertexvis/rendering-client-lib-java/blob/master/src/main/java/com/vertexvis/rendering/graphics/PerspectiveCamera.java#L65
36497
+ // and needs to remain in sync with that computation.
36498
+ // TODO: revisit computation of these values in a single location
36499
+ function fromBoundingBoxAndPerspectiveCamera(boundingBox, camera) {
36500
+ const boundingSphere = bundle_esm.boundingSphere.create(boundingBox);
36501
+ const minRange = boundingSphere.epsilon * 1e2;
36502
+ const signedDistToEye = bundle_esm.vector3.dot(bundle_esm.vector3.subtract(boundingSphere.center, camera.position), bundle_esm.vector3.normalize(bundle_esm.vector3.subtract(camera.lookAt, camera.position)));
36503
+ const bRadius = Math.max(boundingSphere.radius, minRange);
36504
+ let newFar = bRadius + signedDistToEye < minRange
36505
+ ? bRadius * 3.0
36506
+ : bRadius + signedDistToEye;
36507
+ let newNear = newFar - bRadius * 2.0 < minRange
36508
+ ? Math.min(minRange, newFar)
36509
+ : newFar - bRadius * 2.0;
36510
+ if (newFar - newNear < minRange) {
36511
+ newNear = Math.max(newNear, minRange);
36512
+ newFar += newNear + minRange;
36513
+ }
36514
+ else if (newNear / newFar < 0.0001) {
36515
+ newNear = newFar * 0.0001;
36516
+ }
36517
+ if (newNear > newFar - bRadius * 2.0) {
36518
+ if (newNear > 1000 + minRange) {
36519
+ newFar -= newNear - 1000;
36520
+ newNear = 1000;
36521
+ }
36522
+ }
36523
+ return {
36524
+ near: newNear,
36525
+ far: newFar,
36526
+ };
36527
+ }
36528
+ // Logic pulled from https://github.com/Vertexvis/rendering-client-lib-java/blob/master/src/main/java/com/vertexvis/rendering/graphics/OrthographicCamera.java#L35
36529
+ // and needs to remain in sync with that computation.
36530
+ // TODO: revisit computation of these values in a single location
36531
+ function fromBoundingBoxAndOrthographicCamera(boundingBox, camera) {
36532
+ const boundingSphere = bundle_esm.boundingSphere.create(boundingBox);
36533
+ const minRange = boundingSphere.epsilon * 1e2;
36534
+ const bRadius = Math.max(boundingSphere.radius, minRange);
36535
+ return {
36536
+ near: -bRadius,
36537
+ far: bRadius,
36538
+ };
35842
36539
  }
35843
36540
 
35844
36541
  function create$2(data = {}) {
@@ -35890,7 +36587,7 @@ class DepthBuffer {
35890
36587
  /**
35891
36588
  * Computes the depth from a 2D point within the coordinate space of the depth
35892
36589
  * buffer. The returned depth is a value that's between the near and far plane
35893
- * of the camera.
36590
+ * of the perspective camera.
35894
36591
  *
35895
36592
  * @param point A 2D point within the viewport.
35896
36593
  * @param fallbackNormalizedDepth A fallback value if the depth is the max
@@ -35902,6 +36599,21 @@ class DepthBuffer {
35902
36599
  const depth = this.getNormalizedDepthAtPoint(point, fallbackNormalizedDepth);
35903
36600
  return depth * (far - near) + near;
35904
36601
  }
36602
+ /**
36603
+ * Computes the depth from a 2D point within the coordinate space of the depth
36604
+ * buffer. The returned depth is a value that's between the near and far plane
36605
+ * of the orthographic camera.
36606
+ *
36607
+ * @param point A 2D point within the viewport.
36608
+ * @param fallbackNormalizedDepth A fallback value if the depth is the max
36609
+ * depth value, or cannot be determined.
36610
+ * @returns A depth between the near and far plane.
36611
+ */
36612
+ getOrthographicDepthAtPoint(point, fallbackNormalizedDepth) {
36613
+ const { near, far } = this.camera;
36614
+ const depth = this.getNormalizedDepthAtPoint(point, fallbackNormalizedDepth);
36615
+ return depth * (far - near) + near / 2;
36616
+ }
35905
36617
  /**
35906
36618
  * Computes a depth from a 2D point within the coordinate space of the frame.
35907
36619
  * The returned depth is a normalized value (`[0, 1]`) between the near and
@@ -35942,7 +36654,7 @@ class DepthBuffer {
35942
36654
  return this.getNormalizedDepthAtPoint(point) < 1;
35943
36655
  }
35944
36656
  /**
35945
- * Computes a 3D point in world space coordinates from the depth value at the
36657
+ * Computes a 3D point in perspective world space coordinates from the depth value at the
35946
36658
  * given pixel and ray.
35947
36659
  *
35948
36660
  * @param point A pixel to use for reading a depth value.
@@ -35962,6 +36674,20 @@ class DepthBuffer {
35962
36674
  (bundle_esm.vector3.magnitude(vv) * bundle_esm.vector3.magnitude(eyeToWorldPt));
35963
36675
  return bundle_esm.ray.at(ray, distance / angle);
35964
36676
  }
36677
+ /**
36678
+ * Computes a 3D point in orthographic world space coordinates from the depth value at the
36679
+ * given pixel and ray.
36680
+ *
36681
+ * @param point A pixel to use for reading a depth value.
36682
+ * @param ray A ray that specifies the origin and direction.
36683
+ * @param fallbackNormalizedDepth A fallback value if the depth is the max
36684
+ * depth value, or cannot be determined.
36685
+ * @returns A point in world space coordinates.
36686
+ */
36687
+ getOrthographicWorldPoint(point, ray, fallbackNormalizedDepth) {
36688
+ const distance = this.getOrthographicDepthAtPoint(point, fallbackNormalizedDepth);
36689
+ return bundle_esm.ray.at(ray, distance);
36690
+ }
35965
36691
  /**
35966
36692
  * Returns `true` if the given point in world space is occluded by any
35967
36693
  * geometry.
@@ -36113,7 +36839,7 @@ class FeatureMap {
36113
36839
  }
36114
36840
 
36115
36841
  async function loadWorker() {
36116
- return Promise.resolve().then(function () { return require('./png-decoder-27d25eed.js'); });
36842
+ return Promise.resolve().then(function () { return require('./png-decoder-076131d8.js'); });
36117
36843
  }
36118
36844
 
36119
36845
  let workerLoader;
@@ -36153,6 +36879,12 @@ const decodePng = async (bytes) => {
36153
36879
  // Prefetch the worker and initialize the pool.
36154
36880
  getPool();
36155
36881
 
36882
+ function constrainViewVector(viewVector, boundingSphere) {
36883
+ const magnitude = bundle_esm.vector3.magnitude(viewVector);
36884
+ const scale = boundingSphere.radius / magnitude;
36885
+ return bundle_esm.vector3.scale(scale, viewVector);
36886
+ }
36887
+
36156
36888
  class Frame {
36157
36889
  constructor(correlationIds, sequenceNumber, dimensions, image, scene, depthBufferBytes, featureMapBytes) {
36158
36890
  this.correlationIds = correlationIds;
@@ -36205,19 +36937,14 @@ class FrameScene {
36205
36937
  this.hasChanged = hasChanged;
36206
36938
  }
36207
36939
  }
36208
- class FramePerspectiveCamera {
36209
- constructor(position, lookAt, up, near, far, aspectRatio, fovY) {
36940
+ class FrameCameraBase {
36941
+ constructor(position, lookAt, up, near, far, aspectRatio) {
36210
36942
  this.position = position;
36211
36943
  this.lookAt = lookAt;
36212
36944
  this.up = up;
36213
36945
  this.near = near;
36214
36946
  this.far = far;
36215
36947
  this.aspectRatio = aspectRatio;
36216
- this.fovY = fovY;
36217
- }
36218
- static fromBoundingBox(camera, boundingBox, aspectRatio) {
36219
- const { near, far } = fromBoundingBoxAndLookAtCamera(boundingBox, camera);
36220
- return new FramePerspectiveCamera(camera.position, camera.lookAt, camera.up, near, far, aspectRatio, 45);
36221
36948
  }
36222
36949
  get direction() {
36223
36950
  return bundle_esm.vector3.normalize(this.viewVector);
@@ -36240,22 +36967,29 @@ class FramePerspectiveCamera {
36240
36967
  get projectionViewMatrix() {
36241
36968
  return this.computeCameraMatrices().projectionViewMatrix;
36242
36969
  }
36243
- computeCameraMatrices() {
36244
- if (this.cameraMatrices == null) {
36245
- const viewMatrix = bundle_esm.matrix4.makeLookAtView(this.position, this.lookAt, this.up);
36246
- const worldMatrix = bundle_esm.matrix4.invert(viewMatrix);
36247
- const projectionMatrix = bundle_esm.matrix4.makePerspective(this.near, this.far, this.fovY, this.aspectRatio);
36248
- const projectionMatrixInverse = bundle_esm.matrix4.invert(projectionMatrix);
36249
- const projectionViewMatrix = bundle_esm.matrix4.multiply(projectionMatrix, viewMatrix);
36250
- this.cameraMatrices = {
36251
- viewMatrix,
36252
- worldMatrix,
36253
- projectionMatrix,
36254
- projectionMatrixInverse,
36255
- projectionViewMatrix,
36256
- };
36970
+ get frustumProjectionViewMatrix() {
36971
+ return this.computeCameraMatrices().projectionViewMatrix;
36972
+ }
36973
+ static fromBoundingBox(camera, boundingBox, aspectRatio) {
36974
+ const { near, far } = fromBoundingBoxAndLookAtCamera(boundingBox, camera);
36975
+ if (isOrthographicFrameCamera(camera)) {
36976
+ return new FrameOrthographicCamera(constrainViewVector(camera.viewVector, bundle_esm.boundingSphere.create(boundingBox)), camera.lookAt, camera.up, near, far, aspectRatio, camera.fovHeight);
36257
36977
  }
36258
- return this.cameraMatrices;
36978
+ else {
36979
+ return new FramePerspectiveCamera(camera.position, camera.lookAt, camera.up, near, far, aspectRatio, 45);
36980
+ }
36981
+ }
36982
+ /**
36983
+ * Returns whether this `FrameCameraBase` is an orthographic camera.
36984
+ */
36985
+ isOrthographic() {
36986
+ return false;
36987
+ }
36988
+ /**
36989
+ * Returns whether this `FrameCameraBase` is a perspective camera.
36990
+ */
36991
+ isPerspective() {
36992
+ return false;
36259
36993
  }
36260
36994
  /**
36261
36995
  * Checks if the given point, in world space, is behind the near plane
@@ -36286,6 +37020,111 @@ class FramePerspectiveCamera {
36286
37020
  const pt = bundle_esm.plane.intersectLine(nearP, vl);
36287
37021
  return pt != null ? bundle_esm.vector3.add(pt, position) : undefined;
36288
37022
  }
37023
+ computeCameraMatrices() {
37024
+ if (this.cameraMatrices == null) {
37025
+ return {
37026
+ viewMatrix: bundle_esm.matrix4.makeIdentity(),
37027
+ worldMatrix: bundle_esm.matrix4.makeIdentity(),
37028
+ projectionMatrix: bundle_esm.matrix4.makeIdentity(),
37029
+ projectionMatrixInverse: bundle_esm.matrix4.makeIdentity(),
37030
+ projectionViewMatrix: bundle_esm.matrix4.makeIdentity(),
37031
+ };
37032
+ }
37033
+ return this.cameraMatrices;
37034
+ }
37035
+ updateCameraMatrices(cameraMatrices) {
37036
+ this.cameraMatrices = cameraMatrices;
37037
+ return this.cameraMatrices;
37038
+ }
37039
+ }
37040
+ class FramePerspectiveCamera extends FrameCameraBase {
37041
+ constructor(position, lookAt, up, near, far, aspectRatio, fovY = 45) {
37042
+ super(position, lookAt, up, near, far, aspectRatio);
37043
+ this.position = position;
37044
+ this.lookAt = lookAt;
37045
+ this.up = up;
37046
+ this.near = near;
37047
+ this.far = far;
37048
+ this.aspectRatio = aspectRatio;
37049
+ this.fovY = fovY;
37050
+ }
37051
+ /**
37052
+ * Converts this `FramePerspectiveCamera` to a `FrameOrthographicCamera` using
37053
+ * the provided `boundingBox` to compute the viewing frustum.
37054
+ *
37055
+ * @param boundingBox The visible bounding box.
37056
+ */
37057
+ toOrthographic(boundingBox) {
37058
+ return FrameCameraBase.fromBoundingBox(toOrthographic(this, boundingBox), boundingBox, this.aspectRatio);
37059
+ }
37060
+ isPerspective() {
37061
+ return true;
37062
+ }
37063
+ computeCameraMatrices() {
37064
+ if (this.cameraMatrices == null) {
37065
+ const viewMatrix = bundle_esm.matrix4.makeLookAtView(this.position, this.lookAt, this.up);
37066
+ const worldMatrix = bundle_esm.matrix4.invert(viewMatrix);
37067
+ const projectionMatrix = bundle_esm.matrix4.makePerspective(this.near, this.far, this.fovY, this.aspectRatio);
37068
+ const projectionMatrixInverse = bundle_esm.matrix4.invert(projectionMatrix);
37069
+ const projectionViewMatrix = bundle_esm.matrix4.multiply(projectionMatrix, viewMatrix);
37070
+ return super.updateCameraMatrices({
37071
+ viewMatrix,
37072
+ worldMatrix,
37073
+ projectionMatrix,
37074
+ projectionMatrixInverse,
37075
+ projectionViewMatrix,
37076
+ });
37077
+ }
37078
+ return this.cameraMatrices;
37079
+ }
37080
+ }
37081
+ class FrameOrthographicCamera extends FrameCameraBase {
37082
+ constructor(viewVector, lookAt, up, near, far, aspectRatio, fovHeight) {
37083
+ super(bundle_esm.vector3.add(lookAt, bundle_esm.vector3.negate(viewVector)), lookAt, up, near, far, aspectRatio);
37084
+ this.lookAt = lookAt;
37085
+ this.up = up;
37086
+ this.near = near;
37087
+ this.far = far;
37088
+ this.aspectRatio = aspectRatio;
37089
+ this.fovHeight = fovHeight;
37090
+ this.top = fovHeight * 0.5;
37091
+ this.bottom = -this.top;
37092
+ this.right = this.top * aspectRatio;
37093
+ this.left = -this.right;
37094
+ }
37095
+ /**
37096
+ * Converts this `FrameOrthographicCamera` to a `FramePerspectiveCamera` using
37097
+ * the provided `boundingBox` to compute the near and far clipping planes.
37098
+ *
37099
+ * @param boundingBox The visible bounding box.
37100
+ */
37101
+ toPerspective(boundingBox) {
37102
+ return FrameCameraBase.fromBoundingBox(toPerspective(this), boundingBox, this.aspectRatio);
37103
+ }
37104
+ isOrthographic() {
37105
+ return true;
37106
+ }
37107
+ get frustumProjectionViewMatrix() {
37108
+ const frustumProjectionMatrix = bundle_esm.matrix4.makeFrustum(this.left, this.right, this.top, this.bottom, this.near, this.far);
37109
+ return bundle_esm.matrix4.multiply(frustumProjectionMatrix, this.computeCameraMatrices().viewMatrix);
37110
+ }
37111
+ computeCameraMatrices() {
37112
+ if (this.cameraMatrices == null) {
37113
+ const viewMatrix = bundle_esm.matrix4.makeLookAtView(this.position, this.lookAt, this.up);
37114
+ const worldMatrix = bundle_esm.matrix4.invert(viewMatrix);
37115
+ const projectionMatrix = bundle_esm.matrix4.makeOrthographic(this.left, this.right, this.bottom, this.top, this.near, this.far);
37116
+ const projectionMatrixInverse = bundle_esm.matrix4.invert(projectionMatrix);
37117
+ const projectionViewMatrix = bundle_esm.matrix4.multiply(projectionMatrix, viewMatrix);
37118
+ return super.updateCameraMatrices({
37119
+ viewMatrix,
37120
+ worldMatrix,
37121
+ projectionMatrix,
37122
+ projectionMatrixInverse,
37123
+ projectionViewMatrix,
37124
+ });
37125
+ }
37126
+ return this.cameraMatrices;
37127
+ }
36289
37128
  }
36290
37129
 
36291
37130
  class ScaledUnitConverter {
@@ -36739,7 +37578,29 @@ function fromPbScalarWrapper() {
36739
37578
  return browser_esm.mapper.defineMapper((value) => (value === null || value === void 0 ? void 0 : value.value) || undefined, (value) => value);
36740
37579
  }
36741
37580
 
36742
- const fromPbCamera = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('position', browser_esm.mapper.compose(browser_esm.mapper.required('position'), fromPbVector3f)), browser_esm.mapper.mapProp('lookAt', browser_esm.mapper.compose(browser_esm.mapper.required('lookAt'), fromPbVector3f)), browser_esm.mapper.mapProp('up', browser_esm.mapper.compose(browser_esm.mapper.required('up'), fromPbVector3f))), ([position, lookAt, up]) => ({ position, lookAt, up }));
37581
+ const fromPbPerspectiveCamera = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('position', browser_esm.mapper.compose(browser_esm.mapper.required('position'), fromPbVector3f)), browser_esm.mapper.mapProp('lookAt', browser_esm.mapper.compose(browser_esm.mapper.required('lookAt'), fromPbVector3f)), browser_esm.mapper.mapProp('up', browser_esm.mapper.compose(browser_esm.mapper.required('up'), fromPbVector3f))), ([position, lookAt, up]) => ({
37582
+ position,
37583
+ lookAt,
37584
+ up,
37585
+ // TODO: map fovY property when available
37586
+ fovY: 45,
37587
+ }));
37588
+ const fromPbOrthographicCamera = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('viewVector', browser_esm.mapper.compose(browser_esm.mapper.required('viewVector'), fromPbVector3f)), browser_esm.mapper.mapProp('lookAt', browser_esm.mapper.compose(browser_esm.mapper.required('lookAt'), fromPbVector3f)), browser_esm.mapper.mapProp('up', browser_esm.mapper.compose(browser_esm.mapper.required('up'), fromPbVector3f)), browser_esm.mapper.mapProp('fovHeight', browser_esm.mapper.required('fovHeight'))), ([viewVector, lookAt, up, fovHeight]) => ({
37589
+ viewVector,
37590
+ lookAt,
37591
+ up,
37592
+ fovHeight,
37593
+ }));
37594
+ const fromPbCamera = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('position', browser_esm.mapper.ifDefined(fromPbVector3f)), browser_esm.mapper.mapProp('lookAt', browser_esm.mapper.ifDefined(fromPbVector3f)), browser_esm.mapper.mapProp('up', browser_esm.mapper.ifDefined(fromPbVector3f)), browser_esm.mapper.mapProp('perspective', browser_esm.mapper.ifDefined(fromPbPerspectiveCamera)), browser_esm.mapper.mapProp('orthographic', browser_esm.mapper.ifDefined(fromPbOrthographicCamera))), ([position, lookAt, up, perspective, orthographic]) => {
37595
+ var _a;
37596
+ return (_a = perspective !== null && perspective !== void 0 ? perspective : orthographic) !== null && _a !== void 0 ? _a : {
37597
+ position: position !== null && position !== void 0 ? position : bundle_esm.vector3.back(),
37598
+ lookAt: lookAt !== null && lookAt !== void 0 ? lookAt : bundle_esm.vector3.origin(),
37599
+ up: up !== null && up !== void 0 ? up : bundle_esm.vector3.up(),
37600
+ // TODO: map fovY property when available
37601
+ fovY: 45,
37602
+ };
37603
+ });
36743
37604
  const fromPbSectionPlane = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('normal', browser_esm.mapper.compose(browser_esm.mapper.required('normal'), fromPbVector3f)), browser_esm.mapper.requiredProp('offset')), ([normal, offset]) => ({ normal, offset }));
36744
37605
  const fromPbImageAttributes = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('frameDimensions', browser_esm.mapper.compose(browser_esm.mapper.required('frameDimensions'), fromPbDim)), browser_esm.mapper.mapProp('imageRect', browser_esm.mapper.compose(browser_esm.mapper.required('imageRect'), fromPbRect)), browser_esm.mapper.mapProp('scaleFactor', browser_esm.mapper.required('scaleFactor'))), ([frameDimensions, imageRect, imageScale]) => ({
36745
37606
  frameDimensions,
@@ -36759,7 +37620,7 @@ const fromPbSceneAttributes = browser_esm.mapper.defineMapper(browser_esm.mapper
36759
37620
  hasChanged,
36760
37621
  }));
36761
37622
  const fromPbFrameSceneAttributes = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('sceneAttributes', browser_esm.mapper.compose(browser_esm.mapper.required('sceneAttributes'), fromPbSceneAttributes))), ([sceneAttr]) => sceneAttr);
36762
- const fromPbFrameCamera = browser_esm.mapper.defineMapper(browser_esm.mapper.read(fromPbFrameSceneAttributes, fromPbFrameImageAttributes), ([sceneAttr, imageAttr]) => FramePerspectiveCamera.fromBoundingBox(sceneAttr.camera, sceneAttr.boundingBox, bundle_esm.dimensions.aspectRatio(imageAttr.frameDimensions)));
37623
+ const fromPbFrameCamera = browser_esm.mapper.defineMapper(browser_esm.mapper.read(fromPbFrameSceneAttributes, fromPbFrameImageAttributes), ([sceneAttr, imageAttr]) => FrameCameraBase.fromBoundingBox(sceneAttr.camera, sceneAttr.boundingBox, bundle_esm.dimensions.aspectRatio(imageAttr.frameDimensions)));
36763
37624
  function fromPbFrameScene(worldOrientation) {
36764
37625
  return browser_esm.mapper.defineMapper(browser_esm.mapper.read(fromPbFrameSceneAttributes, fromPbFrameCamera), ([sceneAttr, camera]) => new FrameScene(camera, sceneAttr.boundingBox, sceneAttr.crossSectioning, worldOrientation, sceneAttr.hasChanged));
36765
37626
  }
@@ -39464,6 +40325,522 @@ const vertexvis = $root.vertexvis = (() => {
39464
40325
  */
39465
40326
  const stream = {};
39466
40327
 
40328
+ stream.PerspectiveCamera = (function() {
40329
+
40330
+ /**
40331
+ * Properties of a PerspectiveCamera.
40332
+ * @memberof vertexvis.protobuf.stream
40333
+ * @interface IPerspectiveCamera
40334
+ * @property {vertexvis.protobuf.core.IVector3f|null} [position] PerspectiveCamera position
40335
+ * @property {vertexvis.protobuf.core.IVector3f|null} [lookAt] PerspectiveCamera lookAt
40336
+ * @property {vertexvis.protobuf.core.IVector3f|null} [up] PerspectiveCamera up
40337
+ */
40338
+
40339
+ /**
40340
+ * Constructs a new PerspectiveCamera.
40341
+ * @memberof vertexvis.protobuf.stream
40342
+ * @classdesc Represents a PerspectiveCamera.
40343
+ * @implements IPerspectiveCamera
40344
+ * @constructor
40345
+ * @param {vertexvis.protobuf.stream.IPerspectiveCamera=} [properties] Properties to set
40346
+ */
40347
+ function PerspectiveCamera(properties) {
40348
+ if (properties)
40349
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
40350
+ if (properties[keys[i]] != null)
40351
+ this[keys[i]] = properties[keys[i]];
40352
+ }
40353
+
40354
+ /**
40355
+ * PerspectiveCamera position.
40356
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} position
40357
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40358
+ * @instance
40359
+ */
40360
+ PerspectiveCamera.prototype.position = null;
40361
+
40362
+ /**
40363
+ * PerspectiveCamera lookAt.
40364
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} lookAt
40365
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40366
+ * @instance
40367
+ */
40368
+ PerspectiveCamera.prototype.lookAt = null;
40369
+
40370
+ /**
40371
+ * PerspectiveCamera up.
40372
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} up
40373
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40374
+ * @instance
40375
+ */
40376
+ PerspectiveCamera.prototype.up = null;
40377
+
40378
+ /**
40379
+ * Creates a new PerspectiveCamera instance using the specified properties.
40380
+ * @function create
40381
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40382
+ * @static
40383
+ * @param {vertexvis.protobuf.stream.IPerspectiveCamera=} [properties] Properties to set
40384
+ * @returns {vertexvis.protobuf.stream.PerspectiveCamera} PerspectiveCamera instance
40385
+ */
40386
+ PerspectiveCamera.create = function create(properties) {
40387
+ return new PerspectiveCamera(properties);
40388
+ };
40389
+
40390
+ /**
40391
+ * Encodes the specified PerspectiveCamera message. Does not implicitly {@link vertexvis.protobuf.stream.PerspectiveCamera.verify|verify} messages.
40392
+ * @function encode
40393
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40394
+ * @static
40395
+ * @param {vertexvis.protobuf.stream.IPerspectiveCamera} message PerspectiveCamera message or plain object to encode
40396
+ * @param {$protobuf.Writer} [writer] Writer to encode to
40397
+ * @returns {$protobuf.Writer} Writer
40398
+ */
40399
+ PerspectiveCamera.encode = function encode(message, writer) {
40400
+ if (!writer)
40401
+ writer = $Writer.create();
40402
+ if (message.position != null && Object.hasOwnProperty.call(message, "position"))
40403
+ $root.vertexvis.protobuf.core.Vector3f.encode(message.position, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
40404
+ if (message.lookAt != null && Object.hasOwnProperty.call(message, "lookAt"))
40405
+ $root.vertexvis.protobuf.core.Vector3f.encode(message.lookAt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
40406
+ if (message.up != null && Object.hasOwnProperty.call(message, "up"))
40407
+ $root.vertexvis.protobuf.core.Vector3f.encode(message.up, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
40408
+ return writer;
40409
+ };
40410
+
40411
+ /**
40412
+ * Encodes the specified PerspectiveCamera message, length delimited. Does not implicitly {@link vertexvis.protobuf.stream.PerspectiveCamera.verify|verify} messages.
40413
+ * @function encodeDelimited
40414
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40415
+ * @static
40416
+ * @param {vertexvis.protobuf.stream.IPerspectiveCamera} message PerspectiveCamera message or plain object to encode
40417
+ * @param {$protobuf.Writer} [writer] Writer to encode to
40418
+ * @returns {$protobuf.Writer} Writer
40419
+ */
40420
+ PerspectiveCamera.encodeDelimited = function encodeDelimited(message, writer) {
40421
+ return this.encode(message, writer).ldelim();
40422
+ };
40423
+
40424
+ /**
40425
+ * Decodes a PerspectiveCamera message from the specified reader or buffer.
40426
+ * @function decode
40427
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40428
+ * @static
40429
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
40430
+ * @param {number} [length] Message length if known beforehand
40431
+ * @returns {vertexvis.protobuf.stream.PerspectiveCamera} PerspectiveCamera
40432
+ * @throws {Error} If the payload is not a reader or valid buffer
40433
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
40434
+ */
40435
+ PerspectiveCamera.decode = function decode(reader, length) {
40436
+ if (!(reader instanceof $Reader))
40437
+ reader = $Reader.create(reader);
40438
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vertexvis.protobuf.stream.PerspectiveCamera();
40439
+ while (reader.pos < end) {
40440
+ let tag = reader.uint32();
40441
+ switch (tag >>> 3) {
40442
+ case 1:
40443
+ message.position = $root.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
40444
+ break;
40445
+ case 2:
40446
+ message.lookAt = $root.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
40447
+ break;
40448
+ case 3:
40449
+ message.up = $root.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
40450
+ break;
40451
+ default:
40452
+ reader.skipType(tag & 7);
40453
+ break;
40454
+ }
40455
+ }
40456
+ return message;
40457
+ };
40458
+
40459
+ /**
40460
+ * Decodes a PerspectiveCamera message from the specified reader or buffer, length delimited.
40461
+ * @function decodeDelimited
40462
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40463
+ * @static
40464
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
40465
+ * @returns {vertexvis.protobuf.stream.PerspectiveCamera} PerspectiveCamera
40466
+ * @throws {Error} If the payload is not a reader or valid buffer
40467
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
40468
+ */
40469
+ PerspectiveCamera.decodeDelimited = function decodeDelimited(reader) {
40470
+ if (!(reader instanceof $Reader))
40471
+ reader = new $Reader(reader);
40472
+ return this.decode(reader, reader.uint32());
40473
+ };
40474
+
40475
+ /**
40476
+ * Verifies a PerspectiveCamera message.
40477
+ * @function verify
40478
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40479
+ * @static
40480
+ * @param {Object.<string,*>} message Plain object to verify
40481
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
40482
+ */
40483
+ PerspectiveCamera.verify = function verify(message) {
40484
+ if (typeof message !== "object" || message === null)
40485
+ return "object expected";
40486
+ if (message.position != null && message.hasOwnProperty("position")) {
40487
+ let error = $root.vertexvis.protobuf.core.Vector3f.verify(message.position);
40488
+ if (error)
40489
+ return "position." + error;
40490
+ }
40491
+ if (message.lookAt != null && message.hasOwnProperty("lookAt")) {
40492
+ let error = $root.vertexvis.protobuf.core.Vector3f.verify(message.lookAt);
40493
+ if (error)
40494
+ return "lookAt." + error;
40495
+ }
40496
+ if (message.up != null && message.hasOwnProperty("up")) {
40497
+ let error = $root.vertexvis.protobuf.core.Vector3f.verify(message.up);
40498
+ if (error)
40499
+ return "up." + error;
40500
+ }
40501
+ return null;
40502
+ };
40503
+
40504
+ /**
40505
+ * Creates a PerspectiveCamera message from a plain object. Also converts values to their respective internal types.
40506
+ * @function fromObject
40507
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40508
+ * @static
40509
+ * @param {Object.<string,*>} object Plain object
40510
+ * @returns {vertexvis.protobuf.stream.PerspectiveCamera} PerspectiveCamera
40511
+ */
40512
+ PerspectiveCamera.fromObject = function fromObject(object) {
40513
+ if (object instanceof $root.vertexvis.protobuf.stream.PerspectiveCamera)
40514
+ return object;
40515
+ let message = new $root.vertexvis.protobuf.stream.PerspectiveCamera();
40516
+ if (object.position != null) {
40517
+ if (typeof object.position !== "object")
40518
+ throw TypeError(".vertexvis.protobuf.stream.PerspectiveCamera.position: object expected");
40519
+ message.position = $root.vertexvis.protobuf.core.Vector3f.fromObject(object.position);
40520
+ }
40521
+ if (object.lookAt != null) {
40522
+ if (typeof object.lookAt !== "object")
40523
+ throw TypeError(".vertexvis.protobuf.stream.PerspectiveCamera.lookAt: object expected");
40524
+ message.lookAt = $root.vertexvis.protobuf.core.Vector3f.fromObject(object.lookAt);
40525
+ }
40526
+ if (object.up != null) {
40527
+ if (typeof object.up !== "object")
40528
+ throw TypeError(".vertexvis.protobuf.stream.PerspectiveCamera.up: object expected");
40529
+ message.up = $root.vertexvis.protobuf.core.Vector3f.fromObject(object.up);
40530
+ }
40531
+ return message;
40532
+ };
40533
+
40534
+ /**
40535
+ * Creates a plain object from a PerspectiveCamera message. Also converts values to other types if specified.
40536
+ * @function toObject
40537
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40538
+ * @static
40539
+ * @param {vertexvis.protobuf.stream.PerspectiveCamera} message PerspectiveCamera
40540
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
40541
+ * @returns {Object.<string,*>} Plain object
40542
+ */
40543
+ PerspectiveCamera.toObject = function toObject(message, options) {
40544
+ if (!options)
40545
+ options = {};
40546
+ let object = {};
40547
+ if (options.defaults) {
40548
+ object.position = null;
40549
+ object.lookAt = null;
40550
+ object.up = null;
40551
+ }
40552
+ if (message.position != null && message.hasOwnProperty("position"))
40553
+ object.position = $root.vertexvis.protobuf.core.Vector3f.toObject(message.position, options);
40554
+ if (message.lookAt != null && message.hasOwnProperty("lookAt"))
40555
+ object.lookAt = $root.vertexvis.protobuf.core.Vector3f.toObject(message.lookAt, options);
40556
+ if (message.up != null && message.hasOwnProperty("up"))
40557
+ object.up = $root.vertexvis.protobuf.core.Vector3f.toObject(message.up, options);
40558
+ return object;
40559
+ };
40560
+
40561
+ /**
40562
+ * Converts this PerspectiveCamera to JSON.
40563
+ * @function toJSON
40564
+ * @memberof vertexvis.protobuf.stream.PerspectiveCamera
40565
+ * @instance
40566
+ * @returns {Object.<string,*>} JSON object
40567
+ */
40568
+ PerspectiveCamera.prototype.toJSON = function toJSON() {
40569
+ return this.constructor.toObject(this, minimal.util.toJSONOptions);
40570
+ };
40571
+
40572
+ return PerspectiveCamera;
40573
+ })();
40574
+
40575
+ stream.OrthographicCamera = (function() {
40576
+
40577
+ /**
40578
+ * Properties of an OrthographicCamera.
40579
+ * @memberof vertexvis.protobuf.stream
40580
+ * @interface IOrthographicCamera
40581
+ * @property {vertexvis.protobuf.core.IVector3f|null} [viewVector] OrthographicCamera viewVector
40582
+ * @property {vertexvis.protobuf.core.IVector3f|null} [lookAt] OrthographicCamera lookAt
40583
+ * @property {vertexvis.protobuf.core.IVector3f|null} [up] OrthographicCamera up
40584
+ * @property {number|null} [fovHeight] OrthographicCamera fovHeight
40585
+ */
40586
+
40587
+ /**
40588
+ * Constructs a new OrthographicCamera.
40589
+ * @memberof vertexvis.protobuf.stream
40590
+ * @classdesc Represents an OrthographicCamera.
40591
+ * @implements IOrthographicCamera
40592
+ * @constructor
40593
+ * @param {vertexvis.protobuf.stream.IOrthographicCamera=} [properties] Properties to set
40594
+ */
40595
+ function OrthographicCamera(properties) {
40596
+ if (properties)
40597
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
40598
+ if (properties[keys[i]] != null)
40599
+ this[keys[i]] = properties[keys[i]];
40600
+ }
40601
+
40602
+ /**
40603
+ * OrthographicCamera viewVector.
40604
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} viewVector
40605
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40606
+ * @instance
40607
+ */
40608
+ OrthographicCamera.prototype.viewVector = null;
40609
+
40610
+ /**
40611
+ * OrthographicCamera lookAt.
40612
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} lookAt
40613
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40614
+ * @instance
40615
+ */
40616
+ OrthographicCamera.prototype.lookAt = null;
40617
+
40618
+ /**
40619
+ * OrthographicCamera up.
40620
+ * @member {vertexvis.protobuf.core.IVector3f|null|undefined} up
40621
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40622
+ * @instance
40623
+ */
40624
+ OrthographicCamera.prototype.up = null;
40625
+
40626
+ /**
40627
+ * OrthographicCamera fovHeight.
40628
+ * @member {number} fovHeight
40629
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40630
+ * @instance
40631
+ */
40632
+ OrthographicCamera.prototype.fovHeight = 0;
40633
+
40634
+ /**
40635
+ * Creates a new OrthographicCamera instance using the specified properties.
40636
+ * @function create
40637
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40638
+ * @static
40639
+ * @param {vertexvis.protobuf.stream.IOrthographicCamera=} [properties] Properties to set
40640
+ * @returns {vertexvis.protobuf.stream.OrthographicCamera} OrthographicCamera instance
40641
+ */
40642
+ OrthographicCamera.create = function create(properties) {
40643
+ return new OrthographicCamera(properties);
40644
+ };
40645
+
40646
+ /**
40647
+ * Encodes the specified OrthographicCamera message. Does not implicitly {@link vertexvis.protobuf.stream.OrthographicCamera.verify|verify} messages.
40648
+ * @function encode
40649
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40650
+ * @static
40651
+ * @param {vertexvis.protobuf.stream.IOrthographicCamera} message OrthographicCamera message or plain object to encode
40652
+ * @param {$protobuf.Writer} [writer] Writer to encode to
40653
+ * @returns {$protobuf.Writer} Writer
40654
+ */
40655
+ OrthographicCamera.encode = function encode(message, writer) {
40656
+ if (!writer)
40657
+ writer = $Writer.create();
40658
+ if (message.viewVector != null && Object.hasOwnProperty.call(message, "viewVector"))
40659
+ $root.vertexvis.protobuf.core.Vector3f.encode(message.viewVector, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
40660
+ if (message.lookAt != null && Object.hasOwnProperty.call(message, "lookAt"))
40661
+ $root.vertexvis.protobuf.core.Vector3f.encode(message.lookAt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
40662
+ if (message.up != null && Object.hasOwnProperty.call(message, "up"))
40663
+ $root.vertexvis.protobuf.core.Vector3f.encode(message.up, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
40664
+ if (message.fovHeight != null && Object.hasOwnProperty.call(message, "fovHeight"))
40665
+ writer.uint32(/* id 4, wireType 5 =*/37).float(message.fovHeight);
40666
+ return writer;
40667
+ };
40668
+
40669
+ /**
40670
+ * Encodes the specified OrthographicCamera message, length delimited. Does not implicitly {@link vertexvis.protobuf.stream.OrthographicCamera.verify|verify} messages.
40671
+ * @function encodeDelimited
40672
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40673
+ * @static
40674
+ * @param {vertexvis.protobuf.stream.IOrthographicCamera} message OrthographicCamera message or plain object to encode
40675
+ * @param {$protobuf.Writer} [writer] Writer to encode to
40676
+ * @returns {$protobuf.Writer} Writer
40677
+ */
40678
+ OrthographicCamera.encodeDelimited = function encodeDelimited(message, writer) {
40679
+ return this.encode(message, writer).ldelim();
40680
+ };
40681
+
40682
+ /**
40683
+ * Decodes an OrthographicCamera message from the specified reader or buffer.
40684
+ * @function decode
40685
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40686
+ * @static
40687
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
40688
+ * @param {number} [length] Message length if known beforehand
40689
+ * @returns {vertexvis.protobuf.stream.OrthographicCamera} OrthographicCamera
40690
+ * @throws {Error} If the payload is not a reader or valid buffer
40691
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
40692
+ */
40693
+ OrthographicCamera.decode = function decode(reader, length) {
40694
+ if (!(reader instanceof $Reader))
40695
+ reader = $Reader.create(reader);
40696
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vertexvis.protobuf.stream.OrthographicCamera();
40697
+ while (reader.pos < end) {
40698
+ let tag = reader.uint32();
40699
+ switch (tag >>> 3) {
40700
+ case 1:
40701
+ message.viewVector = $root.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
40702
+ break;
40703
+ case 2:
40704
+ message.lookAt = $root.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
40705
+ break;
40706
+ case 3:
40707
+ message.up = $root.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
40708
+ break;
40709
+ case 4:
40710
+ message.fovHeight = reader.float();
40711
+ break;
40712
+ default:
40713
+ reader.skipType(tag & 7);
40714
+ break;
40715
+ }
40716
+ }
40717
+ return message;
40718
+ };
40719
+
40720
+ /**
40721
+ * Decodes an OrthographicCamera message from the specified reader or buffer, length delimited.
40722
+ * @function decodeDelimited
40723
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40724
+ * @static
40725
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
40726
+ * @returns {vertexvis.protobuf.stream.OrthographicCamera} OrthographicCamera
40727
+ * @throws {Error} If the payload is not a reader or valid buffer
40728
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
40729
+ */
40730
+ OrthographicCamera.decodeDelimited = function decodeDelimited(reader) {
40731
+ if (!(reader instanceof $Reader))
40732
+ reader = new $Reader(reader);
40733
+ return this.decode(reader, reader.uint32());
40734
+ };
40735
+
40736
+ /**
40737
+ * Verifies an OrthographicCamera message.
40738
+ * @function verify
40739
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40740
+ * @static
40741
+ * @param {Object.<string,*>} message Plain object to verify
40742
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
40743
+ */
40744
+ OrthographicCamera.verify = function verify(message) {
40745
+ if (typeof message !== "object" || message === null)
40746
+ return "object expected";
40747
+ if (message.viewVector != null && message.hasOwnProperty("viewVector")) {
40748
+ let error = $root.vertexvis.protobuf.core.Vector3f.verify(message.viewVector);
40749
+ if (error)
40750
+ return "viewVector." + error;
40751
+ }
40752
+ if (message.lookAt != null && message.hasOwnProperty("lookAt")) {
40753
+ let error = $root.vertexvis.protobuf.core.Vector3f.verify(message.lookAt);
40754
+ if (error)
40755
+ return "lookAt." + error;
40756
+ }
40757
+ if (message.up != null && message.hasOwnProperty("up")) {
40758
+ let error = $root.vertexvis.protobuf.core.Vector3f.verify(message.up);
40759
+ if (error)
40760
+ return "up." + error;
40761
+ }
40762
+ if (message.fovHeight != null && message.hasOwnProperty("fovHeight"))
40763
+ if (typeof message.fovHeight !== "number")
40764
+ return "fovHeight: number expected";
40765
+ return null;
40766
+ };
40767
+
40768
+ /**
40769
+ * Creates an OrthographicCamera message from a plain object. Also converts values to their respective internal types.
40770
+ * @function fromObject
40771
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40772
+ * @static
40773
+ * @param {Object.<string,*>} object Plain object
40774
+ * @returns {vertexvis.protobuf.stream.OrthographicCamera} OrthographicCamera
40775
+ */
40776
+ OrthographicCamera.fromObject = function fromObject(object) {
40777
+ if (object instanceof $root.vertexvis.protobuf.stream.OrthographicCamera)
40778
+ return object;
40779
+ let message = new $root.vertexvis.protobuf.stream.OrthographicCamera();
40780
+ if (object.viewVector != null) {
40781
+ if (typeof object.viewVector !== "object")
40782
+ throw TypeError(".vertexvis.protobuf.stream.OrthographicCamera.viewVector: object expected");
40783
+ message.viewVector = $root.vertexvis.protobuf.core.Vector3f.fromObject(object.viewVector);
40784
+ }
40785
+ if (object.lookAt != null) {
40786
+ if (typeof object.lookAt !== "object")
40787
+ throw TypeError(".vertexvis.protobuf.stream.OrthographicCamera.lookAt: object expected");
40788
+ message.lookAt = $root.vertexvis.protobuf.core.Vector3f.fromObject(object.lookAt);
40789
+ }
40790
+ if (object.up != null) {
40791
+ if (typeof object.up !== "object")
40792
+ throw TypeError(".vertexvis.protobuf.stream.OrthographicCamera.up: object expected");
40793
+ message.up = $root.vertexvis.protobuf.core.Vector3f.fromObject(object.up);
40794
+ }
40795
+ if (object.fovHeight != null)
40796
+ message.fovHeight = Number(object.fovHeight);
40797
+ return message;
40798
+ };
40799
+
40800
+ /**
40801
+ * Creates a plain object from an OrthographicCamera message. Also converts values to other types if specified.
40802
+ * @function toObject
40803
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40804
+ * @static
40805
+ * @param {vertexvis.protobuf.stream.OrthographicCamera} message OrthographicCamera
40806
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
40807
+ * @returns {Object.<string,*>} Plain object
40808
+ */
40809
+ OrthographicCamera.toObject = function toObject(message, options) {
40810
+ if (!options)
40811
+ options = {};
40812
+ let object = {};
40813
+ if (options.defaults) {
40814
+ object.viewVector = null;
40815
+ object.lookAt = null;
40816
+ object.up = null;
40817
+ object.fovHeight = 0;
40818
+ }
40819
+ if (message.viewVector != null && message.hasOwnProperty("viewVector"))
40820
+ object.viewVector = $root.vertexvis.protobuf.core.Vector3f.toObject(message.viewVector, options);
40821
+ if (message.lookAt != null && message.hasOwnProperty("lookAt"))
40822
+ object.lookAt = $root.vertexvis.protobuf.core.Vector3f.toObject(message.lookAt, options);
40823
+ if (message.up != null && message.hasOwnProperty("up"))
40824
+ object.up = $root.vertexvis.protobuf.core.Vector3f.toObject(message.up, options);
40825
+ if (message.fovHeight != null && message.hasOwnProperty("fovHeight"))
40826
+ object.fovHeight = options.json && !isFinite(message.fovHeight) ? String(message.fovHeight) : message.fovHeight;
40827
+ return object;
40828
+ };
40829
+
40830
+ /**
40831
+ * Converts this OrthographicCamera to JSON.
40832
+ * @function toJSON
40833
+ * @memberof vertexvis.protobuf.stream.OrthographicCamera
40834
+ * @instance
40835
+ * @returns {Object.<string,*>} JSON object
40836
+ */
40837
+ OrthographicCamera.prototype.toJSON = function toJSON() {
40838
+ return this.constructor.toObject(this, minimal.util.toJSONOptions);
40839
+ };
40840
+
40841
+ return OrthographicCamera;
40842
+ })();
40843
+
39467
40844
  stream.Camera = (function() {
39468
40845
 
39469
40846
  /**
@@ -39473,6 +40850,8 @@ const vertexvis = $root.vertexvis = (() => {
39473
40850
  * @property {vertexvis.protobuf.core.IVector3f|null} [position] Camera position
39474
40851
  * @property {vertexvis.protobuf.core.IVector3f|null} [lookAt] Camera lookAt
39475
40852
  * @property {vertexvis.protobuf.core.IVector3f|null} [up] Camera up
40853
+ * @property {vertexvis.protobuf.stream.IPerspectiveCamera|null} [perspective] Camera perspective
40854
+ * @property {vertexvis.protobuf.stream.IOrthographicCamera|null} [orthographic] Camera orthographic
39476
40855
  */
39477
40856
 
39478
40857
  /**
@@ -39514,6 +40893,36 @@ const vertexvis = $root.vertexvis = (() => {
39514
40893
  */
39515
40894
  Camera.prototype.up = null;
39516
40895
 
40896
+ /**
40897
+ * Camera perspective.
40898
+ * @member {vertexvis.protobuf.stream.IPerspectiveCamera|null|undefined} perspective
40899
+ * @memberof vertexvis.protobuf.stream.Camera
40900
+ * @instance
40901
+ */
40902
+ Camera.prototype.perspective = null;
40903
+
40904
+ /**
40905
+ * Camera orthographic.
40906
+ * @member {vertexvis.protobuf.stream.IOrthographicCamera|null|undefined} orthographic
40907
+ * @memberof vertexvis.protobuf.stream.Camera
40908
+ * @instance
40909
+ */
40910
+ Camera.prototype.orthographic = null;
40911
+
40912
+ // OneOf field names bound to virtual getters and setters
40913
+ let $oneOfFields;
40914
+
40915
+ /**
40916
+ * Camera type.
40917
+ * @member {"perspective"|"orthographic"|undefined} type
40918
+ * @memberof vertexvis.protobuf.stream.Camera
40919
+ * @instance
40920
+ */
40921
+ Object.defineProperty(Camera.prototype, "type", {
40922
+ get: $util.oneOfGetter($oneOfFields = ["perspective", "orthographic"]),
40923
+ set: $util.oneOfSetter($oneOfFields)
40924
+ });
40925
+
39517
40926
  /**
39518
40927
  * Creates a new Camera instance using the specified properties.
39519
40928
  * @function create
@@ -39544,6 +40953,10 @@ const vertexvis = $root.vertexvis = (() => {
39544
40953
  $root.vertexvis.protobuf.core.Vector3f.encode(message.lookAt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
39545
40954
  if (message.up != null && Object.hasOwnProperty.call(message, "up"))
39546
40955
  $root.vertexvis.protobuf.core.Vector3f.encode(message.up, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
40956
+ if (message.perspective != null && Object.hasOwnProperty.call(message, "perspective"))
40957
+ $root.vertexvis.protobuf.stream.PerspectiveCamera.encode(message.perspective, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
40958
+ if (message.orthographic != null && Object.hasOwnProperty.call(message, "orthographic"))
40959
+ $root.vertexvis.protobuf.stream.OrthographicCamera.encode(message.orthographic, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
39547
40960
  return writer;
39548
40961
  };
39549
40962
 
@@ -39587,6 +41000,12 @@ const vertexvis = $root.vertexvis = (() => {
39587
41000
  case 3:
39588
41001
  message.up = $root.vertexvis.protobuf.core.Vector3f.decode(reader, reader.uint32());
39589
41002
  break;
41003
+ case 4:
41004
+ message.perspective = $root.vertexvis.protobuf.stream.PerspectiveCamera.decode(reader, reader.uint32());
41005
+ break;
41006
+ case 5:
41007
+ message.orthographic = $root.vertexvis.protobuf.stream.OrthographicCamera.decode(reader, reader.uint32());
41008
+ break;
39590
41009
  default:
39591
41010
  reader.skipType(tag & 7);
39592
41011
  break;
@@ -39622,6 +41041,7 @@ const vertexvis = $root.vertexvis = (() => {
39622
41041
  Camera.verify = function verify(message) {
39623
41042
  if (typeof message !== "object" || message === null)
39624
41043
  return "object expected";
41044
+ let properties = {};
39625
41045
  if (message.position != null && message.hasOwnProperty("position")) {
39626
41046
  let error = $root.vertexvis.protobuf.core.Vector3f.verify(message.position);
39627
41047
  if (error)
@@ -39637,6 +41057,24 @@ const vertexvis = $root.vertexvis = (() => {
39637
41057
  if (error)
39638
41058
  return "up." + error;
39639
41059
  }
41060
+ if (message.perspective != null && message.hasOwnProperty("perspective")) {
41061
+ properties.type = 1;
41062
+ {
41063
+ let error = $root.vertexvis.protobuf.stream.PerspectiveCamera.verify(message.perspective);
41064
+ if (error)
41065
+ return "perspective." + error;
41066
+ }
41067
+ }
41068
+ if (message.orthographic != null && message.hasOwnProperty("orthographic")) {
41069
+ if (properties.type === 1)
41070
+ return "type: multiple values";
41071
+ properties.type = 1;
41072
+ {
41073
+ let error = $root.vertexvis.protobuf.stream.OrthographicCamera.verify(message.orthographic);
41074
+ if (error)
41075
+ return "orthographic." + error;
41076
+ }
41077
+ }
39640
41078
  return null;
39641
41079
  };
39642
41080
 
@@ -39667,6 +41105,16 @@ const vertexvis = $root.vertexvis = (() => {
39667
41105
  throw TypeError(".vertexvis.protobuf.stream.Camera.up: object expected");
39668
41106
  message.up = $root.vertexvis.protobuf.core.Vector3f.fromObject(object.up);
39669
41107
  }
41108
+ if (object.perspective != null) {
41109
+ if (typeof object.perspective !== "object")
41110
+ throw TypeError(".vertexvis.protobuf.stream.Camera.perspective: object expected");
41111
+ message.perspective = $root.vertexvis.protobuf.stream.PerspectiveCamera.fromObject(object.perspective);
41112
+ }
41113
+ if (object.orthographic != null) {
41114
+ if (typeof object.orthographic !== "object")
41115
+ throw TypeError(".vertexvis.protobuf.stream.Camera.orthographic: object expected");
41116
+ message.orthographic = $root.vertexvis.protobuf.stream.OrthographicCamera.fromObject(object.orthographic);
41117
+ }
39670
41118
  return message;
39671
41119
  };
39672
41120
 
@@ -39694,6 +41142,16 @@ const vertexvis = $root.vertexvis = (() => {
39694
41142
  object.lookAt = $root.vertexvis.protobuf.core.Vector3f.toObject(message.lookAt, options);
39695
41143
  if (message.up != null && message.hasOwnProperty("up"))
39696
41144
  object.up = $root.vertexvis.protobuf.core.Vector3f.toObject(message.up, options);
41145
+ if (message.perspective != null && message.hasOwnProperty("perspective")) {
41146
+ object.perspective = $root.vertexvis.protobuf.stream.PerspectiveCamera.toObject(message.perspective, options);
41147
+ if (options.oneofs)
41148
+ object.type = "perspective";
41149
+ }
41150
+ if (message.orthographic != null && message.hasOwnProperty("orthographic")) {
41151
+ object.orthographic = $root.vertexvis.protobuf.stream.OrthographicCamera.toObject(message.orthographic, options);
41152
+ if (options.oneofs)
41153
+ object.type = "orthographic";
41154
+ }
39697
41155
  return object;
39698
41156
  };
39699
41157
 
@@ -70232,7 +71690,9 @@ exports.AreaUnits = AreaUnits;
70232
71690
  exports.DepthBuffer = DepthBuffer;
70233
71691
  exports.DistanceUnits = DistanceUnits;
70234
71692
  exports.Frame = Frame;
71693
+ exports.FrameCameraBase = FrameCameraBase;
70235
71694
  exports.FrameImage = FrameImage;
71695
+ exports.FrameOrthographicCamera = FrameOrthographicCamera;
70236
71696
  exports.FramePerspectiveCamera = FramePerspectiveCamera;
70237
71697
  exports.FrameScene = FrameScene;
70238
71698
  exports.Orientation = Orientation;
@@ -70240,6 +71700,7 @@ exports.StandardView = StandardView;
70240
71700
  exports.StreamApi = StreamApi;
70241
71701
  exports.StreamRequestError = StreamRequestError;
70242
71702
  exports.WebSocketClientImpl = WebSocketClientImpl;
71703
+ exports.constrainViewVector = constrainViewVector;
70243
71704
  exports.currentDateAsProtoTimestamp = currentDateAsProtoTimestamp;
70244
71705
  exports.decodePng = decodePng;
70245
71706
  exports.fromBoundingBoxAndLookAtCamera = fromBoundingBoxAndLookAtCamera;
@@ -70252,7 +71713,11 @@ exports.fromPbStencilBufferOrThrow = fromPbStencilBufferOrThrow;
70252
71713
  exports.fromPbSyncTimeResponseOrThrow = fromPbSyncTimeResponseOrThrow;
70253
71714
  exports.fromPbVector3f = fromPbVector3f;
70254
71715
  exports.protoToDate = protoToDate;
71716
+ exports.toOrthographic = toOrthographic;
70255
71717
  exports.toPbRGBi = toPbRGBi;
70256
71718
  exports.toPbStreamAttributes = toPbStreamAttributes;
71719
+ exports.toPerspective = toPerspective;
70257
71720
  exports.toProtoDuration = toProtoDuration;
71721
+ exports.toProtobuf = toProtobuf;
70258
71722
  exports.vertexvis = vertexvis;
71723
+ exports.withPositionAndViewVector = withPositionAndViewVector;