@xviewer.js/core 1.0.4-alpha.1 → 1.0.4-alpha.3
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.cjs +6 -9
- package/dist/main.cjs.map +1 -1
- package/dist/module.js +6 -9
- package/dist/module.js.map +1 -1
- package/package.json +1 -1
- package/types/Viewer.d.ts +3 -1
- package/types/asset/Loader.d.ts +1 -0
- package/types/asset/ResourceManager.d.ts +2 -1
- package/types/loaders/KTX2Loader.d.ts +1 -1
package/dist/main.cjs
CHANGED
|
@@ -459,11 +459,11 @@ class SVGLoader extends Loader {
|
|
|
459
459
|
SVGLoader.Primitive = SVGLoader_js.SVGLoader;
|
|
460
460
|
|
|
461
461
|
class KTX2Loader extends Loader {
|
|
462
|
-
load({ url, path, resourcePath, manager, texSettings, onLoad, onProgress, onError }) {
|
|
462
|
+
load({ url, path, resourcePath, transcoderPath, manager, texSettings, onLoad, onProgress, onError }) {
|
|
463
463
|
let loader = this._loader;
|
|
464
464
|
if (loader === undefined) {
|
|
465
465
|
loader = this._loader = new KTX2Loader$1.KTX2Loader();
|
|
466
|
-
loader.setTranscoderPath(
|
|
466
|
+
loader.setTranscoderPath(transcoderPath);
|
|
467
467
|
loader.detectSupport(this.viewer.renderer);
|
|
468
468
|
}
|
|
469
469
|
loader.manager = manager;
|
|
@@ -4411,19 +4411,15 @@ class ResourceManager {
|
|
|
4411
4411
|
}
|
|
4412
4412
|
return loader;
|
|
4413
4413
|
}
|
|
4414
|
-
loadAsset({ url,
|
|
4414
|
+
loadAsset({ url, ext, onProgress, ...props }) {
|
|
4415
4415
|
return new Promise((resolve, reject)=>{
|
|
4416
4416
|
const sel = ext || url && ResourceManager.extension(url) || "";
|
|
4417
4417
|
const texSettings = ResourceManager._splitTextureSettings(props);
|
|
4418
4418
|
if (this._loaders.has(sel)) {
|
|
4419
4419
|
this._loaders.get(sel).load({
|
|
4420
4420
|
url,
|
|
4421
|
-
buffer,
|
|
4422
4421
|
texSettings,
|
|
4423
|
-
|
|
4424
|
-
resourcePath,
|
|
4425
|
-
dracoPath,
|
|
4426
|
-
manager,
|
|
4422
|
+
...props,
|
|
4427
4423
|
onProgress,
|
|
4428
4424
|
onLoad: resolve,
|
|
4429
4425
|
onError: (err)=>{
|
|
@@ -5011,7 +5007,7 @@ class Viewer extends EventEmitter {
|
|
|
5011
5007
|
near: 0.1,
|
|
5012
5008
|
far: 1000,
|
|
5013
5009
|
position: new THREE.Vector3(0, 0, 4)
|
|
5014
|
-
}, targetFrameRate = -1, fixedFrameTime = false, colorSpace = THREE.SRGBColorSpace, toneMapping = THREE.LinearToneMapping, toneMappingExposure = 1, maxDPR = 1.5, path = "", resourcePath = "", dracoPath = "https://www.gstatic.com/draco/v1/decoders/", orientation = Orientation.AUTO, loader = {}, tasker = {}, ...webglOpts } = {}){
|
|
5010
|
+
}, targetFrameRate = -1, fixedFrameTime = false, colorSpace = THREE.SRGBColorSpace, toneMapping = THREE.LinearToneMapping, toneMappingExposure = 1, maxDPR = 1.5, path = "", resourcePath = "", dracoPath = "https://www.gstatic.com/draco/v1/decoders/", transcoderPath = "three/examples/js/libs/basis/", orientation = Orientation.AUTO, loader = {}, tasker = {}, ...webglOpts } = {}){
|
|
5015
5011
|
super(), this._instanceId = Viewer.instanceCount++, this._dpr = 1, this._width = 1, this._height = 1, this._viewport = {
|
|
5016
5012
|
width: 1,
|
|
5017
5013
|
height: 1,
|
|
@@ -5069,6 +5065,7 @@ class Viewer extends EventEmitter {
|
|
|
5069
5065
|
path,
|
|
5070
5066
|
resourcePath,
|
|
5071
5067
|
dracoPath,
|
|
5068
|
+
transcoderPath,
|
|
5072
5069
|
manager: this._loadingManager
|
|
5073
5070
|
};
|
|
5074
5071
|
this._mount = applyProps(new THREE.Object3D(), {
|