@galacean/engine-xr 0.0.0-experimental-2.0-skill.0 → 0.0.0-experimental-2.0-migrate.7
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 +645 -81
- 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 +645 -81
- package/dist/main.js.map +1 -1
- package/dist/module.js +646 -82
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
package/dist/browser.js
CHANGED
|
@@ -1122,32 +1122,552 @@
|
|
|
1122
1122
|
/** The normal of the hit point. */ this.normal = new engine.Vector3();
|
|
1123
1123
|
};
|
|
1124
1124
|
|
|
1125
|
-
|
|
1126
|
-
Copyright (c) Microsoft Corporation.
|
|
1127
|
-
|
|
1128
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1129
|
-
purpose with or without fee is hereby granted.
|
|
1130
|
-
|
|
1131
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1132
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1133
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1134
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1135
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1136
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1137
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1138
|
-
***************************************************************************** */
|
|
1139
|
-
|
|
1140
|
-
function __decorate(decorators, target, key, desc) {
|
|
1141
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1142
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1143
|
-
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;
|
|
1144
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1145
|
-
}
|
|
1125
|
+
/* @minVersion 7.20.0 */
|
|
1146
1126
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1127
|
+
/**
|
|
1128
|
+
Enums are used in this file, but not assigned to vars to avoid non-hoistable values
|
|
1129
|
+
|
|
1130
|
+
CONSTRUCTOR = 0;
|
|
1131
|
+
PUBLIC = 1;
|
|
1132
|
+
PRIVATE = 2;
|
|
1133
|
+
|
|
1134
|
+
FIELD = 0;
|
|
1135
|
+
ACCESSOR = 1;
|
|
1136
|
+
METHOD = 2;
|
|
1137
|
+
GETTER = 3;
|
|
1138
|
+
SETTER = 4;
|
|
1139
|
+
|
|
1140
|
+
STATIC = 5;
|
|
1141
|
+
|
|
1142
|
+
CLASS = 10; // only used in assertValidReturnValue
|
|
1143
|
+
*/
|
|
1144
|
+
|
|
1145
|
+
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
1146
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
1147
|
+
return function addInitializer(initializer) {
|
|
1148
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
1149
|
+
assertCallable(initializer, "An initializer");
|
|
1150
|
+
initializers.push(initializer);
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
1155
|
+
var kindStr;
|
|
1156
|
+
|
|
1157
|
+
switch (kind) {
|
|
1158
|
+
case 1 /* ACCESSOR */:
|
|
1159
|
+
kindStr = "accessor";
|
|
1160
|
+
break;
|
|
1161
|
+
case 2 /* METHOD */:
|
|
1162
|
+
kindStr = "method";
|
|
1163
|
+
break;
|
|
1164
|
+
case 3 /* GETTER */:
|
|
1165
|
+
kindStr = "getter";
|
|
1166
|
+
break;
|
|
1167
|
+
case 4 /* SETTER */:
|
|
1168
|
+
kindStr = "setter";
|
|
1169
|
+
break;
|
|
1170
|
+
default:
|
|
1171
|
+
kindStr = "field";
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
var ctx = { kind: kindStr, name: isPrivate ? "#" + name : name, static: isStatic, private: isPrivate, metadata: metadata };
|
|
1175
|
+
|
|
1176
|
+
var decoratorFinishedRef = { v: false };
|
|
1177
|
+
|
|
1178
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
1179
|
+
|
|
1180
|
+
var get, set;
|
|
1181
|
+
if (kind === 0 /* FIELD */) {
|
|
1182
|
+
if (isPrivate) {
|
|
1183
|
+
get = desc.get;
|
|
1184
|
+
set = desc.set;
|
|
1185
|
+
} else {
|
|
1186
|
+
get = function() {
|
|
1187
|
+
return this[name];
|
|
1188
|
+
};
|
|
1189
|
+
set = function(v) {
|
|
1190
|
+
this[name] = v;
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
} else if (kind === 2 /* METHOD */) {
|
|
1194
|
+
get = function() {
|
|
1195
|
+
return desc.value;
|
|
1196
|
+
};
|
|
1197
|
+
} else {
|
|
1198
|
+
// replace with values that will go through the final getter and setter
|
|
1199
|
+
if (kind === 1 /* ACCESSOR */ || kind === 3 /* GETTER */) {
|
|
1200
|
+
get = function() {
|
|
1201
|
+
return desc.get.call(this);
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
if (kind === 1 /* ACCESSOR */ || kind === 4 /* SETTER */) {
|
|
1206
|
+
set = function(v) {
|
|
1207
|
+
desc.set.call(this, v);
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
ctx.access = get && set ? { get: get, set: set } : get ? { get: get } : { set: set };
|
|
1212
|
+
|
|
1213
|
+
try {
|
|
1214
|
+
return dec(value, ctx);
|
|
1215
|
+
} finally {
|
|
1216
|
+
decoratorFinishedRef.v = true;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
1221
|
+
if (decoratorFinishedRef.v) {
|
|
1222
|
+
throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
function assertCallable(fn, hint) {
|
|
1227
|
+
if (typeof fn !== "function") {
|
|
1228
|
+
throw new TypeError(hint + " must be a function");
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
function assertValidReturnValue(kind, value) {
|
|
1233
|
+
var type = typeof value;
|
|
1234
|
+
|
|
1235
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
1236
|
+
if (type !== "object" || value === null) {
|
|
1237
|
+
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1238
|
+
}
|
|
1239
|
+
if (value.get !== undefined) {
|
|
1240
|
+
assertCallable(value.get, "accessor.get");
|
|
1241
|
+
}
|
|
1242
|
+
if (value.set !== undefined) {
|
|
1243
|
+
assertCallable(value.set, "accessor.set");
|
|
1244
|
+
}
|
|
1245
|
+
if (value.init !== undefined) {
|
|
1246
|
+
assertCallable(value.init, "accessor.init");
|
|
1247
|
+
}
|
|
1248
|
+
} else if (type !== "function") {
|
|
1249
|
+
var hint;
|
|
1250
|
+
if (kind === 0 /* FIELD */) {
|
|
1251
|
+
hint = "field";
|
|
1252
|
+
} else if (kind === 10 /* CLASS */) {
|
|
1253
|
+
hint = "class";
|
|
1254
|
+
} else {
|
|
1255
|
+
hint = "method";
|
|
1256
|
+
}
|
|
1257
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
1262
|
+
var decs = decInfo[0];
|
|
1263
|
+
|
|
1264
|
+
var desc, init, value;
|
|
1265
|
+
|
|
1266
|
+
if (isPrivate) {
|
|
1267
|
+
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
|
|
1268
|
+
desc = { get: decInfo[3], set: decInfo[4] };
|
|
1269
|
+
} else if (kind === 3 /* GETTER */) {
|
|
1270
|
+
desc = { get: decInfo[3] };
|
|
1271
|
+
} else if (kind === 4 /* SETTER */) {
|
|
1272
|
+
desc = { set: decInfo[3] };
|
|
1273
|
+
} else {
|
|
1274
|
+
desc = { value: decInfo[3] };
|
|
1275
|
+
}
|
|
1276
|
+
} else if (kind !== 0 /* FIELD */) {
|
|
1277
|
+
desc = Object.getOwnPropertyDescriptor(base, name);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
1281
|
+
value = { get: desc.get, set: desc.set };
|
|
1282
|
+
} else if (kind === 2 /* METHOD */) {
|
|
1283
|
+
value = desc.value;
|
|
1284
|
+
} else if (kind === 3 /* GETTER */) {
|
|
1285
|
+
value = desc.get;
|
|
1286
|
+
} else if (kind === 4 /* SETTER */) {
|
|
1287
|
+
value = desc.set;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
var newValue, get, set;
|
|
1291
|
+
|
|
1292
|
+
if (typeof decs === "function") {
|
|
1293
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
1294
|
+
|
|
1295
|
+
if (newValue !== void 0) {
|
|
1296
|
+
assertValidReturnValue(kind, newValue);
|
|
1297
|
+
|
|
1298
|
+
if (kind === 0 /* FIELD */) {
|
|
1299
|
+
init = newValue;
|
|
1300
|
+
} else if (kind === 1 /* ACCESSOR */) {
|
|
1301
|
+
init = newValue.init;
|
|
1302
|
+
get = newValue.get || value.get;
|
|
1303
|
+
set = newValue.set || value.set;
|
|
1304
|
+
|
|
1305
|
+
value = { get: get, set: set };
|
|
1306
|
+
} else {
|
|
1307
|
+
value = newValue;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
} else {
|
|
1311
|
+
for (var i = decs.length - 1; i >= 0; i--) {
|
|
1312
|
+
var dec = decs[i];
|
|
1313
|
+
|
|
1314
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
1315
|
+
|
|
1316
|
+
if (newValue !== void 0) {
|
|
1317
|
+
assertValidReturnValue(kind, newValue);
|
|
1318
|
+
var newInit;
|
|
1319
|
+
|
|
1320
|
+
if (kind === 0 /* FIELD */) {
|
|
1321
|
+
newInit = newValue;
|
|
1322
|
+
} else if (kind === 1 /* ACCESSOR */) {
|
|
1323
|
+
newInit = newValue.init;
|
|
1324
|
+
get = newValue.get || value.get;
|
|
1325
|
+
set = newValue.set || value.set;
|
|
1326
|
+
|
|
1327
|
+
value = { get: get, set: set };
|
|
1328
|
+
} else {
|
|
1329
|
+
value = newValue;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
if (newInit !== void 0) {
|
|
1333
|
+
if (init === void 0) {
|
|
1334
|
+
init = newInit;
|
|
1335
|
+
} else if (typeof init === "function") {
|
|
1336
|
+
init = [init, newInit];
|
|
1337
|
+
} else {
|
|
1338
|
+
init.push(newInit);
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
|
|
1346
|
+
if (init === void 0) {
|
|
1347
|
+
// If the initializer was void 0, sub in a dummy initializer
|
|
1348
|
+
init = function(instance, init) {
|
|
1349
|
+
return init;
|
|
1350
|
+
};
|
|
1351
|
+
} else if (typeof init !== "function") {
|
|
1352
|
+
var ownInitializers = init;
|
|
1353
|
+
|
|
1354
|
+
init = function(instance, init) {
|
|
1355
|
+
var value = init;
|
|
1356
|
+
|
|
1357
|
+
for (var i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
|
|
1358
|
+
|
|
1359
|
+
return value;
|
|
1360
|
+
};
|
|
1361
|
+
} else {
|
|
1362
|
+
var originalInitializer = init;
|
|
1363
|
+
|
|
1364
|
+
init = function(instance, init) {
|
|
1365
|
+
return originalInitializer.call(instance, init);
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
ret.push(init);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
if (kind !== 0 /* FIELD */) {
|
|
1373
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
1374
|
+
desc.get = value.get;
|
|
1375
|
+
desc.set = value.set;
|
|
1376
|
+
} else if (kind === 2 /* METHOD */) {
|
|
1377
|
+
desc.value = value;
|
|
1378
|
+
} else if (kind === 3 /* GETTER */) {
|
|
1379
|
+
desc.get = value;
|
|
1380
|
+
} else if (kind === 4 /* SETTER */) {
|
|
1381
|
+
desc.set = value;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
if (isPrivate) {
|
|
1385
|
+
if (kind === 1 /* ACCESSOR */) {
|
|
1386
|
+
ret.push(function(instance, args) {
|
|
1387
|
+
return value.get.call(instance, args);
|
|
1388
|
+
});
|
|
1389
|
+
ret.push(function(instance, args) {
|
|
1390
|
+
return value.set.call(instance, args);
|
|
1391
|
+
});
|
|
1392
|
+
} else if (kind === 2 /* METHOD */) {
|
|
1393
|
+
ret.push(value);
|
|
1394
|
+
} else {
|
|
1395
|
+
ret.push(function(instance, args) {
|
|
1396
|
+
return value.call(instance, args);
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
} else {
|
|
1400
|
+
Object.defineProperty(base, name, desc);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
1406
|
+
var ret = [];
|
|
1407
|
+
var protoInitializers;
|
|
1408
|
+
var staticInitializers;
|
|
1409
|
+
|
|
1410
|
+
var existingProtoNonFields = new Map();
|
|
1411
|
+
var existingStaticNonFields = new Map();
|
|
1412
|
+
|
|
1413
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
1414
|
+
var decInfo = decInfos[i];
|
|
1415
|
+
|
|
1416
|
+
// skip computed property names
|
|
1417
|
+
if (!Array.isArray(decInfo)) continue;
|
|
1418
|
+
|
|
1419
|
+
var kind = decInfo[1];
|
|
1420
|
+
var name = decInfo[2];
|
|
1421
|
+
var isPrivate = decInfo.length > 3;
|
|
1422
|
+
|
|
1423
|
+
var isStatic = kind >= 5; /* STATIC */
|
|
1424
|
+
var base;
|
|
1425
|
+
var initializers;
|
|
1426
|
+
|
|
1427
|
+
if (isStatic) {
|
|
1428
|
+
base = Class;
|
|
1429
|
+
kind = kind - 5 /* STATIC */;
|
|
1430
|
+
// initialize staticInitializers when we see a non-field static member
|
|
1431
|
+
staticInitializers = staticInitializers || [];
|
|
1432
|
+
initializers = staticInitializers;
|
|
1433
|
+
} else {
|
|
1434
|
+
base = Class.prototype;
|
|
1435
|
+
// initialize protoInitializers when we see a non-field member
|
|
1436
|
+
protoInitializers = protoInitializers || [];
|
|
1437
|
+
initializers = protoInitializers;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
if (kind !== 0 /* FIELD */ && !isPrivate) {
|
|
1441
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
1442
|
+
|
|
1443
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
1444
|
+
|
|
1445
|
+
if (existingKind === true || (existingKind === 3 /* GETTER */ && kind !== 4) /* SETTER */ || (existingKind === 4 /* SETTER */ && kind !== 3) /* GETTER */) {
|
|
1446
|
+
throw new Error(
|
|
1447
|
+
"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "
|
|
1448
|
+
+ name
|
|
1449
|
+
);
|
|
1450
|
+
} else if (!existingKind && kind > 2 /* METHOD */) {
|
|
1451
|
+
existingNonFields.set(name, kind);
|
|
1452
|
+
} else {
|
|
1453
|
+
existingNonFields.set(name, true);
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
pushInitializers(ret, protoInitializers);
|
|
1461
|
+
pushInitializers(ret, staticInitializers);
|
|
1462
|
+
return ret;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
function pushInitializers(ret, initializers) {
|
|
1466
|
+
if (initializers) {
|
|
1467
|
+
ret.push(function(instance) {
|
|
1468
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
1469
|
+
return instance;
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
1475
|
+
if (classDecs.length > 0) {
|
|
1476
|
+
var initializers = [];
|
|
1477
|
+
var newClass = targetClass;
|
|
1478
|
+
var name = targetClass.name;
|
|
1479
|
+
|
|
1480
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
1481
|
+
var decoratorFinishedRef = { v: false };
|
|
1482
|
+
|
|
1483
|
+
try {
|
|
1484
|
+
var nextNewClass = classDecs[i](newClass, { kind: "class", name: name, addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef), metadata });
|
|
1485
|
+
} finally {
|
|
1486
|
+
decoratorFinishedRef.v = true;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
if (nextNewClass !== undefined) {
|
|
1490
|
+
assertValidReturnValue(10, /* CLASS */ nextNewClass);
|
|
1491
|
+
newClass = nextNewClass;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
1496
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
|
|
1497
|
+
}];
|
|
1498
|
+
}
|
|
1499
|
+
// The transformer will not emit assignment when there are no class decorators,
|
|
1500
|
+
// so we don't have to return an empty array here.
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
function defineMetadata(Class, metadata) {
|
|
1504
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: true, enumerable: true, value: metadata });
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
Basic usage:
|
|
1509
|
+
|
|
1510
|
+
applyDecs(
|
|
1511
|
+
Class,
|
|
1512
|
+
[
|
|
1513
|
+
// member decorators
|
|
1514
|
+
[
|
|
1515
|
+
dec, // dec or array of decs
|
|
1516
|
+
0, // kind of value being decorated
|
|
1517
|
+
'prop', // name of public prop on class containing the value being decorated,
|
|
1518
|
+
'#p', // the name of the private property (if is private, void 0 otherwise),
|
|
1519
|
+
]
|
|
1520
|
+
],
|
|
1521
|
+
[
|
|
1522
|
+
// class decorators
|
|
1523
|
+
dec1, dec2
|
|
1524
|
+
]
|
|
1525
|
+
)
|
|
1526
|
+
```
|
|
1527
|
+
|
|
1528
|
+
Fully transpiled example:
|
|
1529
|
+
|
|
1530
|
+
```js
|
|
1531
|
+
@dec
|
|
1532
|
+
class Class {
|
|
1533
|
+
@dec
|
|
1534
|
+
a = 123;
|
|
1535
|
+
|
|
1536
|
+
@dec
|
|
1537
|
+
#a = 123;
|
|
1538
|
+
|
|
1539
|
+
@dec
|
|
1540
|
+
@dec2
|
|
1541
|
+
accessor b = 123;
|
|
1542
|
+
|
|
1543
|
+
@dec
|
|
1544
|
+
accessor #b = 123;
|
|
1545
|
+
|
|
1546
|
+
@dec
|
|
1547
|
+
c() { console.log('c'); }
|
|
1548
|
+
|
|
1549
|
+
@dec
|
|
1550
|
+
#c() { console.log('privC'); }
|
|
1551
|
+
|
|
1552
|
+
@dec
|
|
1553
|
+
get d() { console.log('d'); }
|
|
1554
|
+
|
|
1555
|
+
@dec
|
|
1556
|
+
get #d() { console.log('privD'); }
|
|
1557
|
+
|
|
1558
|
+
@dec
|
|
1559
|
+
set e(v) { console.log('e'); }
|
|
1560
|
+
|
|
1561
|
+
@dec
|
|
1562
|
+
set #e(v) { console.log('privE'); }
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
|
|
1566
|
+
// becomes
|
|
1567
|
+
let initializeInstance;
|
|
1568
|
+
let initializeClass;
|
|
1569
|
+
|
|
1570
|
+
let initA;
|
|
1571
|
+
let initPrivA;
|
|
1572
|
+
|
|
1573
|
+
let initB;
|
|
1574
|
+
let initPrivB, getPrivB, setPrivB;
|
|
1575
|
+
|
|
1576
|
+
let privC;
|
|
1577
|
+
let privD;
|
|
1578
|
+
let privE;
|
|
1579
|
+
|
|
1580
|
+
let Class;
|
|
1581
|
+
class _Class {
|
|
1582
|
+
static {
|
|
1583
|
+
let ret = applyDecs(
|
|
1584
|
+
this,
|
|
1585
|
+
[
|
|
1586
|
+
[dec, 0, 'a'],
|
|
1587
|
+
[dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],
|
|
1588
|
+
[[dec, dec2], 1, 'b'],
|
|
1589
|
+
[dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],
|
|
1590
|
+
[dec, 2, 'c'],
|
|
1591
|
+
[dec, 2, 'c', () => console.log('privC')],
|
|
1592
|
+
[dec, 3, 'd'],
|
|
1593
|
+
[dec, 3, 'd', () => console.log('privD')],
|
|
1594
|
+
[dec, 4, 'e'],
|
|
1595
|
+
[dec, 4, 'e', () => console.log('privE')],
|
|
1596
|
+
],
|
|
1597
|
+
[
|
|
1598
|
+
dec
|
|
1599
|
+
]
|
|
1600
|
+
)
|
|
1601
|
+
|
|
1602
|
+
initA = ret[0];
|
|
1603
|
+
|
|
1604
|
+
initPrivA = ret[1];
|
|
1605
|
+
|
|
1606
|
+
initB = ret[2];
|
|
1607
|
+
|
|
1608
|
+
initPrivB = ret[3];
|
|
1609
|
+
getPrivB = ret[4];
|
|
1610
|
+
setPrivB = ret[5];
|
|
1611
|
+
|
|
1612
|
+
privC = ret[6];
|
|
1613
|
+
|
|
1614
|
+
privD = ret[7];
|
|
1615
|
+
|
|
1616
|
+
privE = ret[8];
|
|
1617
|
+
|
|
1618
|
+
initializeInstance = ret[9];
|
|
1619
|
+
|
|
1620
|
+
Class = ret[10]
|
|
1621
|
+
|
|
1622
|
+
initializeClass = ret[11];
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
a = (initializeInstance(this), initA(this, 123));
|
|
1626
|
+
|
|
1627
|
+
#a = initPrivA(this, 123);
|
|
1628
|
+
|
|
1629
|
+
#bData = initB(this, 123);
|
|
1630
|
+
get b() { return this.#bData }
|
|
1631
|
+
set b(v) { this.#bData = v }
|
|
1632
|
+
|
|
1633
|
+
#privBData = initPrivB(this, 123);
|
|
1634
|
+
get #b() { return getPrivB(this); }
|
|
1635
|
+
set #b(v) { setPrivB(this, v); }
|
|
1636
|
+
|
|
1637
|
+
c() { console.log('c'); }
|
|
1638
|
+
|
|
1639
|
+
#c(...args) { return privC(this, ...args) }
|
|
1640
|
+
|
|
1641
|
+
get d() { console.log('d'); }
|
|
1642
|
+
|
|
1643
|
+
get #d() { return privD(this); }
|
|
1644
|
+
|
|
1645
|
+
set e(v) { console.log('e'); }
|
|
1646
|
+
|
|
1647
|
+
set #e(v) { privE(this, v); }
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
initializeClass(Class);
|
|
1651
|
+
*/
|
|
1652
|
+
|
|
1653
|
+
_apply_decs_2203_r = function(targetClass, memberDecs, classDecs, parentClass) {
|
|
1654
|
+
if (parentClass !== void 0) {
|
|
1655
|
+
var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1656
|
+
}
|
|
1657
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
1658
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
1659
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
1660
|
+
return {
|
|
1661
|
+
e: e,
|
|
1662
|
+
// Lazily apply class decorations so that member init locals can be properly bound.
|
|
1663
|
+
get c() {
|
|
1664
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
1665
|
+
}
|
|
1666
|
+
};
|
|
1667
|
+
};
|
|
1668
|
+
|
|
1669
|
+
return _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass);
|
|
1670
|
+
}
|
|
1151
1671
|
|
|
1152
1672
|
/**
|
|
1153
1673
|
* Enumerates modes of plane in XR.
|
|
@@ -1196,12 +1716,15 @@
|
|
|
1196
1716
|
return XRTrackedPlane;
|
|
1197
1717
|
}(XRTracked);
|
|
1198
1718
|
|
|
1199
|
-
|
|
1200
|
-
|
|
1719
|
+
var _dec$5, _initClass$5, _XRTrackableFeature$2;
|
|
1720
|
+
exports.XRPlaneTracking = void 0;
|
|
1721
|
+
_dec$5 = registerXRFeature(XRFeatureType.PlaneTracking);
|
|
1722
|
+
var XRPlaneTracking = /*#__PURE__*/ function(_superClass) {
|
|
1723
|
+
_inherits(XRPlaneTracking, _superClass);
|
|
1201
1724
|
function XRPlaneTracking(xrManager, detectionMode) {
|
|
1202
1725
|
if (detectionMode === void 0) detectionMode = XRPlaneMode.EveryThing;
|
|
1203
1726
|
var _this;
|
|
1204
|
-
_this =
|
|
1727
|
+
_this = _superClass.call(this, xrManager, XRFeatureType.PlaneTracking, detectionMode) || this;
|
|
1205
1728
|
_this._addRequestTracking(new XRRequestPlane(detectionMode));
|
|
1206
1729
|
return _this;
|
|
1207
1730
|
}
|
|
@@ -1230,16 +1753,21 @@
|
|
|
1230
1753
|
}
|
|
1231
1754
|
]);
|
|
1232
1755
|
return XRPlaneTracking;
|
|
1233
|
-
}(XRTrackableFeature);
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1756
|
+
}(_XRTrackableFeature$2 = XRTrackableFeature);
|
|
1757
|
+
var ref$4, ref1$4;
|
|
1758
|
+
ref$4 = _apply_decs_2203_r(XRPlaneTracking, [], [
|
|
1759
|
+
_dec$5
|
|
1760
|
+
], _XRTrackableFeature$2), ref1$4 = ref$4.c, exports.XRPlaneTracking = ref1$4[0], _initClass$5 = ref1$4[1];
|
|
1761
|
+
_initClass$5();
|
|
1762
|
+
|
|
1763
|
+
var _dec$4, _initClass$4, _XRFeature;
|
|
1764
|
+
exports.XRHitTest = void 0;
|
|
1765
|
+
_dec$4 = registerXRFeature(XRFeatureType.HitTest);
|
|
1766
|
+
var XRHitTest = /*#__PURE__*/ function(_superClass) {
|
|
1767
|
+
_inherits(XRHitTest, _superClass);
|
|
1240
1768
|
function XRHitTest(xrManager) {
|
|
1241
1769
|
var _this;
|
|
1242
|
-
_this =
|
|
1770
|
+
_this = _superClass.call(this, xrManager, XRFeatureType.HitTest) || this, _this._tempRay = new engine.Ray(), _this._tempPlane = new engine.Plane(), _this._tempVec2 = new engine.Vector2(), _this._tempVec30 = new engine.Vector3(), _this._tempVec31 = new engine.Vector3(), _this._tempVec32 = new engine.Vector3(), _this._tempVec33 = new engine.Vector3(), _this._tempVec34 = new engine.Vector3(), _this._tempVec35 = new engine.Vector3();
|
|
1243
1771
|
return _this;
|
|
1244
1772
|
}
|
|
1245
1773
|
var _proto = XRHitTest.prototype;
|
|
@@ -1330,10 +1858,12 @@
|
|
|
1330
1858
|
return true;
|
|
1331
1859
|
};
|
|
1332
1860
|
return XRHitTest;
|
|
1333
|
-
}(XRFeature);
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1861
|
+
}(_XRFeature = XRFeature);
|
|
1862
|
+
var ref$3, ref1$3;
|
|
1863
|
+
ref$3 = _apply_decs_2203_r(XRHitTest, [], [
|
|
1864
|
+
_dec$4
|
|
1865
|
+
], _XRFeature), ref1$3 = ref$3.c, exports.XRHitTest = ref1$3[0], _initClass$4 = ref1$3[1];
|
|
1866
|
+
_initClass$4();
|
|
1337
1867
|
|
|
1338
1868
|
/**
|
|
1339
1869
|
* The anchor in XR space.
|
|
@@ -1357,11 +1887,14 @@
|
|
|
1357
1887
|
return XRRequestAnchor;
|
|
1358
1888
|
}(XRRequestTracking);
|
|
1359
1889
|
|
|
1360
|
-
|
|
1361
|
-
|
|
1890
|
+
var _dec$3, _initClass$3, _XRTrackableFeature$1;
|
|
1891
|
+
exports.XRAnchorTracking = void 0;
|
|
1892
|
+
_dec$3 = registerXRFeature(XRFeatureType.AnchorTracking);
|
|
1893
|
+
var XRAnchorTracking = /*#__PURE__*/ function(_superClass) {
|
|
1894
|
+
_inherits(XRAnchorTracking, _superClass);
|
|
1362
1895
|
function XRAnchorTracking(xrManager) {
|
|
1363
1896
|
var _this;
|
|
1364
|
-
_this =
|
|
1897
|
+
_this = _superClass.call(this, xrManager, XRFeatureType.AnchorTracking) || this, _this._anchors = [];
|
|
1365
1898
|
return _this;
|
|
1366
1899
|
}
|
|
1367
1900
|
var _proto = XRAnchorTracking.prototype;
|
|
@@ -1429,10 +1962,12 @@
|
|
|
1429
1962
|
}
|
|
1430
1963
|
]);
|
|
1431
1964
|
return XRAnchorTracking;
|
|
1432
|
-
}(XRTrackableFeature);
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1965
|
+
}(_XRTrackableFeature$1 = XRTrackableFeature);
|
|
1966
|
+
var ref$2, ref1$2;
|
|
1967
|
+
ref$2 = _apply_decs_2203_r(XRAnchorTracking, [], [
|
|
1968
|
+
_dec$3
|
|
1969
|
+
], _XRTrackableFeature$1), ref1$2 = ref$2.c, exports.XRAnchorTracking = ref1$2[0], _initClass$3 = ref1$2[1];
|
|
1970
|
+
_initClass$3();
|
|
1436
1971
|
|
|
1437
1972
|
/**
|
|
1438
1973
|
* The request image in XR space.
|
|
@@ -1456,11 +1991,14 @@
|
|
|
1456
1991
|
return XRTrackedImage;
|
|
1457
1992
|
}(XRTracked);
|
|
1458
1993
|
|
|
1459
|
-
|
|
1460
|
-
|
|
1994
|
+
var _dec$2, _initClass$2, _XRTrackableFeature;
|
|
1995
|
+
exports.XRImageTracking = void 0;
|
|
1996
|
+
_dec$2 = registerXRFeature(XRFeatureType.ImageTracking);
|
|
1997
|
+
var XRImageTracking = /*#__PURE__*/ function(_superClass) {
|
|
1998
|
+
_inherits(XRImageTracking, _superClass);
|
|
1461
1999
|
function XRImageTracking(xrManager, trackingImages) {
|
|
1462
2000
|
var _this;
|
|
1463
|
-
_this =
|
|
2001
|
+
_this = _superClass.call(this, xrManager, XRFeatureType.ImageTracking, trackingImages) || this;
|
|
1464
2002
|
_this._trackingImages = trackingImages;
|
|
1465
2003
|
var imageLength = trackingImages ? trackingImages.length : 0;
|
|
1466
2004
|
if (imageLength > 0) {
|
|
@@ -1497,10 +2035,12 @@
|
|
|
1497
2035
|
}
|
|
1498
2036
|
]);
|
|
1499
2037
|
return XRImageTracking;
|
|
1500
|
-
}(XRTrackableFeature);
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
2038
|
+
}(_XRTrackableFeature = XRTrackableFeature);
|
|
2039
|
+
var ref$1, ref1$1;
|
|
2040
|
+
ref$1 = _apply_decs_2203_r(XRImageTracking, [], [
|
|
2041
|
+
_dec$2
|
|
2042
|
+
], _XRTrackableFeature), ref1$1 = ref$1.c, exports.XRImageTracking = ref1$1[0], _initClass$2 = ref1$1[1];
|
|
2043
|
+
_initClass$2();
|
|
1504
2044
|
|
|
1505
2045
|
/**
|
|
1506
2046
|
* A reference image is an image to look for in the physical environment.
|
|
@@ -1510,26 +2050,45 @@
|
|
|
1510
2050
|
this.physicalWidth = physicalWidth;
|
|
1511
2051
|
};
|
|
1512
2052
|
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
}
|
|
1528
|
-
return
|
|
1529
|
-
}()
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
2053
|
+
function _identity(x) {
|
|
2054
|
+
return x;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
var _class;
|
|
2058
|
+
var _dec$1, _initClass$1;
|
|
2059
|
+
exports.XRReferenceImageDecoder = void 0;
|
|
2060
|
+
_dec$1 = engine.decoder("XRReferenceImage");
|
|
2061
|
+
new (_class = /*#__PURE__*/ function(_identity) {
|
|
2062
|
+
_inherits(_class, _identity);
|
|
2063
|
+
function _class() {
|
|
2064
|
+
var _this;
|
|
2065
|
+
_this = _identity.apply(this, arguments) || this, _initClass$1();
|
|
2066
|
+
return _this;
|
|
2067
|
+
}
|
|
2068
|
+
return _class;
|
|
2069
|
+
}(_identity), function() {
|
|
2070
|
+
var XRReferenceImageDecoder = /*#__PURE__*/ function() {
|
|
2071
|
+
function XRReferenceImageDecoder() {}
|
|
2072
|
+
XRReferenceImageDecoder.decode = function decode(engine$1, bufferReader) {
|
|
2073
|
+
return new engine.AssetPromise(function(resolve, reject) {
|
|
2074
|
+
var physicalWidth = bufferReader.nextFloat32();
|
|
2075
|
+
bufferReader.nextUint8();
|
|
2076
|
+
var img = new Image();
|
|
2077
|
+
img.onload = function() {
|
|
2078
|
+
resolve(new XRReferenceImage("", img, physicalWidth));
|
|
2079
|
+
};
|
|
2080
|
+
img.src = URL.createObjectURL(new window.Blob([
|
|
2081
|
+
bufferReader.nextImagesData(1)[0]
|
|
2082
|
+
]));
|
|
2083
|
+
});
|
|
2084
|
+
};
|
|
2085
|
+
return XRReferenceImageDecoder;
|
|
2086
|
+
}();
|
|
2087
|
+
var ref, ref1;
|
|
2088
|
+
ref = _apply_decs_2203_r(XRReferenceImageDecoder, [], [
|
|
2089
|
+
_dec$1
|
|
2090
|
+
]), ref1 = ref.c, exports.XRReferenceImageDecoder = ref1[0], _initClass$1 = ref1[1];
|
|
2091
|
+
}(), _class)();
|
|
1533
2092
|
|
|
1534
2093
|
function _extends() {
|
|
1535
2094
|
_extends = Object.assign || function assign(target) {
|
|
@@ -1544,10 +2103,13 @@
|
|
|
1544
2103
|
return _extends.apply(this, arguments);
|
|
1545
2104
|
}
|
|
1546
2105
|
|
|
1547
|
-
|
|
1548
|
-
|
|
2106
|
+
var _dec, _initClass, _Loader;
|
|
2107
|
+
exports.XRReferenceImageLoader = void 0;
|
|
2108
|
+
_dec = engine.resourceLoader("XRReferenceImage", []);
|
|
2109
|
+
var XRReferenceImageLoader = /*#__PURE__*/ function(_superClass) {
|
|
2110
|
+
_inherits(XRReferenceImageLoader, _superClass);
|
|
1549
2111
|
function XRReferenceImageLoader() {
|
|
1550
|
-
return
|
|
2112
|
+
return _superClass.apply(this, arguments) || this;
|
|
1551
2113
|
}
|
|
1552
2114
|
var _proto = XRReferenceImageLoader.prototype;
|
|
1553
2115
|
_proto.load = function load(item, resourceManager) {
|
|
@@ -1563,10 +2125,12 @@
|
|
|
1563
2125
|
});
|
|
1564
2126
|
};
|
|
1565
2127
|
return XRReferenceImageLoader;
|
|
1566
|
-
}(engine.Loader);
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
2128
|
+
}(_Loader = engine.Loader);
|
|
2129
|
+
var ref, ref1;
|
|
2130
|
+
ref = _apply_decs_2203_r(XRReferenceImageLoader, [], [
|
|
2131
|
+
_dec
|
|
2132
|
+
], _Loader), ref1 = ref.c, exports.XRReferenceImageLoader = ref1[0], _initClass = ref1[1];
|
|
2133
|
+
_initClass();
|
|
1570
2134
|
|
|
1571
2135
|
exports.TrackableType = TrackableType;
|
|
1572
2136
|
exports.XRAnchor = XRAnchor;
|