@xviewer.js/core 1.0.0-alpha.53 → 1.0.0-alpha.55
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/main.js +8 -51
- package/dist/main.js.map +1 -1
- package/dist/module.js +8 -51
- package/dist/module.js.map +1 -1
- package/package.json +1 -1
- package/types/Viewer.d.ts +1 -3
- package/types/asset/ResourceManager.d.ts +3 -11
- package/types/index.d.ts +2 -1
package/dist/main.js
CHANGED
|
@@ -1483,19 +1483,13 @@ class Lens {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
1485
|
__decorate([
|
|
1486
|
-
property
|
|
1487
|
-
dir: "lens"
|
|
1488
|
-
})
|
|
1486
|
+
property
|
|
1489
1487
|
], Lens.prototype, "fov", void 0);
|
|
1490
1488
|
__decorate([
|
|
1491
|
-
property
|
|
1492
|
-
dir: "lens"
|
|
1493
|
-
})
|
|
1489
|
+
property
|
|
1494
1490
|
], Lens.prototype, "near", void 0);
|
|
1495
1491
|
__decorate([
|
|
1496
|
-
property
|
|
1497
|
-
dir: "lens"
|
|
1498
|
-
})
|
|
1492
|
+
property
|
|
1499
1493
|
], Lens.prototype, "far", void 0);
|
|
1500
1494
|
class VirtualCamera extends Component {
|
|
1501
1495
|
get finalPosition() {
|
|
@@ -2872,7 +2866,7 @@ class FreelookVirtualCamera extends VirtualCamera {
|
|
|
2872
2866
|
this._touchID = -1;
|
|
2873
2867
|
this._preLoc0 = new three.Vector2();
|
|
2874
2868
|
this._preLoc1 = new three.Vector2();
|
|
2875
|
-
this._spherical = new three.Spherical(
|
|
2869
|
+
this._spherical = new three.Spherical(2, Math.PI / 2);
|
|
2876
2870
|
this._lookAt = new three.Vector3();
|
|
2877
2871
|
this._tempSmoothing = 6;
|
|
2878
2872
|
this._tempRotateSmoothing = 8;
|
|
@@ -4261,28 +4255,6 @@ class ResourceManager {
|
|
|
4261
4255
|
let str = path.split("/").pop();
|
|
4262
4256
|
return ext ? str.replace("." + ext, "") : str;
|
|
4263
4257
|
}
|
|
4264
|
-
static _parseURL(uri) {
|
|
4265
|
-
let url = "";
|
|
4266
|
-
let file = null;
|
|
4267
|
-
let ext = "";
|
|
4268
|
-
if (typeof File !== "undefined" && uri instanceof File) {
|
|
4269
|
-
url = uri.name;
|
|
4270
|
-
ext = ResourceManager.extension(url);
|
|
4271
|
-
file = uri;
|
|
4272
|
-
} else if (typeof uri === "object") {
|
|
4273
|
-
url = uri.mainFile.name;
|
|
4274
|
-
ext = ResourceManager.extension(url);
|
|
4275
|
-
file = uri;
|
|
4276
|
-
} else {
|
|
4277
|
-
url += uri;
|
|
4278
|
-
ext = ResourceManager.extension(url);
|
|
4279
|
-
}
|
|
4280
|
-
return {
|
|
4281
|
-
url,
|
|
4282
|
-
file,
|
|
4283
|
-
ext
|
|
4284
|
-
};
|
|
4285
|
-
}
|
|
4286
4258
|
static _getTextureKey(url, settings) {
|
|
4287
4259
|
let keys = [
|
|
4288
4260
|
url
|
|
@@ -4317,9 +4289,9 @@ class ResourceManager {
|
|
|
4317
4289
|
}
|
|
4318
4290
|
loadAsset({ url, ext, onProgress, ...props }) {
|
|
4319
4291
|
return new Promise((resolve, reject)=>{
|
|
4320
|
-
const
|
|
4292
|
+
const ext_ = ResourceManager.extension(url);
|
|
4321
4293
|
const texSettings = ResourceManager._splitTextureSettings(props);
|
|
4322
|
-
const key = ResourceManager._getTextureKey(
|
|
4294
|
+
const key = ResourceManager._getTextureKey(url, texSettings);
|
|
4323
4295
|
let result = this._caches.get(key);
|
|
4324
4296
|
if (result) {
|
|
4325
4297
|
resolve(result);
|
|
@@ -4328,10 +4300,10 @@ class ResourceManager {
|
|
|
4328
4300
|
this._caches.set(key, file);
|
|
4329
4301
|
resolve(file);
|
|
4330
4302
|
};
|
|
4331
|
-
let sel = ext ||
|
|
4303
|
+
let sel = ext || ext_;
|
|
4332
4304
|
if (this._loaders.has(sel)) {
|
|
4333
4305
|
this._loaders.get(sel).load({
|
|
4334
|
-
url
|
|
4306
|
+
url,
|
|
4335
4307
|
texSettings,
|
|
4336
4308
|
onProgress,
|
|
4337
4309
|
onLoad,
|
|
@@ -4746,21 +4718,6 @@ class Viewer extends EventEmitter {
|
|
|
4746
4718
|
addLoader(Loader) {
|
|
4747
4719
|
this._resourceManager.addLoader(Loader);
|
|
4748
4720
|
}
|
|
4749
|
-
async load({ url, ext, onProgress, castShadow = false, receiveShadow = false, ...props }) {
|
|
4750
|
-
const node = await this.loadAsset({
|
|
4751
|
-
url,
|
|
4752
|
-
ext,
|
|
4753
|
-
onProgress
|
|
4754
|
-
});
|
|
4755
|
-
if (castShadow || receiveShadow) {
|
|
4756
|
-
node.userData.meshData.meshes.forEach((v)=>{
|
|
4757
|
-
v.castShadow = castShadow;
|
|
4758
|
-
v.receiveShadow = receiveShadow;
|
|
4759
|
-
});
|
|
4760
|
-
}
|
|
4761
|
-
this.addNode(node, props);
|
|
4762
|
-
return node;
|
|
4763
|
-
}
|
|
4764
4721
|
timeline(target) {
|
|
4765
4722
|
return this._tweenManager.timeline(target);
|
|
4766
4723
|
}
|