@openheart/tavio-renderer 2.3.26-with-wasm → 2.3.27-with-wasm
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/build/esm/index.js
CHANGED
|
@@ -13358,12 +13358,17 @@ class Xn extends qD {
|
|
|
13358
13358
|
this.backgroundTexture = new Bg(A4.data), this.backgroundTexture.needsUpdate = true, this.environmentTexture = null, this.initializedBackground = true, this.emit("setupbackground");
|
|
13359
13359
|
}
|
|
13360
13360
|
});
|
|
13361
|
-
const s2 = new URL(A3, location.origin).toString(),
|
|
13361
|
+
const s2 = "string" == typeof A3 ? null : URL.createObjectURL(A3 instanceof Blob ? A3 : new Blob([A3])), e2 = s2 ?? new URL(A3, location.origin).toString(), w2 = new Promise((A4) => {
|
|
13362
13362
|
this.once("sort", () => {
|
|
13363
13363
|
this.sourceProperty[t2].ready = true, this.sorted || (this.sorted = true, this.emit("finallyupdate", this.gaussianCount)), A4();
|
|
13364
13364
|
});
|
|
13365
13365
|
});
|
|
13366
|
-
|
|
13366
|
+
try {
|
|
13367
|
+
await E2.api.decodeTavio(e2, { decodeMode: g2, maxDecodePoints: C2, useSphericalHarmonics: Q2 });
|
|
13368
|
+
} finally {
|
|
13369
|
+
null != s2 && URL.revokeObjectURL(s2);
|
|
13370
|
+
}
|
|
13371
|
+
this.emit("load", { length: i2 }), E2.dispose(), await w2;
|
|
13367
13372
|
}
|
|
13368
13373
|
async loadMeshWasm(A3, I2, g2) {
|
|
13369
13374
|
const Q2 = g2?.useSphericalHarmonics ?? true;
|
|
@@ -156,7 +156,8 @@ export declare class TavioMesh extends EventEmitter {
|
|
|
156
156
|
loadImage(url: string): Promise<void>;
|
|
157
157
|
/**
|
|
158
158
|
* tavio 形式のリソースをロードする
|
|
159
|
-
* @param
|
|
159
|
+
* @param source - 読み込む .tavio ファイル。URL 文字列に加え、事前に取得済みの
|
|
160
|
+
* Blob / ArrayBuffer を渡すこともできる(内部で Object URL 化して WASM デコーダに渡す)
|
|
160
161
|
* @param option - ロード・パース関連のオプション
|
|
161
162
|
* @param options.decodeMode - デコードモード. "sync", "concurrent", "parallel" を指定
|
|
162
163
|
* @param options.maxThreads - decodeMode が "parallel" のときに使用されるスレッド数の上限
|
|
@@ -164,7 +165,7 @@ export declare class TavioMesh extends EventEmitter {
|
|
|
164
165
|
* @param options.useSphericalHarmonics - 球面調和関数の交流成分を使用
|
|
165
166
|
* @param options.isEncodeEnabled - エンコードを有効にする. 有効にするとエンコード時に必要なデータを読み込む
|
|
166
167
|
*/
|
|
167
|
-
loadTavioWasm(
|
|
168
|
+
loadTavioWasm(source: string | Blob | ArrayBuffer, options?: ({
|
|
168
169
|
decodeMode?: "sync";
|
|
169
170
|
} | {
|
|
170
171
|
decodeMode: "parallel";
|