@zappar/zappar-cv 3.0.1-alpha.16 → 3.0.1-alpha.17
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/README.md +2 -2
- package/lib/additional.d.ts +1 -0
- package/lib/deserializer.d.ts +4 -1
- package/lib/deserializer.js +3 -0
- package/lib/gen/zappar-bridge.d.ts +33 -9
- package/lib/gen/zappar-bridge.js +3 -0
- package/lib/gen/zappar-client.d.ts +1 -0
- package/lib/gen/zappar-client.js +236 -47
- package/lib/gen/zappar-cwrap.js +157 -32
- package/lib/gen/zappar-native.d.ts +44 -10
- package/lib/gen/zappar-native.js +23 -1
- package/lib/gen/zappar-server.d.ts +3 -0
- package/lib/gen/zappar-server.js +127 -27
- package/lib/gen/zappar.d.ts +40 -11
- package/lib/gen/zappar.js +3 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/native.js +48 -4
- package/lib/permission.js +35 -9
- package/lib/serializer.d.ts +4 -1
- package/lib/serializer.js +3 -0
- package/lib/tr.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/zappar-cv.js +1 -1
- package/lib/zappar-cv.wasm +0 -0
- package/package.json +1 -1
- package/umd/751.zappar-cv.js +1 -1
- package/umd/867.zappar-cv.js +1 -1
- package/umd/{6cf17bab4f58a189fc94.wasm → e601e2d6a412c37c4379.wasm} +0 -0
- package/umd/zappar-cv.js +1 -1
- package/umd/zappar-cv.worker.js +1 -1
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ npm i @zappar/zappar-cv
|
|
|
18
18
|
|
|
19
19
|
You can use our CDN from within your HTML:
|
|
20
20
|
```
|
|
21
|
-
<script src="https://libs.zappar.com/zappar-cv/3.0.1-alpha.
|
|
21
|
+
<script src="https://libs.zappar.com/zappar-cv/3.0.1-alpha.17/zappar-cv.js"></script>
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Or you can download and host our standalone JavaScript bundle:
|
|
25
|
-
[https://libs.zappar.com/zappar-cv/3.0.1-alpha.
|
|
25
|
+
[https://libs.zappar.com/zappar-cv/3.0.1-alpha.17/zappar-cv.zip](https://libs.zappar.com/zappar-cv/3.0.1-alpha.17/zappar-cv.zip)
|
package/lib/additional.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface Additional {
|
|
|
15
15
|
pipeline_camera_frame_data_height(pipeline: zappar_pipeline_t): number;
|
|
16
16
|
draw_plane(gl: WebGLRenderingContext, projectionMatrix: Float32Array, cameraMatrix: Float32Array, targetMatrix: Float32Array, texture: string): void;
|
|
17
17
|
draw_grid(gl: WebGLRenderingContext, projectionMatrix: Float32Array, cameraMatrix: Float32Array, targetMatrix: Float32Array): void;
|
|
18
|
+
draw_axis(gl: WebGLRenderingContext, projectionMatrix: Float32Array, cameraMatrix: Float32Array, targetMatrix: Float32Array): void;
|
|
18
19
|
image_tracker_target_image(o: zappar_image_tracker_t, indx: number): HTMLImageElement | undefined;
|
|
19
20
|
face_mesh_load_default(o: zappar_face_mesh_t): Promise<void>;
|
|
20
21
|
face_mesh_load_default_face(o: zappar_face_mesh_t, fillMouth: boolean, fillEyeL: boolean, fillEyeR: boolean): Promise<void>;
|
package/lib/deserializer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { barcode_format_t, face_landmark_name_t, instant_world_tracker_transform_orientation_t, log_level_t } from "./gen/zappar-native";
|
|
1
|
+
import { barcode_format_t, face_landmark_name_t, instant_world_tracker_transform_orientation_t, transform_orientation_t, log_level_t, plane_orientation_t, anchor_status_t } from "./gen/zappar-native";
|
|
2
2
|
interface Message {
|
|
3
3
|
int: () => number;
|
|
4
4
|
float: () => number;
|
|
@@ -17,6 +17,9 @@ interface Message {
|
|
|
17
17
|
barcodeFormat: () => barcode_format_t;
|
|
18
18
|
faceLandmarkName: () => face_landmark_name_t;
|
|
19
19
|
instantTrackerTransformOrientation: () => instant_world_tracker_transform_orientation_t;
|
|
20
|
+
transformOrientation: () => transform_orientation_t;
|
|
21
|
+
planeOrientation: () => plane_orientation_t;
|
|
22
|
+
anchorStatus: () => anchor_status_t;
|
|
20
23
|
logLevel: () => log_level_t;
|
|
21
24
|
}
|
|
22
25
|
export declare class MessageDeserializer {
|
package/lib/deserializer.js
CHANGED
|
@@ -94,6 +94,9 @@ export class MessageDeserializer {
|
|
|
94
94
|
barcodeFormat: () => this._i32View[this._startOffset++],
|
|
95
95
|
faceLandmarkName: () => this._i32View[this._startOffset++],
|
|
96
96
|
instantTrackerTransformOrientation: () => this._i32View[this._startOffset++],
|
|
97
|
+
transformOrientation: () => this._i32View[this._startOffset++],
|
|
98
|
+
planeOrientation: () => this._i32View[this._startOffset++],
|
|
99
|
+
anchorStatus: () => this._i32View[this._startOffset++],
|
|
97
100
|
logLevel: () => this._i32View[this._startOffset++],
|
|
98
101
|
};
|
|
99
102
|
}
|
|
@@ -5,10 +5,16 @@ export { face_landmark_name_t } from "./zappar-native";
|
|
|
5
5
|
export { frame_pixel_format_t } from "./zappar-native";
|
|
6
6
|
import { instant_world_tracker_transform_orientation_t } from "./zappar-native";
|
|
7
7
|
export { instant_world_tracker_transform_orientation_t } from "./zappar-native";
|
|
8
|
+
import { transform_orientation_t } from "./zappar-native";
|
|
9
|
+
export { transform_orientation_t } from "./zappar-native";
|
|
10
|
+
import { plane_orientation_t } from "./zappar-native";
|
|
11
|
+
export { plane_orientation_t } from "./zappar-native";
|
|
8
12
|
import { log_level_t } from "./zappar-native";
|
|
9
13
|
export { log_level_t } from "./zappar-native";
|
|
10
14
|
export { image_target_type_t } from "./zappar-native";
|
|
11
15
|
export { world_tracker_quality_t } from "./zappar-native";
|
|
16
|
+
import { anchor_status_t } from "./zappar-native";
|
|
17
|
+
export { anchor_status_t } from "./zappar-native";
|
|
12
18
|
export { camera_profile_t } from "./zappar-native";
|
|
13
19
|
export declare type zappar_pipeline_t = number & {
|
|
14
20
|
_: 'zappar_pipeline_t';
|
|
@@ -43,6 +49,9 @@ export declare type zappar_zapcode_tracker_t = number & {
|
|
|
43
49
|
export declare type zappar_world_tracker_t = number & {
|
|
44
50
|
_: 'zappar_world_tracker_t';
|
|
45
51
|
};
|
|
52
|
+
export declare type zappar_custom_anchor_t = number & {
|
|
53
|
+
_: 'zappar_custom_anchor_t';
|
|
54
|
+
};
|
|
46
55
|
export interface zappar {
|
|
47
56
|
log_level(): log_level_t;
|
|
48
57
|
log_level_set(level: log_level_t): void;
|
|
@@ -123,16 +132,23 @@ export interface zappar {
|
|
|
123
132
|
world_tracker_enabled(o: zappar_world_tracker_t): boolean;
|
|
124
133
|
world_tracker_enabled_set(o: zappar_world_tracker_t, enabled: boolean): void;
|
|
125
134
|
world_tracker_quality(o: zappar_world_tracker_t): number;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
135
|
+
world_tracker_horizontal_plane_detection_enabled(o: zappar_world_tracker_t): boolean;
|
|
136
|
+
world_tracker_horizontal_plane_detection_enabled_set(o: zappar_world_tracker_t, horizontal_plane_detection_enabled: boolean): void;
|
|
137
|
+
world_tracker_vertical_plane_detection_enabled(o: zappar_world_tracker_t): boolean;
|
|
138
|
+
world_tracker_vertical_plane_detection_enabled_set(o: zappar_world_tracker_t, vertical_plane_detection_enabled: boolean): void;
|
|
139
|
+
world_tracker_plane_anchor_count(o: zappar_world_tracker_t): number;
|
|
140
|
+
world_tracker_plane_anchor_id(o: zappar_world_tracker_t, indx: number): string;
|
|
141
|
+
world_tracker_plane_anchor_pose_raw(o: zappar_world_tracker_t, indx: number): Float32Array;
|
|
142
|
+
world_tracker_plane_anchor_status(o: zappar_world_tracker_t, indx: number): anchor_status_t;
|
|
143
|
+
world_tracker_plane_anchor_polygon_data_size(o: zappar_world_tracker_t, indx: number): number;
|
|
144
|
+
world_tracker_plane_anchor_polygon_data(o: zappar_world_tracker_t, indx: number): Float32Array;
|
|
145
|
+
world_tracker_plane_anchor_polygon_version(o: zappar_world_tracker_t, indx: number): number;
|
|
146
|
+
world_tracker_plane_anchor_orientation(o: zappar_world_tracker_t, indx: number): plane_orientation_t;
|
|
147
|
+
world_tracker_world_anchor_status(o: zappar_world_tracker_t): anchor_status_t;
|
|
148
|
+
world_tracker_world_anchor_id(o: zappar_world_tracker_t): string;
|
|
134
149
|
world_tracker_world_anchor_pose_raw(o: zappar_world_tracker_t): Float32Array;
|
|
135
|
-
|
|
150
|
+
world_tracker_ground_anchor_id(o: zappar_world_tracker_t): string;
|
|
151
|
+
world_tracker_ground_anchor_status(o: zappar_world_tracker_t): anchor_status_t;
|
|
136
152
|
world_tracker_ground_anchor_pose_raw(o: zappar_world_tracker_t): Float32Array;
|
|
137
153
|
world_tracker_reset(o: zappar_world_tracker_t): void;
|
|
138
154
|
world_tracker_tracks_data_enabled(o: zappar_world_tracker_t): boolean;
|
|
@@ -145,4 +161,12 @@ export interface zappar {
|
|
|
145
161
|
world_tracker_projections_data_enabled_set(o: zappar_world_tracker_t, projections_data_enabled: boolean): void;
|
|
146
162
|
world_tracker_projections_data_size(o: zappar_world_tracker_t): number;
|
|
147
163
|
world_tracker_projections_data(o: zappar_world_tracker_t): Float32Array;
|
|
164
|
+
custom_anchor_create(pipeline: zappar_pipeline_t, worldtracker: zappar_world_tracker_t, id: string): zappar_custom_anchor_t;
|
|
165
|
+
custom_anchor_destroy(o: zappar_custom_anchor_t): void;
|
|
166
|
+
custom_anchor_status(o: zappar_custom_anchor_t): anchor_status_t;
|
|
167
|
+
custom_anchor_enabled_set(o: zappar_custom_anchor_t, enabled: boolean): void;
|
|
168
|
+
custom_anchor_enabled(o: zappar_custom_anchor_t): boolean;
|
|
169
|
+
custom_anchor_pose_raw(o: zappar_custom_anchor_t): Float32Array;
|
|
170
|
+
custom_anchor_pose_set_from_camera_offset_raw(o: zappar_custom_anchor_t, x: number, y: number, z: number, orientation: transform_orientation_t): void;
|
|
171
|
+
custom_anchor_pose_set_from_anchor_offset(o: zappar_custom_anchor_t, anchor_id: string, x: number, y: number, z: number, orientation: transform_orientation_t): void;
|
|
148
172
|
}
|
package/lib/gen/zappar-bridge.js
CHANGED
|
@@ -2,7 +2,10 @@ export { barcode_format_t } from "./zappar-native";
|
|
|
2
2
|
export { face_landmark_name_t } from "./zappar-native";
|
|
3
3
|
export { frame_pixel_format_t } from "./zappar-native";
|
|
4
4
|
export { instant_world_tracker_transform_orientation_t } from "./zappar-native";
|
|
5
|
+
export { transform_orientation_t } from "./zappar-native";
|
|
6
|
+
export { plane_orientation_t } from "./zappar-native";
|
|
5
7
|
export { log_level_t } from "./zappar-native";
|
|
6
8
|
export { image_target_type_t } from "./zappar-native";
|
|
7
9
|
export { world_tracker_quality_t } from "./zappar-native";
|
|
10
|
+
export { anchor_status_t } from "./zappar-native";
|
|
8
11
|
export { camera_profile_t } from "./zappar-native";
|
|
@@ -19,6 +19,7 @@ export declare class zappar_client {
|
|
|
19
19
|
private _instant_world_tracker_state_by_instance;
|
|
20
20
|
private _zapcode_tracker_state_by_instance;
|
|
21
21
|
private _world_tracker_state_by_instance;
|
|
22
|
+
private _custom_anchor_state_by_instance;
|
|
22
23
|
impl: zappar;
|
|
23
24
|
processMessages(a: ArrayBuffer): void;
|
|
24
25
|
}
|
package/lib/gen/zappar-client.js
CHANGED
|
@@ -22,6 +22,7 @@ export class zappar_client {
|
|
|
22
22
|
this._instant_world_tracker_state_by_instance = new Map();
|
|
23
23
|
this._zapcode_tracker_state_by_instance = new Map();
|
|
24
24
|
this._world_tracker_state_by_instance = new Map();
|
|
25
|
+
this._custom_anchor_state_by_instance = new Map();
|
|
25
26
|
this.impl = {
|
|
26
27
|
log_level: () => {
|
|
27
28
|
return this._globalState.log_level;
|
|
@@ -680,16 +681,22 @@ export class zappar_client {
|
|
|
680
681
|
let newId = (this._latestId++);
|
|
681
682
|
let s = {
|
|
682
683
|
enabled: true,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
684
|
+
horizontal_plane_detection_enabled: true,
|
|
685
|
+
vertical_plane_detection_enabled: false,
|
|
686
|
+
plane_anchor_count: 0,
|
|
687
|
+
plane_anchor_pose: [],
|
|
688
|
+
plane_anchor_status: [],
|
|
689
|
+
plane_anchor_polygon_version: [],
|
|
690
|
+
plane_anchor_polygon_data: [],
|
|
691
|
+
plane_anchor_polygon_data_size: [],
|
|
692
|
+
plane_anchor_id: [],
|
|
693
|
+
plane_anchor_orientation: [],
|
|
694
|
+
world_anchor_status: 0,
|
|
690
695
|
world_anchor_pose: new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
|
|
691
|
-
|
|
696
|
+
world_anchor_id: '',
|
|
697
|
+
ground_anchor_status: 0,
|
|
692
698
|
ground_anchor_pose: new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
|
|
699
|
+
ground_anchor_id: '',
|
|
693
700
|
tracks_data_enabled: false,
|
|
694
701
|
tracks_data: new Float32Array([]),
|
|
695
702
|
tracks_data_size: 0,
|
|
@@ -737,56 +744,95 @@ export class zappar_client {
|
|
|
737
744
|
throw new Error("This object has been destroyed");
|
|
738
745
|
return s.quality;
|
|
739
746
|
},
|
|
740
|
-
|
|
747
|
+
world_tracker_horizontal_plane_detection_enabled: (o) => {
|
|
741
748
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
742
749
|
if (!s)
|
|
743
750
|
throw new Error("This object has been destroyed");
|
|
744
|
-
return s.
|
|
751
|
+
return s.horizontal_plane_detection_enabled;
|
|
745
752
|
},
|
|
746
|
-
|
|
753
|
+
world_tracker_horizontal_plane_detection_enabled_set: (o, horizontal_plane_detection_enabled) => {
|
|
747
754
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
748
755
|
if (!s)
|
|
749
756
|
throw new Error("This object has been destroyed");
|
|
750
757
|
this.serializer.sendMessage(48, m => {
|
|
751
758
|
m.type(o);
|
|
752
|
-
m.bool(
|
|
759
|
+
m.bool(horizontal_plane_detection_enabled);
|
|
753
760
|
});
|
|
754
761
|
},
|
|
755
|
-
|
|
762
|
+
world_tracker_vertical_plane_detection_enabled: (o) => {
|
|
756
763
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
757
764
|
if (!s)
|
|
758
765
|
throw new Error("This object has been destroyed");
|
|
759
|
-
return s.
|
|
766
|
+
return s.vertical_plane_detection_enabled;
|
|
760
767
|
},
|
|
761
|
-
|
|
768
|
+
world_tracker_vertical_plane_detection_enabled_set: (o, vertical_plane_detection_enabled) => {
|
|
762
769
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
763
770
|
if (!s)
|
|
764
771
|
throw new Error("This object has been destroyed");
|
|
765
|
-
|
|
772
|
+
this.serializer.sendMessage(49, m => {
|
|
773
|
+
m.type(o);
|
|
774
|
+
m.bool(vertical_plane_detection_enabled);
|
|
775
|
+
});
|
|
776
|
+
},
|
|
777
|
+
world_tracker_plane_anchor_count: (o) => {
|
|
778
|
+
let s = this._world_tracker_state_by_instance.get(o);
|
|
779
|
+
if (!s)
|
|
780
|
+
throw new Error("This object has been destroyed");
|
|
781
|
+
return s.plane_anchor_count;
|
|
782
|
+
},
|
|
783
|
+
world_tracker_plane_anchor_id: (o, indx) => {
|
|
784
|
+
let s = this._world_tracker_state_by_instance.get(o);
|
|
785
|
+
if (!s)
|
|
786
|
+
throw new Error("This object has been destroyed");
|
|
787
|
+
return s.plane_anchor_id[indx];
|
|
788
|
+
},
|
|
789
|
+
world_tracker_plane_anchor_pose_raw: (o, indx) => {
|
|
790
|
+
let s = this._world_tracker_state_by_instance.get(o);
|
|
791
|
+
if (!s)
|
|
792
|
+
throw new Error("This object has been destroyed");
|
|
793
|
+
return s.plane_anchor_pose[indx];
|
|
794
|
+
},
|
|
795
|
+
world_tracker_plane_anchor_status: (o, indx) => {
|
|
796
|
+
let s = this._world_tracker_state_by_instance.get(o);
|
|
797
|
+
if (!s)
|
|
798
|
+
throw new Error("This object has been destroyed");
|
|
799
|
+
return s.plane_anchor_status[indx];
|
|
766
800
|
},
|
|
767
|
-
|
|
801
|
+
world_tracker_plane_anchor_polygon_data_size: (o, indx) => {
|
|
768
802
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
769
803
|
if (!s)
|
|
770
804
|
throw new Error("This object has been destroyed");
|
|
771
|
-
return s.
|
|
805
|
+
return s.plane_anchor_polygon_data_size[indx];
|
|
772
806
|
},
|
|
773
|
-
|
|
807
|
+
world_tracker_plane_anchor_polygon_data: (o, indx) => {
|
|
774
808
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
775
809
|
if (!s)
|
|
776
810
|
throw new Error("This object has been destroyed");
|
|
777
|
-
return s.
|
|
811
|
+
return s.plane_anchor_polygon_data[indx];
|
|
778
812
|
},
|
|
779
|
-
|
|
813
|
+
world_tracker_plane_anchor_polygon_version: (o, indx) => {
|
|
780
814
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
781
815
|
if (!s)
|
|
782
816
|
throw new Error("This object has been destroyed");
|
|
783
|
-
return s.
|
|
817
|
+
return s.plane_anchor_polygon_version[indx];
|
|
784
818
|
},
|
|
785
|
-
|
|
819
|
+
world_tracker_plane_anchor_orientation: (o, indx) => {
|
|
786
820
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
787
821
|
if (!s)
|
|
788
822
|
throw new Error("This object has been destroyed");
|
|
789
|
-
return s.
|
|
823
|
+
return s.plane_anchor_orientation[indx];
|
|
824
|
+
},
|
|
825
|
+
world_tracker_world_anchor_status: (o) => {
|
|
826
|
+
let s = this._world_tracker_state_by_instance.get(o);
|
|
827
|
+
if (!s)
|
|
828
|
+
throw new Error("This object has been destroyed");
|
|
829
|
+
return s.world_anchor_status;
|
|
830
|
+
},
|
|
831
|
+
world_tracker_world_anchor_id: (o) => {
|
|
832
|
+
let s = this._world_tracker_state_by_instance.get(o);
|
|
833
|
+
if (!s)
|
|
834
|
+
throw new Error("This object has been destroyed");
|
|
835
|
+
return s.world_anchor_id;
|
|
790
836
|
},
|
|
791
837
|
world_tracker_world_anchor_pose_raw: (o) => {
|
|
792
838
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
@@ -794,11 +840,17 @@ export class zappar_client {
|
|
|
794
840
|
throw new Error("This object has been destroyed");
|
|
795
841
|
return s.world_anchor_pose;
|
|
796
842
|
},
|
|
797
|
-
|
|
843
|
+
world_tracker_ground_anchor_id: (o) => {
|
|
844
|
+
let s = this._world_tracker_state_by_instance.get(o);
|
|
845
|
+
if (!s)
|
|
846
|
+
throw new Error("This object has been destroyed");
|
|
847
|
+
return s.ground_anchor_id;
|
|
848
|
+
},
|
|
849
|
+
world_tracker_ground_anchor_status: (o) => {
|
|
798
850
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
799
851
|
if (!s)
|
|
800
852
|
throw new Error("This object has been destroyed");
|
|
801
|
-
return s.
|
|
853
|
+
return s.ground_anchor_status;
|
|
802
854
|
},
|
|
803
855
|
world_tracker_ground_anchor_pose_raw: (o) => {
|
|
804
856
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
@@ -810,7 +862,7 @@ export class zappar_client {
|
|
|
810
862
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
811
863
|
if (!s)
|
|
812
864
|
throw new Error("This object has been destroyed");
|
|
813
|
-
this.serializer.sendMessage(
|
|
865
|
+
this.serializer.sendMessage(50, m => {
|
|
814
866
|
m.type(o);
|
|
815
867
|
});
|
|
816
868
|
},
|
|
@@ -824,7 +876,7 @@ export class zappar_client {
|
|
|
824
876
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
825
877
|
if (!s)
|
|
826
878
|
throw new Error("This object has been destroyed");
|
|
827
|
-
this.serializer.sendMessage(
|
|
879
|
+
this.serializer.sendMessage(51, m => {
|
|
828
880
|
m.type(o);
|
|
829
881
|
m.bool(tracks_data_enabled);
|
|
830
882
|
});
|
|
@@ -863,7 +915,7 @@ export class zappar_client {
|
|
|
863
915
|
let s = this._world_tracker_state_by_instance.get(o);
|
|
864
916
|
if (!s)
|
|
865
917
|
throw new Error("This object has been destroyed");
|
|
866
|
-
this.serializer.sendMessage(
|
|
918
|
+
this.serializer.sendMessage(52, m => {
|
|
867
919
|
m.type(o);
|
|
868
920
|
m.bool(projections_data_enabled);
|
|
869
921
|
});
|
|
@@ -880,6 +932,84 @@ export class zappar_client {
|
|
|
880
932
|
throw new Error("This object has been destroyed");
|
|
881
933
|
return s.projections_data;
|
|
882
934
|
},
|
|
935
|
+
// #### custom_anchor ####
|
|
936
|
+
custom_anchor_create: (pipeline, worldtracker, id) => {
|
|
937
|
+
let newId = (this._latestId++);
|
|
938
|
+
let s = {
|
|
939
|
+
enabled: true,
|
|
940
|
+
pose: new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
|
|
941
|
+
status: 0,
|
|
942
|
+
};
|
|
943
|
+
this._custom_anchor_state_by_instance.set(newId, s);
|
|
944
|
+
this.serializer.sendMessage(53, m => {
|
|
945
|
+
m.type(newId);
|
|
946
|
+
m.type(pipeline);
|
|
947
|
+
m.type(worldtracker);
|
|
948
|
+
m.string(id);
|
|
949
|
+
});
|
|
950
|
+
return newId;
|
|
951
|
+
},
|
|
952
|
+
custom_anchor_destroy: (o) => {
|
|
953
|
+
let s = this._custom_anchor_state_by_instance.get(o);
|
|
954
|
+
if (!s)
|
|
955
|
+
throw new Error("This object has been destroyed");
|
|
956
|
+
this._custom_anchor_state_by_instance.delete(o);
|
|
957
|
+
this.serializer.sendMessage(54, m => {
|
|
958
|
+
m.type(o);
|
|
959
|
+
});
|
|
960
|
+
},
|
|
961
|
+
custom_anchor_status: (o) => {
|
|
962
|
+
let s = this._custom_anchor_state_by_instance.get(o);
|
|
963
|
+
if (!s)
|
|
964
|
+
throw new Error("This object has been destroyed");
|
|
965
|
+
return s.status;
|
|
966
|
+
},
|
|
967
|
+
custom_anchor_enabled_set: (o, enabled) => {
|
|
968
|
+
let s = this._custom_anchor_state_by_instance.get(o);
|
|
969
|
+
if (!s)
|
|
970
|
+
throw new Error("This object has been destroyed");
|
|
971
|
+
this.serializer.sendMessage(55, m => {
|
|
972
|
+
m.type(o);
|
|
973
|
+
m.bool(enabled);
|
|
974
|
+
});
|
|
975
|
+
},
|
|
976
|
+
custom_anchor_enabled: (o) => {
|
|
977
|
+
let s = this._custom_anchor_state_by_instance.get(o);
|
|
978
|
+
if (!s)
|
|
979
|
+
throw new Error("This object has been destroyed");
|
|
980
|
+
return s.enabled;
|
|
981
|
+
},
|
|
982
|
+
custom_anchor_pose_raw: (o) => {
|
|
983
|
+
let s = this._custom_anchor_state_by_instance.get(o);
|
|
984
|
+
if (!s)
|
|
985
|
+
throw new Error("This object has been destroyed");
|
|
986
|
+
return s.pose;
|
|
987
|
+
},
|
|
988
|
+
custom_anchor_pose_set_from_camera_offset_raw: (o, x, y, z, orientation) => {
|
|
989
|
+
let s = this._custom_anchor_state_by_instance.get(o);
|
|
990
|
+
if (!s)
|
|
991
|
+
throw new Error("This object has been destroyed");
|
|
992
|
+
this.serializer.sendMessage(56, m => {
|
|
993
|
+
m.type(o);
|
|
994
|
+
m.float(x);
|
|
995
|
+
m.float(y);
|
|
996
|
+
m.float(z);
|
|
997
|
+
m.transformOrientation(orientation);
|
|
998
|
+
});
|
|
999
|
+
},
|
|
1000
|
+
custom_anchor_pose_set_from_anchor_offset: (o, anchor_id, x, y, z, orientation) => {
|
|
1001
|
+
let s = this._custom_anchor_state_by_instance.get(o);
|
|
1002
|
+
if (!s)
|
|
1003
|
+
throw new Error("This object has been destroyed");
|
|
1004
|
+
this.serializer.sendMessage(57, m => {
|
|
1005
|
+
m.type(o);
|
|
1006
|
+
m.string(anchor_id);
|
|
1007
|
+
m.float(x);
|
|
1008
|
+
m.float(y);
|
|
1009
|
+
m.float(z);
|
|
1010
|
+
m.transformOrientation(orientation);
|
|
1011
|
+
});
|
|
1012
|
+
},
|
|
883
1013
|
};
|
|
884
1014
|
}
|
|
885
1015
|
processMessages(a) {
|
|
@@ -1080,7 +1210,7 @@ export class zappar_client {
|
|
|
1080
1210
|
inst.anchor_pose[indx] = msg.matrix4x4();
|
|
1081
1211
|
break;
|
|
1082
1212
|
}
|
|
1083
|
-
case
|
|
1213
|
+
case 40: {
|
|
1084
1214
|
let handle = msg.type();
|
|
1085
1215
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1086
1216
|
if (!inst)
|
|
@@ -1093,25 +1223,25 @@ export class zappar_client {
|
|
|
1093
1223
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1094
1224
|
if (!inst)
|
|
1095
1225
|
return;
|
|
1096
|
-
inst.
|
|
1226
|
+
inst.plane_anchor_count = msg.int();
|
|
1097
1227
|
break;
|
|
1098
1228
|
}
|
|
1099
|
-
case
|
|
1229
|
+
case 33: {
|
|
1100
1230
|
let handle = msg.type();
|
|
1101
1231
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1102
1232
|
if (!inst)
|
|
1103
1233
|
return;
|
|
1104
1234
|
let indx = msg.int();
|
|
1105
|
-
inst.
|
|
1235
|
+
inst.plane_anchor_id[indx] = msg.string();
|
|
1106
1236
|
break;
|
|
1107
1237
|
}
|
|
1108
|
-
case
|
|
1238
|
+
case 26: {
|
|
1109
1239
|
let handle = msg.type();
|
|
1110
1240
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1111
1241
|
if (!inst)
|
|
1112
1242
|
return;
|
|
1113
1243
|
let indx = msg.int();
|
|
1114
|
-
inst.
|
|
1244
|
+
inst.plane_anchor_pose[indx] = msg.matrix4x4();
|
|
1115
1245
|
break;
|
|
1116
1246
|
}
|
|
1117
1247
|
case 28: {
|
|
@@ -1120,7 +1250,7 @@ export class zappar_client {
|
|
|
1120
1250
|
if (!inst)
|
|
1121
1251
|
return;
|
|
1122
1252
|
let indx = msg.int();
|
|
1123
|
-
inst.
|
|
1253
|
+
inst.plane_anchor_status[indx] = msg.anchorStatus();
|
|
1124
1254
|
break;
|
|
1125
1255
|
}
|
|
1126
1256
|
case 29: {
|
|
@@ -1129,7 +1259,7 @@ export class zappar_client {
|
|
|
1129
1259
|
if (!inst)
|
|
1130
1260
|
return;
|
|
1131
1261
|
let indx = msg.int();
|
|
1132
|
-
inst.
|
|
1262
|
+
inst.plane_anchor_polygon_data_size[indx] = msg.int();
|
|
1133
1263
|
break;
|
|
1134
1264
|
}
|
|
1135
1265
|
case 30: {
|
|
@@ -1137,10 +1267,45 @@ export class zappar_client {
|
|
|
1137
1267
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1138
1268
|
if (!inst)
|
|
1139
1269
|
return;
|
|
1140
|
-
|
|
1270
|
+
let indx = msg.int();
|
|
1271
|
+
inst.plane_anchor_polygon_data[indx] = msg.floatArray();
|
|
1141
1272
|
break;
|
|
1142
1273
|
}
|
|
1143
1274
|
case 31: {
|
|
1275
|
+
let handle = msg.type();
|
|
1276
|
+
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1277
|
+
if (!inst)
|
|
1278
|
+
return;
|
|
1279
|
+
let indx = msg.int();
|
|
1280
|
+
inst.plane_anchor_polygon_version[indx] = msg.int();
|
|
1281
|
+
break;
|
|
1282
|
+
}
|
|
1283
|
+
case 32: {
|
|
1284
|
+
let handle = msg.type();
|
|
1285
|
+
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1286
|
+
if (!inst)
|
|
1287
|
+
return;
|
|
1288
|
+
let indx = msg.int();
|
|
1289
|
+
inst.plane_anchor_orientation[indx] = msg.planeOrientation();
|
|
1290
|
+
break;
|
|
1291
|
+
}
|
|
1292
|
+
case 36: {
|
|
1293
|
+
let handle = msg.type();
|
|
1294
|
+
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1295
|
+
if (!inst)
|
|
1296
|
+
return;
|
|
1297
|
+
inst.world_anchor_status = msg.anchorStatus();
|
|
1298
|
+
break;
|
|
1299
|
+
}
|
|
1300
|
+
case 35: {
|
|
1301
|
+
let handle = msg.type();
|
|
1302
|
+
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1303
|
+
if (!inst)
|
|
1304
|
+
return;
|
|
1305
|
+
inst.world_anchor_id = msg.string();
|
|
1306
|
+
break;
|
|
1307
|
+
}
|
|
1308
|
+
case 34: {
|
|
1144
1309
|
let handle = msg.type();
|
|
1145
1310
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1146
1311
|
if (!inst)
|
|
@@ -1148,23 +1313,31 @@ export class zappar_client {
|
|
|
1148
1313
|
inst.world_anchor_pose = msg.matrix4x4();
|
|
1149
1314
|
break;
|
|
1150
1315
|
}
|
|
1151
|
-
case
|
|
1316
|
+
case 38: {
|
|
1152
1317
|
let handle = msg.type();
|
|
1153
1318
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1154
1319
|
if (!inst)
|
|
1155
1320
|
return;
|
|
1156
|
-
inst.
|
|
1321
|
+
inst.ground_anchor_id = msg.string();
|
|
1157
1322
|
break;
|
|
1158
1323
|
}
|
|
1159
|
-
case
|
|
1324
|
+
case 39: {
|
|
1160
1325
|
let handle = msg.type();
|
|
1161
1326
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1162
1327
|
if (!inst)
|
|
1163
1328
|
return;
|
|
1164
|
-
inst.
|
|
1329
|
+
inst.ground_anchor_status = msg.anchorStatus();
|
|
1165
1330
|
break;
|
|
1166
1331
|
}
|
|
1167
1332
|
case 37: {
|
|
1333
|
+
let handle = msg.type();
|
|
1334
|
+
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1335
|
+
if (!inst)
|
|
1336
|
+
return;
|
|
1337
|
+
inst.ground_anchor_pose = msg.matrix4x4();
|
|
1338
|
+
break;
|
|
1339
|
+
}
|
|
1340
|
+
case 43: {
|
|
1168
1341
|
let handle = msg.type();
|
|
1169
1342
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1170
1343
|
if (!inst)
|
|
@@ -1172,7 +1345,7 @@ export class zappar_client {
|
|
|
1172
1345
|
inst.tracks_data_size = msg.int();
|
|
1173
1346
|
break;
|
|
1174
1347
|
}
|
|
1175
|
-
case
|
|
1348
|
+
case 42: {
|
|
1176
1349
|
let handle = msg.type();
|
|
1177
1350
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1178
1351
|
if (!inst)
|
|
@@ -1180,7 +1353,7 @@ export class zappar_client {
|
|
|
1180
1353
|
inst.tracks_data = msg.floatArray();
|
|
1181
1354
|
break;
|
|
1182
1355
|
}
|
|
1183
|
-
case
|
|
1356
|
+
case 45: {
|
|
1184
1357
|
let handle = msg.type();
|
|
1185
1358
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1186
1359
|
if (!inst)
|
|
@@ -1188,7 +1361,7 @@ export class zappar_client {
|
|
|
1188
1361
|
inst.tracks_type_data_size = msg.int();
|
|
1189
1362
|
break;
|
|
1190
1363
|
}
|
|
1191
|
-
case
|
|
1364
|
+
case 44: {
|
|
1192
1365
|
let handle = msg.type();
|
|
1193
1366
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1194
1367
|
if (!inst)
|
|
@@ -1196,7 +1369,7 @@ export class zappar_client {
|
|
|
1196
1369
|
inst.tracks_type_data = msg.ucharArray();
|
|
1197
1370
|
break;
|
|
1198
1371
|
}
|
|
1199
|
-
case
|
|
1372
|
+
case 48: {
|
|
1200
1373
|
let handle = msg.type();
|
|
1201
1374
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1202
1375
|
if (!inst)
|
|
@@ -1204,7 +1377,7 @@ export class zappar_client {
|
|
|
1204
1377
|
inst.projections_data_size = msg.int();
|
|
1205
1378
|
break;
|
|
1206
1379
|
}
|
|
1207
|
-
case
|
|
1380
|
+
case 47: {
|
|
1208
1381
|
let handle = msg.type();
|
|
1209
1382
|
let inst = this._world_tracker_state_by_instance.get(handle);
|
|
1210
1383
|
if (!inst)
|
|
@@ -1212,6 +1385,22 @@ export class zappar_client {
|
|
|
1212
1385
|
inst.projections_data = msg.floatArray();
|
|
1213
1386
|
break;
|
|
1214
1387
|
}
|
|
1388
|
+
case 50: {
|
|
1389
|
+
let handle = msg.type();
|
|
1390
|
+
let inst = this._custom_anchor_state_by_instance.get(handle);
|
|
1391
|
+
if (!inst)
|
|
1392
|
+
return;
|
|
1393
|
+
inst.status = msg.anchorStatus();
|
|
1394
|
+
break;
|
|
1395
|
+
}
|
|
1396
|
+
case 49: {
|
|
1397
|
+
let handle = msg.type();
|
|
1398
|
+
let inst = this._custom_anchor_state_by_instance.get(handle);
|
|
1399
|
+
if (!inst)
|
|
1400
|
+
return;
|
|
1401
|
+
inst.pose = msg.matrix4x4();
|
|
1402
|
+
break;
|
|
1403
|
+
}
|
|
1215
1404
|
}
|
|
1216
1405
|
});
|
|
1217
1406
|
}
|