@realsee/five 5.0.0-alpha.14 → 5.0.0-alpha.142

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 (221) hide show
  1. package/README.md +21 -11
  2. package/docs/.nojekyll +1 -0
  3. package/docs/assets/highlight.css +134 -0
  4. package/docs/assets/icons.css +1043 -0
  5. package/docs/assets/{images/icons.png → icons.png} +0 -0
  6. package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
  7. package/docs/assets/main.js +52 -0
  8. package/docs/assets/search.js +1 -0
  9. package/docs/assets/style.css +1413 -0
  10. package/docs/assets/{images/widgets.png → widgets.png} +0 -0
  11. package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
  12. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  13. package/docs/classes/five.BVH.html +10 -0
  14. package/docs/classes/five.BVHIntersect.html +1 -0
  15. package/docs/classes/five.BVHNode.html +7 -0
  16. package/docs/classes/five.BVHVector3.html +1 -0
  17. package/docs/classes/five.Camera.html +11 -0
  18. package/docs/classes/five.Five.html +310 -0
  19. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  20. package/docs/classes/five.IntersectMesh.html +1 -0
  21. package/docs/classes/five.LegacyPanoCircleMesh.html +5 -0
  22. package/docs/classes/five.Model.html +87 -0
  23. package/docs/classes/five.NetworkSubscribe.html +50 -0
  24. package/docs/classes/five.PBMContainer.html +17 -0
  25. package/docs/classes/five.PBMGroup.html +19 -0
  26. package/docs/classes/five.PBMMaterial.html +19 -0
  27. package/docs/classes/five.PBMMesh.html +7 -0
  28. package/docs/classes/five.PanoCircleMesh.html +7 -0
  29. package/docs/classes/five.Scene.html +3 -0
  30. package/docs/classes/five.Subscribe.html +56 -0
  31. package/docs/classes/five.Tile3D.html +34 -0
  32. package/docs/classes/five.Tile3DModel.html +15 -0
  33. package/docs/classes/five.TileBoundingSphere.html +1 -0
  34. package/docs/classes/five.TileCacheNode.html +1 -0
  35. package/docs/classes/five.TileCullingVolume.html +1 -0
  36. package/docs/classes/five.TileOrientedBoundingBox.html +1 -0
  37. package/docs/classes/five.TilePlane.html +1 -0
  38. package/docs/classes/five.TileRequestScheduler.html +16 -0
  39. package/docs/classes/five.Tileset3D.html +11 -0
  40. package/docs/classes/five.Tileset3DTraverser.html +1 -0
  41. package/docs/classes/five.TilesetCache.html +1 -0
  42. package/docs/classes/five.Work.html +30 -0
  43. package/docs/classes/five.XRButton.html +1 -0
  44. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  45. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  46. package/docs/classes/line.Line.html +1 -0
  47. package/docs/classes/line.LineGeometry.html +1 -0
  48. package/docs/classes/line.LineMaterial.html +1 -0
  49. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  50. package/docs/classes/line.THREE_Line2.html +1 -0
  51. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  52. package/docs/classes/react.Store.html +29 -0
  53. package/docs/classes/server.BVH.html +10 -0
  54. package/docs/classes/server.BVHIntersect.html +1 -0
  55. package/docs/classes/server.BVHNode.html +7 -0
  56. package/docs/classes/server.BVHVector3.html +1 -0
  57. package/docs/classes/server.Model.html +63 -0
  58. package/docs/classes/server.PBMGroup.html +9 -0
  59. package/docs/classes/server.PBMMesh.html +7 -0
  60. package/docs/classes/sticker.Sticker.html +32 -0
  61. package/docs/index.html +166 -422
  62. package/docs/interfaces/five.AddableObject.html +1 -0
  63. package/docs/interfaces/five.AnimationFrame.html +1 -0
  64. package/docs/interfaces/five.CameraPose.html +1 -0
  65. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  66. package/docs/interfaces/five.EventCallback.html +399 -0
  67. package/docs/interfaces/five.FiveInitArgs.html +107 -0
  68. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
  69. package/docs/interfaces/five.ImageOptions.html +18 -0
  70. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  71. package/docs/interfaces/five.ImageURLOptions.html +17 -0
  72. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  73. package/docs/interfaces/five.Intersection.html +7 -0
  74. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
  75. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  76. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  77. package/docs/interfaces/five.MovePanoOptions.html +42 -0
  78. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  79. package/docs/interfaces/five.PBMParameters.html +19 -0
  80. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  81. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +33 -0
  82. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  83. package/docs/interfaces/five.Pose.html +37 -0
  84. package/docs/interfaces/five.Scissor.html +14 -0
  85. package/docs/interfaces/five.State.html +21 -0
  86. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  87. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  88. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  89. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  90. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  91. package/docs/interfaces/five.TextureOptions.html +20 -0
  92. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +3 -0
  93. package/docs/interfaces/five.TileBoundingVolume.html +19 -0
  94. package/docs/interfaces/five.TileContent.html +1 -0
  95. package/docs/interfaces/five.Tileset3dOptions.html +1 -0
  96. package/docs/interfaces/five.TilesetJSON.html +1 -0
  97. package/docs/interfaces/five.TilesetJSONNode.html +1 -0
  98. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
  99. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +29 -0
  100. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  101. package/docs/interfaces/five.WorkImage.html +21 -0
  102. package/docs/interfaces/five.WorkInitial.html +13 -0
  103. package/docs/interfaces/five.WorkModel.html +11 -0
  104. package/docs/interfaces/five.WorkModelTiles.html +3 -0
  105. package/docs/interfaces/five.WorkObserver.html +25 -0
  106. package/docs/interfaces/five.WorkTile.html +1 -0
  107. package/docs/interfaces/five.WorkVideo.html +9 -0
  108. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +29 -0
  109. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  110. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  111. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  112. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  113. package/docs/interfaces/server.Intersection.html +7 -0
  114. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  115. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  116. package/docs/interfaces/vue.FiveActionVueCallbacks.html +62 -0
  117. package/docs/modules/five.SubscribeMixinType.html +1 -0
  118. package/docs/modules/five.html +496 -0
  119. package/docs/modules/gltf_loader.html +1 -0
  120. package/docs/modules/line.html +1 -0
  121. package/docs/modules/react.html +130 -1374
  122. package/docs/modules/server.html +18 -0
  123. package/docs/modules/sticker.html +1 -0
  124. package/docs/modules/vue.html +112 -0
  125. package/docs/modules.html +1 -120
  126. package/exporters/staticify.js +210 -0
  127. package/{index.d.ts → five/index.d.ts} +1211 -331
  128. package/five/index.js +372 -0
  129. package/gltf-loader/index.d.ts +76 -0
  130. package/gltf-loader/index.js +260 -0
  131. package/line/index.d.ts +69 -0
  132. package/line/index.js +260 -0
  133. package/package.json +25 -17
  134. package/react/index.d.ts +86 -24
  135. package/react/index.js +260 -1
  136. package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
  137. package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
  138. package/resource/gltf/draco_decoder.js +31 -0
  139. package/resource/gltf/draco_decoder.wasm +0 -0
  140. package/resource/gltf/draco_wasm_wrapper.js +119 -0
  141. package/scripts/five-staticify.js +26 -0
  142. package/server/index.d.ts +197 -26
  143. package/server/index.js +367 -1
  144. package/sticker/index.d.ts +71 -0
  145. package/sticker/index.js +260 -0
  146. package/templates/quick-start/README.md +1 -1
  147. package/templates/quick-start/package.json +1 -1
  148. package/templates/react-component/lib/index.tsx +3 -3
  149. package/umd/five-gltf-loader.js +2 -0
  150. package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
  151. package/umd/five-line.js +2 -0
  152. package/umd/five-line.js.LICENSE.txt +14 -0
  153. package/umd/five-react.js +2 -0
  154. package/umd/five-react.js.LICENSE.txt +14 -0
  155. package/umd/five-sticker.js +2 -0
  156. package/umd/five-sticker.js.LICENSE.txt +14 -0
  157. package/umd/five-vue.js +1 -0
  158. package/umd/five.js +2 -0
  159. package/umd/five.js.LICENSE.txt +116 -0
  160. package/vue/index.d.ts +433 -0
  161. package/vue/index.js +260 -0
  162. package/bundles/five.js +0 -2
  163. package/bundles/five.js.LICENSE.txt +0 -160
  164. package/docs/assets/css/main.css +0 -2660
  165. package/docs/assets/js/main.js +0 -248
  166. package/docs/assets/js/search.js +0 -1
  167. package/docs/classes/index.five.html +0 -2498
  168. package/docs/classes/index.fivecamera.html +0 -311
  169. package/docs/classes/index.fivehashcubetexture.html +0 -240
  170. package/docs/classes/index.fiveline.html +0 -342
  171. package/docs/classes/index.fivelinegeometry.html +0 -500
  172. package/docs/classes/index.fivelinematerial.html +0 -276
  173. package/docs/classes/index.fivelinesegmentsgeometry.html +0 -447
  174. package/docs/classes/index.fivescene.html +0 -186
  175. package/docs/classes/index.internalwebglrenderer.html +0 -200
  176. package/docs/classes/index.model.html +0 -883
  177. package/docs/classes/index.pbmgroup.html +0 -415
  178. package/docs/classes/index.pbmmaterial.html +0 -521
  179. package/docs/classes/index.pbmmesh.html +0 -242
  180. package/docs/classes/index.subscribe.html +0 -556
  181. package/docs/classes/react.store.html +0 -584
  182. package/docs/interfaces/index.depthpanoramacontrollercustominitargs.html +0 -408
  183. package/docs/interfaces/index.eventcallback.html +0 -2452
  184. package/docs/interfaces/index.fiveinitargs.html +0 -695
  185. package/docs/interfaces/index.floorplancontrollercustominitargs.html +0 -283
  186. package/docs/interfaces/index.imageoptions.html +0 -320
  187. package/docs/interfaces/index.intersection.html +0 -215
  188. package/docs/interfaces/index.intersectmeshinterface.html +0 -176
  189. package/docs/interfaces/index.modelcontrollercustominitargs.html +0 -354
  190. package/docs/interfaces/index.modeleventcallback.html +0 -316
  191. package/docs/interfaces/index.movepanooptions.html +0 -457
  192. package/docs/interfaces/index.panocirclemeshinterface.html +0 -349
  193. package/docs/interfaces/index.panoramacontrollercustominitargs.html +0 -433
  194. package/docs/interfaces/index.panoramalikecontrollercustominitargs.html +0 -352
  195. package/docs/interfaces/index.pbmparameters.html +0 -462
  196. package/docs/interfaces/index.pose.html +0 -258
  197. package/docs/interfaces/index.scissor.html +0 -240
  198. package/docs/interfaces/index.state.html +0 -288
  199. package/docs/interfaces/index.subscribemixintype.emit.html +0 -180
  200. package/docs/interfaces/index.subscribemixintype.haslistener.html +0 -171
  201. package/docs/interfaces/index.subscribemixintype.off.html +0 -198
  202. package/docs/interfaces/index.subscribemixintype.on.html +0 -213
  203. package/docs/interfaces/index.subscribemixintype.once.html +0 -210
  204. package/docs/interfaces/index.topviewcontrollercustominitargs.html +0 -214
  205. package/docs/interfaces/index.vrpanoramacontrollercustominitargs.html +0 -420
  206. package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -559
  207. package/docs/interfaces/react.fiveinjectiontypes.html +0 -1473
  208. package/docs/interfaces/react.injectfivetoprops.html +0 -259
  209. package/docs/modules/index.html +0 -3027
  210. package/docs/modules/index.subscribemixintype.html +0 -143
  211. package/five.js.LICENSE.txt +0 -160
  212. package/index.js +0 -1
  213. package/scripts/export-five-resource/chfs.exe +0 -0
  214. package/scripts/export-five-resource/fileify.js +0 -192
  215. package/scripts/export-five-resource/format-work.js +0 -71
  216. package/scripts/export-five-resource/staticify.js +0 -327
  217. package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
  218. package/scripts/transcode-model/LoaderSupport.js +0 -1545
  219. package/scripts/transcode-model/MTLLoader.js +0 -602
  220. package/scripts/transcode-model/OBJLoader2.js +0 -1470
  221. package/scripts/transcode-model/obj2pbm.js +0 -65
@@ -1,6 +1,126 @@
1
- /// <reference types="hammerjs" />
2
-
1
+ import Matrix3 from '@math.gl/core/dist/esm/classes/matrix3';
2
+ import Matrix4 from '@math.gl/core/dist/esm/classes/matrix4';
3
+ import Quaternion from '@math.gl/core/dist/esm/classes/quaternion';
3
4
  import * as THREE_2 from 'three';
5
+ import Vector3 from '@math.gl/core/dist/esm/classes/vector3';
6
+
7
+ export declare interface AddableObject extends THREE_2.Object3D {
8
+ needsRender?: boolean;
9
+ mixer?: THREE_2.AnimationMixer;
10
+ setResolution?(width: number, height: number): void;
11
+ }
12
+
13
+ export declare interface AnimationFrame {
14
+ callback: (time: number, deltaTime: number, ...args: any[]) => void;
15
+ once: boolean;
16
+ delay: number;
17
+ order: number;
18
+ }
19
+
20
+ export declare class AnimationFrameLoop {
21
+ private frames;
22
+ private time;
23
+ private stoped;
24
+ private context?;
25
+ private requestId;
26
+ private static sharedInstance?;
27
+ static get shared(): AnimationFrameLoop;
28
+ static getFrameTime(): number;
29
+ constructor();
30
+ private loop;
31
+ setContext(context: any): void;
32
+ getContext(): any;
33
+ private requestAnimationFrame;
34
+ private cancelAnimationFrame;
35
+ private remove;
36
+ /**
37
+ * 添加到动画循环
38
+ * @param callback - 动画循环回调
39
+ * @param once - 是否只回调一次
40
+ * @param delay - 延迟多少个动画循环回调
41
+ * @param order - 优先级,数字越小越早被调用
42
+ * @returns 移除动画循环函数
43
+ */
44
+ add(callback: AnimationFrame["callback"], once?: boolean, delay?: number, order?: number): () => void;
45
+ disponse(): void;
46
+ }
47
+
48
+ export declare class BVH {
49
+ trianglesArray?: Float32Array;
50
+ offsetArray?: Uint32Array;
51
+ rootNode?: BVHNode;
52
+ create(trianglesArray: Float32Array): this;
53
+ splitNode(maxTrianglesPerNode: number): this;
54
+ /**
55
+ * 计算射线与三角形的碰撞
56
+ * @param rayOrigin - 射线的原点坐标
57
+ * @param rayDirection - 设想的方向向量
58
+ * @param backfaceCulling - 是否背面剔除
59
+ * @return 碰撞焦点数组
60
+ */
61
+ intersectRay(rayOrigin: BVHVector3, rayDirection: BVHVector3, backfaceCulling: boolean): BVHIntersect[];
62
+ dispose(): void;
63
+ }
64
+
65
+ export declare class BVHIntersect {
66
+ triangle: [BVHVector3, BVHVector3, BVHVector3];
67
+ intersectionPoint: BVHVector3;
68
+ constructor(triangle: [BVHVector3, BVHVector3, BVHVector3], intersectionPoint: BVHVector3);
69
+ }
70
+
71
+ /**
72
+ * A node in the BVH structure
73
+ * @param extents - the min coords of this node's bounding box
74
+ * @param startIndex - an index in the bbox array, where the first element of this node is located
75
+ * @param endIndex - an index in the bbox array, where the last of this node is located, plus 1 (meaning that its non-inclusive).
76
+ * @param level - distance of this node from the root for the bvh tree. root node has level=0, its children have level=1 etc.
77
+ */
78
+ export declare class BVHNode {
79
+ extents: ArrayLike<number>;
80
+ startIndex: number;
81
+ endIndex: number;
82
+ node0?: BVHNode;
83
+ node1?: BVHNode;
84
+ constructor(extents: ArrayLike<number>, startIndex: number, endIndex: number);
85
+ }
86
+
87
+ export declare class BVHVector3 {
88
+ x: number;
89
+ y: number;
90
+ z: number;
91
+ constructor(x: number, y: number, z: number);
92
+ copy(v: BVHVector3): this;
93
+ set(x: number, y: number, z: number): this;
94
+ fromArray(array: number[], firstElementPos?: number): this;
95
+ add(v: BVHVector3): this;
96
+ multiplyScalar(scalar: number): this;
97
+ subVectors(a: BVHVector3, b: BVHVector3): this;
98
+ dot(v: BVHVector3): number;
99
+ cross(v: BVHVector3): this;
100
+ crossVectors(a: BVHVector3, b: BVHVector3): this;
101
+ clone(): BVHVector3;
102
+ }
103
+
104
+ /** Five 相机 */
105
+ export declare class Camera extends THREE_2.PerspectiveCamera {
106
+ /** 相机姿态 */
107
+ pose: CameraPose;
108
+ constructor(fov: number);
109
+ /** 通过相机参数反算姿态 */
110
+ computePose(): this;
111
+ /** 设置相机姿态 */
112
+ setFromPose(pose: Partial<CameraPose>): this;
113
+ /** 拷贝相机姿态 */
114
+ copyPose(): CameraPose;
115
+ }
116
+
117
+ export declare interface CameraPose {
118
+ longitude: number;
119
+ latitude: number;
120
+ fov: number;
121
+ distance: number;
122
+ offset: THREE_2.Vector3;
123
+ }
4
124
 
5
125
  export declare type ControllerCustomInitTypes = {
6
126
  Floorplan: FloorplanControllerCustomInitArgs;
@@ -9,6 +129,8 @@ export declare type ControllerCustomInitTypes = {
9
129
  VRPanorama: VRPanoramaControllerCustomInitArgs;
10
130
  Model: ModelControllerCustomInitArgs;
11
131
  DepthPanorama: DepthPanoramaControllerCustomInitArgs;
132
+ Mapview: MapviewControllerCustomInitArgs;
133
+ XRPanorama: XRPanoramaControllerCustomInitArgs;
12
134
  };
13
135
 
14
136
  export declare type ControllerEventTypes = {
@@ -62,7 +184,7 @@ export declare type ControllerEventTypes = {
62
184
  * 观察点位被选择
63
185
  * @param panoIndex - 选择的点位
64
186
  */
65
- panoSelected(panoIndex: number): void;
187
+ panoSelected(panoIndex: number | null): void;
66
188
  /**
67
189
  * 意图要移动到某个点位 可以通过 `return false` 阻止
68
190
  * @param panoIndex - 图要移动到的点位下标
@@ -142,6 +264,7 @@ export declare type ControllerEventTypes = {
142
264
  wantsGesture(type: GestureTypes, pointers: {
143
265
  x: number;
144
266
  y: number;
267
+ delta?: number;
145
268
  }[], final: boolean): void | false;
146
269
  /**
147
270
  * 手势 触发
@@ -152,6 +275,7 @@ export declare type ControllerEventTypes = {
152
275
  gesture(type: GestureTypes, pointers: {
153
276
  x: number;
154
277
  y: number;
278
+ delta?: number;
155
279
  }[], final: boolean): void;
156
280
  /**
157
281
  * 意图要触发 pan 手势(滑动屏幕), 可以通过 `return false` 阻止
@@ -183,15 +307,17 @@ export declare type ControllerEventTypes = {
183
307
  * 意图要触发 tap 手势(点击屏幕), 可以通过 `return false` 阻止
184
308
  * @param raycaster - 点击对应的三维射线
185
309
  * @param tapPosition - 点击对应的屏幕位置
310
+ * @param final - 是否手势结束
186
311
  * @returns 可以通过 `return false` 阻止
187
312
  */
188
- wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2): void | false;
313
+ wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void | false;
189
314
  /**
190
315
  * tap 手势(点击屏幕) 被触发
191
316
  * @param raycaster - 点击对应的三维射线
192
317
  * @param tapPosition - 点击对应的屏幕位置
318
+ * @param final - 是否手势结束
193
319
  */
194
- tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2): void;
320
+ tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void;
195
321
  /**
196
322
  * 意图要触发 pinch 手势(双指缩放),可以通过 `return false` 阻止
197
323
  * @param scale - 缩放数值
@@ -200,6 +326,23 @@ export declare type ControllerEventTypes = {
200
326
  * @returns 可以通过 `return false` 阻止
201
327
  */
202
328
  wantsPinchGesture(scale: number, nextFov: number, final: boolean): void | false;
329
+ /**
330
+ * 意图要触发 press 手势(长按屏幕), 可以通过 `return false` 阻止
331
+ * @param raycaster - 长按对应的三维射线
332
+ * @param tapPosition - 长按对应的屏幕位置
333
+ * @param duration - 长按持续时间
334
+ * @param final - 是否手势结束
335
+ * @returns 可以通过 `return false` 阻止
336
+ */
337
+ wantsPressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void | false;
338
+ /**
339
+ * tap 手势(点击屏幕) 被触发
340
+ * @param raycaster - 点击对应的三维射线
341
+ * @param tapPosition - 点击对应的屏幕位置
342
+ * @param duration - 长按持续时间
343
+ * @param final - 是否手势结束
344
+ */
345
+ pressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void;
203
346
  /**
204
347
  * pinch 手势(双指缩放) 被触发
205
348
  * @param scale - 缩放数值
@@ -269,80 +412,48 @@ export declare type ControllerEventTypes = {
269
412
  * @param panoIndex - 加载点位下标
270
413
  * @param observer - 对应的 observer 详情
271
414
  */
272
- textureLoaded(panoIndex: number, observer: WorkObserver): void;
415
+ textureLoaded(panoIndex: number, observer: WorkObserver, meta: (NetWorkMeta | null)[]): void;
273
416
  /**
274
417
  * 抛出错误
275
418
  * @param error - 抛出错误
276
419
  */
277
420
  error(error: Error): void;
421
+ /**
422
+ * webXR模式开始,webxr session完成坐标系矫正
423
+ */
424
+ webXRSessionStart(): void;
425
+ /**
426
+ * webXR模式结束,webxr session销毁
427
+ */
428
+ webXRSessionEnd(): void;
429
+ /**
430
+ * webXR模式结束,webxr session销毁
431
+ */
432
+ webXRSelected(type: WebXRSelectType): void;
278
433
  };
279
434
 
435
+ /**
436
+ * URL 地址的转换
437
+ * @param source - url 原地址
438
+ * @param options - url 转换参数
439
+ * @returns url 转换结果
440
+ */
441
+ export declare function defaultImageURLTransform(source: string, options: ImageURLOptions): string;
442
+
280
443
  export declare interface DepthPanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
281
444
  /** 最远可移动观察点距离 */
282
445
  maxAccessibleDistance?: number;
446
+ /**
447
+ * 点击地面观察点标识的判定范围
448
+ * @description
449
+ * 如果在判定范围内则确定去到目标点,
450
+ * 否则寻找点击位置方向最适合的点(可能会走到一个离相机更近的点)。
451
+ */
452
+ panoTapTriggerRadius?: number;
283
453
  /** 地面观察点标识自定义创建器 */
284
454
  panoCircleMeshCreator?: () => PanoCircleMeshInterface;
285
455
  }
286
456
 
287
- /**
288
- * 动画变化曲线
289
- */
290
- export declare const Easing: {
291
- Linear: {
292
- None: (amount: number) => number;
293
- };
294
- Quadratic: {
295
- In: (amount: number) => number;
296
- Out: (amount: number) => number;
297
- InOut: (amount: number) => number;
298
- };
299
- Cubic: {
300
- In: (amount: number) => number;
301
- Out: (amount: number) => number;
302
- InOut: (amount: number) => number;
303
- };
304
- Quartic: {
305
- In: (amount: number) => number;
306
- Out: (amount: number) => number;
307
- InOut: (amount: number) => number;
308
- };
309
- Quintic: {
310
- In: (amount: number) => number;
311
- Out: (amount: number) => number;
312
- InOut: (amount: number) => number;
313
- };
314
- Sinusoidal: {
315
- In: (amount: number) => number;
316
- Out: (amount: number) => number;
317
- InOut: (amount: number) => number;
318
- };
319
- Exponential: {
320
- In: (amount: number) => number;
321
- Out: (amount: number) => number;
322
- InOut: (amount: number) => number;
323
- };
324
- Circular: {
325
- In: (amount: number) => number;
326
- Out: (amount: number) => number;
327
- InOut: (amount: number) => number;
328
- };
329
- Elastic: {
330
- In: (amount: number) => number;
331
- Out: (amount: number) => number;
332
- InOut: (amount: number) => number;
333
- };
334
- Back: {
335
- In: (amount: number) => number;
336
- Out: (amount: number) => number;
337
- InOut: (amount: number) => number;
338
- };
339
- Bounce: {
340
- In: (amount: number) => number;
341
- Out: (amount: number) => number;
342
- InOut: (amount: number) => number;
343
- };
344
- };
345
-
346
457
  /**
347
458
  * Five 事件列表
348
459
  * @description
@@ -363,19 +474,25 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
363
474
  */
364
475
  error(error: Error): void;
365
476
  /**
366
- * 开始加载 Work 数据
477
+ * 准备加载 Work 数据
367
478
  * @param input - 输入的 work
368
479
  * @param work - 归一化的标准 work
369
480
  * @param state - 加载时的姿态
370
481
  */
371
- willLoad(input: any, work: Work, state: Omit<State, "offset">): void;
482
+ willLoad(input: any, work: Work, state: Omit<State, "offset" | "distance">): void;
372
483
  /**
373
484
  * 开始加载 Work 数据
374
485
  * @param input - 输入的 work
375
486
  * @param work - 归一化的标准 work
376
487
  * @param state - 加载时的姿态
377
488
  */
378
- load(input: any, work: Work, state: Omit<State, "offset">): void;
489
+ load(input: any, work: Work, state: Omit<State, "offset" | "distance">): void;
490
+ /**
491
+ * 加载完 Work 数据
492
+ * @param input - 输入的 work
493
+ * @param work - 归一化的标准 work
494
+ */
495
+ loaded(input: any, work: Work): void;
379
496
  /**
380
497
  * 模型开始加载
381
498
  * @param workModel - 归一化的标准 work 中的 model 值
@@ -410,8 +527,16 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
410
527
  * @param model - 加载完的 model 本质是一个 {@link PBMGroup}
411
528
  */
412
529
  modelLoaded(model: Model): void;
413
- /** 每帧渲染完成 */
414
- renderFrame(): void;
530
+ /**
531
+ * 模型楼层切换
532
+ * @param shownFloor - 模型楼层
533
+ */
534
+ modelShownFloorChange(shownFloor: number | null, totalFloorLength: number): void;
535
+ /**
536
+ * 渲染循环
537
+ * @param rendered - 是否渲染了
538
+ */
539
+ renderFrame(rendered: boolean): void;
415
540
  /**
416
541
  * 当前 fps 变化
417
542
  * @param fps - 当前刷新率
@@ -469,8 +594,21 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
469
594
  * @param prevMode - 上本质是一个模态
470
595
  * @param panoIndex - 初始化动画结束后的点位下标
471
596
  * @param toPose - 初始化动画结束后的状态
597
+ * @param userAction - 是否用户触发
472
598
  */
473
- modeChange(mode: Mode, prevMode: Mode, panoIndex: number, toPose: Pose): void;
599
+ modeChange(mode: Mode, prevMode: Mode, panoIndex: number, toPose: Pose, userAction: boolean): void;
600
+ /**
601
+ * 帮助元素显应的变换
602
+ * @param visible - 帮助元素的是否开启
603
+ */
604
+ helpersVisibleChange(visible: boolean): void;
605
+ /**
606
+ * 网络资源分析
607
+ * @param source - 资源地址
608
+ * @param state - 状态
609
+ * @param detail - 详情
610
+ */
611
+ network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
474
612
  /** five 被析构。 插件中请监听用于自身析构 */
475
613
  dispose(): void;
476
614
  };
@@ -489,6 +627,7 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
489
627
  * ```
490
628
  */
491
629
  export declare class Five extends Subscribe<EventTypes> {
630
+ static get version(): string;
492
631
  /**
493
632
  * Five 的显示模式,可以通过 `five.changeMode` `five.setState` 来切换
494
633
  * @description
@@ -499,67 +638,15 @@ export declare class Five extends Subscribe<EventTypes> {
499
638
  * Topview 户型图模式
500
639
  * DepthPanorama 深度图游走模式
501
640
  * VRPanorama VR眼镜模式
641
+ * XRPanorama VR硬件模式
502
642
  * ```
503
643
  */
504
644
  static Mode: Mirror<Mode>;
505
- /** Five 线条*/
506
- static FiveLine: typeof FiveLine;
507
- /** Five 的动画函数*/
508
- static Easing: {
509
- Linear: {
510
- None: (amount: number) => number;
511
- };
512
- Quadratic: {
513
- In: (amount: number) => number;
514
- Out: (amount: number) => number;
515
- InOut: (amount: number) => number;
516
- };
517
- Cubic: {
518
- In: (amount: number) => number;
519
- Out: (amount: number) => number;
520
- InOut: (amount: number) => number;
521
- };
522
- Quartic: {
523
- In: (amount: number) => number;
524
- Out: (amount: number) => number;
525
- InOut: (amount: number) => number;
526
- };
527
- Quintic: {
528
- In: (amount: number) => number;
529
- Out: (amount: number) => number;
530
- InOut: (amount: number) => number;
531
- };
532
- Sinusoidal: {
533
- In: (amount: number) => number;
534
- Out: (amount: number) => number;
535
- InOut: (amount: number) => number;
536
- };
537
- Exponential: {
538
- In: (amount: number) => number;
539
- Out: (amount: number) => number;
540
- InOut: (amount: number) => number;
541
- };
542
- Circular: {
543
- In: (amount: number) => number;
544
- Out: (amount: number) => number;
545
- InOut: (amount: number) => number;
546
- };
547
- Elastic: {
548
- In: (amount: number) => number;
549
- Out: (amount: number) => number;
550
- InOut: (amount: number) => number;
551
- };
552
- Back: {
553
- In: (amount: number) => number;
554
- Out: (amount: number) => number;
555
- InOut: (amount: number) => number;
556
- };
557
- Bounce: {
558
- In: (amount: number) => number;
559
- Out: (amount: number) => number;
560
- InOut: (amount: number) => number;
561
- };
562
- };
645
+ /**
646
+ * @deprecated
647
+ * 请使用 `import { Line } from "@realsee/five/line"` 代替;
648
+ */
649
+ static Line: any;
563
650
  /**
564
651
  * 自动播放状态是否暂停
565
652
  * @description
@@ -571,9 +658,9 @@ export declare class Five extends Subscribe<EventTypes> {
571
658
  /** 当前展示的模式 */
572
659
  currentMode?: Mode;
573
660
  /** 内部使用的 `THREE.Scene` */
574
- scene: FiveScene;
661
+ scene: Scene;
575
662
  /** 内部使用的 `Camera` */
576
- camera: FiveCamera;
663
+ camera: Camera;
577
664
  /**
578
665
  * 当前设置的 `scissor`
579
666
  * @description
@@ -592,11 +679,9 @@ export declare class Five extends Subscribe<EventTypes> {
592
679
  * 如果初始化时传入了 `renderer` 则直接时该值
593
680
  * 否则会通过 `preserveDrawingBuffer` `backgroundColor` `backgroundAlpha` `antialias` 创建一个 `THREE.WebGLRenderer`
594
681
  */
595
- renderer: THREE_2.WebGLRenderer;
682
+ renderer?: THREE_2.WebGLRenderer;
596
683
  /** 当前加载的模型 */
597
684
  model: Model;
598
- /** 当前加载的 work 数据 */
599
- work?: Work;
600
685
  /**
601
686
  * 是否需要渲染
602
687
  * @description
@@ -617,7 +702,7 @@ export declare class Five extends Subscribe<EventTypes> {
617
702
  * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
618
703
  * 平衡加载时间和图片质量
619
704
  */
620
- textureOptions: ImageOptions;
705
+ textureOptions: TextureOptions;
621
706
  /**
622
707
  * 模型贴图的配置参数
623
708
  * @description
@@ -648,21 +733,35 @@ export declare class Five extends Subscribe<EventTypes> {
648
733
  plugins: {
649
734
  [key: string]: FivePluginInstance<any>;
650
735
  };
651
- private ident;
736
+ ident: string;
737
+ private stopAnimationLoop?;
738
+ private fps;
739
+ private helperGroup;
652
740
  private modeChangeDuration;
653
741
  private onlyRenderIfNeeds;
654
- private maxFps;
742
+ private poweredByRealsee;
655
743
  private controller?;
656
744
  private destroyed;
657
745
  private stateSynced;
658
746
  private controllerInits;
659
747
  private panoramaLikeSavedPose;
660
748
  private extraElements;
661
- private moveToPanoQueue?;
662
749
  private getPixelsRenderTarget;
663
- private tweenCoordinates?;
664
750
  private readyCallbacks;
665
751
  private modelPending;
752
+ private syncingState;
753
+ /**
754
+ * 是否开启 IOS EDR 模式
755
+ * 需要客户端配合
756
+ * 并且开启 five.enablepostProcessing = true
757
+ */
758
+ private _enableIOSEDR;
759
+ private lastLoadWorkTask;
760
+ private requestProxy;
761
+ private networkSubscribe;
762
+ private screenBuffer?;
763
+ private analysis?;
764
+ private renderSwitch01;
666
765
  constructor(initArgs?: FiveInitArgs);
667
766
  /**
668
767
  * 析构 five 对象。
@@ -683,6 +782,21 @@ export declare class Five extends Subscribe<EventTypes> {
683
782
  * ```
684
783
  */
685
784
  setScissor(scissor: Scissor): void;
785
+ /**
786
+ * 帮助元素显示/隐藏
787
+ */
788
+ get helperVisible(): boolean;
789
+ set helperVisible(visible: boolean);
790
+ /**
791
+ * 是否开启 IOS EDR 模式
792
+ * 需要客户端配合
793
+ * 并且开启 five.enablepostProcessing = true
794
+ */
795
+ get enableIOSEDR(): boolean;
796
+ set enableIOSEDR(enable: boolean);
797
+ get enablePostProcessing(): boolean;
798
+ set enablePostProcessing(enable: boolean);
799
+ updateConfiguration(args: Pick<FiveInitArgs, "panorama" | "model" | "floorplan" | "topview" | "mapview" | "depthPanorama" | "vrPanorama" | "imageOptions">): void;
686
800
  /**
687
801
  * 将显示区域加载到页面 DOM 中
688
802
  * @description
@@ -720,6 +834,8 @@ export declare class Five extends Subscribe<EventTypes> {
720
834
  * 获取当前相机姿态, 可以使用 getCurrentState 代替
721
835
  */
722
836
  getPose(): Pose;
837
+ getSize(target: THREE_2.Vector2): THREE_2.Vector2;
838
+ getDrawingBufferSize(target: THREE_2.Vector2): THREE_2.Vector2;
723
839
  /**
724
840
  * 移动相机。(不触发点位移动)
725
841
  * @description
@@ -727,9 +843,10 @@ export declare class Five extends Subscribe<EventTypes> {
727
843
  * 会 Promise.reject。运动完成则 Promise.resolve
728
844
  * @param pose - 相机目标位置
729
845
  * @param duration - 动画触发的时常
846
+ * @param userAction - 是否用户触发
730
847
  * @returns Promise 是否移动成功
731
848
  */
732
- updateCamera(pose: Partial<Pose>, duration: number): Promise<void>;
849
+ updateCamera(pose: Partial<Omit<Pose, "offset">>, duration: number, userAction?: boolean): Promise<void>;
733
850
  /**
734
851
  * 获取当前相机经纬度
735
852
  * @deprecated 请使用使用 getPose
@@ -765,10 +882,12 @@ export declare class Five extends Subscribe<EventTypes> {
765
882
  *
766
883
  * // 使用指定解析器
767
884
  * // 会调用这个目录下的 basis_transcoder.js basis_transcoder.wasm 文件作为解析器
768
- * five.initialBasisLoader("https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/");
885
+ * five.initialBasisLoader("https://vr-public.realsee-cdn.cn/release/static/image/release/five/basis/");
769
886
  * ```
770
887
  */
771
888
  initBasisLoader(transcoderResourcePath?: string): void;
889
+ /** 当前加载的 work 数据 */
890
+ get work(): Work;
772
891
  /**
773
892
  * 加载 Work 数据
774
893
  * @param inputWork - Work 数据
@@ -778,15 +897,17 @@ export declare class Five extends Subscribe<EventTypes> {
778
897
  * - State 自定义姿态
779
898
  * @param duration - 切换时间
780
899
  */
781
- load(inputWork: Work | LooseWork | any, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number): Promise<void>;
900
+ load(inputWork: Work | LooseWork | any | Promise<Work | LooseWork | any>, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number, userAction?: boolean): Promise<void>;
901
+ private load_;
782
902
  /**
783
903
  * 切换模态
784
904
  * @param mode - 切换到的模态
785
905
  * @param state - 切换完成时的姿态
786
906
  * @param duration - 模态切换动画用时
787
907
  * @param userAction - 是否时用户动作触发 默认 true
908
+ * @param force - 必须重新初始化 controller
788
909
  */
789
- changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, duration?: number, userAction?: boolean): Promise<void>;
910
+ changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, duration?: number, userAction?: boolean, force?: boolean): Promise<void>;
790
911
  /**
791
912
  * 获取画面中的像素颜色
792
913
  * @param x - 获取像素区域的起始坐标 x
@@ -800,11 +921,7 @@ export declare class Five extends Subscribe<EventTypes> {
800
921
  /**
801
922
  * 获取显示用的画布(Canvas DOM节点)
802
923
  */
803
- getElement(): HTMLCanvasElement;
804
- /**
805
- * 但停自动播放
806
- */
807
- pause(): void;
924
+ getElement(): HTMLCanvasElement | undefined;
808
925
  /**
809
926
  * 强制渲染
810
927
  * @description
@@ -816,7 +933,12 @@ export declare class Five extends Subscribe<EventTypes> {
816
933
  *
817
934
  * @param callback - 渲染完成回调
818
935
  */
819
- render(callback?: () => void): void;
936
+ render(callback?: () => void, updateObjectResolution?: boolean): THREE_2.WebGLRenderTarget;
937
+ updateTime(time: number, deltaTime: number, ...args: any[]): void;
938
+ /**
939
+ * 但停自动播放
940
+ */
941
+ pause(): void;
820
942
  play(): void;
821
943
  /**
822
944
  * 转化到 Panorama 模态,并移动到对应序号的观察点。
@@ -824,7 +946,7 @@ export declare class Five extends Subscribe<EventTypes> {
824
946
  * @param options - 移动点位参数
825
947
  * @param userAction - 是否用户触犯
826
948
  */
827
- moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): void;
949
+ moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): Promise<void>;
828
950
  /**
829
951
  * 预加载点位图片资源
830
952
  * @param panoIndex - 观察点序号
@@ -845,7 +967,7 @@ export declare class Five extends Subscribe<EventTypes> {
845
967
  * 获取当前在屏幕视锥中的 mesh。
846
968
  * @param object - 如果传入则检查这个对象中的mesh,如果不传,则检查整个 scene
847
969
  */
848
- getRenderMeshes(object?: THREE_2.Object3D): THREE_2.Object3D[];
970
+ getRenderObjects(object?: THREE_2.Object3D): THREE_2.Object3D[];
849
971
  getCurrentState(): State;
850
972
  /**
851
973
  * 设置 State
@@ -866,34 +988,32 @@ export declare class Five extends Subscribe<EventTypes> {
866
988
  * ```
867
989
  * @param state - 目标状态
868
990
  * @param immediately - 是否马上转换,马上转换会尽快达到目标状态,尽量减少中间状态,更少动画。
991
+ * @param userAction - 是否是用户触发的动作
869
992
  */
870
- setState(state: Partial<State>, immediately?: boolean): void;
993
+ setState(state: Partial<State>, immediately?: boolean, userAction?: boolean): void;
994
+ aroundScissor(callback: () => void): void;
871
995
  private syncState;
872
- ready(): Promise<void>;
873
- private updateResolution;
996
+ /**
997
+ * 当前页面静态
998
+ */
999
+ ready(args?: {
1000
+ tile?: boolean;
1001
+ }): Promise<void>;
1002
+ /**
1003
+ * 请求全屏
1004
+ */
1005
+ requestFullscreen(): void;
1006
+ /**
1007
+ * 退出全屏
1008
+ */
1009
+ exitFullscreen(): void;
874
1010
  private throwError;
875
1011
  private loadModel;
876
1012
  private commonParams;
877
1013
  private saveControllerPose;
878
1014
  private applyController;
879
- }
880
-
881
- /** Five 相机 */
882
- export declare class FiveCamera extends THREE_2.PerspectiveCamera {
883
- /** 相机姿态 */
884
- pose: Pose;
885
- constructor(fov: number);
886
- /** 通过相机参数反算姿态 */
887
- computePose(): void;
888
- /** 设置相机姿态 */
889
- setFromPose(pose: Partial<Pose>): void;
890
- /** 拷贝相机姿态 */
891
- copyPose(): Pose;
892
- }
893
-
894
- export declare class FiveHashCubeTexture extends THREE_2.CubeTexture {
895
- /** 识别哈希 */
896
- hash: string;
1015
+ /** 移除事件绑定 */
1016
+ private removeEventListeners;
897
1017
  }
898
1018
 
899
1019
  /** Five 初始化参数 */
@@ -979,7 +1099,7 @@ export declare interface FiveInitArgs {
979
1099
  * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
980
1100
  * 平衡加载时间和图片质量
981
1101
  */
982
- textureOptions?: ImageOptions;
1102
+ textureOptions?: TextureOptions;
983
1103
  /**
984
1104
  * 是否按需渲染
985
1105
  * @description
@@ -1009,7 +1129,7 @@ export declare interface FiveInitArgs {
1009
1129
  *
1010
1130
  * // 使用指定解析器
1011
1131
  * // 会调用这个目录下的 basis_transcoder.js basis_transcoder.wasm 文件作为解析器
1012
- * initialBasisLoader: "https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/"
1132
+ * initialBasisLoader: "https://vr-public.realsee-cdn.cn/release/static/image/release/five/basis/"
1013
1133
  * ```
1014
1134
  */
1015
1135
  initialBasisLoader?: boolean | string;
@@ -1029,15 +1149,19 @@ export declare interface FiveInitArgs {
1029
1149
  floorplan?: ControllerCustomInitTypes["Floorplan"];
1030
1150
  /** 户型图模式下的特定参数 */
1031
1151
  topview?: ControllerCustomInitTypes["Topview"];
1152
+ /** 地图模式下的特定参数 */
1153
+ mapview?: ControllerCustomInitTypes["Mapview"];
1032
1154
  /** 深度图游走模式下的特定参数 */
1033
1155
  depthPanorama?: ControllerCustomInitTypes["DepthPanorama"];
1034
1156
  /** VR眼镜模式下的特定参数 */
1035
1157
  vrPanorama?: ControllerCustomInitTypes["VRPanorama"];
1158
+ /** XR眼镜模式下的特定参数 */
1159
+ xrPanorama?: ControllerCustomInitTypes["XRPanorama"];
1036
1160
  /**
1037
1161
  * 模式间切换时的过度动画时间
1038
1162
  * @description
1039
1163
  * 单位毫秒
1040
- * @default `1000`
1164
+ * @default `800`
1041
1165
  */
1042
1166
  modeChangeDuration?: number;
1043
1167
  /**
@@ -1046,58 +1170,20 @@ export declare interface FiveInitArgs {
1046
1170
  * 详见插件部分。
1047
1171
  */
1048
1172
  plugins?: (FivePlugin<void> | FivePluginInit<FivePlugin<any, any>> | FivePluginInit<FivePlugin<void, any>>)[];
1049
- }
1050
-
1051
- export declare class FiveLine extends THREE_2.Object3D {
1052
- private line;
1053
- private points;
1054
- constructor(vector0?: THREE_2.Vector3, vector1?: THREE_2.Vector3);
1055
- setPoints(vector0: THREE_2.Vector3, vector1: THREE_2.Vector3): void;
1056
- getPoints(): THREE_2.Vector3[];
1057
- setMaterial(map: ConstructorParameters<typeof FiveLineMaterial>[0]): void;
1058
- setResolution(width: number, height: number): void;
1059
- }
1060
-
1061
- export declare class FiveLineGeometry extends FiveLineSegmentsGeometry {
1062
- constructor();
1063
- setPositions(array: ArrayLike<number>): this;
1064
- setColors(array: ArrayLike<number>): this;
1065
- fromLine(line: THREE_2.Line): this;
1066
- copy(): this;
1067
- }
1068
-
1069
- export declare class FiveLineMaterial extends THREE_2.ShaderMaterial {
1070
- color: number | THREE_2.Vector3;
1071
- dashed: boolean;
1072
- dashScale: number;
1073
- dashSize: number;
1074
- gapSize: number;
1075
- resolution: THREE_2.Vector2;
1076
- constructor(parameters: FiveLineMaterialParameters);
1077
- }
1078
-
1079
- export declare type FiveLineMaterialParameters = {
1080
- color?: number | THREE_2.Vector3;
1081
- linewidth?: number;
1082
- dashed?: boolean;
1083
- dashScale?: number;
1084
- dashSize?: number;
1085
- gapSize?: number;
1086
- resolution?: THREE_2.Vector2;
1087
- };
1088
-
1089
- export declare class FiveLineSegmentsGeometry extends THREE_2.InstancedBufferGeometry {
1090
- constructor();
1091
- applyMatrix4(matrix: THREE_2.Matrix4): this;
1092
- setPositions(array: ArrayLike<number> | number[]): this;
1093
- setColors(array: Float32Array | number[]): this;
1094
- fromWireframeGeometry(geometry: THREE_2.WireframeGeometry): this;
1095
- fromEdgesGeometry(geometry: THREE_2.EdgesGeometry): this;
1096
- fromMesh(mesh: THREE_2.Mesh): this;
1097
- fromLineSegments(lineSegments: THREE_2.LineSegments): this;
1098
- computeBoundingBox(): void;
1099
- computeBoundingSphere(): void;
1100
- toJSON(): void;
1173
+ /**
1174
+ * 是否展示 powered by 如视
1175
+ */
1176
+ poweredByRealsee?: boolean;
1177
+ /**
1178
+ * 是否使用webgl2渲染执行环境, 默认值 false
1179
+ */
1180
+ webgl2?: boolean;
1181
+ /**
1182
+ * 请求代理
1183
+ * @param url - 发起的请求
1184
+ * @returns 返回的请求
1185
+ */
1186
+ requestProxy?(url: string): string;
1101
1187
  }
1102
1188
 
1103
1189
  /**
@@ -1127,10 +1213,6 @@ parameters: Parameters<T>[1]
1127
1213
  */
1128
1214
  export declare type FivePluginInstance<T extends FivePlugin<any, any>> = ReturnType<T>;
1129
1215
 
1130
- /** Five 场景*/
1131
- export declare class FiveScene extends THREE_2.Scene {
1132
- }
1133
-
1134
1216
  export declare interface FloorplanControllerCustomInitArgs {
1135
1217
  /** 默认偏航角 */
1136
1218
  defaultLongitude?: number;
@@ -1148,7 +1230,7 @@ export declare interface FloorplanControllerCustomInitArgs {
1148
1230
  minFov?: number;
1149
1231
  }
1150
1232
 
1151
- export declare type GestureTypes = "pan" | "tap" | "pinch" | "mouseWheel";
1233
+ export declare type GestureTypes = "pan" | "tap" | "pinch" | "press" | "mouseWheel";
1152
1234
 
1153
1235
  export declare function getViewportScale(): number;
1154
1236
 
@@ -1156,33 +1238,65 @@ export declare function getViewportScale(): number;
1156
1238
  * 图片参数
1157
1239
  */
1158
1240
  export declare interface ImageOptions {
1159
- key?: string;
1160
1241
  /**
1161
1242
  * url 地址转化
1162
1243
  * @param url - 原始地址
1163
1244
  * @param options - 当前地址参数
1164
1245
  * @returns 转化后地址
1165
1246
  */
1166
- transform?: (url: string, options: ImageOptions) => string;
1167
- /** 图片尺寸参数 */
1247
+ transform?: (url: string, options: ImageURLOptions) => string;
1248
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 512 1024 2048 */
1168
1249
  size?: number;
1169
1250
  /** 图片质量参数(0-100) */
1170
1251
  quality?: number;
1171
- /** 图片格式参数(jpg, png) */
1172
- format?: string;
1173
- /** basis loader 是否初始化完成 */
1174
- basisLoaderInitialized?: boolean;
1175
- /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
1176
- autoResize?: boolean;
1252
+ /** 图片格式参数 */
1253
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
1254
+ /** 锐化参数 海外不支持 */
1255
+ sharpen?: number;
1256
+ mappings?: ImageURLMappings;
1257
+ }
1258
+
1259
+ export declare function imageSupport(): Promise<{
1260
+ avif: boolean;
1261
+ webp: boolean;
1262
+ }>;
1263
+
1264
+ export declare interface ImageURLMappings {
1265
+ [publicDomain: string]: {
1266
+ "pano": [string, string];
1267
+ "tile": [string, string];
1268
+ "texture": [string];
1269
+ "default": [string];
1270
+ };
1271
+ }
1272
+
1273
+ export declare interface ImageURLOptions {
1274
+ /** 图片类型标识 */
1275
+ key: string;
1276
+ /** basisLoader 是否初始化完成 */
1277
+ basisLoaderInitialized: boolean;
1278
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
1279
+ size?: number;
1280
+ /** 图片质量参数(0-100) */
1281
+ quality?: number;
1282
+ /** 图片格式参数 */
1283
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
1284
+ /** 图片裁切 */
1285
+ cut?: [x: number, y: number, width: number, height: number];
1286
+ /** 锐化参数 海外不支持 */
1287
+ sharpen?: number;
1288
+ /** url匹配规则 */
1289
+ mappings?: ImageURLMappings;
1177
1290
  }
1178
1291
 
1179
1292
  export declare class InternalWebGLRenderer extends THREE_2.WebGLRenderer {
1180
- constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias }: {
1293
+ constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias, webgl2 }: {
1181
1294
  preserveDrawingBuffer?: boolean;
1182
1295
  backgroundColor?: number | THREE_2.Color;
1183
1296
  backgroundAlpha?: number;
1184
1297
  pixelRatio?: number;
1185
1298
  antialias?: boolean;
1299
+ webgl2?: boolean;
1186
1300
  });
1187
1301
  }
1188
1302
 
@@ -1197,10 +1311,42 @@ export declare interface Intersection {
1197
1311
  distance: number;
1198
1312
  }
1199
1313
 
1314
+ export declare class IntersectMesh extends THREE_2.Object3D implements IntersectMeshInterface {
1315
+ private ringMesh;
1316
+ constructor();
1317
+ dispose(): void;
1318
+ }
1319
+
1320
+ /**
1321
+ * 地面提示点位接口
1322
+ */
1200
1323
  export declare interface IntersectMeshInterface extends THREE_2.Object3D {
1201
1324
  dispose(): void;
1202
1325
  }
1203
1326
 
1327
+ export declare class LegacyPanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
1328
+ needsRender: boolean;
1329
+ hitTestMesh: THREE_2.Mesh<THREE_2.BufferGeometry, THREE_2.MeshBasicMaterial>;
1330
+ current: boolean;
1331
+ loading: boolean;
1332
+ disabled: boolean;
1333
+ progress: number;
1334
+ opacity: number;
1335
+ private centerMesh;
1336
+ private loadingMesh;
1337
+ private progressMotion;
1338
+ private opacityMotion;
1339
+ private stopInterval?;
1340
+ constructor();
1341
+ setLoading(shown: boolean): void;
1342
+ setDisabled(disabled: boolean): void;
1343
+ setProgress(progress: number): void;
1344
+ setOpacity(opacity: number): void;
1345
+ setCurrent(current: boolean): void;
1346
+ updateTime(time: number, deltaTime: number): void;
1347
+ dispose(): void;
1348
+ }
1349
+
1204
1350
  export declare type LooseWork = {
1205
1351
  bvh?: boolean;
1206
1352
  modelAsync?: boolean;
@@ -1258,7 +1404,15 @@ export declare type LooseWorkPanorama = {
1258
1404
  front: string;
1259
1405
  back: string;
1260
1406
  video?: LooseWorkVideo;
1261
- tiles?: string;
1407
+ luminance?: {
1408
+ up: string;
1409
+ down: string;
1410
+ right: string;
1411
+ left: string;
1412
+ front: string;
1413
+ back: string;
1414
+ };
1415
+ tiles?: number[];
1262
1416
  };
1263
1417
 
1264
1418
  export declare type LooseWorkVideo = {
@@ -1267,6 +1421,23 @@ export declare type LooseWorkVideo = {
1267
1421
  size: number[];
1268
1422
  };
1269
1423
 
1424
+ export declare interface MapviewControllerCustomInitArgs {
1425
+ /** 默认偏航角 */
1426
+ defaultLongitude?: number;
1427
+ /** 默认俯仰角 */
1428
+ defaultLatitude?: number;
1429
+ /** 默认相机距离 */
1430
+ defaultDistance?: number;
1431
+ /** 最大俯仰角 */
1432
+ maxLatitude?: number;
1433
+ /** 最小俯仰角 */
1434
+ minLatitude?: number;
1435
+ /** 最大相机距离 */
1436
+ maxDistance?: number;
1437
+ /** 最小相机距离 */
1438
+ minDistance?: number;
1439
+ }
1440
+
1270
1441
  export declare type Mirror<T extends string> = Record<T, T>;
1271
1442
 
1272
1443
  /**
@@ -1275,6 +1446,7 @@ export declare type Mirror<T extends string> = Record<T, T>;
1275
1446
  * - **Model**: 模型游走模式
1276
1447
  * - **Floorplan**: 模型查看模式
1277
1448
  * - **Topview**: 户型图模式
1449
+ * - **Mapview**: 地图模式
1278
1450
  * - **DepthPanorama**: 深度图游走模式
1279
1451
  * - **VRPanorama**: VR眼镜模式
1280
1452
  */
@@ -1283,6 +1455,8 @@ export declare type Mode =
1283
1455
  "Floorplan" |
1284
1456
  /** 户型图模式 */
1285
1457
  "Topview" |
1458
+ /** 地图模式 */
1459
+ "Mapview" |
1286
1460
  /** 全景图游走模式 */
1287
1461
  "Panorama" |
1288
1462
  /** VR眼镜模式 */
@@ -1290,7 +1464,9 @@ export declare type Mode =
1290
1464
  /** 模型游走模式 */
1291
1465
  "Model" |
1292
1466
  /** 深度图游走模式 */
1293
- "DepthPanorama";
1467
+ "DepthPanorama" |
1468
+ /** XR眼镜模式*/
1469
+ "XRPanorama";
1294
1470
 
1295
1471
  /**
1296
1472
  * Five 模型
@@ -1300,7 +1476,7 @@ export declare type Mode =
1300
1476
  * 需要满足 your/path/filename.at3d.json_xxxxxx,
1301
1477
  * 通过 json_xxxxxx(<dataURL>) 方式返回。
1302
1478
  */
1303
- export declare class Model extends PBMGroup implements Subscribe<ModelEventType> {
1479
+ export declare class Model extends PBMContainer implements Subscribe<ModelEventType> {
1304
1480
  /** 是否加载完成 */
1305
1481
  loaded: boolean;
1306
1482
  /** 是否未加载 */
@@ -1308,7 +1484,13 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1308
1484
  /** 外接盒子的大小 */
1309
1485
  bounding: THREE_2.Box3;
1310
1486
  /** 当前显示的楼层 */
1311
- shownfloor: number | null;
1487
+ shownFloor: number | null;
1488
+ /** 楼层的数量 */
1489
+ floorLength: number;
1490
+ /** 模型瓦片 */
1491
+ originModel?: PBMContainer;
1492
+ /** 模型瓦片 */
1493
+ tiledModel?: Tile3DModel;
1312
1494
  /**
1313
1495
  * 判断是否注册了事件
1314
1496
  * 具体可查看 {@link Subscribe.hasListener}
@@ -1335,18 +1517,48 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1335
1517
  */
1336
1518
  emit: SubscribeMixinType.emit<ModelEventType>;
1337
1519
  /** bvh 树的计算结果 */
1338
- bvhs: any[] & {
1339
- loaded?: boolean;
1520
+ bvhs: BVH[] & {
1521
+ loaded: boolean;
1340
1522
  };
1341
- constructor();
1523
+ /** 网络代理 */
1524
+ private requestProxy?;
1525
+ /** 网络跟踪 */
1526
+ private networkSubscribe?;
1527
+ /** 安全域名 */
1528
+ private allowHosts?;
1529
+ constructor(options?: {
1530
+ networkSubscribe?: NetworkSubscribe;
1531
+ requestProxy?: (url: string) => string;
1532
+ allowHosts?: string[];
1533
+ });
1534
+ /**
1535
+ * 当前显示的楼层
1536
+ * @deprecated
1537
+ * 请用 shwonFloor 代替
1538
+ */
1539
+ get shownfloor(): number | null;
1540
+ /**
1541
+ * 当前模型是否支持瓦片
1542
+ */
1543
+ get hasTiles(): boolean;
1544
+ /**
1545
+ * 是否开启瓦片
1546
+ */
1547
+ get enableTiles(): boolean;
1548
+ set enableTiles(enable: boolean);
1342
1549
  /**
1343
1550
  * 获取模型边界线
1344
1551
  * @param threshold - 面片间夹角阈值
1345
1552
  * @returns 所有模型边界线
1346
1553
  */
1347
1554
  getEdges(threshold?: number): THREE_2.Line3[];
1348
- /** 获取当前楼层数 */
1555
+ /**
1556
+ * 获取当前楼层数
1557
+ * @deprecated
1558
+ * 请使用 floorLength 参数代替
1559
+ */
1349
1560
  hasFloors(): number;
1561
+ private hasFloors_;
1350
1562
  /**
1351
1563
  * 显示某楼层
1352
1564
  * @example
@@ -1357,7 +1569,9 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1357
1569
  * ```
1358
1570
  */
1359
1571
  show(): void;
1360
- show(floorIndex: number, hideOpacity?: number): void;
1572
+ show(floorIndex: number, hiddenOpacity?: number): void;
1573
+ private at3dShow;
1574
+ private b3dmShow;
1361
1575
  /**
1362
1576
  * 计算模型射线碰撞检测
1363
1577
  * @param raycaster - THREE 射线对象
@@ -1365,13 +1579,14 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1365
1579
  * @returns 返回碰撞
1366
1580
  */
1367
1581
  intersectRaycaster(raycaster: THREE_2.Raycaster, floors?: number | number[]): Intersection[];
1368
- buildBVH(): Promise<void>;
1582
+ buildBVH(): void;
1369
1583
  /**
1370
1584
  * 加载模型
1371
1585
  * @param workModel - work 的 model 内容
1372
1586
  * @param imageOptions - 图片参数
1373
1587
  */
1374
- load(workModel: WorkModel, imageOptions?: ImageOptions): void;
1588
+ load(workModel: WorkModel, textureOptions?: TextureOptions): Promise<void>;
1589
+ update(renderer: THREE_2.WebGLRenderer, camera: THREE_2.PerspectiveCamera): void;
1375
1590
  /**
1376
1591
  * 析构函数
1377
1592
  * @description
@@ -1410,6 +1625,11 @@ export declare type ModelEventType = {
1410
1625
  materialLoaded(): void;
1411
1626
  /** 模型加载完成 */
1412
1627
  loaded(): void;
1628
+ /**
1629
+ * 显示楼层改变
1630
+ * @param shownFloor - 显示的楼层
1631
+ */
1632
+ shownFloorChange(shownFloor: number | null, totalFloorLength: number): void;
1413
1633
  /**
1414
1634
  * 内部错误
1415
1635
  * @param error - 错误对象
@@ -1428,9 +1648,10 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1428
1648
  * @description
1429
1649
  * - `fly` 通过相机移动方式变化
1430
1650
  * - `fade` 通过渐变方式变化
1651
+ * - `montage` 通过渐变穿插到黑屏方式变化
1431
1652
  * - `instant` 通过插入黑屏方式变化
1432
1653
  */
1433
- effect?: "fly" | "fade" | "instant";
1654
+ effect?: "fly" | "fade" | "montage" | "instant";
1434
1655
  /**
1435
1656
  * 运动耗时
1436
1657
  * @description
@@ -1456,15 +1677,84 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1456
1677
  moveCancelCallback?: () => void;
1457
1678
  }
1458
1679
 
1680
+ export declare type NetWorkMeta = {
1681
+ source: string;
1682
+ headers: {
1683
+ [name: string]: string;
1684
+ };
1685
+ requestTime: number;
1686
+ responseTime: number;
1687
+ costs: number;
1688
+ size?: number;
1689
+ };
1690
+
1691
+ export declare type NetworkState = "ok" | "preload" | "error" | "timeout" | "forbidden";
1692
+
1693
+ export declare class NetworkSubscribe extends Subscribe<{
1694
+ network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
1695
+ }> {
1696
+ }
1697
+
1698
+ export declare type NetworkType = "XMLHttpRequest" | "Script" | "Image" | "Link";
1699
+
1700
+ export declare class PanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
1701
+ needsRender: boolean;
1702
+ private loadingMesh;
1703
+ private disableMesh;
1704
+ private centerMesh;
1705
+ private ringMesh;
1706
+ private progressMesh;
1707
+ private ringRotateMotion;
1708
+ private tapMotion;
1709
+ private progressMotion;
1710
+ private progressOpacityMotion;
1711
+ private opacityMotion;
1712
+ progress: number;
1713
+ opacity: number;
1714
+ current: boolean;
1715
+ loading: boolean;
1716
+ disabled: boolean;
1717
+ constructor();
1718
+ setProgress(progress: number): void;
1719
+ setOpacity(opacity: number): void;
1720
+ setCurrent(current: boolean): void;
1721
+ setLoading(loading: boolean): void;
1722
+ setDisabled(disabled: boolean): void;
1723
+ tap(): Promise<void>;
1724
+ updateTime(time: number, deltaTime: number): void;
1725
+ dispose(): void;
1726
+ }
1727
+
1728
+ /**
1729
+ * 地面提示点位接口
1730
+ *
1731
+ * 点位状态
1732
+ * 1. 默认状态: 无任何操作的情况
1733
+ * 2. 高亮状态: 高亮,认为是合适的下一个点位,或者设备选中了某个点位
1734
+ * 3. 进度状态: 点位加载中,存在进度的情况
1735
+ * 4. 加载状态: 点位加载中,不存在进度的情况
1736
+ * 5. 不可用状态:点位不可用,存在点位,但是点位是个摆设
1737
+ * 6. 点击动画: 点位被选择,触发全景图切换
1738
+ * 7. 透明度改变: 一般会处理为近的点位透明度高,远的点位透明度低
1739
+ */
1459
1740
  export declare interface PanoCircleMeshInterface extends THREE_2.Object3D {
1460
1741
  needsRender: boolean;
1742
+ hitTestMesh?: THREE_2.Mesh;
1743
+ /** 当前高亮 */
1744
+ current: boolean;
1745
+ /** 是否当前高亮 */
1746
+ setCurrent(current: boolean): void;
1461
1747
  loading: boolean;
1748
+ setLoading(loading: boolean): void;
1462
1749
  disabled: boolean;
1463
- panoIndex: number;
1464
- setLoading(shown: boolean): void;
1465
1750
  setDisabled(disabled: boolean): void;
1751
+ progress: number;
1466
1752
  setProgress(progress: number): void;
1753
+ opacity: number;
1467
1754
  setOpacity(opacity: number): void;
1755
+ updateTime?(time: number, deltaTime: number): void;
1756
+ /** 点击交互 */
1757
+ tap?(): Promise<void>;
1468
1758
  dispose(): void;
1469
1759
  }
1470
1760
 
@@ -1480,6 +1770,13 @@ export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeCo
1480
1770
  panoTapTriggerRadius?: number;
1481
1771
  /** 地面观察点标识自定义创建器 */
1482
1772
  panoCircleMeshCreator?: () => PanoCircleMeshInterface;
1773
+ /**
1774
+ * 全景瓦片登记
1775
+ * @param fov - 当前 fov
1776
+ * @param viewSize - 当前绘制区域大小
1777
+ * @returns 返回瓦片等级
1778
+ */
1779
+ tileLevelForFov?: false | ((fov: number, viewSize: THREE_2.Vector2) => number);
1483
1780
  }
1484
1781
 
1485
1782
  export declare interface PanoramaLikeControllerCustomInitArgs {
@@ -1507,14 +1804,31 @@ export declare interface PanoramaLikeControllerCustomInitArgs {
1507
1804
  intersectMeshCreator?: () => IntersectMeshInterface;
1508
1805
  }
1509
1806
 
1510
- export declare function parseWork(obj: Work | LooseWork | any): Work;
1807
+ /**
1808
+ * 解析 Work 数据
1809
+ * @param obj - work 数据,从如数开发者平台获取
1810
+ * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
1811
+ * @param urlTransform - 配置参数, URL 解析规则
1812
+ * @returns - 签署过的 Work 数据结构
1813
+ */
1814
+ export declare function parseWork(obj: Work | LooseWork | string | any, options?: ParseWorkOptions, urlTransform?: (origin: string, absolute: string, relative: string, type: "panorama" | "texture" | "model") => void): Work;
1815
+
1816
+ export declare type ParseWorkOptions = {
1817
+ /** 重写 work 中的资源前缀 */
1818
+ baseURL?: string;
1819
+ /** work 中的资源地址使用短地址 */
1820
+ shortPath?: boolean;
1821
+ /** work 中的资源使用 jsonp 方式发布 */
1822
+ jsonp?: boolean;
1823
+ /** work 中模型是否计算bvh碰撞数,默认计算 true */
1824
+ modelBvh?: boolean;
1825
+ };
1511
1826
 
1512
1827
  /** PBM 模型组 */
1513
- export declare class PBMGroup extends THREE_2.Group {
1514
- /** 楼层序号 */
1515
- floorIndex: number;
1828
+ export declare class PBMContainer extends THREE_2.Group {
1516
1829
  /** 是否需要更新按需渲染 */
1517
1830
  needsRender: boolean;
1831
+ private enableTransparent;
1518
1832
  /** 获取是否有透明参数 */
1519
1833
  getTransparent(): boolean;
1520
1834
  /** 设置透明参数 */
@@ -1529,39 +1843,32 @@ export declare class PBMGroup extends THREE_2.Group {
1529
1843
  disposeGeometry(): void;
1530
1844
  }
1531
1845
 
1846
+ /** PBM 模型组 */
1847
+ export declare class PBMGroup extends PBMContainer {
1848
+ /** 楼层序号 */
1849
+ floorIndex: number;
1850
+ }
1851
+
1532
1852
  /** PBM 材质 */
1533
1853
  export declare class PBMMaterial extends THREE_2.ShaderMaterial implements PBMParameters {
1534
- /** 起始点位全景图 */
1535
- pano0Map: FiveHashCubeTexture | null;
1536
- /** 起始点全景图变换矩阵 4x4 */
1537
- pano0Matrix: THREE_2.Matrix4;
1538
- /** 结束点位全景图 */
1539
- pano1Map: FiveHashCubeTexture | null;
1540
- /** 结束点全景图变换矩阵 4x4 */
1541
- pano1Matrix: THREE_2.Matrix4;
1854
+ /** 起始点 */
1855
+ pano0: PBMPanoPicture | null;
1856
+ /** 结束点 */
1857
+ pano1: PBMPanoPicture | null;
1542
1858
  /** 模型贴图和全景图的混合程度 [0-1] */
1543
1859
  modelAlpha: number;
1544
1860
  /** 全景图混合程度 [0-1] */
1545
1861
  progress: number;
1546
1862
  /** 全景图通过过度黑色混合 */
1547
1863
  useBlackTransition: boolean;
1864
+ /** XR模式防止申请纹理显存时的黑色过渡 */
1865
+ useXRBlackTransition: boolean;
1548
1866
  perspToOrtho: number;
1549
1867
  /** 模型透明度 */
1550
1868
  opacity: number;
1551
- /** 起始点位深度, 需要使用深度参与计算全景图混合的话 */
1552
- pano0DepthMap: THREE_2.CubeTexture | null;
1553
- /** 全景视频贴图 */
1554
- panoVideoMap: THREE_2.VideoTexture | null;
1555
- /** 全景视频尺寸 */
1556
- panoVideoSize: THREE_2.Vector2;
1557
- /** 全景视频贴图变换矩阵 */
1558
- panoVideoMatrix: THREE_2.Matrix4;
1559
- /** 全景视频透明度 [0-1] */
1560
- panoVideoAlpha: number;
1561
- /** 瓦片材质 */
1562
- panoTileMap: THREE_2.Texture | null;
1563
- /** 瓦片寻址规则 */
1564
- panoTileMappings: THREE_2.Vector4[][] | null;
1869
+ originOpacity: number;
1870
+ /** 楼层切割参数*/
1871
+ floorInfo: THREE_2.Vector3 | null;
1565
1872
  constructor(parameters?: Partial<PBMParameters>);
1566
1873
  }
1567
1874
 
@@ -1573,39 +1880,34 @@ export declare class PBMMesh extends THREE_2.Mesh<THREE_2.BufferGeometry, PBMMat
1573
1880
  needsRender: boolean;
1574
1881
  }
1575
1882
 
1576
- /** PBM 材质参数 */
1577
- export declare interface PBMParameters {
1883
+ export declare interface PBMPanoPicture {
1578
1884
  /** 起始点位全景图 */
1579
- pano0Map: FiveHashCubeTexture | null;
1885
+ map: THREE_2.CubeTexture;
1886
+ /** 亮度增益 */
1887
+ luminanceMap: THREE_2.CubeTexture | null;
1580
1888
  /** 起始点全景图变换矩阵 4x4 */
1581
- pano0Matrix: THREE_2.Matrix4;
1582
- /** 结束点位全景图 */
1583
- pano1Map: FiveHashCubeTexture | null;
1584
- /** 结束点位全景图变换矩阵 */
1585
- pano1Matrix: THREE_2.Matrix4;
1889
+ matrix: THREE_2.Matrix4;
1890
+ }
1891
+
1892
+ /** PBM 材质参数 */
1893
+ export declare interface PBMParameters {
1894
+ /** 起始点 */
1895
+ pano0: PBMPanoPicture | null;
1896
+ /** 结束点 */
1897
+ pano1: PBMPanoPicture | null;
1586
1898
  /** 模型贴图和全景图的混合程度 [0-1] */
1587
1899
  modelAlpha: number;
1588
1900
  /** 全景图混合程度 [0-1] */
1589
1901
  progress: number;
1590
1902
  /** 全景图通过过度黑色混合 */
1591
1903
  useBlackTransition: boolean;
1904
+ /** XR模式防止申请纹理显存时的黑色过渡 */
1905
+ useXRBlackTransition: boolean;
1592
1906
  perspToOrtho: number;
1593
1907
  /** 模型透明度 */
1594
1908
  opacity: number;
1595
- /** 起始点位深度, 需要使用深度参与计算全景图混合的话 */
1596
- pano0DepthMap: THREE_2.CubeTexture | null;
1597
- /** 全景视频贴图 */
1598
- panoVideoMap: THREE_2.VideoTexture | null;
1599
- /** 全景视频尺寸 */
1600
- panoVideoSize: THREE_2.Vector2;
1601
- /** 全景视频贴图变换矩阵 */
1602
- panoVideoMatrix: THREE_2.Matrix4;
1603
- /** 全景视频透明度 [0-1] */
1604
- panoVideoAlpha: number;
1605
- /** 瓦片材质 */
1606
- panoTileMap: THREE_2.Texture | null;
1607
- /** 瓦片寻址规则 */
1608
- panoTileMappings: THREE_2.Vector4[][] | null;
1909
+ /** 楼层切割参数*/
1910
+ floorInfo?: THREE_2.Vector3 | null;
1609
1911
  }
1610
1912
 
1611
1913
  /**
@@ -1613,17 +1915,25 @@ export declare interface PBMParameters {
1613
1915
  * [[include: coordinate.md]]
1614
1916
  */
1615
1917
  export declare interface Pose {
1616
- /** 相机俯仰角 */
1617
- longitude: number;
1618
1918
  /** 相机偏航角 */
1919
+ longitude: number;
1920
+ /** 相机俯仰角 */
1619
1921
  latitude: number;
1620
1922
  /** 相机可视角度(垂直)*/
1621
1923
  fov: number;
1622
1924
  /** 相机位置*/
1623
1925
  offset: THREE_2.Vector3;
1926
+ /** 相机距离 */
1927
+ distance: number;
1624
1928
  }
1625
1929
 
1626
- export declare const PROXY_CONTROLLER_EVENT_NAMES: readonly ["cameraDirectionUpdate", "cameraUpdate", "cameraPositionUpdate", "panoSelected", "moveToPano", "moveToPanoCanceled", "panoWillArrive", "movingToPano", "panoArrived", "panoWillLoad", "panoLoaded", "panoLoadError", "initAnimationEnded", "initAnimationWillStart", "wantsGesture", "gesture", "wantsTapGesture", "tapGesture", "wantsPanGesture", "wantsInteriaPan", "panGesture", "interiaPan", "wantsPinchGesture", "pinchGesture", "wantsMouseWheel", "mouseWheel", "wantsShowIntersectionOnModel", "intersectionOnModelUpdate", "intersectionHidden", "textureStartLoad", "textureLoading", "textureAbort", "textureLoaded", "textureError"];
1930
+ export declare const PROXY_CONTROLLER_EVENT_NAMES: readonly ["cameraDirectionUpdate", "cameraUpdate", "cameraPositionUpdate", "panoSelected", "moveToPano", "moveToPanoCanceled", "panoWillArrive", "movingToPano", "panoArrived", "panoWillLoad", "panoLoaded", "panoLoadError", "initAnimationEnded", "initAnimationWillStart", "wantsGesture", "gesture", "wantsTapGesture", "tapGesture", "wantsPressGesture", "pressGesture", "wantsPanGesture", "wantsInteriaPan", "panGesture", "interiaPan", "wantsPinchGesture", "pinchGesture", "wantsMouseWheel", "mouseWheel", "wantsShowIntersectionOnModel", "intersectionOnModelUpdate", "intersectionHidden", "textureStartLoad", "textureLoading", "textureAbort", "textureLoaded", "textureError", "webXRSessionStart", "webXRSessionEnd", "webXRSelected"];
1931
+
1932
+ /** Five 场景*/
1933
+ export declare class Scene extends THREE_2.Scene {
1934
+ add(...objects: AddableObject[]): this;
1935
+ remove(...objects: AddableObject[]): this;
1936
+ }
1627
1937
 
1628
1938
  /**
1629
1939
  * 显示区域裁剪参数
@@ -1659,8 +1969,6 @@ export declare interface State extends Pose {
1659
1969
  panoIndex: number;
1660
1970
  }
1661
1971
 
1662
- export declare function stringifyWork(work: Work): LooseWork;
1663
-
1664
1972
  /**
1665
1973
  * 监听者模式
1666
1974
  * @template T - 预设的监听回调类型
@@ -1739,69 +2047,641 @@ export declare namespace SubscribeMixinType {
1739
2047
  }
1740
2048
  }
1741
2049
 
1742
- export declare interface TopviewControllerCustomInitArgs extends Omit<FloorplanControllerCustomInitArgs, "defaultLongitude" | "defaultLatitude" | "maxLatitude" | "minLatitude"> {
2050
+ /**
2051
+ * 图片参数
2052
+ */
2053
+ export declare interface TextureOptions {
2054
+ /**
2055
+ * url 地址转化
2056
+ * @param url - 原始地址
2057
+ * @param options - 当前地址参数
2058
+ * @returns 转化后地址
2059
+ */
2060
+ transform?: (url: string, options: ImageURLOptions) => string;
2061
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
2062
+ size?: number;
2063
+ /** 图片质量参数(0-100) */
2064
+ quality?: number;
2065
+ /** 图片格式参数 */
2066
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
2067
+ /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
2068
+ autoResize?: boolean;
2069
+ /** 锐化参数 海外不支持 */
2070
+ sharpen?: number;
2071
+ mappings?: ImageURLMappings;
1743
2072
  }
1744
2073
 
1745
- export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2074
+ /**
2075
+ * A Tile3DHeader represents a tile as Tileset3D. When a tile is first created, its content is not loaded;
2076
+ * the content is loaded on-demand when needed based on the view.
2077
+ * Do not construct this directly, instead access tiles through {@link Tileset3D#tileVisible}.
2078
+ */
2079
+ export declare class Tile3D {
2080
+ cacheNode?: TileCacheNode<Tile3D>;
2081
+ tileset: Tileset3D;
2082
+ header: TilesetJSONNode;
2083
+ content?: TileContent;
2084
+ parent?: Tile3D;
2085
+ boundingVolume: TileOrientedBoundingBox;
2086
+ contentState: "UNLOADED" | "LOADING" | "PROCESSING" | "READY" | "FAILED";
2087
+ children: Tile3D[];
2088
+ depth: number;
2089
+ selectionDepth: number;
2090
+ transform: Matrix4;
2091
+ computedTransform: Matrix4;
2092
+ frameNumber: number;
2093
+ touchedFrameNumber: number;
2094
+ requestedFrameNumber: number;
2095
+ selectedFrameNumber: number;
2096
+ distanceToCamera: number;
2097
+ centerZDepth: number;
2098
+ screenSpaceError: number;
2099
+ visibilityPlaneMask: number;
2100
+ visible: boolean;
2101
+ shouldRefine: boolean;
2102
+ /**
2103
+ * @constructs
2104
+ * Create a TileHeader instance
2105
+ * @param tileset - Tileset3D instance
2106
+ * @param header - tile header - JSON loaded from a dataset
2107
+ * @param parentHeader - parent TileHeader instance
2108
+ */
2109
+ constructor(tileset: Tileset3D, header: TilesetJSONNode, parentHeader?: Tile3D);
2110
+ get id(): string;
2111
+ get refine(): "REPLACE" | "ADD";
2112
+ get type(): "EMPTY" | "SCENEGRAPH" | "MESH";
2113
+ get contentUrl(): string;
2114
+ get lodMetricType(): "geometricError";
2115
+ get lodMetricValue(): number;
2116
+ get hasEmptyContent(): boolean;
2117
+ get selected(): boolean;
2118
+ /** Returns true if tile is not an empty tile and not an external tileset */
2119
+ get hasRenderContent(): boolean;
2120
+ /** Returns true if tile has children */
2121
+ get hasChildren(): boolean;
2122
+ /**
2123
+ * Determines if the tile's content is ready. This is automatically `true` for
2124
+ * tiles with empty content.
2125
+ */
2126
+ get contentReady(): boolean;
2127
+ /**
2128
+ * Determines if the tile has available content to render. `true` if the tile's
2129
+ * content is ready or if it has expired content this renders while new content loads; otherwise,
2130
+ */
2131
+ get contentAvailable(): boolean;
2132
+ /** Returns true if tile has renderable content but it's unloaded */
2133
+ get hasUnloadedContent(): boolean;
2134
+ /**
2135
+ * Determines if the tile's content has not be requested. `true` if tile's
2136
+ * content has not be requested; otherwise, `false`.
2137
+ */
2138
+ get contentUnloaded(): boolean;
2139
+ get contentFailed(): boolean;
2140
+ /** Get the tile's screen space error. */
2141
+ getScreenSpaceError(frameState: TileFrameState, useParentLodMetric: boolean): number;
2142
+ private getPriority;
2143
+ /**
2144
+ * Requests the tile's content.
2145
+ * The request may not be made if the Request Scheduler can't prioritize it.
2146
+ */
2147
+ loadContent(): Promise<boolean>;
2148
+ unloadContent(): void;
2149
+ /**
2150
+ * Update the tile's visibility
2151
+ */
2152
+ updateVisibility(frameState: TileFrameState): void;
2153
+ private visibility;
2154
+ /**
2155
+ * Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.
2156
+ * @param frameState - The frame state.
2157
+ * @returns The distance, in meters, or zero if the camera is inside the bounding volume.
2158
+ */
2159
+ private distanceToTile;
2160
+ private updateTransform;
2161
+ }
2162
+
2163
+ export declare class Tile3DModel extends PBMContainer {
2164
+ tileset?: Tileset3D;
2165
+ private options;
2166
+ private nodeGroup;
2167
+ private boundingGroup;
2168
+ private nodes;
2169
+ private boundings;
2170
+ private unloadTileQueue;
2171
+ private timer;
2172
+ private clock;
2173
+ private lastCameraTransform;
2174
+ private lastCameraAspect;
2175
+ private lastCameraFov;
2176
+ private sseDenominator;
2177
+ private lastCamera;
2178
+ private lastRenderer;
2179
+ private enabled;
2180
+ constructor(loaderOptions?: Partial<Tile3DModelLoaderOptions>);
2181
+ get enable(): boolean;
2182
+ set enable(value: boolean);
2183
+ load(url: WorkModelTiles): void;
2184
+ update(renderer: THREE_2.WebGLRenderer, camera: THREE_2.PerspectiveCamera): void;
2185
+ private tilesetUpdate;
2186
+ reset(): void;
2187
+ }
2188
+
2189
+ /** Advanced loader options */
2190
+ export declare interface Tile3DModelLoaderOptions {
2191
+ updateInterval: number;
2192
+ maxMemoryUsage: number;
2193
+ maxScreenSpaceError: number;
2194
+ viewDistanceScale: number;
2195
+ throttleRequests: boolean;
2196
+ maxRequests: number;
2197
+ onNodeCreated: (node: PBMGroup) => void;
2198
+ allowHosts?: string[];
2199
+ requestProxy?: (url: string) => string;
2200
+ networkSubscribe?: NetworkSubscribe;
2201
+ maxDepth?: number;
2202
+ }
2203
+
2204
+ export declare class TileBoundingSphere {
2205
+ center: Vector3;
2206
+ radius: number;
2207
+ constructor(center?: number[], radius?: number);
2208
+ fromCenterRadius(center: number[], radius: number): this;
2209
+ fromCornerPoints(corner: number[], oppositeCorner: number[]): this;
2210
+ equals(right: TileBoundingSphere): boolean;
2211
+ clone(): TileBoundingSphere;
2212
+ union(boundingSphere: TileBoundingSphere): TileBoundingSphere;
2213
+ expand(point: number[]): this;
2214
+ transform(transform: Matrix4): this;
2215
+ distanceSquaredTo(point: number[]): number;
2216
+ distanceTo(point: number[]): number;
2217
+ intersectPlane(plane: TilePlane): number;
2218
+ }
2219
+
2220
+ export declare interface TileBoundingVolume {
1746
2221
  /**
1747
- * webvrPolyfill 的设置对象
1748
- * @description
1749
- * 只可被设置一次,所有的 five 实例共用这个设置
2222
+ * Applies a 4x4 affine transformation matrix to a bounding sphere.
2223
+ * @param sphere - The bounding sphere to apply the transformation to.
2224
+ * @param transform - The transformation matrix to apply to the bounding sphere.
2225
+ * @returns itself, i.e. the modified BoundingVolume.
2226
+ */
2227
+ transform(transform: readonly number[]): this;
2228
+ /** Computes the estimated distance squared from the closest point on a bounding sphere to a point. */
2229
+ distanceSquaredTo(point: readonly number[]): number;
2230
+ /** Computes the estimated distance from the closest point on a bounding sphere to a point. */
2231
+ distanceTo(point: readonly number[]): number;
2232
+ /**
2233
+ * Determines which side of a plane the oriented bounding box is located.
2234
+ *
2235
+ * @param plane - The plane to test against.
2236
+ * @returns
2237
+ * - `INTERSECTION.INSIDE` if the entire box is on the side of the plane the normal is pointing.
2238
+ * - `INTERSECTION.OUTSIDE` if the entire box is on the opposite side.
2239
+ * - `INTERSECTION.INTERSECTING` if the box intersects the plane.
1750
2240
  */
1751
- webvrPolyfillConfig?: any;
2241
+ intersectPlane(plane: TilePlane): number;
2242
+ }
2243
+
2244
+ export declare class TileCacheNode<T> {
2245
+ item: T;
2246
+ previous: TileCacheNode<T> | null;
2247
+ next: TileCacheNode<T> | null;
2248
+ constructor(item: T, previous: TileCacheNode<T> | null, next: TileCacheNode<T> | null);
2249
+ }
2250
+
2251
+ export declare interface TileContent {
2252
+ version: 1;
2253
+ magic: number;
2254
+ byteLength: number;
2255
+ header: {
2256
+ featureTableJsonByteLength: number;
2257
+ featureTableBinaryByteLength: number;
2258
+ batchTableJsonByteLength: number;
2259
+ batchTableBinaryByteLength: number;
2260
+ batchLength: number;
2261
+ };
2262
+ featureTableJson: Record<string, any>;
2263
+ featureTableBinary: Uint8Array;
2264
+ batchTableJson: Record<string, any>;
2265
+ batchTableBinary: Uint8Array;
2266
+ rotateYtoZ: boolean;
2267
+ gltfUpAxis: "X" | "Y" | "Z";
2268
+ gltfArrayBuffer: ArrayBuffer;
2269
+ gltfByteOffset: number;
2270
+ gltfByteLength: number;
2271
+ rtcCenter?: Float32Array;
2272
+ }
2273
+
2274
+ export declare class TileCullingVolume {
2275
+ static get MASK_OUTSIDE(): number;
2276
+ static get MASK_INSIDE(): number;
2277
+ static get MASK_INDETERMINATE(): number;
2278
+ planes: TilePlane[];
2279
+ constructor(planes?: TilePlane[]);
2280
+ fromBoundingSphere(boundingSphere: {
2281
+ center: Vector3;
2282
+ radius: number;
2283
+ }): this;
2284
+ computeVisibilityWithPlaneMask(boundingVolume: TileBoundingVolume, parentPlaneMask: number): number;
2285
+ }
2286
+
2287
+ export declare type TileFrameState = {
2288
+ camera: {
2289
+ position: number[];
2290
+ direction: number[];
2291
+ up: number[];
2292
+ };
2293
+ height: number;
2294
+ cullingVolume: TileCullingVolume;
2295
+ frameNumber: number;
2296
+ sseDenominator: number;
2297
+ };
2298
+
2299
+ export declare class TileOrientedBoundingBox {
2300
+ center: Vector3;
2301
+ halfAxes: Matrix3;
2302
+ constructor(center?: number[], halfAxes?: number[]);
2303
+ get halfSize(): number[];
2304
+ get quaternion(): Quaternion;
2305
+ fromCenterHalfSizeQuaternion(center: number[], halfSize: number[], quaternion: number[]): this;
2306
+ clone(): TileOrientedBoundingBox;
2307
+ equals(right: TileOrientedBoundingBox): boolean;
2308
+ getBoundingSphere(result?: TileBoundingSphere): TileBoundingSphere;
2309
+ intersectPlane(plane: TilePlane): number;
2310
+ distanceTo(point: number[]): number;
2311
+ distanceSquaredTo(point: number[]): number;
2312
+ computePlaneDistances(position: Vector3, direction: Vector3, result?: number[]): number[];
2313
+ transform(transformation: number[]): this;
2314
+ }
2315
+
2316
+ export declare class TilePlane {
2317
+ normal: Vector3;
2318
+ distance: number;
2319
+ constructor(normal?: number[], distance?: number);
2320
+ fromNormalDistance(normal: number[], distance: number): this;
2321
+ fromPointNormal(point: number[], normal: number[]): this;
2322
+ fromCoefficients(a: number, b: number, c: number, d: number): this;
2323
+ clone(): TilePlane;
2324
+ equals(right: TilePlane): boolean;
2325
+ getPointDistance(point: number[]): number;
2326
+ transform(matrix4: Matrix4): this;
2327
+ projectPointOntoPlane(point: number[], result?: number[]): Vector3;
2328
+ }
2329
+
2330
+ /** Tracks one request */
2331
+ export declare type TileRequest<Identiy> = {
2332
+ identiy: Identiy;
2333
+ priority: number;
2334
+ getPriority: (identiy: Identiy) => number;
2335
+ resolve: (requestResult: TileRequestResult) => void;
2336
+ };
2337
+
2338
+ export declare type TileRequestResult = null | {
2339
+ done: () => void;
2340
+ };
2341
+
2342
+ /**
2343
+ * Used to issue a request, without having them "deeply queued" by the browser.
2344
+ * @todo - Track requests globally, across multiple servers
2345
+ */
2346
+ export declare class TileRequestScheduler<Identiy> {
2347
+ private props;
2348
+ private activeRequestCount;
2349
+ /** Tracks the number of active requests and prioritizes/cancels queued requests. */
2350
+ private requestQueue;
2351
+ private requestMap;
2352
+ private deferred;
2353
+ constructor(props?: TileRequestSchedulerOptions);
2354
+ /**
2355
+ * Called by an application that wants to issue a request, without having it deeply queued by the browser
2356
+ *
2357
+ * When the returned promise resolved, it is OK for the application to issue a request.
2358
+ * The promise resolves to an object that contains a `done` method.
2359
+ * When the application's request has completed (or failed), the application must call the `done` function
2360
+ *
2361
+ * @param identiy - Identiy
2362
+ * @param getPriority - will be called when request "slots" open up, allowing the caller to update priority or cancel the request Highest priority executes first, priority less than 0 cancels the request
2363
+ * @returns a promise resolves to a object (with a `done` field) when the request can be issued without queueing, resolves to `null` if the request has been cancelled (by the callback return less than 0). In this case the application should not issue the request
2364
+ */
2365
+ scheduleRequest(identiy: Identiy, getPriority?: (identiy: Identiy) => number): Promise<TileRequestResult>;
2366
+ private issueRequest;
2367
+ /** We check requests asynchronously, to prevent multiple updates */
2368
+ private issueNewRequests;
2369
+ /** Refresh all requests */
2370
+ private issueNewRequestsAsync;
2371
+ /** Ensure all requests have updated priorities, and that no longer valid requests are cancelled */
2372
+ private updateAllRequests;
2373
+ /** Update a single request by calling the callback */
2374
+ private updateRequest;
2375
+ }
2376
+
2377
+ /** RequestScheduler Options */
2378
+ export declare type TileRequestSchedulerOptions = {
2379
+ throttleRequests?: boolean;
2380
+ maxRequests?: number;
2381
+ };
2382
+
2383
+ export declare class Tileset3D {
2384
+ rawJson: any;
2385
+ options: Tileset3dOptions;
2386
+ root: Tile3D;
2387
+ traverser: Tileset3DTraverser;
2388
+ cache: TilesetCache;
2389
+ requestScheduler: TileRequestScheduler<string>;
2390
+ selectedTiles: Tile3D[];
2391
+ requestedTiles: Tile3D[];
2392
+ memoryUsageInBytes: number;
2393
+ frameNumber: number;
2394
+ private _tiles;
2395
+ private pendingCount;
2396
+ b3dmMapping: TilesetJSON['b3dmMapping'];
2397
+ /**
2398
+ * Create a new Tileset3D
2399
+ * @param json - TilesetJSON
2400
+ * @param options - Tileset3dOptions
2401
+ */
2402
+ constructor(json: TilesetJSON, options: Tileset3dOptions);
2403
+ get maxMemoryUsage(): number;
2404
+ get asset(): any;
2405
+ get type(): any;
2406
+ get basePath(): any;
2407
+ get modelMatrix(): Matrix4;
2408
+ get geometricError(): number;
2409
+ get lodMetricType(): number;
2410
+ get lodMetricValue(): number;
2411
+ get refine(): 'ADD' | "REPLACE";
2412
+ get tiles(): Tile3D[];
2413
+ get floorInfo(): TilesetJSON['floorInfo'];
2414
+ /** Release resources */
2415
+ reset(): void;
2416
+ /** Is the tileset loaded (update needs to have been called at least once) */
2417
+ isLoaded(): boolean;
2418
+ /**
2419
+ * The callback to post-process tiles after traversal procedure
2420
+ * @param frameState - frame state for tile culling
2421
+ */
2422
+ private onTraversalEnd;
2423
+ loadTile(tile: Tile3D): void;
2424
+ unloadTile(tile: Tile3D): void;
2425
+ }
2426
+
2427
+ export declare interface Tileset3dOptions {
2428
+ throttleRequests: boolean;
2429
+ maxRequests: number;
2430
+ maxMemoryUsage: number;
2431
+ modelMatrix: Matrix4;
2432
+ maxScreenSpaceError: number;
2433
+ viewDistanceScale: number;
2434
+ onTileLoad: (tile: Tile3D) => any;
2435
+ onTileUnload: (tile: Tile3D) => any;
2436
+ onTileError: (tile: Tile3D, message: string) => any;
2437
+ contentLoader: (tile: Tile3D) => Promise<void>;
2438
+ onTraversalComplete: (selectedTiles: Tile3D[]) => Tile3D[];
2439
+ allowHosts?: string[];
2440
+ requestProxy?: (url: string) => string;
2441
+ networkSubscribe?: NetworkSubscribe;
2442
+ maxDepth?: number;
2443
+ }
2444
+
2445
+ export declare class Tileset3DTraverser {
2446
+ root: Tile3D | null;
2447
+ options: TilesetTraverserProps;
2448
+ requestedTiles: Record<string, Tile3D>;
2449
+ selectedTiles: Record<string, Tile3D>;
2450
+ emptyTiles: Record<string, Tile3D>;
2451
+ private _traversalStack;
2452
+ private _emptyTraversalStack;
2453
+ private _frameNumber;
2454
+ constructor(options: TilesetTraverserProps);
2455
+ traverse(root: Tile3D, frameState: TileFrameState): void;
2456
+ reset(): void;
2457
+ private executeTraversal;
2458
+ private updateChildTiles;
2459
+ private updateAndPushChildren;
2460
+ updateTile(tile: Tile3D, frameState: TileFrameState): void;
2461
+ selectTile(tile: Tile3D, frameState: TileFrameState): void;
2462
+ loadTile(tile: Tile3D, frameState: TileFrameState): void;
2463
+ touchTile(tile: Tile3D, frameState: TileFrameState): void;
2464
+ private canTraverse;
2465
+ private shouldLoadTile;
2466
+ private shouldSelectTile;
2467
+ private shouldRefine;
2468
+ private updateTileVisibility;
2469
+ private meetsScreenSpaceErrorEarly;
2470
+ private compareDistanceToCamera;
2471
+ private anyChildrenVisible;
2472
+ private everyChildrenVisibleIsLoaded;
2473
+ private executeEmptyTraversal;
2474
+ }
2475
+
2476
+ export declare class TilesetCache {
2477
+ private list;
2478
+ private sentinel;
2479
+ constructor();
2480
+ reset(): void;
2481
+ touch(tile: Tile3D): void;
2482
+ add(tile: Tile3D, addCallback?: (tile: Tile3D) => void): void;
2483
+ unloadTile(tile: Tile3D, unloadCallback?: (tile: Tile3D) => void): void;
2484
+ unloadTiles(isOverMemory: () => boolean, unloadCallback?: (tile: Tile3D) => void): void;
2485
+ }
2486
+
2487
+ export declare interface TilesetJSON {
2488
+ asset: {
2489
+ gltfUpAxis: "X" | "Y" | "Z";
2490
+ version: "1.0";
2491
+ };
2492
+ basePath: string;
2493
+ lodMetricType: "geometricError";
2494
+ geometricError: number;
2495
+ lodMetricValue: number;
2496
+ root: TilesetJSONNode;
2497
+ type: "TILES3D";
2498
+ floorInfo: {
2499
+ ground: number;
2500
+ height: number;
2501
+ }[];
2502
+ b3dmMapping: {
2503
+ b3dm_base_url: string;
2504
+ b3dm_url: Record<string, string>;
2505
+ };
1752
2506
  }
1753
2507
 
1754
- export declare type Work = {
1755
- uuid: string;
2508
+ export declare interface TilesetJSONNode {
2509
+ boundingVolume: {
2510
+ box: number[];
2511
+ };
2512
+ content: {
2513
+ uri: string;
2514
+ };
2515
+ id: string;
2516
+ transform?: number[];
2517
+ contentUrl?: string;
2518
+ children: TilesetJSONNode[];
2519
+ lodMetricType: "geometricError";
2520
+ geometricError: number;
2521
+ lodMetricValue: number;
2522
+ refine: "REPLACE" | "ADD";
2523
+ type: "EMPTY" | "SCENEGRAPH" | "MESH";
2524
+ }
2525
+
2526
+ export declare type TilesetTraverserProps = {
2527
+ loadSiblings: boolean;
2528
+ skipLevelOfDetail: boolean;
2529
+ maxScreenSpaceError: number;
2530
+ maxDepth?: number;
2531
+ onTraversalEnd: (frameState: TileFrameState) => any;
2532
+ };
2533
+
2534
+ export declare interface TopviewControllerCustomInitArgs extends Omit<FloorplanControllerCustomInitArgs, "defaultLongitude" | "defaultLatitude" | "maxLatitude" | "minLatitude"> {
2535
+ }
2536
+
2537
+ export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2538
+ }
2539
+
2540
+ export declare type WebXREventTypes = {
2541
+ /** WebXR模式开始,session完成坐标系设置*/
2542
+ webXRSessionStart(): void;
2543
+ /** WebXR模式结束,销毁session*/
2544
+ webXRSessionEnd(): void;
2545
+ };
2546
+
2547
+ export declare type WebXRSelectType = "Select" | "Squeeze";
2548
+
2549
+ export declare class Work {
2550
+ /** 名称 */
2551
+ name: string;
2552
+ /** 编号 */
2553
+ workCode: string;
2554
+ /** 允许访问的安全域名 */
2555
+ allowHosts: string[];
2556
+ /** 过期时间 */
2557
+ expire: Date;
2558
+ /** 初始化参数 */
1756
2559
  initial: WorkInitial;
2560
+ /** 模型参数 */
1757
2561
  model?: WorkModel;
2562
+ /** 全景点位信息 */
1758
2563
  observers: WorkObserver[];
1759
- };
2564
+ /** 数据签发人 */
2565
+ issuer: string;
2566
+ /** 原始数据 */
2567
+ raw: {
2568
+ works: string[];
2569
+ options: string;
2570
+ };
2571
+ /**
2572
+ * 解析 Work 数据
2573
+ * @param obj - work 数据,从如数开发者平台获取
2574
+ * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
2575
+ * @param urlTransform - 配置参数, URL 解析规则
2576
+ * @returns - 签署过的 Work 数据结构
2577
+ */
2578
+ static parse: typeof parseWork;
2579
+ constructor();
2580
+ toJSON(): any;
2581
+ }
1760
2582
 
1761
- /** 全景图 */
1762
- export declare type WorkImages = {
2583
+ export declare interface WorkCubeImage {
2584
+ /** 全景图 up */
1763
2585
  up: string;
2586
+ /** 全景图 down */
1764
2587
  down: string;
2588
+ /** 全景图 right */
1765
2589
  right: string;
2590
+ /** 全景图 left */
1766
2591
  left: string;
2592
+ /** 全景图 front */
1767
2593
  front: string;
2594
+ /** 全景图 back */
1768
2595
  back: string;
2596
+ }
2597
+
2598
+ /** 全景图 */
2599
+ export declare interface WorkImage extends WorkCubeImage {
2600
+ /** 深度图 */
1769
2601
  depth?: string;
1770
- tiles?: string;
1771
- };
2602
+ /** 光照强度图 */
2603
+ luminance?: WorkCubeImage;
2604
+ /** 瓦片信息 */
2605
+ tiles?: WorkTile[];
2606
+ }
1772
2607
 
1773
2608
  /** 初始化位姿参数 */
1774
- export declare type WorkInitial = Omit<State, "offset">;
2609
+ export declare interface WorkInitial extends Omit<State, "offset" | "distance"> {
2610
+ }
1775
2611
 
1776
2612
  /** 模型数据 */
1777
- export declare type WorkModel = {
2613
+ export declare interface WorkModel {
2614
+ /** 模型文件地址 at3d / domez */
1778
2615
  file: string;
2616
+ /** 模型贴图文件地址 */
1779
2617
  textures: string[];
2618
+ /** 模型贴图文件地址的父目录 */
1780
2619
  textureBase: string;
2620
+ /** 是否开启 bvh 碰撞树,开启会大大加快射线碰撞的执行效率 */
1781
2621
  bvh: boolean;
1782
- async: boolean;
1783
- };
2622
+ tiles?: WorkModelTiles;
2623
+ }
2624
+
2625
+ /** 模型瓦片 */
2626
+ export declare interface WorkModelTiles {
2627
+ tileset_url: string;
2628
+ tileset_url_md5: string;
2629
+ b3md_mappings_url: string;
2630
+ b3md_mappings_url_md5: string;
2631
+ }
1784
2632
 
1785
2633
  /** 每个点位的数据 */
1786
- export declare type WorkObserver = {
2634
+ export declare interface WorkObserver {
2635
+ /** 点位序号 */
1787
2636
  panoIndex: number;
2637
+ /** 点位是否激活可用 */
1788
2638
  active: boolean;
2639
+ /** 点位是否可加载 */
1789
2640
  loadable: boolean;
1790
- images: WorkImages;
2641
+ /** 点位全景图 */
2642
+ images: WorkImage;
2643
+ /** 点位视频 */
1791
2644
  video?: WorkVideo;
2645
+ /** 可以看到的相关点位序号 */
1792
2646
  visibleNodes: number[];
2647
+ /** 可以连通的相关点位序号 */
1793
2648
  accessibleNodes: number[];
2649
+ /** 点位和模型的旋转对齐关系四元数 */
1794
2650
  quaternion: THREE_2.Quaternion;
2651
+ /** 点位和模型的地面位置坐标关系 */
1795
2652
  standingPosition: THREE_2.Vector3;
2653
+ /** 点位和模型的观察点坐标关系 */
1796
2654
  position: THREE_2.Vector3;
2655
+ /** 点位所在楼层 */
1797
2656
  floorIndex: number;
1798
- };
2657
+ }
2658
+
2659
+ export declare interface WorkTile {
2660
+ level: number;
2661
+ size: number;
2662
+ up: string;
2663
+ down: string;
2664
+ right: string;
2665
+ left: string;
2666
+ front: string;
2667
+ back: string;
2668
+ }
1799
2669
 
1800
2670
  /** 全景视频贴片 */
1801
- export declare type WorkVideo = {
2671
+ export declare interface WorkVideo {
2672
+ /** 视频源 url */
1802
2673
  source: string;
2674
+ /** 视频源变化矩阵 */
1803
2675
  matrix: THREE_2.Matrix4;
2676
+ /** 视频源长宽尺寸 */
1804
2677
  size: THREE_2.Vector2;
1805
- };
2678
+ }
2679
+
2680
+ export declare class XRButton {
2681
+ static createButton(onClickHook: () => void): HTMLAnchorElement | HTMLButtonElement;
2682
+ }
2683
+
2684
+ export declare interface XRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2685
+ }
1806
2686
 
1807
2687
  export { }