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