@reall3d/reall3dviewer 0.0.5 → 0.0.7
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/README.md +23 -1
- package/dist/pkg.d.ts +192 -2
- package/dist/pkg.js +166 -165
- package/dist/pkg.umd.cjs +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @reall3d/reall3dviewer
|
|
2
|
+
|
|
3
|
+
Install
|
|
4
|
+
```shell
|
|
5
|
+
npm i @reall3d/reall3dviewer
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Use Reall3dViewer
|
|
9
|
+
```js
|
|
10
|
+
const viewer = new Reall3dViewer({ root: '#viewer2' });
|
|
11
|
+
viewer.addModel(`https://reall3d.com/demo-models/yz.spx`);
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Use Reall3dMapViewer
|
|
15
|
+
```js
|
|
16
|
+
const mapViewer = new Reall3dMapViewer({ root: '#viewer4' });
|
|
17
|
+
mapViewer.addScenes('https://reall3d.com/demo-models/map/00.scenes.json');
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
# Links
|
|
21
|
+
|
|
22
|
+
- https://github.com/reall3d-com/Reall3dViewer
|
|
23
|
+
- https://github.com/reall3d-com/reall3dviewer-samples-use-npm-package
|
package/dist/pkg.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { AmbientLight } from 'three';
|
|
|
2
2
|
import { DirectionalLight } from 'three';
|
|
3
3
|
import { EventDispatcher } from 'three';
|
|
4
4
|
import { MapControls } from 'three/examples/jsm/controls/MapControls.js';
|
|
5
|
+
import { Matrix4 } from 'three';
|
|
6
|
+
import { Mesh } from 'three';
|
|
5
7
|
import { OrbitControls } from 'three/examples/jsm/Addons.js';
|
|
6
8
|
import { PerspectiveCamera } from 'three';
|
|
7
9
|
import { Renderer } from 'three';
|
|
@@ -9,6 +11,40 @@ import { Scene } from 'three';
|
|
|
9
11
|
import * as tt from '@gotoeasy/three-tile';
|
|
10
12
|
import { WebGLRenderer } from 'three';
|
|
11
13
|
|
|
14
|
+
/**
|
|
15
|
+
* 相机参数信息
|
|
16
|
+
*/
|
|
17
|
+
export declare interface CameraInfo {
|
|
18
|
+
/**
|
|
19
|
+
* 相机视场
|
|
20
|
+
*/
|
|
21
|
+
fov?: number;
|
|
22
|
+
/**
|
|
23
|
+
* 相机近截面距离
|
|
24
|
+
*/
|
|
25
|
+
near?: number;
|
|
26
|
+
/**
|
|
27
|
+
* 相机远截面距离
|
|
28
|
+
*/
|
|
29
|
+
far?: number;
|
|
30
|
+
/**
|
|
31
|
+
* 相机宽高比
|
|
32
|
+
*/
|
|
33
|
+
aspect?: number;
|
|
34
|
+
/**
|
|
35
|
+
* 相机位置
|
|
36
|
+
*/
|
|
37
|
+
position: number[];
|
|
38
|
+
/**
|
|
39
|
+
* 相机注视点
|
|
40
|
+
*/
|
|
41
|
+
lookAt?: number[];
|
|
42
|
+
/**
|
|
43
|
+
* 相机上向量
|
|
44
|
+
*/
|
|
45
|
+
lookUp?: number[];
|
|
46
|
+
}
|
|
47
|
+
|
|
12
48
|
declare class Events {
|
|
13
49
|
private map;
|
|
14
50
|
constructor();
|
|
@@ -19,6 +55,54 @@ declare class Events {
|
|
|
19
55
|
clear(): void;
|
|
20
56
|
}
|
|
21
57
|
|
|
58
|
+
/**
|
|
59
|
+
* 元数据
|
|
60
|
+
*/
|
|
61
|
+
export declare interface MetaData {
|
|
62
|
+
/** 名称 */
|
|
63
|
+
name?: string;
|
|
64
|
+
/** 版本 */
|
|
65
|
+
version?: string;
|
|
66
|
+
/** 更新日期(YYYYMMDD) */
|
|
67
|
+
updateDate?: number;
|
|
68
|
+
/** 是否自动旋转 */
|
|
69
|
+
autoRotate?: boolean;
|
|
70
|
+
/** 是否调试模式 */
|
|
71
|
+
debugMode?: boolean;
|
|
72
|
+
/** 是否点云模式 */
|
|
73
|
+
pointcloudMode?: boolean;
|
|
74
|
+
/** 移动端最大渲染数量 */
|
|
75
|
+
maxRenderCountOfMobile?: number;
|
|
76
|
+
/** PC端最大渲染数量 */
|
|
77
|
+
maxRenderCountOfPc?: number;
|
|
78
|
+
/** 移动端最大下载数量 */
|
|
79
|
+
mobileDownloadLimitSplatCount?: number;
|
|
80
|
+
/** PC端最大下载数量 */
|
|
81
|
+
pcDownloadLimitSplatCount?: number;
|
|
82
|
+
/** 米比例尺 */
|
|
83
|
+
meterScale?: number;
|
|
84
|
+
/** 文字水印 */
|
|
85
|
+
watermark?: string;
|
|
86
|
+
/** 是否显示水印 */
|
|
87
|
+
showWatermark?: boolean;
|
|
88
|
+
/** 相机参数 */
|
|
89
|
+
cameraInfo?: CameraInfo;
|
|
90
|
+
/** 标注 */
|
|
91
|
+
marks?: any[];
|
|
92
|
+
/** 飞翔相机位置点 */
|
|
93
|
+
flyPositions?: number[];
|
|
94
|
+
/** 飞翔相机注视点 */
|
|
95
|
+
flyTargets?: number[];
|
|
96
|
+
/** 自动切割数量 */
|
|
97
|
+
autoCut?: number;
|
|
98
|
+
/** 变换矩阵 */
|
|
99
|
+
transform?: number[];
|
|
100
|
+
/** 定位坐标(EPSG:4326 WGS 84) */
|
|
101
|
+
WGS84?: number[];
|
|
102
|
+
/** 模型地址 */
|
|
103
|
+
url?: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
22
106
|
/**
|
|
23
107
|
* 高斯模型选项
|
|
24
108
|
*/
|
|
@@ -76,9 +160,9 @@ export declare interface Reall3dMapViewerOptions {
|
|
|
76
160
|
*/
|
|
77
161
|
root?: HTMLElement | string;
|
|
78
162
|
/**
|
|
79
|
-
* 是否允许键盘操作,默认
|
|
163
|
+
* 是否允许键盘操作,默认false
|
|
80
164
|
*/
|
|
81
|
-
enableKeyboard?: boolean
|
|
165
|
+
enableKeyboard?: boolean;
|
|
82
166
|
/**
|
|
83
167
|
* 是否调试模式,生产环境默认false
|
|
84
168
|
*/
|
|
@@ -284,6 +368,112 @@ export declare interface Reall3dViewerOptions {
|
|
|
284
368
|
* 球谐系数的渲染级别,默认为模型数据的最大可渲染级别
|
|
285
369
|
*/
|
|
286
370
|
shDegree?: number | undefined;
|
|
371
|
+
/**
|
|
372
|
+
* 背景色(默认 '#000000')
|
|
373
|
+
*/
|
|
374
|
+
background?: string;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Gaussian splatting mesh
|
|
379
|
+
*/
|
|
380
|
+
export declare class SplatMesh extends Mesh {
|
|
381
|
+
readonly isSplatMesh: boolean;
|
|
382
|
+
meta: MetaData;
|
|
383
|
+
private disposed;
|
|
384
|
+
private events;
|
|
385
|
+
private opts;
|
|
386
|
+
/**
|
|
387
|
+
* 构造函数
|
|
388
|
+
* @param options 渲染器、场景、相机都应该传入
|
|
389
|
+
*/
|
|
390
|
+
constructor(options: SplatMeshOptions);
|
|
391
|
+
/**
|
|
392
|
+
* 设定或者获取最新配置项
|
|
393
|
+
* @param opts 配置项
|
|
394
|
+
* @returns 最新配置项
|
|
395
|
+
*/
|
|
396
|
+
options(opts?: SplatMeshOptions): SplatMeshOptions;
|
|
397
|
+
/**
|
|
398
|
+
* 添加渲染指定高斯模型
|
|
399
|
+
* @param opts 高斯模型选项
|
|
400
|
+
* @param meta 元数据
|
|
401
|
+
*/
|
|
402
|
+
addModel(opts: ModelOptions, meta: MetaData): Promise<void>;
|
|
403
|
+
fire(key: number, ...args: any): any;
|
|
404
|
+
/**
|
|
405
|
+
* 销毁
|
|
406
|
+
*/
|
|
407
|
+
dispose(): void;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* 高斯网格配置项
|
|
412
|
+
*/
|
|
413
|
+
export declare interface SplatMeshOptions {
|
|
414
|
+
/**
|
|
415
|
+
* 名称
|
|
416
|
+
*/
|
|
417
|
+
name?: string;
|
|
418
|
+
/**
|
|
419
|
+
* 指定渲染器对象传入使用
|
|
420
|
+
*/
|
|
421
|
+
renderer: Renderer;
|
|
422
|
+
/**
|
|
423
|
+
* 指定场景对象传入使用
|
|
424
|
+
*/
|
|
425
|
+
scene: Scene;
|
|
426
|
+
/**
|
|
427
|
+
* 控制器
|
|
428
|
+
*/
|
|
429
|
+
controls?: OrbitControls;
|
|
430
|
+
/**
|
|
431
|
+
* 模型矩阵
|
|
432
|
+
*/
|
|
433
|
+
matrix?: Matrix4 | undefined;
|
|
434
|
+
/**
|
|
435
|
+
* 渲染器事件管理器
|
|
436
|
+
*/
|
|
437
|
+
viewerEvents?: Events | undefined;
|
|
438
|
+
/**
|
|
439
|
+
* 是否调试模式,生产环境默认false
|
|
440
|
+
*/
|
|
441
|
+
debugMode?: boolean | undefined;
|
|
442
|
+
/**
|
|
443
|
+
* 是否大场景模式,初始化后不可修改
|
|
444
|
+
*/
|
|
445
|
+
bigSceneMode?: boolean;
|
|
446
|
+
/**
|
|
447
|
+
* 是否点云模式渲染,默认为true
|
|
448
|
+
* 支持通过viewer.options()动态更新
|
|
449
|
+
*/
|
|
450
|
+
pointcloudMode?: boolean | undefined;
|
|
451
|
+
/**
|
|
452
|
+
* 移动端可渲染的高斯点数量限制,默认200万
|
|
453
|
+
* 支持通过viewer.options()动态更新
|
|
454
|
+
*/
|
|
455
|
+
maxRenderCountOfMobile?: number | undefined;
|
|
456
|
+
/**
|
|
457
|
+
* PC端可渲染的高斯点数量限制,默认500万
|
|
458
|
+
* 支持通过viewer.options()动态更新
|
|
459
|
+
*/
|
|
460
|
+
maxRenderCountOfPc?: number | undefined;
|
|
461
|
+
/**
|
|
462
|
+
* 颜色亮度系数,默认1.1
|
|
463
|
+
*/
|
|
464
|
+
lightFactor?: number | undefined;
|
|
465
|
+
/**
|
|
466
|
+
* 是否显示水印
|
|
467
|
+
*/
|
|
468
|
+
showWatermark?: boolean | undefined;
|
|
469
|
+
/**
|
|
470
|
+
* 球谐系数的渲染级别,默认为模型数据的最大可渲染级别
|
|
471
|
+
*/
|
|
472
|
+
shDegree?: number | undefined;
|
|
473
|
+
/**
|
|
474
|
+
* 是否开启深度测试,默认true
|
|
475
|
+
*/
|
|
476
|
+
depthTest?: boolean;
|
|
287
477
|
}
|
|
288
478
|
|
|
289
479
|
export { }
|