@openheart/tavio-renderer 2.6.2 → 2.6.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/build/esm/assets/{tavio-2ixVQ2OF.js → tavio-Bg15-kQi.js} +5 -5
- package/build/esm/assets/{workerHelpers-DfEuvGGn.js → workerHelpers-DAGUqfaD.js} +1 -1
- package/build/esm/index.js +982 -873
- package/build/esm/types/editor/visibleAreaHelper.d.ts +36 -0
- package/build/esm/types/module.d.ts +5 -3
- package/build/esm/types/viewer/canvas.d.ts +21 -2
- package/build/esm/types/viewer/driver/coreDriver.d.ts +24 -2
- package/build/esm/types/viewer/driver/iCoreDriver.d.ts +8 -2
- package/build/esm/types/viewer/driver/offscreenDriver.d.ts +10 -6
- package/build/esm/types/viewer/tavioMesh/bounds.d.ts +7 -0
- package/build/esm/types/viewer/tavioMesh/tavioMesh.d.ts +9 -2
- package/build/esm/types/viewer/types.d.ts +9 -0
- package/build/esm/types/wasm-bindings/wasm-handlers.d.ts +1 -1
- package/build/esm/types/wasm-bindings/wasm-worker-client.d.ts +8 -0
- package/build/esm/wasm/pkg/no-thread/tavio.d.ts +3 -3
- package/build/esm/wasm/pkg/no-thread/tavio.js +9 -9
- package/build/esm/wasm/pkg/no-thread/tavio_bg.wasm +0 -0
- package/build/esm/wasm/pkg/no-thread/tavio_bg.wasm.d.ts +3 -3
- package/build/esm/wasm/pkg/thread/tavio.d.ts +4 -4
- package/build/esm/wasm/pkg/thread/tavio.js +16 -16
- package/build/esm/wasm/pkg/thread/tavio_bg.wasm +0 -0
- package/build/esm/wasm/pkg/thread/tavio_bg.wasm.d.ts +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Group } from 'three';
|
|
2
|
+
import { iVectorLike } from '../viewer/types';
|
|
3
|
+
export interface iVisibleAreaHelperOption {
|
|
4
|
+
/** "sphere": 楕円体 / "cube": 直方体 */
|
|
5
|
+
type: "sphere" | "cube";
|
|
6
|
+
/** 領域の中心(ワールド座標) */
|
|
7
|
+
position: iVectorLike | [number, number, number];
|
|
8
|
+
/** 各軸の大きさ(sphere は直径、cube は辺の長さ) */
|
|
9
|
+
size: iVectorLike | [number, number, number];
|
|
10
|
+
/** 回転(ラジアン、オイラー角 XYZ 順)。省略時は回転なし */
|
|
11
|
+
rotation?: iVectorLike | [number, number, number];
|
|
12
|
+
/** 線と面の色(デフォルト: 0x13acfc) */
|
|
13
|
+
color?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* クロップ領域(表示領域)を、輪郭の線と薄い半透明の面で表示するヘルパー。
|
|
17
|
+
* 単位サイズの形を position / rotation / size で変換して表示する。
|
|
18
|
+
* 点群に埋もれても見えるよう深度テストは行わない
|
|
19
|
+
*/
|
|
20
|
+
export declare class VisibleAreaHelper extends Group {
|
|
21
|
+
private areaType;
|
|
22
|
+
private fill;
|
|
23
|
+
private lines;
|
|
24
|
+
constructor(option: iVisibleAreaHelperOption, resolution: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
});
|
|
28
|
+
/** 形・位置・大きさ・回転・色を更新する。形が変わった場合だけジオメトリを作り直す */
|
|
29
|
+
update(option: iVisibleAreaHelperOption): void;
|
|
30
|
+
/** 線の太さ(px)を計算するための描画領域のサイズを設定する */
|
|
31
|
+
setResolution(resolution: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}): void;
|
|
35
|
+
dispose(): void;
|
|
36
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Core } from './viewer/canvas';
|
|
2
|
-
import { TavioError, tSelectionMode, tMaskSource, iLoadingOption, iViewerOption, iHeaderInfo, iDistanceInfo, iTransform, iVectorLike, iSurfaceInfo, iFocusMarkerOption, tUniformPlainValue, tCustomDefines, tCustomUniformValue, tCustomUniforms } from './viewer/types';
|
|
2
|
+
import { TavioError, tSelectionMode, tMaskSource, iLoadingOption, iViewerOption, iHeaderInfo, iDistanceInfo, iBoundsInfo, iTransform, iVectorLike, iSurfaceInfo, iFocusMarkerOption, tUniformPlainValue, tCustomDefines, tCustomUniformValue, tCustomUniforms } from './viewer/types';
|
|
3
3
|
import { TAVIO_ERROR_CODE, SELECTION_MODE } from './viewer/constants';
|
|
4
4
|
import { CHUNK_TARGET, SHADER_STAGE, iMaterialOption } from './viewer/materialGenerator';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { iVisibleAreaHelperOption } from './editor/visibleAreaHelper';
|
|
6
|
+
import { setWasmBaseUrl } from './wasm-bindings/wasm-worker-client';
|
|
7
|
+
export { Core, TavioError, TAVIO_ERROR_CODE, SELECTION_MODE, CHUNK_TARGET, SHADER_STAGE, setWasmBaseUrl, };
|
|
8
|
+
export type { iMaterialOption, iVisibleAreaHelperOption, tSelectionMode, tMaskSource, iLoadingOption, iViewerOption, iHeaderInfo, iDistanceInfo, iBoundsInfo, iTransform, iVectorLike, iSurfaceInfo, iFocusMarkerOption, tUniformPlainValue, tCustomDefines, tCustomUniformValue, tCustomUniforms, };
|
|
7
9
|
export default Core;
|
|
@@ -8,6 +8,7 @@ import { iCollisionTarget } from '../worker/tavioWorker';
|
|
|
8
8
|
import { iSphereSelectorOption } from '../editor/selector/sphereSelector';
|
|
9
9
|
import { iBoxSelectorOption } from '../editor/selector/boxSelector';
|
|
10
10
|
import { iCameraSelectorOption } from '../editor/selector/cameraSelector';
|
|
11
|
+
import { iVisibleAreaHelperOption } from '../editor/visibleAreaHelper';
|
|
11
12
|
export declare class Core extends EventEmitter {
|
|
12
13
|
private driver;
|
|
13
14
|
static CHUNK_TARGET: {
|
|
@@ -87,6 +88,12 @@ export declare class Core extends EventEmitter {
|
|
|
87
88
|
saveSpzWasm(name: string, fileName?: string): Promise<any>;
|
|
88
89
|
saveTavioWasm(name: string, fileName?: string, options?: any): Promise<any>;
|
|
89
90
|
exportTavioWasm(name: string, options?: any): Promise<any>;
|
|
91
|
+
/**
|
|
92
|
+
* splat / ply / spz / sog 形式のバイナリデータを取得する。OffscreenCanvas(Worker)で描画している場合も取得できる
|
|
93
|
+
* @param name - このメッシュの固有名
|
|
94
|
+
* @param format - ファイル形式
|
|
95
|
+
*/
|
|
96
|
+
exportMeshWasm(name: string, format: "splat" | "ply" | "spz" | "sog"): Promise<Uint8Array>;
|
|
90
97
|
/**
|
|
91
98
|
* 現在の描画内容を画像として取得する。OffscreenCanvas(Worker)で描画している場合も取得できる
|
|
92
99
|
* @param type - 画像の MIME タイプ [default: "image/png"]
|
|
@@ -166,8 +173,18 @@ export declare class Core extends EventEmitter {
|
|
|
166
173
|
setControlsType(controlsType: string): void;
|
|
167
174
|
getControlsType(): Promise<tControlsType> | tControlsType;
|
|
168
175
|
setControlsAttenuation(attenuation: number): void;
|
|
169
|
-
|
|
170
|
-
|
|
176
|
+
/**
|
|
177
|
+
* アクティブなカメラパスを選択する
|
|
178
|
+
* @param name - 選択するカメラパスの名前
|
|
179
|
+
* @param force - 切り替え時にイージング(補間)を行わず、即座に新しいパスの始点へ移動するかどうか [default: false]
|
|
180
|
+
*/
|
|
181
|
+
selectCameraPath(name: string, force?: boolean): void;
|
|
182
|
+
/**
|
|
183
|
+
* カメラパスが有効な場合、指定された時間を設定し更新する
|
|
184
|
+
* @param time - 設定する時間(0.0 ~ 1.0)
|
|
185
|
+
* @param force - イージング(補間)を行わず即座にカメラへ反映するかどうか [default: false]
|
|
186
|
+
*/
|
|
187
|
+
updateCameraPath(time?: number, force?: boolean): void;
|
|
171
188
|
createCameraPath(position: number[][] | iVectorLike[], target: number[][] | iVectorLike[], debug?: boolean, times?: number[] | null): CameraPath | void;
|
|
172
189
|
addCameraPath(name: string, position: number[][] | iVectorLike[], target: number[][] | iVectorLike[], debug?: boolean, times?: number[] | null): void;
|
|
173
190
|
removeCameraPath(name: string): void;
|
|
@@ -255,6 +272,8 @@ export declare class Core extends EventEmitter {
|
|
|
255
272
|
setSelectorColor(name: string, color: number): void;
|
|
256
273
|
setGuideLine(name: string, from: iVectorLike, to: iVectorLike, color?: number): void;
|
|
257
274
|
removeGuideLine(name: string): void;
|
|
275
|
+
setVisibleAreaHelper(name: string, option: iVisibleAreaHelperOption): void;
|
|
276
|
+
removeVisibleAreaHelper(name: string): void;
|
|
258
277
|
pickSelector(ndcX: number, ndcY: number): Promise<string | null> | string | null;
|
|
259
278
|
setSelectorScale(name: string, scale: iVectorLike): void;
|
|
260
279
|
deleteSelector(name: string): void;
|
|
@@ -2,6 +2,7 @@ import { RawShaderMaterial, WebGLRenderTarget, WebGLRenderer, PMREMGenerator, Me
|
|
|
2
2
|
import { iSphereSelectorOption } from '../../editor/selector/sphereSelector';
|
|
3
3
|
import { iBoxSelectorOption } from '../../editor/selector/boxSelector';
|
|
4
4
|
import { iCameraSelectorOption } from '../../editor/selector/cameraSelector';
|
|
5
|
+
import { iVisibleAreaHelperOption } from '../../editor/visibleAreaHelper';
|
|
5
6
|
import { iSelectorInfo, tControlsType, tMaskSource, tSelectionMode, iVectorLike, iCameraPathOption, iCameraParameter, iViewerOption, iViewerMaterialOption, iLoadingOption, iHeaderInfo, iTransform, iPickingInfo, iSurfaceInfo, iFocusMarkerOption, tUniformValue, tCustomDefines, tCustomUniforms } from '../types';
|
|
6
7
|
import { iCollisionTarget } from '../../worker/tavioWorker';
|
|
7
8
|
import { WorkerElementAdapter } from './workerElementAdapter';
|
|
@@ -327,6 +328,12 @@ export declare class CoreDriver extends EventEmitter implements iCoreDriver {
|
|
|
327
328
|
bytes: Uint8Array;
|
|
328
329
|
version: string;
|
|
329
330
|
}>;
|
|
331
|
+
/**
|
|
332
|
+
* splat / ply / spz / sog 形式のバイナリデータを生成する
|
|
333
|
+
* @param name - このメッシュの固有名
|
|
334
|
+
* @param format - ファイル形式
|
|
335
|
+
*/
|
|
336
|
+
exportMeshWasm(name: string, format: Parameters<typeof TavioMesh.prototype.exportMeshWasm>[0]): Promise<Uint8Array>;
|
|
330
337
|
/**
|
|
331
338
|
* 現在の描画内容を画像として取得する
|
|
332
339
|
* preserveDrawingBuffer が無効でも取得できるよう、その場で1フレーム描画し、同じタスク内で
|
|
@@ -818,8 +825,9 @@ export declare class CoreDriver extends EventEmitter implements iCoreDriver {
|
|
|
818
825
|
/**
|
|
819
826
|
* カメラパスが有効な場合、指定された時間を設定し更新する
|
|
820
827
|
* @param time - 設定する時間(0.0 ~ 1.0)
|
|
828
|
+
* @param force - イージング(補間)を行わず即座にカメラへ反映するかどうか [default: false]
|
|
821
829
|
*/
|
|
822
|
-
updateCameraPath(time: number): void;
|
|
830
|
+
updateCameraPath(time: number, force?: boolean): void;
|
|
823
831
|
/**
|
|
824
832
|
* カメラパスを名前と座標データで追加登録する
|
|
825
833
|
* @param name - カメラパスの識別名
|
|
@@ -844,8 +852,9 @@ export declare class CoreDriver extends EventEmitter implements iCoreDriver {
|
|
|
844
852
|
/**
|
|
845
853
|
* アクティブなカメラパスを選択する
|
|
846
854
|
* @param name - 選択するカメラパスの名前
|
|
855
|
+
* @param force - 切り替え時にイージング(補間)を行わず、即座に新しいパスの始点へ移動するかどうか [default: false]
|
|
847
856
|
*/
|
|
848
|
-
selectCameraPath(name: string): void;
|
|
857
|
+
selectCameraPath(name: string, force?: boolean): void;
|
|
849
858
|
/**
|
|
850
859
|
* 現在アクティブなカメラパスの名前を取得する
|
|
851
860
|
* @returns アクティブなカメラパスの名前、または null
|
|
@@ -1353,6 +1362,7 @@ export declare class CoreDriver extends EventEmitter implements iCoreDriver {
|
|
|
1353
1362
|
setPointUniforms(uniforms: Record<string, tUniformValue>): void;
|
|
1354
1363
|
private selectorMap;
|
|
1355
1364
|
private guideLineMap;
|
|
1365
|
+
private visibleAreaHelperMap;
|
|
1356
1366
|
private reversedCollision;
|
|
1357
1367
|
/**
|
|
1358
1368
|
* セレクターによる衝突判定の反転フラグを設定する
|
|
@@ -1470,6 +1480,18 @@ export declare class CoreDriver extends EventEmitter implements iCoreDriver {
|
|
|
1470
1480
|
* @param name - 削除するガイド線の識別名
|
|
1471
1481
|
*/
|
|
1472
1482
|
removeGuideLine(name: string): void;
|
|
1483
|
+
/**
|
|
1484
|
+
* クロップ領域(表示領域)を、輪郭の線と薄い半透明の面で表示する。同じ名前で呼ぶと形・位置・大きさ・回転・色を更新する。
|
|
1485
|
+
* 表示のみで、セレクターの選択・衝突判定やガウシアンのピッキングには影響しない
|
|
1486
|
+
* @param name - クロップ領域の表示の識別名
|
|
1487
|
+
* @param option - 形・位置・大きさ・回転・色
|
|
1488
|
+
*/
|
|
1489
|
+
setVisibleAreaHelper(name: string, option: iVisibleAreaHelperOption): void;
|
|
1490
|
+
/**
|
|
1491
|
+
* 名前を指定してクロップ領域の表示を削除する
|
|
1492
|
+
* @param name - 削除するクロップ領域の表示の識別名
|
|
1493
|
+
*/
|
|
1494
|
+
removeVisibleAreaHelper(name: string): void;
|
|
1473
1495
|
/**
|
|
1474
1496
|
* 画面上の位置(正規化デバイス座標)からレイを飛ばし、最初に当たる表示中のセレクターの名前を返す。
|
|
1475
1497
|
* 各セレクターを包む境界球で判定し、遠くにある小さなセレクターでもクリックしやすいよう、
|
|
@@ -4,6 +4,7 @@ import { iCollisionTarget } from '../../worker/tavioWorker';
|
|
|
4
4
|
import { iSphereSelectorOption } from '../../editor/selector/sphereSelector';
|
|
5
5
|
import { iBoxSelectorOption } from '../../editor/selector/boxSelector';
|
|
6
6
|
import { iCameraSelectorOption } from '../../editor/selector/cameraSelector';
|
|
7
|
+
import { iVisibleAreaHelperOption } from '../../editor/visibleAreaHelper';
|
|
7
8
|
import { MeshStandardMaterialParameters } from 'three';
|
|
8
9
|
import { iLatitudeLongitude } from '../../camera/flightControls';
|
|
9
10
|
import { WorkerElementAdapter } from './workerElementAdapter';
|
|
@@ -58,6 +59,7 @@ export interface iCoreDriver extends EventEmitter {
|
|
|
58
59
|
saveSpzWasm(name: string, fileName?: string): Promise<any>;
|
|
59
60
|
saveTavioWasm(name: string, fileName?: string, options?: any): Promise<any>;
|
|
60
61
|
exportTavioWasm(name: string, options?: any): Promise<any>;
|
|
62
|
+
exportMeshWasm(name: string, format: "splat" | "ply" | "spz" | "sog"): Promise<Uint8Array>;
|
|
61
63
|
/**
|
|
62
64
|
* 現在の描画内容を画像として取得する(描画内容の画像化・サムネイル生成用)
|
|
63
65
|
* @param type - 画像の MIME タイプ [default: "image/png"]
|
|
@@ -146,8 +148,8 @@ export interface iCoreDriver extends EventEmitter {
|
|
|
146
148
|
setControlsType(controlsType: string): void;
|
|
147
149
|
getControlsType(): Promise<tControlsType> | tControlsType;
|
|
148
150
|
setControlsAttenuation(attenuation: number): void;
|
|
149
|
-
selectCameraPath(name: string): void;
|
|
150
|
-
updateCameraPath(time?: number): void;
|
|
151
|
+
selectCameraPath(name: string, force?: boolean): void;
|
|
152
|
+
updateCameraPath(time?: number, force?: boolean): void;
|
|
151
153
|
createCameraPath(position: number[][] | iVectorLike[], target: number[][] | iVectorLike[], debug?: boolean, times?: number[] | null): CameraPath | void;
|
|
152
154
|
/** times: 各制御点に対応する時刻(0.0 ~ 1.0)。省略時は等間隔 */
|
|
153
155
|
addCameraPath(name: string, position: number[][] | iVectorLike[], target: number[][] | iVectorLike[], debug?: boolean, times?: number[] | null): void;
|
|
@@ -235,6 +237,10 @@ export interface iCoreDriver extends EventEmitter {
|
|
|
235
237
|
setGuideLine(name: string, from: iVectorLike, to: iVectorLike, color?: number): void;
|
|
236
238
|
/** 編集用のガイド線を削除する */
|
|
237
239
|
removeGuideLine(name: string): void;
|
|
240
|
+
/** クロップ領域(表示領域)を輪郭の線と薄い半透明の面で表示する。同じ名前で呼ぶと更新する */
|
|
241
|
+
setVisibleAreaHelper(name: string, option: iVisibleAreaHelperOption): void;
|
|
242
|
+
/** クロップ領域の表示を削除する */
|
|
243
|
+
removeVisibleAreaHelper(name: string): void;
|
|
238
244
|
/** 画面上の位置(正規化デバイス座標)にある、表示中のセレクターの名前を返す(無ければnull) */
|
|
239
245
|
pickSelector(ndcX: number, ndcY: number): Promise<string | null> | string | null;
|
|
240
246
|
setSelectorScale(name: string, scale: iVectorLike): void;
|
|
@@ -6,6 +6,7 @@ import { iLatitudeLongitude } from '../../camera/flightControls';
|
|
|
6
6
|
import { iSphereSelectorOption } from '../../editor/selector/sphereSelector';
|
|
7
7
|
import { iBoxSelectorOption } from '../../editor/selector/boxSelector';
|
|
8
8
|
import { iCameraSelectorOption } from '../../editor/selector/cameraSelector';
|
|
9
|
+
import { iVisibleAreaHelperOption } from '../../editor/visibleAreaHelper';
|
|
9
10
|
import { MeshStandardMaterialParameters } from 'three';
|
|
10
11
|
import { WorkerElementAdapter } from './workerElementAdapter';
|
|
11
12
|
/**
|
|
@@ -114,8 +115,8 @@ export declare class OffscreenDriver extends EventEmitter implements iCoreDriver
|
|
|
114
115
|
setCameraParameter(position?: number[] | iVectorLike, target?: number[] | iVectorLike, fov?: number): void;
|
|
115
116
|
setControlsType(controlsType: string): void;
|
|
116
117
|
getControlsType(): Promise<tControlsType>;
|
|
117
|
-
selectCameraPath(name: string): void;
|
|
118
|
-
updateCameraPath(time?: number): void;
|
|
118
|
+
selectCameraPath(name: string, force?: boolean): void;
|
|
119
|
+
updateCameraPath(time?: number, force?: boolean): void;
|
|
119
120
|
setOrbitPointerDown(isDown: boolean): void;
|
|
120
121
|
setOrbitRelativeRotateLeft(value: number): void;
|
|
121
122
|
setOrbitRelativeRotateUp(value: number): void;
|
|
@@ -141,11 +142,12 @@ export declare class OffscreenDriver extends EventEmitter implements iCoreDriver
|
|
|
141
142
|
setSpotLightDecay(decay: number): void;
|
|
142
143
|
addSpotLight(position: iVectorLike, target: iVectorLike, color: number, intensity: number, distance: number, angle: number, penumbra: number, decay: number, castShadow?: boolean, isDebug?: boolean): void;
|
|
143
144
|
addWhiteCube(position?: iVectorLike, scale?: iVectorLike, receiveShadow?: boolean, materialOption?: MeshStandardMaterialParameters): void;
|
|
144
|
-
saveSplatWasm(name: string, fileName?: string): Promise<
|
|
145
|
-
savePlyWasm(name: string, fileName?: string): Promise<
|
|
146
|
-
saveSpzWasm(name: string, fileName?: string): Promise<
|
|
147
|
-
saveTavioWasm(name: string, fileName?: string, options?: any): Promise<
|
|
145
|
+
saveSplatWasm(name: string, fileName?: string): Promise<void>;
|
|
146
|
+
savePlyWasm(name: string, fileName?: string): Promise<void>;
|
|
147
|
+
saveSpzWasm(name: string, fileName?: string): Promise<void>;
|
|
148
|
+
saveTavioWasm(name: string, fileName?: string, options?: any): Promise<void>;
|
|
148
149
|
exportTavioWasm(name: string, options?: any): Promise<any>;
|
|
150
|
+
exportMeshWasm(name: string, format: "splat" | "ply" | "spz" | "sog"): Promise<Uint8Array>;
|
|
149
151
|
/**
|
|
150
152
|
* Worker 内の OffscreenCanvas で描画した内容を画像として取得する
|
|
151
153
|
* (Blob は構造化複製で Worker からメインスレッドへ返る)
|
|
@@ -243,6 +245,8 @@ export declare class OffscreenDriver extends EventEmitter implements iCoreDriver
|
|
|
243
245
|
setSelectorColor(name: string, color: number): void;
|
|
244
246
|
setGuideLine(name: string, from: iVectorLike, to: iVectorLike, color?: number): void;
|
|
245
247
|
removeGuideLine(name: string): void;
|
|
248
|
+
setVisibleAreaHelper(name: string, option: iVisibleAreaHelperOption): void;
|
|
249
|
+
removeVisibleAreaHelper(name: string): void;
|
|
246
250
|
pickSelector(ndcX: number, ndcY: number): Promise<string | null>;
|
|
247
251
|
setSelectorScale(name: string, scale: iVectorLike): void;
|
|
248
252
|
deleteSelector(name: string): void;
|
|
@@ -26,6 +26,7 @@ export declare class TavioMesh extends EventEmitter {
|
|
|
26
26
|
private minorVersionNumber;
|
|
27
27
|
private backgroundExists;
|
|
28
28
|
private containmentRadius;
|
|
29
|
+
private bounds;
|
|
29
30
|
private sourceProperty;
|
|
30
31
|
private viewerOption;
|
|
31
32
|
private sharedData;
|
|
@@ -254,11 +255,17 @@ export declare class TavioMesh extends EventEmitter {
|
|
|
254
255
|
*/
|
|
255
256
|
saveTavioWasm(filename: string, options?: Parameters<typeof TavioMesh.prototype.exportTavioWasm>[0]): Promise<void>;
|
|
256
257
|
/**
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
* 様々な形式のリソースをセーブする
|
|
259
|
+
* @param filename - 保存ファイル名
|
|
259
260
|
* @param format - ファイル形式
|
|
260
261
|
*/
|
|
261
262
|
saveMeshWasm(filename: string, format: "splat" | "ply" | "spz" | "sog"): Promise<void>;
|
|
263
|
+
/**
|
|
264
|
+
* 様々な形式のバイナリデータを生成する
|
|
265
|
+
* ダウンロードは行わないため、DOM の無い Worker(OffscreenCanvas)でも使用できる
|
|
266
|
+
* @param format - ファイル形式
|
|
267
|
+
*/
|
|
268
|
+
exportMeshWasm(format: "splat" | "ply" | "spz" | "sog"): Promise<Uint8Array>;
|
|
262
269
|
/**
|
|
263
270
|
* ==========================================================================
|
|
264
271
|
* getter / setter
|
|
@@ -171,6 +171,14 @@ export interface iDistanceInfo {
|
|
|
171
171
|
per90?: number | null;
|
|
172
172
|
per100: number | null;
|
|
173
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* 3DGS の位置の範囲(遠くに飛んだノイズ点を除くため、軸ごとの 5〜95 パーセンタイルで求める)
|
|
176
|
+
*/
|
|
177
|
+
export interface iBoundsInfo {
|
|
178
|
+
center: iVectorLike;
|
|
179
|
+
min: iVectorLike;
|
|
180
|
+
max: iVectorLike;
|
|
181
|
+
}
|
|
174
182
|
/**
|
|
175
183
|
* ファイル内のヘッダ及び頂点情報
|
|
176
184
|
*/
|
|
@@ -179,6 +187,7 @@ export interface iHeaderInfo {
|
|
|
179
187
|
minorVersionNumber: number;
|
|
180
188
|
featureBits: any;
|
|
181
189
|
distance: iDistanceInfo;
|
|
190
|
+
bounds: iBoundsInfo | null;
|
|
182
191
|
}
|
|
183
192
|
/**
|
|
184
193
|
* ファイルに対する座標変換情報
|
|
@@ -15,7 +15,7 @@ export type WasmWorkerUpdateMessage = {
|
|
|
15
15
|
export declare function wasmBuildSourceProperty(event: WasmDecodeHeaderEvent, sourceIndex: number, sourceVertexOffset: number): {
|
|
16
16
|
ready: boolean;
|
|
17
17
|
index: number;
|
|
18
|
-
type: "
|
|
18
|
+
type: "splat" | "ply" | "spz" | "sog" | "tavio";
|
|
19
19
|
vertexCount: number;
|
|
20
20
|
vertexOffset: number;
|
|
21
21
|
featureBits: number;
|
|
@@ -9,6 +9,14 @@ export declare const setWasmBinaryUrls: (urls: {
|
|
|
9
9
|
thread?: string;
|
|
10
10
|
noThread?: string;
|
|
11
11
|
}) => void;
|
|
12
|
+
/**
|
|
13
|
+
* wasmバイナリの配信元ベースURLを外部から指定する。
|
|
14
|
+
* バンドラーによる `new URL(..., import.meta.url)` の解決に依存せず、
|
|
15
|
+
* アプリケーション側で `wasm/pkg` の配信先を明示したい場合に使う。
|
|
16
|
+
* TavioMesh を読み込む前に呼び出すこと。
|
|
17
|
+
* @param baseUrl - `thread/tavio_bg.wasm` / `no-thread/tavio_bg.wasm` を含むディレクトリ(`wasm/pkg`相当)のURL
|
|
18
|
+
*/
|
|
19
|
+
export declare const setWasmBaseUrl: (baseUrl: string) => void;
|
|
12
20
|
export interface ResolvedGaussianEdits {
|
|
13
21
|
pointCount: number;
|
|
14
22
|
gaussianData: Uint8Array;
|
|
@@ -92,9 +92,9 @@ export interface InitOutput {
|
|
|
92
92
|
readonly registerEventHandler: (a: number) => number;
|
|
93
93
|
readonly resolveGaussianEdits: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
94
94
|
readonly sort: (a: number, b: number, c: number) => number;
|
|
95
|
-
readonly
|
|
96
|
-
readonly
|
|
97
|
-
readonly
|
|
95
|
+
readonly __wasm_bindgen_func_elem_2979: (a: number, b: number, c: number, d: number) => void;
|
|
96
|
+
readonly __wasm_bindgen_func_elem_2981: (a: number, b: number, c: number, d: number) => void;
|
|
97
|
+
readonly __wasm_bindgen_func_elem_1190: (a: number, b: number, c: number) => void;
|
|
98
98
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
99
99
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
100
100
|
readonly __wbindgen_export3: (a: number) => void;
|
|
@@ -618,7 +618,7 @@ function __wbg_get_imports() {
|
|
|
618
618
|
const a = state0.a;
|
|
619
619
|
state0.a = 0;
|
|
620
620
|
try {
|
|
621
|
-
return
|
|
621
|
+
return __wasm_bindgen_func_elem_2981(a, state0.b, arg0, arg1);
|
|
622
622
|
} finally {
|
|
623
623
|
state0.a = a;
|
|
624
624
|
}
|
|
@@ -757,12 +757,12 @@ function __wbg_get_imports() {
|
|
|
757
757
|
},
|
|
758
758
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
759
759
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 315, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
760
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
760
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1190);
|
|
761
761
|
return addHeapObject(ret);
|
|
762
762
|
},
|
|
763
763
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
764
764
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 632, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
765
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
765
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_2979);
|
|
766
766
|
return addHeapObject(ret);
|
|
767
767
|
},
|
|
768
768
|
__wbindgen_generic_0000000000000003: function(arg0) {
|
|
@@ -827,18 +827,18 @@ function __wbg_get_imports() {
|
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
829
|
|
|
830
|
-
function
|
|
831
|
-
wasm.
|
|
830
|
+
function __wasm_bindgen_func_elem_1190(arg0, arg1, arg2) {
|
|
831
|
+
wasm.__wasm_bindgen_func_elem_1190(arg0, arg1, addHeapObject(arg2));
|
|
832
832
|
}
|
|
833
833
|
|
|
834
|
-
function
|
|
835
|
-
wasm.
|
|
834
|
+
function __wasm_bindgen_func_elem_2981(arg0, arg1, arg2, arg3) {
|
|
835
|
+
wasm.__wasm_bindgen_func_elem_2981(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
836
836
|
}
|
|
837
837
|
|
|
838
|
-
function
|
|
838
|
+
function __wasm_bindgen_func_elem_2979(arg0, arg1, arg2) {
|
|
839
839
|
try {
|
|
840
840
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
841
|
-
wasm.
|
|
841
|
+
wasm.__wasm_bindgen_func_elem_2979(retptr, arg0, arg1, addHeapObject(arg2));
|
|
842
842
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
843
843
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
844
844
|
if (r1) {
|
|
Binary file
|
|
@@ -27,9 +27,9 @@ export const main: () => void;
|
|
|
27
27
|
export const registerEventHandler: (a: number) => number;
|
|
28
28
|
export const resolveGaussianEdits: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
29
29
|
export const sort: (a: number, b: number, c: number) => number;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const __wasm_bindgen_func_elem_2979: (a: number, b: number, c: number, d: number) => void;
|
|
31
|
+
export const __wasm_bindgen_func_elem_2981: (a: number, b: number, c: number, d: number) => void;
|
|
32
|
+
export const __wasm_bindgen_func_elem_1190: (a: number, b: number, c: number) => void;
|
|
33
33
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
34
34
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
35
35
|
export const __wbindgen_export3: (a: number) => void;
|
|
@@ -110,10 +110,10 @@ export interface InitOutput {
|
|
|
110
110
|
readonly wbg_rayon_poolbuilder_numThreads: (a: number) => number;
|
|
111
111
|
readonly wbg_rayon_poolbuilder_receiver: (a: number) => number;
|
|
112
112
|
readonly wbg_rayon_start_worker: (a: number) => void;
|
|
113
|
-
readonly
|
|
114
|
-
readonly
|
|
115
|
-
readonly
|
|
116
|
-
readonly
|
|
113
|
+
readonly __wasm_bindgen_func_elem_3151: (a: number, b: number, c: number, d: number) => void;
|
|
114
|
+
readonly __wasm_bindgen_func_elem_3154: (a: number, b: number, c: number, d: number) => void;
|
|
115
|
+
readonly __wasm_bindgen_func_elem_1228: (a: number, b: number, c: number) => void;
|
|
116
|
+
readonly __wasm_bindgen_func_elem_3153: (a: number, b: number, c: number) => void;
|
|
117
117
|
readonly memory: WebAssembly.Memory;
|
|
118
118
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
119
119
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -690,7 +690,7 @@ function __wbg_get_imports(memory) {
|
|
|
690
690
|
const a = state0.a;
|
|
691
691
|
state0.a = 0;
|
|
692
692
|
try {
|
|
693
|
-
return
|
|
693
|
+
return __wasm_bindgen_func_elem_3154(a, state0.b, arg0, arg1);
|
|
694
694
|
} finally {
|
|
695
695
|
state0.a = a;
|
|
696
696
|
}
|
|
@@ -728,7 +728,7 @@ function __wbg_get_imports(memory) {
|
|
|
728
728
|
const a = state0.a;
|
|
729
729
|
state0.a = 0;
|
|
730
730
|
try {
|
|
731
|
-
return
|
|
731
|
+
return __wasm_bindgen_func_elem_3154(a, state0.b, arg0, arg1);
|
|
732
732
|
} finally {
|
|
733
733
|
state0.a = a;
|
|
734
734
|
}
|
|
@@ -900,18 +900,18 @@ function __wbg_get_imports(memory) {
|
|
|
900
900
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
901
901
|
},
|
|
902
902
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
903
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
904
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
903
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 323, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
904
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1228);
|
|
905
905
|
return addHeapObject(ret);
|
|
906
906
|
},
|
|
907
907
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
908
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
909
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
908
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 640, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
909
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3151);
|
|
910
910
|
return addHeapObject(ret);
|
|
911
911
|
},
|
|
912
912
|
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
913
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
914
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
913
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 659, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
914
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3153);
|
|
915
915
|
return addHeapObject(ret);
|
|
916
916
|
},
|
|
917
917
|
__wbindgen_generic_0000000000000004: function(arg0) {
|
|
@@ -991,22 +991,22 @@ function __wbg_get_imports(memory) {
|
|
|
991
991
|
};
|
|
992
992
|
}
|
|
993
993
|
|
|
994
|
-
function
|
|
995
|
-
wasm.
|
|
994
|
+
function __wasm_bindgen_func_elem_1228(arg0, arg1, arg2) {
|
|
995
|
+
wasm.__wasm_bindgen_func_elem_1228(arg0, arg1, addHeapObject(arg2));
|
|
996
996
|
}
|
|
997
997
|
|
|
998
|
-
function
|
|
999
|
-
wasm.
|
|
998
|
+
function __wasm_bindgen_func_elem_3153(arg0, arg1, arg2) {
|
|
999
|
+
wasm.__wasm_bindgen_func_elem_3153(arg0, arg1, addHeapObject(arg2));
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
|
-
function
|
|
1003
|
-
wasm.
|
|
1002
|
+
function __wasm_bindgen_func_elem_3154(arg0, arg1, arg2, arg3) {
|
|
1003
|
+
wasm.__wasm_bindgen_func_elem_3154(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
1004
1004
|
}
|
|
1005
1005
|
|
|
1006
|
-
function
|
|
1006
|
+
function __wasm_bindgen_func_elem_3151(arg0, arg1, arg2) {
|
|
1007
1007
|
try {
|
|
1008
1008
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1009
|
-
wasm.
|
|
1009
|
+
wasm.__wasm_bindgen_func_elem_3151(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1010
1010
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1011
1011
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1012
1012
|
if (r1) {
|
|
Binary file
|
|
@@ -32,10 +32,10 @@ export const wbg_rayon_poolbuilder_build: (a: number) => void;
|
|
|
32
32
|
export const wbg_rayon_poolbuilder_numThreads: (a: number) => number;
|
|
33
33
|
export const wbg_rayon_poolbuilder_receiver: (a: number) => number;
|
|
34
34
|
export const wbg_rayon_start_worker: (a: number) => void;
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
35
|
+
export const __wasm_bindgen_func_elem_3151: (a: number, b: number, c: number, d: number) => void;
|
|
36
|
+
export const __wasm_bindgen_func_elem_3154: (a: number, b: number, c: number, d: number) => void;
|
|
37
|
+
export const __wasm_bindgen_func_elem_1228: (a: number, b: number, c: number) => void;
|
|
38
|
+
export const __wasm_bindgen_func_elem_3153: (a: number, b: number, c: number) => void;
|
|
39
39
|
export const memory: WebAssembly.Memory;
|
|
40
40
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
41
41
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|