@openheart/tavio-renderer 2.3.30-with-wasm → 2.5.0

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.
Files changed (40) hide show
  1. package/build/esm/assets/{tavio-JUxSmuMi.js → tavio-2ixVQ2OF.js} +149 -149
  2. package/build/esm/assets/{workerHelpers-yS8SNwfU.js → workerHelpers-DfEuvGGn.js} +1 -1
  3. package/build/esm/index.js +8609 -6542
  4. package/build/esm/types/camera/cameraPath.d.ts +37 -3
  5. package/build/esm/types/editor/selector/boxSelector.d.ts +4 -3
  6. package/build/esm/types/editor/selector/cameraSelector.d.ts +57 -0
  7. package/build/esm/types/editor/selector/selector.d.ts +25 -1
  8. package/build/esm/types/editor/selector/sphereSelector.d.ts +1 -0
  9. package/build/esm/types/module.d.ts +5 -4
  10. package/build/esm/types/viewer/canvas.d.ts +159 -1560
  11. package/build/esm/types/viewer/constants.d.ts +99 -0
  12. package/build/esm/types/viewer/driver/coreDriver.d.ts +1474 -0
  13. package/build/esm/types/viewer/driver/iCoreDriver.d.ts +224 -0
  14. package/build/esm/types/viewer/driver/offscreenDriver.d.ts +231 -0
  15. package/build/esm/types/viewer/driver/rpcBridge.d.ts +39 -0
  16. package/build/esm/types/viewer/driver/workerElementAdapter.d.ts +66 -0
  17. package/build/esm/types/viewer/materialGenerator.d.ts +24 -27
  18. package/build/esm/types/viewer/renderView.d.ts +4 -3
  19. package/build/esm/types/viewer/shaderRegistry.d.ts +22 -0
  20. package/build/esm/types/viewer/tavioMesh/localTransform.d.ts +65 -0
  21. package/build/esm/types/viewer/tavioMesh/minMaxRange.d.ts +47 -0
  22. package/build/esm/types/viewer/tavioMesh/parsers/imageParser.d.ts +14 -0
  23. package/build/esm/types/{utility/plyDecoder.d.ts → viewer/tavioMesh/parsers/plyParser.d.ts} +4 -15
  24. package/build/esm/types/viewer/tavioMesh/parsers/splatParser.d.ts +12 -0
  25. package/build/esm/types/viewer/tavioMesh/selection.d.ts +39 -0
  26. package/build/esm/types/viewer/{tavioMesh.d.ts → tavioMesh/tavioMesh.d.ts} +73 -62
  27. package/build/esm/types/viewer/types.d.ts +376 -0
  28. package/build/esm/types/wasm-bindings/wasm-worker-client.d.ts +10 -0
  29. package/build/esm/types/worker/renderingWorker.d.ts +8 -0
  30. package/build/esm/types/worker/tavioWorker.d.ts +1 -1
  31. package/build/esm/wasm/pkg/no-thread/tavio.d.ts +13 -13
  32. package/build/esm/wasm/pkg/no-thread/tavio.js +123 -123
  33. package/build/esm/wasm/pkg/no-thread/tavio_bg.wasm +0 -0
  34. package/build/esm/wasm/pkg/no-thread/tavio_bg.wasm.d.ts +13 -13
  35. package/build/esm/wasm/pkg/thread/tavio.d.ts +17 -17
  36. package/build/esm/wasm/pkg/thread/tavio.js +151 -151
  37. package/build/esm/wasm/pkg/thread/tavio_bg.wasm +0 -0
  38. package/build/esm/wasm/pkg/thread/tavio_bg.wasm.d.ts +17 -17
  39. package/package.json +1 -1
  40. package/build/esm/types/animation/animationController.d.ts +0 -146
@@ -15,10 +15,25 @@ export declare class CameraPath {
15
15
  private positionSpline;
16
16
  private targetSpline;
17
17
  private visualizationObjects;
18
+ private times;
18
19
  /**
19
20
  * @constructor
20
21
  */
21
22
  constructor();
23
+ /**
24
+ * 各制御点に対応する時刻を設定する。制御点ごとに到達するタイミングを変えたい場合に使う
25
+ * (軌道の形は変わらず、各区間を通過する速さだけが変わる)。
26
+ * 2要素以上・有限値・単調非減少でない場合は無視して等間隔として扱う。
27
+ * @param times - 各制御点の時刻(0.0 ~ 1.0)。null で等間隔に戻す
28
+ */
29
+ setTimes(times: number[] | null): this;
30
+ /**
31
+ * 時刻 t(0.0 ~ 1.0)を、スプラインの等間隔パラメータに変換する。
32
+ * times が設定されていて制御点数と一致する場合のみ、t が属する区間を求めてその区間内の割合に変換する
33
+ * @param t - 時刻(0.0 ~ 1.0)
34
+ * @param pointCount - 対象スプラインの制御点数
35
+ */
36
+ private toSplineParameter;
22
37
  /**
23
38
  * カメラパスから指定された時刻の座標・注視点を返す
24
39
  * @param t - 時刻(0.0 ~ 1.0)
@@ -84,8 +99,25 @@ export declare class CameraPath {
84
99
  /**
85
100
  * シーンを指定して、補間後の曲線と制御点を可視化する
86
101
  * @param parent - ラインと点を追加する Object3D
87
- */
88
- insertObject(parent: Object3D): void;
102
+ * @param options.showPoints - 制御点(Points)も表示するか(デフォルト: true)。
103
+ * 本レンダラーでは Points の描画サイズが環境によって意図せず巨大な板状に見えることが
104
+ * あるため、曲線(Line)だけで十分な用途ではfalseを指定できるようにしている。
105
+ * @param options.lineWidth - 曲線の太さ(px)。指定すると太さを持つ線(Line2 + LineMaterial)で描画する
106
+ * (WebGLの通常の線は環境によって1pxに制限されるため)。省略時は通常の1pxの線
107
+ * @param options.resolution - 描画領域のサイズ(px)。lineWidth指定時に太さの計算に使う
108
+ * @param options.lineColor - 曲線の色(座標・注視点の両方)。省略時は座標がマゼンタ、注視点が緑
109
+ * @param options.showTargetLine - 注視点の曲線も表示するか(デフォルト: true)
110
+ */
111
+ insertObject(parent: Object3D, options?: {
112
+ showPoints?: boolean;
113
+ lineWidth?: number;
114
+ resolution?: {
115
+ x: number;
116
+ y: number;
117
+ };
118
+ lineColor?: number;
119
+ showTargetLine?: boolean;
120
+ }): void;
89
121
  /**
90
122
  * 可視化用に追加したオブジェクトを削除する
91
123
  * @param parent - オブジェクトを削除する親 Object3D
@@ -99,6 +131,7 @@ export declare class CameraPath {
99
131
  * @param segments - スプラインを何本の線の結合でジオメトリ生成するか
100
132
  * @param pointColor - 制御点の色
101
133
  * @param lineColor - ラインの色
134
+ * @param showPoints - 制御点(Points)も追加するか
102
135
  */
103
136
  private insert;
104
137
  }
@@ -114,7 +147,8 @@ interface iVectorLike {
114
147
  * カメラパスを生成するヘルパー関数
115
148
  * @param position - カメラの座標({x, y, z} のオブジェクト、または [x, y, z] の数値の配列)の配列
116
149
  * @param target - 注視点の座標({x, y, z} のオブジェクト、または [x, y, z] の数値の配列)の配列
150
+ * @param times - 各制御点に対応する時刻(0.0 ~ 1.0)。省略時は等間隔
117
151
  * @returns 生成された CameraPath
118
152
  */
119
- export declare function createCameraPath(position: iVectorLike[] | number[][], target: iVectorLike[] | number[][]): CameraPath;
153
+ export declare function createCameraPath(position: iVectorLike[] | number[][], target: iVectorLike[] | number[][], times?: number[] | null): CameraPath;
120
154
  export {};
@@ -1,13 +1,14 @@
1
- import { PerspectiveCamera, Vector3, Ray, Quaternion, Euler } from 'three';
1
+ import { PerspectiveCamera, Vector3, Ray } from 'three';
2
2
  import { Selector, iIntersection } from './selector';
3
+ import { iVectorLike } from '../../viewer/types';
3
4
  export interface iBoxSelectorOption {
4
5
  width?: number;
5
6
  height?: number;
6
7
  depth?: number;
7
8
  segment?: number;
8
9
  color?: number;
9
- position?: Vector3 | [number, number, number];
10
- rotation?: Euler | Quaternion | [number, number, number];
10
+ position?: iVectorLike | [number, number, number];
11
+ rotation?: iVectorLike | [number, number, number];
11
12
  visible?: boolean;
12
13
  }
13
14
  /**
@@ -0,0 +1,57 @@
1
+ import { PerspectiveCamera, Ray, Vector3 } from 'three';
2
+ import { Selector, iIntersection } from './selector';
3
+ export interface iCameraSelectorOption {
4
+ radius?: number;
5
+ color?: number;
6
+ lineWidth?: number;
7
+ aspectRatio?: number;
8
+ }
9
+ /**
10
+ * カメラの位置(position)を表す、カメラを模した四角錐(フラスタム)アイコンのセレクター。
11
+ * 底面はカメラのフレーム(画角)を模した長方形(aspectRatioで指定)にし、正方形の底面を持つ
12
+ * ConeGeometryではなくカスタムジオメトリで、頂点から底面各頂点への4本の稜線と底面の
13
+ * 輪郭(4辺)だけのシンプルな形状を作る(底面を閉じる面は作らない)。
14
+ * これをWireframeGeometry2 + LineMaterial(Fat Lines)で太さのある線として描画する。
15
+ * 底面は+Z方向を向く(Selector.lookAt()でtarget方向を向けたときに底面がtarget側になるため)。
16
+ * SphereSelectorと同じくTransformControlsをtranslateモードのみで使う想定(位置編集用の
17
+ * ポイントハンドルとしての利用が主目的)。
18
+ * containsPoint/intersectRayは、実際の四角錐形状ではなく底面・奥行きを包含できる
19
+ * 外接球で近似する(このセレクターは領域選択ではなく位置マーカーとしての利用が主目的のため)。
20
+ * @class
21
+ */
22
+ export declare class CameraSelector extends Selector {
23
+ private radius;
24
+ private boundingRadius;
25
+ private frustumGeometry;
26
+ private wireGeometry;
27
+ private material;
28
+ /**
29
+ * @param camera - TransformControls に設定するカメラ
30
+ * @param eventTarget - TransformControls に設定するイベント処理の対象要素
31
+ * @param option - セットアップオプション
32
+ */
33
+ constructor(camera: PerspectiveCamera, eventTarget: HTMLElement, option?: iCameraSelectorOption);
34
+ /**
35
+ * 設定されている半径(外接球の近似半径)を返す
36
+ */
37
+ getRadius(): number;
38
+ /**
39
+ * セットアップを行う
40
+ * @param option - セットアップオプション
41
+ */
42
+ setup(option?: iCameraSelectorOption): void;
43
+ /**
44
+ * 開放処理
45
+ */
46
+ dispose(): void;
47
+ /**
48
+ * 包含判定処理(外接球で近似)
49
+ * @param point - 任意の点(座標)
50
+ */
51
+ containsPoint(point: Vector3): boolean;
52
+ /**
53
+ * Ray オブジェクトの入射点と射出点までの距離を求める処理(外接球で近似)
54
+ * @param ray - 判定を行う Ray
55
+ */
56
+ intersectRay(ray: Ray): iIntersection;
57
+ }
@@ -1,5 +1,5 @@
1
1
  import { default as EventEmitter } from 'eventemitter3';
2
- import { Euler, Matrix4, Object3D, PerspectiveCamera, Quaternion, Ray, Vector3 } from 'three';
2
+ import { Euler, Matrix4, Object3D, PerspectiveCamera, Quaternion, Ray, Sphere, Vector3 } from 'three';
3
3
  import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
4
4
  /**
5
5
  * Selector は選択範囲を管理・制御するための基底クラスで、継承される前提になっている。
@@ -43,6 +43,23 @@ export declare abstract class Selector extends EventEmitter {
43
43
  */
44
44
  set visible(visible: boolean);
45
45
  get visible(): boolean;
46
+ /**
47
+ * 操作用のギズモ(TransformControls)だけの表示・操作可否を切り替える。
48
+ * 本体(object)の表示はそのまま残すため、「全件表示しつつ、選択中の1件だけドラッグ可能にする」
49
+ * といった使い方ができる
50
+ * @param visible - ギズモを表示して操作可能にするか
51
+ */
52
+ setGizmoVisible(visible: boolean): void;
53
+ /**
54
+ * クリック判定(レイキャスト)用に、本体を包む球(ワールド座標)を返す。非表示の場合はnull。
55
+ * 形状ごとの厳密な判定ではなく、回転を含めた本体全体を包む境界球で近似する
56
+ */
57
+ getPickSphere(): Sphere | null;
58
+ /**
59
+ * 本体の色を変更する(material.color を持つマテリアルの場合のみ)
60
+ * @param color - 設定する色(例: 0xffffff)
61
+ */
62
+ setColor(color: number): void;
46
63
  /**
47
64
  * @constructor
48
65
  * @param camera - TransformControls に設定するカメラ
@@ -107,6 +124,13 @@ export declare abstract class Selector extends EventEmitter {
107
124
  * @param Euler - 設定する回転(オイラー角)
108
125
  */
109
126
  setEuler(euler: Euler): void;
127
+ /**
128
+ * 指定した位置の方を向くよう回転を設定する(現在位置からの相対方向)。
129
+ * カメラの位置マーカー(CameraSelector)を、対応する注視点(target)の方向へ
130
+ * 向けたい場合などに使う。
131
+ * @param target - 向く先の位置(ワールド座標)
132
+ */
133
+ lookAt(target: Vector3): void;
110
134
  /**
111
135
  * 平行移動モードを設定する
112
136
  * @param index - 対象となるインデックス(省略時はすべてのコントロールを対象とする)
@@ -4,6 +4,7 @@ export interface iSphereSelectorOption {
4
4
  radius?: number;
5
5
  segment?: number;
6
6
  color?: number;
7
+ fill?: boolean;
7
8
  }
8
9
  /**
9
10
  * スプラットを選択するための sphere インターフェースを提供する
@@ -1,6 +1,7 @@
1
- import { Core, TavioError, TavioErrorCode, SELECTION_MODE, tSelectionMode, tMaskSource, iLoadingOption, iViewerOption, iHeaderInfo, iDistanceInfo, iTransform, iVectorLike } from './viewer/canvas';
2
- import { iAnimationConfig } from './animation/animationController';
1
+ import { Core } from './viewer/canvas';
2
+ import { TavioError, tSelectionMode, tMaskSource, iLoadingOption, iViewerOption, iHeaderInfo, iDistanceInfo, iTransform, iVectorLike, tUniformPlainValue, tCustomDefines, tCustomUniformValue, tCustomUniforms } from './viewer/types';
3
+ import { TAVIO_ERROR_CODE, SELECTION_MODE } from './viewer/constants';
3
4
  import { CHUNK_TARGET, SHADER_STAGE, iMaterialOption } from './viewer/materialGenerator';
4
- export { Core, TavioError, TavioErrorCode, SELECTION_MODE, CHUNK_TARGET, SHADER_STAGE };
5
- export type { iAnimationConfig, iMaterialOption, tSelectionMode, tMaskSource, iLoadingOption, iViewerOption, iHeaderInfo, iDistanceInfo, iTransform, iVectorLike };
5
+ export { Core, TavioError, TAVIO_ERROR_CODE, SELECTION_MODE, CHUNK_TARGET, SHADER_STAGE, };
6
+ export type { iMaterialOption, tSelectionMode, tMaskSource, iLoadingOption, iViewerOption, iHeaderInfo, iDistanceInfo, iTransform, iVectorLike, tUniformPlainValue, tCustomDefines, tCustomUniformValue, tCustomUniforms, };
6
7
  export default Core;