@galacean/engine-xr-webxr 0.0.0-experimental-1.3-xr.2 → 0.0.0-experimental-1.3-xr.4
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/browser.js +139 -143
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
package/dist/browser.js
CHANGED
|
@@ -1038,139 +1038,6 @@
|
|
|
1038
1038
|
]);
|
|
1039
1039
|
return XRFeature;
|
|
1040
1040
|
}();
|
|
1041
|
-
/**
|
|
1042
|
-
* Enum for the types of hit test that can be performed.
|
|
1043
|
-
* Note: currently only supports plane.
|
|
1044
|
-
*/ var TrackableType;
|
|
1045
|
-
(function(TrackableType) {
|
|
1046
|
-
TrackableType[TrackableType[/** Tracked plane. */ "Plane"] = 0x1] = "Plane";
|
|
1047
|
-
TrackableType[TrackableType[/** All tracked objects. */ "All"] = 0x1] = "All";
|
|
1048
|
-
})(TrackableType || (TrackableType = {}));
|
|
1049
|
-
/**
|
|
1050
|
-
* XR hit result.
|
|
1051
|
-
* It is the detection result returned by using XR HitTest feature.
|
|
1052
|
-
*/ var XRHitResult = function XRHitResult() {
|
|
1053
|
-
/** The position of the hit point. */ this.point = new engine.Vector3();
|
|
1054
|
-
/** The normal of the hit point. */ this.normal = new engine.Vector3();
|
|
1055
|
-
};
|
|
1056
|
-
/******************************************************************************
|
|
1057
|
-
Copyright (c) Microsoft Corporation.
|
|
1058
|
-
|
|
1059
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1060
|
-
purpose with or without fee is hereby granted.
|
|
1061
|
-
|
|
1062
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1063
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1064
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1065
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1066
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1067
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1068
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1069
|
-
***************************************************************************** */ function __decorate(decorators, target, key, desc) {
|
|
1070
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1071
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1072
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1073
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1074
|
-
}
|
|
1075
|
-
function __generator(thisArg, body) {
|
|
1076
|
-
var verb = function verb(n) {
|
|
1077
|
-
return function(v) {
|
|
1078
|
-
return step([
|
|
1079
|
-
n,
|
|
1080
|
-
v
|
|
1081
|
-
]);
|
|
1082
|
-
};
|
|
1083
|
-
};
|
|
1084
|
-
var step = function step(op) {
|
|
1085
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1086
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
1087
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1088
|
-
if (y = 0, t) op = [
|
|
1089
|
-
op[0] & 2,
|
|
1090
|
-
t.value
|
|
1091
|
-
];
|
|
1092
|
-
switch(op[0]){
|
|
1093
|
-
case 0:
|
|
1094
|
-
case 1:
|
|
1095
|
-
t = op;
|
|
1096
|
-
break;
|
|
1097
|
-
case 4:
|
|
1098
|
-
_.label++;
|
|
1099
|
-
return {
|
|
1100
|
-
value: op[1],
|
|
1101
|
-
done: false
|
|
1102
|
-
};
|
|
1103
|
-
case 5:
|
|
1104
|
-
_.label++;
|
|
1105
|
-
y = op[1];
|
|
1106
|
-
op = [
|
|
1107
|
-
0
|
|
1108
|
-
];
|
|
1109
|
-
continue;
|
|
1110
|
-
case 7:
|
|
1111
|
-
op = _.ops.pop();
|
|
1112
|
-
_.trys.pop();
|
|
1113
|
-
continue;
|
|
1114
|
-
default:
|
|
1115
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1116
|
-
_ = 0;
|
|
1117
|
-
continue;
|
|
1118
|
-
}
|
|
1119
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1120
|
-
_.label = op[1];
|
|
1121
|
-
break;
|
|
1122
|
-
}
|
|
1123
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1124
|
-
_.label = t[1];
|
|
1125
|
-
t = op;
|
|
1126
|
-
break;
|
|
1127
|
-
}
|
|
1128
|
-
if (t && _.label < t[2]) {
|
|
1129
|
-
_.label = t[2];
|
|
1130
|
-
_.ops.push(op);
|
|
1131
|
-
break;
|
|
1132
|
-
}
|
|
1133
|
-
if (t[2]) _.ops.pop();
|
|
1134
|
-
_.trys.pop();
|
|
1135
|
-
continue;
|
|
1136
|
-
}
|
|
1137
|
-
op = body.call(thisArg, _);
|
|
1138
|
-
} catch (e) {
|
|
1139
|
-
op = [
|
|
1140
|
-
6,
|
|
1141
|
-
e
|
|
1142
|
-
];
|
|
1143
|
-
y = 0;
|
|
1144
|
-
} finally{
|
|
1145
|
-
f = t = 0;
|
|
1146
|
-
}
|
|
1147
|
-
if (op[0] & 5) throw op[1];
|
|
1148
|
-
return {
|
|
1149
|
-
value: op[0] ? op[1] : void 0,
|
|
1150
|
-
done: true
|
|
1151
|
-
};
|
|
1152
|
-
};
|
|
1153
|
-
var _ = {
|
|
1154
|
-
label: 0,
|
|
1155
|
-
sent: function sent() {
|
|
1156
|
-
if (t[0] & 1) throw t[1];
|
|
1157
|
-
return t[1];
|
|
1158
|
-
},
|
|
1159
|
-
trys: [],
|
|
1160
|
-
ops: []
|
|
1161
|
-
}, f, y, t, g;
|
|
1162
|
-
return g = {
|
|
1163
|
-
next: verb(0),
|
|
1164
|
-
"throw": verb(1),
|
|
1165
|
-
"return": verb(2)
|
|
1166
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1167
|
-
return this;
|
|
1168
|
-
}), g;
|
|
1169
|
-
}
|
|
1170
|
-
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
1171
|
-
var e = new Error(message);
|
|
1172
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1173
|
-
};
|
|
1174
1041
|
var XRFeatureType;
|
|
1175
1042
|
(function(XRFeatureType) {
|
|
1176
1043
|
XRFeatureType[XRFeatureType["AnchorTracking"] = 0] = "AnchorTracking";
|
|
@@ -1287,10 +1154,6 @@
|
|
|
1287
1154
|
// prettier-ignore
|
|
1288
1155
|
this._requestTrackings.length = this._tracked.length = this._added.length = this._updated.length = this._removed.length = 0;
|
|
1289
1156
|
};
|
|
1290
|
-
_proto._onDestroy = function _onDestroy() {
|
|
1291
|
-
// prettier-ignore
|
|
1292
|
-
this._requestTrackings.length = this._tracked.length = this._added.length = this._updated.length = this._removed.length = 0;
|
|
1293
|
-
};
|
|
1294
1157
|
_proto._addRequestTracking = function _addRequestTracking(requestTracking) {
|
|
1295
1158
|
var _this = this, platformFeature = _this._platformFeature;
|
|
1296
1159
|
if (this._xrManager.sessionManager._platformSession && !platformFeature.canModifyRequestTrackingAfterInit) {
|
|
@@ -1321,6 +1184,145 @@
|
|
|
1321
1184
|
(function() {
|
|
1322
1185
|
XRTrackableFeature._uuid = 0;
|
|
1323
1186
|
})();
|
|
1187
|
+
/**
|
|
1188
|
+
* The base class of XR tracked object.
|
|
1189
|
+
*/ var XRTracked = function XRTracked() {
|
|
1190
|
+
/** The pose of the trackable in XR space. */ this.pose = new XRPose();
|
|
1191
|
+
/** The tracking state of the trackable. */ this.state = XRTrackingState.NotTracking;
|
|
1192
|
+
};
|
|
1193
|
+
/**
|
|
1194
|
+
* Enum for the types of hit test that can be performed.
|
|
1195
|
+
* Note: currently only supports plane.
|
|
1196
|
+
*/ var TrackableType;
|
|
1197
|
+
(function(TrackableType) {
|
|
1198
|
+
TrackableType[TrackableType[/** Tracked plane. */ "Plane"] = 0x1] = "Plane";
|
|
1199
|
+
TrackableType[TrackableType[/** All tracked objects. */ "All"] = 0x1] = "All";
|
|
1200
|
+
})(TrackableType || (TrackableType = {}));
|
|
1201
|
+
/**
|
|
1202
|
+
* XR hit result.
|
|
1203
|
+
* It is the detection result returned by using XR HitTest feature.
|
|
1204
|
+
*/ var XRHitResult = function XRHitResult() {
|
|
1205
|
+
/** The position of the hit point. */ this.point = new engine.Vector3();
|
|
1206
|
+
/** The normal of the hit point. */ this.normal = new engine.Vector3();
|
|
1207
|
+
};
|
|
1208
|
+
/******************************************************************************
|
|
1209
|
+
Copyright (c) Microsoft Corporation.
|
|
1210
|
+
|
|
1211
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1212
|
+
purpose with or without fee is hereby granted.
|
|
1213
|
+
|
|
1214
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1215
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1216
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1217
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1218
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1219
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1220
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1221
|
+
***************************************************************************** */ function __decorate(decorators, target, key, desc) {
|
|
1222
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1223
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1224
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1225
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1226
|
+
}
|
|
1227
|
+
function __generator(thisArg, body) {
|
|
1228
|
+
var verb = function verb(n) {
|
|
1229
|
+
return function(v) {
|
|
1230
|
+
return step([
|
|
1231
|
+
n,
|
|
1232
|
+
v
|
|
1233
|
+
]);
|
|
1234
|
+
};
|
|
1235
|
+
};
|
|
1236
|
+
var step = function step(op) {
|
|
1237
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
1238
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
1239
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1240
|
+
if (y = 0, t) op = [
|
|
1241
|
+
op[0] & 2,
|
|
1242
|
+
t.value
|
|
1243
|
+
];
|
|
1244
|
+
switch(op[0]){
|
|
1245
|
+
case 0:
|
|
1246
|
+
case 1:
|
|
1247
|
+
t = op;
|
|
1248
|
+
break;
|
|
1249
|
+
case 4:
|
|
1250
|
+
_.label++;
|
|
1251
|
+
return {
|
|
1252
|
+
value: op[1],
|
|
1253
|
+
done: false
|
|
1254
|
+
};
|
|
1255
|
+
case 5:
|
|
1256
|
+
_.label++;
|
|
1257
|
+
y = op[1];
|
|
1258
|
+
op = [
|
|
1259
|
+
0
|
|
1260
|
+
];
|
|
1261
|
+
continue;
|
|
1262
|
+
case 7:
|
|
1263
|
+
op = _.ops.pop();
|
|
1264
|
+
_.trys.pop();
|
|
1265
|
+
continue;
|
|
1266
|
+
default:
|
|
1267
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1268
|
+
_ = 0;
|
|
1269
|
+
continue;
|
|
1270
|
+
}
|
|
1271
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1272
|
+
_.label = op[1];
|
|
1273
|
+
break;
|
|
1274
|
+
}
|
|
1275
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
1276
|
+
_.label = t[1];
|
|
1277
|
+
t = op;
|
|
1278
|
+
break;
|
|
1279
|
+
}
|
|
1280
|
+
if (t && _.label < t[2]) {
|
|
1281
|
+
_.label = t[2];
|
|
1282
|
+
_.ops.push(op);
|
|
1283
|
+
break;
|
|
1284
|
+
}
|
|
1285
|
+
if (t[2]) _.ops.pop();
|
|
1286
|
+
_.trys.pop();
|
|
1287
|
+
continue;
|
|
1288
|
+
}
|
|
1289
|
+
op = body.call(thisArg, _);
|
|
1290
|
+
} catch (e) {
|
|
1291
|
+
op = [
|
|
1292
|
+
6,
|
|
1293
|
+
e
|
|
1294
|
+
];
|
|
1295
|
+
y = 0;
|
|
1296
|
+
} finally{
|
|
1297
|
+
f = t = 0;
|
|
1298
|
+
}
|
|
1299
|
+
if (op[0] & 5) throw op[1];
|
|
1300
|
+
return {
|
|
1301
|
+
value: op[0] ? op[1] : void 0,
|
|
1302
|
+
done: true
|
|
1303
|
+
};
|
|
1304
|
+
};
|
|
1305
|
+
var _ = {
|
|
1306
|
+
label: 0,
|
|
1307
|
+
sent: function sent() {
|
|
1308
|
+
if (t[0] & 1) throw t[1];
|
|
1309
|
+
return t[1];
|
|
1310
|
+
},
|
|
1311
|
+
trys: [],
|
|
1312
|
+
ops: []
|
|
1313
|
+
}, f, y, t, g;
|
|
1314
|
+
return g = {
|
|
1315
|
+
next: verb(0),
|
|
1316
|
+
"throw": verb(1),
|
|
1317
|
+
"return": verb(2)
|
|
1318
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1319
|
+
return this;
|
|
1320
|
+
}), g;
|
|
1321
|
+
}
|
|
1322
|
+
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
1323
|
+
var e = new Error(message);
|
|
1324
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1325
|
+
};
|
|
1324
1326
|
/**
|
|
1325
1327
|
* Enumerates modes of plane in XR.
|
|
1326
1328
|
*/ var XRPlaneMode;
|
|
@@ -1348,12 +1350,6 @@
|
|
|
1348
1350
|
_inherits(XRRequestPlane, XRRequestTracking1);
|
|
1349
1351
|
return XRRequestPlane;
|
|
1350
1352
|
}(XRRequestTracking);
|
|
1351
|
-
/**
|
|
1352
|
-
* The base class of XR tracked object.
|
|
1353
|
-
*/ var XRTracked = function XRTracked() {
|
|
1354
|
-
/** The pose of the trackable in XR space. */ this.pose = new XRPose();
|
|
1355
|
-
/** The tracking state of the trackable. */ this.state = XRTrackingState.NotTracking;
|
|
1356
|
-
};
|
|
1357
1353
|
/**
|
|
1358
1354
|
* The tracked plane in XR space.
|
|
1359
1355
|
*/ var XRTrackedPlane = /*#__PURE__*/ function(XRTracked1) {
|