@web-ar-studio/webar-engine-sdk 1.0.3 → 1.0.5

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/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  declare const PROJECT_MODE_QR = "QR";
2
2
  declare const PROJECT_MODE_IMAGE = "IMAGE";
3
3
  declare const PROJECT_MODE_SLAM_3DOF = "SLAM_3DOF";
4
+ declare const PROJECT_MODE_FACE = "FACE";
4
5
  declare const PROJECT_MODE_MIX = "MIX";
5
6
  declare const TRIGGER_MODE_QR = "QR";
6
7
  declare const TRIGGER_MODE_IMAGE = "IMAGE";
@@ -34,7 +35,7 @@ type TTrigger = {
34
35
  source: string;
35
36
  };
36
37
 
37
- type TProjectMode = typeof PROJECT_MODE_QR | typeof PROJECT_MODE_IMAGE | typeof PROJECT_MODE_SLAM_3DOF | typeof PROJECT_MODE_MIX;
38
+ type TProjectMode = typeof PROJECT_MODE_QR | typeof PROJECT_MODE_IMAGE | typeof PROJECT_MODE_SLAM_3DOF | typeof PROJECT_MODE_FACE | typeof PROJECT_MODE_MIX;
38
39
 
39
40
  type TAnchorType = typeof ANCHOR_TYPE_BOTTOM_LEFT | typeof ANCHOR_TYPE_BOTTOM_RIGHT | typeof ANCHOR_TYPE_TOP_LEFT | typeof ANCHOR_TYPE_TOP_RIGHT | typeof ANCHOR_TYPE_CENTER;
40
41
 
@@ -43,13 +44,13 @@ type TConfigData = {
43
44
  mode: TProjectMode;
44
45
  container: Element;
45
46
  } & ({
46
- mode: typeof PROJECT_MODE_SLAM_3DOF;
47
+ mode: typeof PROJECT_MODE_SLAM_3DOF | typeof PROJECT_MODE_FACE;
47
48
  fov?: never;
48
49
  triggers?: never;
49
50
  isMultiTracking?: never;
50
51
  anchor?: never;
51
52
  } | {
52
- mode: Exclude<TProjectMode, typeof PROJECT_MODE_SLAM_3DOF>;
53
+ mode: Exclude<TProjectMode, typeof PROJECT_MODE_SLAM_3DOF | typeof PROJECT_MODE_FACE>;
53
54
  fov: number;
54
55
  triggers: TTrigger[];
55
56
  isMultiTracking: boolean;
@@ -64,24 +65,31 @@ type TVector = {
64
65
  z: number;
65
66
  };
66
67
 
68
+ type TQuaternion = {
69
+ x: number;
70
+ y: number;
71
+ z: number;
72
+ w: number;
73
+ };
74
+
67
75
  type TEventDetectedData = {
68
76
  triggerId: number;
69
77
  positionVector: TVector;
70
- rotationVector: TVector;
78
+ rotationQuaternion: TQuaternion;
71
79
  scaleVector: TVector;
72
80
  };
73
81
 
74
82
  type TEventLostData = {
75
83
  triggerId: number;
76
84
  positionVector: TVector;
77
- rotationVector: TVector;
85
+ rotationQuaternion: TQuaternion;
78
86
  scaleVector: TVector;
79
87
  };
80
88
 
81
89
  type TEventPoseData = {
82
90
  triggerId: number;
83
91
  positionVector: TVector;
84
- rotationVector: TVector;
92
+ rotationQuaternion: TQuaternion;
85
93
  scaleVector: TVector;
86
94
  };
87
95
 
@@ -153,6 +161,9 @@ declare class WAS implements IWAS {
153
161
  private triggerScales;
154
162
  private checkPerformance;
155
163
  private checkPose;
164
+ private faceLandmarker;
165
+ private faceLandmarkerTime;
166
+ private faceData;
156
167
  private readonly browserManager;
157
168
  private readonly eventsManager;
158
169
  private readonly dataManager;
@@ -188,11 +199,14 @@ declare class WAS implements IWAS {
188
199
  private setConfig;
189
200
  private setTriggers;
190
201
  private loadImage;
202
+ private initFaceLandmarker;
203
+ private faceLandmarkerProcess;
191
204
  private process;
192
205
  private drawVideo;
193
206
  getTriggerSize(triggerId: number): TTriggerSize | undefined;
194
207
  getTriggerScale(triggerId: number): TVector | undefined;
195
208
  getViewportSizes(): TViewportSizes;
209
+ private getFaceData;
196
210
  }
197
211
 
198
- export { ANCHOR_TYPE_BOTTOM_LEFT, ANCHOR_TYPE_BOTTOM_RIGHT, ANCHOR_TYPE_CENTER, ANCHOR_TYPE_TOP_LEFT, ANCHOR_TYPE_TOP_RIGHT, DATA_ERROR, DEVICE_ERROR, EVENT_DETECTED, EVENT_DEVICE_ORIENTATION, EVENT_ERROR, EVENT_FRAME, EVENT_LOST, EVENT_POSE, EVENT_PROCESS, EVENT_RESIZE, EVENT_SCREEN_ORIENTATION, EVENT_VISIBILITY, GL_ERROR, HTML_ERROR, PROJECT_MODE_IMAGE, PROJECT_MODE_MIX, PROJECT_MODE_QR, PROJECT_MODE_SLAM_3DOF, type TEventDetectedData, type TEventLostData, type TEventPoseData, TRIGGER_MODE_IMAGE, TRIGGER_MODE_QR, type TTriggerSize, type TViewportSizes, VIDEO_ERROR, WORKER_ERROR, WAS as default };
212
+ export { ANCHOR_TYPE_BOTTOM_LEFT, ANCHOR_TYPE_BOTTOM_RIGHT, ANCHOR_TYPE_CENTER, ANCHOR_TYPE_TOP_LEFT, ANCHOR_TYPE_TOP_RIGHT, DATA_ERROR, DEVICE_ERROR, EVENT_DETECTED, EVENT_DEVICE_ORIENTATION, EVENT_ERROR, EVENT_FRAME, EVENT_LOST, EVENT_POSE, EVENT_PROCESS, EVENT_RESIZE, EVENT_SCREEN_ORIENTATION, EVENT_VISIBILITY, GL_ERROR, HTML_ERROR, PROJECT_MODE_FACE, PROJECT_MODE_IMAGE, PROJECT_MODE_MIX, PROJECT_MODE_QR, PROJECT_MODE_SLAM_3DOF, type TEventDetectedData, type TEventLostData, type TEventPoseData, TRIGGER_MODE_IMAGE, TRIGGER_MODE_QR, type TTriggerSize, type TViewportSizes, VIDEO_ERROR, WORKER_ERROR, WAS as default };