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

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} +1208 -329
  128. package/five/index.js +372 -0
  129. package/gltf-loader/index.d.ts +75 -0
  130. package/gltf-loader/index.js +260 -0
  131. package/line/index.d.ts +68 -0
  132. package/line/index.js +260 -0
  133. package/package.json +25 -17
  134. package/react/index.d.ts +84 -22
  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 +70 -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
  };
@@ -499,67 +637,15 @@ export declare class Five extends Subscribe<EventTypes> {
499
637
  * Topview 户型图模式
500
638
  * DepthPanorama 深度图游走模式
501
639
  * VRPanorama VR眼镜模式
640
+ * XRPanorama VR硬件模式
502
641
  * ```
503
642
  */
504
643
  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
- };
644
+ /**
645
+ * @deprecated
646
+ * 请使用 `import { Line } from "@realsee/five/line"` 代替;
647
+ */
648
+ static Line: any;
563
649
  /**
564
650
  * 自动播放状态是否暂停
565
651
  * @description
@@ -571,9 +657,9 @@ export declare class Five extends Subscribe<EventTypes> {
571
657
  /** 当前展示的模式 */
572
658
  currentMode?: Mode;
573
659
  /** 内部使用的 `THREE.Scene` */
574
- scene: FiveScene;
660
+ scene: Scene;
575
661
  /** 内部使用的 `Camera` */
576
- camera: FiveCamera;
662
+ camera: Camera;
577
663
  /**
578
664
  * 当前设置的 `scissor`
579
665
  * @description
@@ -592,11 +678,9 @@ export declare class Five extends Subscribe<EventTypes> {
592
678
  * 如果初始化时传入了 `renderer` 则直接时该值
593
679
  * 否则会通过 `preserveDrawingBuffer` `backgroundColor` `backgroundAlpha` `antialias` 创建一个 `THREE.WebGLRenderer`
594
680
  */
595
- renderer: THREE_2.WebGLRenderer;
681
+ renderer?: THREE_2.WebGLRenderer;
596
682
  /** 当前加载的模型 */
597
683
  model: Model;
598
- /** 当前加载的 work 数据 */
599
- work?: Work;
600
684
  /**
601
685
  * 是否需要渲染
602
686
  * @description
@@ -617,7 +701,7 @@ export declare class Five extends Subscribe<EventTypes> {
617
701
  * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
618
702
  * 平衡加载时间和图片质量
619
703
  */
620
- textureOptions: ImageOptions;
704
+ textureOptions: TextureOptions;
621
705
  /**
622
706
  * 模型贴图的配置参数
623
707
  * @description
@@ -648,21 +732,35 @@ export declare class Five extends Subscribe<EventTypes> {
648
732
  plugins: {
649
733
  [key: string]: FivePluginInstance<any>;
650
734
  };
651
- private ident;
735
+ ident: string;
736
+ private stopAnimationLoop?;
737
+ private fps;
738
+ private helperGroup;
652
739
  private modeChangeDuration;
653
740
  private onlyRenderIfNeeds;
654
- private maxFps;
741
+ private poweredByRealsee;
655
742
  private controller?;
656
743
  private destroyed;
657
744
  private stateSynced;
658
745
  private controllerInits;
659
746
  private panoramaLikeSavedPose;
660
747
  private extraElements;
661
- private moveToPanoQueue?;
662
748
  private getPixelsRenderTarget;
663
- private tweenCoordinates?;
664
749
  private readyCallbacks;
665
750
  private modelPending;
751
+ private syncingState;
752
+ /**
753
+ * 是否开启 IOS EDR 模式
754
+ * 需要客户端配合
755
+ * 并且开启 five.enablepostProcessing = true
756
+ */
757
+ private _enableIOSEDR;
758
+ private lastLoadWorkTask;
759
+ private requestProxy;
760
+ private networkSubscribe;
761
+ private screenBuffer?;
762
+ private analysis?;
763
+ private renderSwitch01;
666
764
  constructor(initArgs?: FiveInitArgs);
667
765
  /**
668
766
  * 析构 five 对象。
@@ -683,6 +781,21 @@ export declare class Five extends Subscribe<EventTypes> {
683
781
  * ```
684
782
  */
685
783
  setScissor(scissor: Scissor): void;
784
+ /**
785
+ * 帮助元素显示/隐藏
786
+ */
787
+ get helperVisible(): boolean;
788
+ set helperVisible(visible: boolean);
789
+ /**
790
+ * 是否开启 IOS EDR 模式
791
+ * 需要客户端配合
792
+ * 并且开启 five.enablepostProcessing = true
793
+ */
794
+ get enableIOSEDR(): boolean;
795
+ set enableIOSEDR(enable: boolean);
796
+ get enablePostProcessing(): boolean;
797
+ set enablePostProcessing(enable: boolean);
798
+ updateConfiguration(args: Pick<FiveInitArgs, "panorama" | "model" | "floorplan" | "topview" | "mapview" | "depthPanorama" | "vrPanorama" | "imageOptions">): void;
686
799
  /**
687
800
  * 将显示区域加载到页面 DOM 中
688
801
  * @description
@@ -720,6 +833,8 @@ export declare class Five extends Subscribe<EventTypes> {
720
833
  * 获取当前相机姿态, 可以使用 getCurrentState 代替
721
834
  */
722
835
  getPose(): Pose;
836
+ getSize(target: THREE_2.Vector2): THREE_2.Vector2;
837
+ getDrawingBufferSize(target: THREE_2.Vector2): THREE_2.Vector2;
723
838
  /**
724
839
  * 移动相机。(不触发点位移动)
725
840
  * @description
@@ -727,9 +842,10 @@ export declare class Five extends Subscribe<EventTypes> {
727
842
  * 会 Promise.reject。运动完成则 Promise.resolve
728
843
  * @param pose - 相机目标位置
729
844
  * @param duration - 动画触发的时常
845
+ * @param userAction - 是否用户触发
730
846
  * @returns Promise 是否移动成功
731
847
  */
732
- updateCamera(pose: Partial<Pose>, duration: number): Promise<void>;
848
+ updateCamera(pose: Partial<Omit<Pose, "offset">>, duration: number, userAction?: boolean): Promise<void>;
733
849
  /**
734
850
  * 获取当前相机经纬度
735
851
  * @deprecated 请使用使用 getPose
@@ -769,6 +885,8 @@ export declare class Five extends Subscribe<EventTypes> {
769
885
  * ```
770
886
  */
771
887
  initBasisLoader(transcoderResourcePath?: string): void;
888
+ /** 当前加载的 work 数据 */
889
+ get work(): Work;
772
890
  /**
773
891
  * 加载 Work 数据
774
892
  * @param inputWork - Work 数据
@@ -778,15 +896,17 @@ export declare class Five extends Subscribe<EventTypes> {
778
896
  * - State 自定义姿态
779
897
  * @param duration - 切换时间
780
898
  */
781
- load(inputWork: Work | LooseWork | any, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number): Promise<void>;
899
+ load(inputWork: Work | LooseWork | any | Promise<Work | LooseWork | any>, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number, userAction?: boolean): Promise<void>;
900
+ private load_;
782
901
  /**
783
902
  * 切换模态
784
903
  * @param mode - 切换到的模态
785
904
  * @param state - 切换完成时的姿态
786
905
  * @param duration - 模态切换动画用时
787
906
  * @param userAction - 是否时用户动作触发 默认 true
907
+ * @param force - 必须重新初始化 controller
788
908
  */
789
- changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, duration?: number, userAction?: boolean): Promise<void>;
909
+ changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, duration?: number, userAction?: boolean, force?: boolean): Promise<void>;
790
910
  /**
791
911
  * 获取画面中的像素颜色
792
912
  * @param x - 获取像素区域的起始坐标 x
@@ -800,11 +920,7 @@ export declare class Five extends Subscribe<EventTypes> {
800
920
  /**
801
921
  * 获取显示用的画布(Canvas DOM节点)
802
922
  */
803
- getElement(): HTMLCanvasElement;
804
- /**
805
- * 但停自动播放
806
- */
807
- pause(): void;
923
+ getElement(): HTMLCanvasElement | undefined;
808
924
  /**
809
925
  * 强制渲染
810
926
  * @description
@@ -816,7 +932,12 @@ export declare class Five extends Subscribe<EventTypes> {
816
932
  *
817
933
  * @param callback - 渲染完成回调
818
934
  */
819
- render(callback?: () => void): void;
935
+ render(callback?: () => void, updateObjectResolution?: boolean): THREE_2.WebGLRenderTarget;
936
+ updateTime(time: number, deltaTime: number, ...args: any[]): void;
937
+ /**
938
+ * 但停自动播放
939
+ */
940
+ pause(): void;
820
941
  play(): void;
821
942
  /**
822
943
  * 转化到 Panorama 模态,并移动到对应序号的观察点。
@@ -824,7 +945,7 @@ export declare class Five extends Subscribe<EventTypes> {
824
945
  * @param options - 移动点位参数
825
946
  * @param userAction - 是否用户触犯
826
947
  */
827
- moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): void;
948
+ moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): Promise<void>;
828
949
  /**
829
950
  * 预加载点位图片资源
830
951
  * @param panoIndex - 观察点序号
@@ -845,7 +966,7 @@ export declare class Five extends Subscribe<EventTypes> {
845
966
  * 获取当前在屏幕视锥中的 mesh。
846
967
  * @param object - 如果传入则检查这个对象中的mesh,如果不传,则检查整个 scene
847
968
  */
848
- getRenderMeshes(object?: THREE_2.Object3D): THREE_2.Object3D[];
969
+ getRenderObjects(object?: THREE_2.Object3D): THREE_2.Object3D[];
849
970
  getCurrentState(): State;
850
971
  /**
851
972
  * 设置 State
@@ -866,34 +987,32 @@ export declare class Five extends Subscribe<EventTypes> {
866
987
  * ```
867
988
  * @param state - 目标状态
868
989
  * @param immediately - 是否马上转换,马上转换会尽快达到目标状态,尽量减少中间状态,更少动画。
990
+ * @param userAction - 是否是用户触发的动作
869
991
  */
870
- setState(state: Partial<State>, immediately?: boolean): void;
992
+ setState(state: Partial<State>, immediately?: boolean, userAction?: boolean): void;
993
+ aroundScissor(callback: () => void): void;
871
994
  private syncState;
872
- ready(): Promise<void>;
873
- private updateResolution;
995
+ /**
996
+ * 当前页面静态
997
+ */
998
+ ready(args?: {
999
+ tile?: boolean;
1000
+ }): Promise<void>;
1001
+ /**
1002
+ * 请求全屏
1003
+ */
1004
+ requestFullscreen(): void;
1005
+ /**
1006
+ * 退出全屏
1007
+ */
1008
+ exitFullscreen(): void;
874
1009
  private throwError;
875
1010
  private loadModel;
876
1011
  private commonParams;
877
1012
  private saveControllerPose;
878
1013
  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;
1014
+ /** 移除事件绑定 */
1015
+ private removeEventListeners;
897
1016
  }
898
1017
 
899
1018
  /** Five 初始化参数 */
@@ -979,7 +1098,7 @@ export declare interface FiveInitArgs {
979
1098
  * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
980
1099
  * 平衡加载时间和图片质量
981
1100
  */
982
- textureOptions?: ImageOptions;
1101
+ textureOptions?: TextureOptions;
983
1102
  /**
984
1103
  * 是否按需渲染
985
1104
  * @description
@@ -1029,15 +1148,19 @@ export declare interface FiveInitArgs {
1029
1148
  floorplan?: ControllerCustomInitTypes["Floorplan"];
1030
1149
  /** 户型图模式下的特定参数 */
1031
1150
  topview?: ControllerCustomInitTypes["Topview"];
1151
+ /** 地图模式下的特定参数 */
1152
+ mapview?: ControllerCustomInitTypes["Mapview"];
1032
1153
  /** 深度图游走模式下的特定参数 */
1033
1154
  depthPanorama?: ControllerCustomInitTypes["DepthPanorama"];
1034
1155
  /** VR眼镜模式下的特定参数 */
1035
1156
  vrPanorama?: ControllerCustomInitTypes["VRPanorama"];
1157
+ /** XR眼镜模式下的特定参数 */
1158
+ xrPanorama?: ControllerCustomInitTypes["XRPanorama"];
1036
1159
  /**
1037
1160
  * 模式间切换时的过度动画时间
1038
1161
  * @description
1039
1162
  * 单位毫秒
1040
- * @default `1000`
1163
+ * @default `800`
1041
1164
  */
1042
1165
  modeChangeDuration?: number;
1043
1166
  /**
@@ -1046,58 +1169,20 @@ export declare interface FiveInitArgs {
1046
1169
  * 详见插件部分。
1047
1170
  */
1048
1171
  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;
1172
+ /**
1173
+ * 是否展示 powered by 如视
1174
+ */
1175
+ poweredByRealsee?: boolean;
1176
+ /**
1177
+ * 是否使用webgl2渲染执行环境, 默认值 false
1178
+ */
1179
+ webgl2?: boolean;
1180
+ /**
1181
+ * 请求代理
1182
+ * @param url - 发起的请求
1183
+ * @returns 返回的请求
1184
+ */
1185
+ requestProxy?(url: string): string;
1101
1186
  }
1102
1187
 
1103
1188
  /**
@@ -1127,10 +1212,6 @@ parameters: Parameters<T>[1]
1127
1212
  */
1128
1213
  export declare type FivePluginInstance<T extends FivePlugin<any, any>> = ReturnType<T>;
1129
1214
 
1130
- /** Five 场景*/
1131
- export declare class FiveScene extends THREE_2.Scene {
1132
- }
1133
-
1134
1215
  export declare interface FloorplanControllerCustomInitArgs {
1135
1216
  /** 默认偏航角 */
1136
1217
  defaultLongitude?: number;
@@ -1148,7 +1229,7 @@ export declare interface FloorplanControllerCustomInitArgs {
1148
1229
  minFov?: number;
1149
1230
  }
1150
1231
 
1151
- export declare type GestureTypes = "pan" | "tap" | "pinch" | "mouseWheel";
1232
+ export declare type GestureTypes = "pan" | "tap" | "pinch" | "press" | "mouseWheel";
1152
1233
 
1153
1234
  export declare function getViewportScale(): number;
1154
1235
 
@@ -1156,33 +1237,65 @@ export declare function getViewportScale(): number;
1156
1237
  * 图片参数
1157
1238
  */
1158
1239
  export declare interface ImageOptions {
1159
- key?: string;
1160
1240
  /**
1161
1241
  * url 地址转化
1162
1242
  * @param url - 原始地址
1163
1243
  * @param options - 当前地址参数
1164
1244
  * @returns 转化后地址
1165
1245
  */
1166
- transform?: (url: string, options: ImageOptions) => string;
1167
- /** 图片尺寸参数 */
1246
+ transform?: (url: string, options: ImageURLOptions) => string;
1247
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 512 1024 2048 */
1168
1248
  size?: number;
1169
1249
  /** 图片质量参数(0-100) */
1170
1250
  quality?: number;
1171
- /** 图片格式参数(jpg, png) */
1172
- format?: string;
1173
- /** basis loader 是否初始化完成 */
1174
- basisLoaderInitialized?: boolean;
1175
- /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
1176
- autoResize?: boolean;
1251
+ /** 图片格式参数 */
1252
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
1253
+ /** 锐化参数 海外不支持 */
1254
+ sharpen?: number;
1255
+ mappings?: ImageURLMappings;
1256
+ }
1257
+
1258
+ export declare function imageSupport(): Promise<{
1259
+ avif: boolean;
1260
+ webp: boolean;
1261
+ }>;
1262
+
1263
+ export declare interface ImageURLMappings {
1264
+ [publicDomain: string]: {
1265
+ "pano": [string, string];
1266
+ "tile": [string, string];
1267
+ "texture": [string];
1268
+ "default": [string];
1269
+ };
1270
+ }
1271
+
1272
+ export declare interface ImageURLOptions {
1273
+ /** 图片类型标识 */
1274
+ key: string;
1275
+ /** basisLoader 是否初始化完成 */
1276
+ basisLoaderInitialized: boolean;
1277
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
1278
+ size?: number;
1279
+ /** 图片质量参数(0-100) */
1280
+ quality?: number;
1281
+ /** 图片格式参数 */
1282
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
1283
+ /** 图片裁切 */
1284
+ cut?: [x: number, y: number, width: number, height: number];
1285
+ /** 锐化参数 海外不支持 */
1286
+ sharpen?: number;
1287
+ /** url匹配规则 */
1288
+ mappings?: ImageURLMappings;
1177
1289
  }
1178
1290
 
1179
1291
  export declare class InternalWebGLRenderer extends THREE_2.WebGLRenderer {
1180
- constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias }: {
1292
+ constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias, webgl2 }: {
1181
1293
  preserveDrawingBuffer?: boolean;
1182
1294
  backgroundColor?: number | THREE_2.Color;
1183
1295
  backgroundAlpha?: number;
1184
1296
  pixelRatio?: number;
1185
1297
  antialias?: boolean;
1298
+ webgl2?: boolean;
1186
1299
  });
1187
1300
  }
1188
1301
 
@@ -1197,10 +1310,42 @@ export declare interface Intersection {
1197
1310
  distance: number;
1198
1311
  }
1199
1312
 
1313
+ export declare class IntersectMesh extends THREE_2.Object3D implements IntersectMeshInterface {
1314
+ private ringMesh;
1315
+ constructor();
1316
+ dispose(): void;
1317
+ }
1318
+
1319
+ /**
1320
+ * 地面提示点位接口
1321
+ */
1200
1322
  export declare interface IntersectMeshInterface extends THREE_2.Object3D {
1201
1323
  dispose(): void;
1202
1324
  }
1203
1325
 
1326
+ export declare class LegacyPanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
1327
+ needsRender: boolean;
1328
+ hitTestMesh: THREE_2.Mesh<THREE_2.BufferGeometry, THREE_2.MeshBasicMaterial>;
1329
+ current: boolean;
1330
+ loading: boolean;
1331
+ disabled: boolean;
1332
+ progress: number;
1333
+ opacity: number;
1334
+ private centerMesh;
1335
+ private loadingMesh;
1336
+ private progressMotion;
1337
+ private opacityMotion;
1338
+ private stopInterval?;
1339
+ constructor();
1340
+ setLoading(shown: boolean): void;
1341
+ setDisabled(disabled: boolean): void;
1342
+ setProgress(progress: number): void;
1343
+ setOpacity(opacity: number): void;
1344
+ setCurrent(current: boolean): void;
1345
+ updateTime(time: number, deltaTime: number): void;
1346
+ dispose(): void;
1347
+ }
1348
+
1204
1349
  export declare type LooseWork = {
1205
1350
  bvh?: boolean;
1206
1351
  modelAsync?: boolean;
@@ -1258,7 +1403,15 @@ export declare type LooseWorkPanorama = {
1258
1403
  front: string;
1259
1404
  back: string;
1260
1405
  video?: LooseWorkVideo;
1261
- tiles?: string;
1406
+ luminance?: {
1407
+ up: string;
1408
+ down: string;
1409
+ right: string;
1410
+ left: string;
1411
+ front: string;
1412
+ back: string;
1413
+ };
1414
+ tiles?: number[];
1262
1415
  };
1263
1416
 
1264
1417
  export declare type LooseWorkVideo = {
@@ -1267,6 +1420,23 @@ export declare type LooseWorkVideo = {
1267
1420
  size: number[];
1268
1421
  };
1269
1422
 
1423
+ export declare interface MapviewControllerCustomInitArgs {
1424
+ /** 默认偏航角 */
1425
+ defaultLongitude?: number;
1426
+ /** 默认俯仰角 */
1427
+ defaultLatitude?: number;
1428
+ /** 默认相机距离 */
1429
+ defaultDistance?: number;
1430
+ /** 最大俯仰角 */
1431
+ maxLatitude?: number;
1432
+ /** 最小俯仰角 */
1433
+ minLatitude?: number;
1434
+ /** 最大相机距离 */
1435
+ maxDistance?: number;
1436
+ /** 最小相机距离 */
1437
+ minDistance?: number;
1438
+ }
1439
+
1270
1440
  export declare type Mirror<T extends string> = Record<T, T>;
1271
1441
 
1272
1442
  /**
@@ -1275,6 +1445,7 @@ export declare type Mirror<T extends string> = Record<T, T>;
1275
1445
  * - **Model**: 模型游走模式
1276
1446
  * - **Floorplan**: 模型查看模式
1277
1447
  * - **Topview**: 户型图模式
1448
+ * - **Mapview**: 地图模式
1278
1449
  * - **DepthPanorama**: 深度图游走模式
1279
1450
  * - **VRPanorama**: VR眼镜模式
1280
1451
  */
@@ -1283,6 +1454,8 @@ export declare type Mode =
1283
1454
  "Floorplan" |
1284
1455
  /** 户型图模式 */
1285
1456
  "Topview" |
1457
+ /** 地图模式 */
1458
+ "Mapview" |
1286
1459
  /** 全景图游走模式 */
1287
1460
  "Panorama" |
1288
1461
  /** VR眼镜模式 */
@@ -1290,7 +1463,9 @@ export declare type Mode =
1290
1463
  /** 模型游走模式 */
1291
1464
  "Model" |
1292
1465
  /** 深度图游走模式 */
1293
- "DepthPanorama";
1466
+ "DepthPanorama" |
1467
+ /** XR眼镜模式*/
1468
+ "XRPanorama";
1294
1469
 
1295
1470
  /**
1296
1471
  * Five 模型
@@ -1300,7 +1475,7 @@ export declare type Mode =
1300
1475
  * 需要满足 your/path/filename.at3d.json_xxxxxx,
1301
1476
  * 通过 json_xxxxxx(<dataURL>) 方式返回。
1302
1477
  */
1303
- export declare class Model extends PBMGroup implements Subscribe<ModelEventType> {
1478
+ export declare class Model extends PBMContainer implements Subscribe<ModelEventType> {
1304
1479
  /** 是否加载完成 */
1305
1480
  loaded: boolean;
1306
1481
  /** 是否未加载 */
@@ -1308,7 +1483,13 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1308
1483
  /** 外接盒子的大小 */
1309
1484
  bounding: THREE_2.Box3;
1310
1485
  /** 当前显示的楼层 */
1311
- shownfloor: number | null;
1486
+ shownFloor: number | null;
1487
+ /** 楼层的数量 */
1488
+ floorLength: number;
1489
+ /** 模型瓦片 */
1490
+ originModel?: PBMContainer;
1491
+ /** 模型瓦片 */
1492
+ tiledModel?: Tile3DModel;
1312
1493
  /**
1313
1494
  * 判断是否注册了事件
1314
1495
  * 具体可查看 {@link Subscribe.hasListener}
@@ -1335,18 +1516,48 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1335
1516
  */
1336
1517
  emit: SubscribeMixinType.emit<ModelEventType>;
1337
1518
  /** bvh 树的计算结果 */
1338
- bvhs: any[] & {
1339
- loaded?: boolean;
1519
+ bvhs: BVH[] & {
1520
+ loaded: boolean;
1340
1521
  };
1341
- constructor();
1522
+ /** 网络代理 */
1523
+ private requestProxy?;
1524
+ /** 网络跟踪 */
1525
+ private networkSubscribe?;
1526
+ /** 安全域名 */
1527
+ private allowHosts?;
1528
+ constructor(options?: {
1529
+ networkSubscribe?: NetworkSubscribe;
1530
+ requestProxy?: (url: string) => string;
1531
+ allowHosts?: string[];
1532
+ });
1533
+ /**
1534
+ * 当前显示的楼层
1535
+ * @deprecated
1536
+ * 请用 shwonFloor 代替
1537
+ */
1538
+ get shownfloor(): number | null;
1539
+ /**
1540
+ * 当前模型是否支持瓦片
1541
+ */
1542
+ get hasTiles(): boolean;
1543
+ /**
1544
+ * 是否开启瓦片
1545
+ */
1546
+ get enableTiles(): boolean;
1547
+ set enableTiles(enable: boolean);
1342
1548
  /**
1343
1549
  * 获取模型边界线
1344
1550
  * @param threshold - 面片间夹角阈值
1345
1551
  * @returns 所有模型边界线
1346
1552
  */
1347
1553
  getEdges(threshold?: number): THREE_2.Line3[];
1348
- /** 获取当前楼层数 */
1554
+ /**
1555
+ * 获取当前楼层数
1556
+ * @deprecated
1557
+ * 请使用 floorLength 参数代替
1558
+ */
1349
1559
  hasFloors(): number;
1560
+ private hasFloors_;
1350
1561
  /**
1351
1562
  * 显示某楼层
1352
1563
  * @example
@@ -1357,7 +1568,9 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1357
1568
  * ```
1358
1569
  */
1359
1570
  show(): void;
1360
- show(floorIndex: number, hideOpacity?: number): void;
1571
+ show(floorIndex: number, hiddenOpacity?: number): void;
1572
+ private at3dShow;
1573
+ private b3dmShow;
1361
1574
  /**
1362
1575
  * 计算模型射线碰撞检测
1363
1576
  * @param raycaster - THREE 射线对象
@@ -1365,13 +1578,14 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1365
1578
  * @returns 返回碰撞
1366
1579
  */
1367
1580
  intersectRaycaster(raycaster: THREE_2.Raycaster, floors?: number | number[]): Intersection[];
1368
- buildBVH(): Promise<void>;
1581
+ buildBVH(): void;
1369
1582
  /**
1370
1583
  * 加载模型
1371
1584
  * @param workModel - work 的 model 内容
1372
1585
  * @param imageOptions - 图片参数
1373
1586
  */
1374
- load(workModel: WorkModel, imageOptions?: ImageOptions): void;
1587
+ load(workModel: WorkModel, textureOptions?: TextureOptions): Promise<void>;
1588
+ update(renderer: THREE_2.WebGLRenderer, camera: THREE_2.PerspectiveCamera): void;
1375
1589
  /**
1376
1590
  * 析构函数
1377
1591
  * @description
@@ -1410,6 +1624,11 @@ export declare type ModelEventType = {
1410
1624
  materialLoaded(): void;
1411
1625
  /** 模型加载完成 */
1412
1626
  loaded(): void;
1627
+ /**
1628
+ * 显示楼层改变
1629
+ * @param shownFloor - 显示的楼层
1630
+ */
1631
+ shownFloorChange(shownFloor: number | null, totalFloorLength: number): void;
1413
1632
  /**
1414
1633
  * 内部错误
1415
1634
  * @param error - 错误对象
@@ -1428,9 +1647,10 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1428
1647
  * @description
1429
1648
  * - `fly` 通过相机移动方式变化
1430
1649
  * - `fade` 通过渐变方式变化
1650
+ * - `montage` 通过渐变穿插到黑屏方式变化
1431
1651
  * - `instant` 通过插入黑屏方式变化
1432
1652
  */
1433
- effect?: "fly" | "fade" | "instant";
1653
+ effect?: "fly" | "fade" | "montage" | "instant";
1434
1654
  /**
1435
1655
  * 运动耗时
1436
1656
  * @description
@@ -1456,15 +1676,84 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1456
1676
  moveCancelCallback?: () => void;
1457
1677
  }
1458
1678
 
1679
+ export declare type NetWorkMeta = {
1680
+ source: string;
1681
+ headers: {
1682
+ [name: string]: string;
1683
+ };
1684
+ requestTime: number;
1685
+ responseTime: number;
1686
+ costs: number;
1687
+ size?: number;
1688
+ };
1689
+
1690
+ export declare type NetworkState = "ok" | "preload" | "error" | "timeout" | "forbidden";
1691
+
1692
+ export declare class NetworkSubscribe extends Subscribe<{
1693
+ network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
1694
+ }> {
1695
+ }
1696
+
1697
+ export declare type NetworkType = "XMLHttpRequest" | "Script" | "Image" | "Link";
1698
+
1699
+ export declare class PanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
1700
+ needsRender: boolean;
1701
+ private loadingMesh;
1702
+ private disableMesh;
1703
+ private centerMesh;
1704
+ private ringMesh;
1705
+ private progressMesh;
1706
+ private ringRotateMotion;
1707
+ private tapMotion;
1708
+ private progressMotion;
1709
+ private progressOpacityMotion;
1710
+ private opacityMotion;
1711
+ progress: number;
1712
+ opacity: number;
1713
+ current: boolean;
1714
+ loading: boolean;
1715
+ disabled: boolean;
1716
+ constructor();
1717
+ setProgress(progress: number): void;
1718
+ setOpacity(opacity: number): void;
1719
+ setCurrent(current: boolean): void;
1720
+ setLoading(loading: boolean): void;
1721
+ setDisabled(disabled: boolean): void;
1722
+ tap(): Promise<void>;
1723
+ updateTime(time: number, deltaTime: number): void;
1724
+ dispose(): void;
1725
+ }
1726
+
1727
+ /**
1728
+ * 地面提示点位接口
1729
+ *
1730
+ * 点位状态
1731
+ * 1. 默认状态: 无任何操作的情况
1732
+ * 2. 高亮状态: 高亮,认为是合适的下一个点位,或者设备选中了某个点位
1733
+ * 3. 进度状态: 点位加载中,存在进度的情况
1734
+ * 4. 加载状态: 点位加载中,不存在进度的情况
1735
+ * 5. 不可用状态:点位不可用,存在点位,但是点位是个摆设
1736
+ * 6. 点击动画: 点位被选择,触发全景图切换
1737
+ * 7. 透明度改变: 一般会处理为近的点位透明度高,远的点位透明度低
1738
+ */
1459
1739
  export declare interface PanoCircleMeshInterface extends THREE_2.Object3D {
1460
1740
  needsRender: boolean;
1741
+ hitTestMesh?: THREE_2.Mesh;
1742
+ /** 当前高亮 */
1743
+ current: boolean;
1744
+ /** 是否当前高亮 */
1745
+ setCurrent(current: boolean): void;
1461
1746
  loading: boolean;
1747
+ setLoading(loading: boolean): void;
1462
1748
  disabled: boolean;
1463
- panoIndex: number;
1464
- setLoading(shown: boolean): void;
1465
1749
  setDisabled(disabled: boolean): void;
1750
+ progress: number;
1466
1751
  setProgress(progress: number): void;
1752
+ opacity: number;
1467
1753
  setOpacity(opacity: number): void;
1754
+ updateTime?(time: number, deltaTime: number): void;
1755
+ /** 点击交互 */
1756
+ tap?(): Promise<void>;
1468
1757
  dispose(): void;
1469
1758
  }
1470
1759
 
@@ -1480,6 +1769,13 @@ export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeCo
1480
1769
  panoTapTriggerRadius?: number;
1481
1770
  /** 地面观察点标识自定义创建器 */
1482
1771
  panoCircleMeshCreator?: () => PanoCircleMeshInterface;
1772
+ /**
1773
+ * 全景瓦片登记
1774
+ * @param fov - 当前 fov
1775
+ * @param viewSize - 当前绘制区域大小
1776
+ * @returns 返回瓦片等级
1777
+ */
1778
+ tileLevelForFov?: false | ((fov: number, viewSize: THREE_2.Vector2) => number);
1483
1779
  }
1484
1780
 
1485
1781
  export declare interface PanoramaLikeControllerCustomInitArgs {
@@ -1507,14 +1803,31 @@ export declare interface PanoramaLikeControllerCustomInitArgs {
1507
1803
  intersectMeshCreator?: () => IntersectMeshInterface;
1508
1804
  }
1509
1805
 
1510
- export declare function parseWork(obj: Work | LooseWork | any): Work;
1806
+ /**
1807
+ * 解析 Work 数据
1808
+ * @param obj - work 数据,从如数开发者平台获取
1809
+ * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
1810
+ * @param urlTransform - 配置参数, URL 解析规则
1811
+ * @returns - 签署过的 Work 数据结构
1812
+ */
1813
+ export declare function parseWork(obj: Work | LooseWork | string | any, options?: ParseWorkOptions, urlTransform?: (origin: string, absolute: string, relative: string, type: "panorama" | "texture" | "model") => void): Work;
1814
+
1815
+ export declare type ParseWorkOptions = {
1816
+ /** 重写 work 中的资源前缀 */
1817
+ baseURL?: string;
1818
+ /** work 中的资源地址使用短地址 */
1819
+ shortPath?: boolean;
1820
+ /** work 中的资源使用 jsonp 方式发布 */
1821
+ jsonp?: boolean;
1822
+ /** work 中模型是否计算bvh碰撞数,默认计算 true */
1823
+ modelBvh?: boolean;
1824
+ };
1511
1825
 
1512
1826
  /** PBM 模型组 */
1513
- export declare class PBMGroup extends THREE_2.Group {
1514
- /** 楼层序号 */
1515
- floorIndex: number;
1827
+ export declare class PBMContainer extends THREE_2.Group {
1516
1828
  /** 是否需要更新按需渲染 */
1517
1829
  needsRender: boolean;
1830
+ private enableTransparent;
1518
1831
  /** 获取是否有透明参数 */
1519
1832
  getTransparent(): boolean;
1520
1833
  /** 设置透明参数 */
@@ -1529,39 +1842,32 @@ export declare class PBMGroup extends THREE_2.Group {
1529
1842
  disposeGeometry(): void;
1530
1843
  }
1531
1844
 
1845
+ /** PBM 模型组 */
1846
+ export declare class PBMGroup extends PBMContainer {
1847
+ /** 楼层序号 */
1848
+ floorIndex: number;
1849
+ }
1850
+
1532
1851
  /** PBM 材质 */
1533
1852
  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;
1853
+ /** 起始点 */
1854
+ pano0: PBMPanoPicture | null;
1855
+ /** 结束点 */
1856
+ pano1: PBMPanoPicture | null;
1542
1857
  /** 模型贴图和全景图的混合程度 [0-1] */
1543
1858
  modelAlpha: number;
1544
1859
  /** 全景图混合程度 [0-1] */
1545
1860
  progress: number;
1546
1861
  /** 全景图通过过度黑色混合 */
1547
1862
  useBlackTransition: boolean;
1863
+ /** XR模式防止申请纹理显存时的黑色过渡 */
1864
+ useXRBlackTransition: boolean;
1548
1865
  perspToOrtho: number;
1549
1866
  /** 模型透明度 */
1550
1867
  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;
1868
+ originOpacity: number;
1869
+ /** 楼层切割参数*/
1870
+ floorInfo: THREE_2.Vector3 | null;
1565
1871
  constructor(parameters?: Partial<PBMParameters>);
1566
1872
  }
1567
1873
 
@@ -1573,39 +1879,34 @@ export declare class PBMMesh extends THREE_2.Mesh<THREE_2.BufferGeometry, PBMMat
1573
1879
  needsRender: boolean;
1574
1880
  }
1575
1881
 
1576
- /** PBM 材质参数 */
1577
- export declare interface PBMParameters {
1882
+ export declare interface PBMPanoPicture {
1578
1883
  /** 起始点位全景图 */
1579
- pano0Map: FiveHashCubeTexture | null;
1884
+ map: THREE_2.CubeTexture;
1885
+ /** 亮度增益 */
1886
+ luminanceMap: THREE_2.CubeTexture | null;
1580
1887
  /** 起始点全景图变换矩阵 4x4 */
1581
- pano0Matrix: THREE_2.Matrix4;
1582
- /** 结束点位全景图 */
1583
- pano1Map: FiveHashCubeTexture | null;
1584
- /** 结束点位全景图变换矩阵 */
1585
- pano1Matrix: THREE_2.Matrix4;
1888
+ matrix: THREE_2.Matrix4;
1889
+ }
1890
+
1891
+ /** PBM 材质参数 */
1892
+ export declare interface PBMParameters {
1893
+ /** 起始点 */
1894
+ pano0: PBMPanoPicture | null;
1895
+ /** 结束点 */
1896
+ pano1: PBMPanoPicture | null;
1586
1897
  /** 模型贴图和全景图的混合程度 [0-1] */
1587
1898
  modelAlpha: number;
1588
1899
  /** 全景图混合程度 [0-1] */
1589
1900
  progress: number;
1590
1901
  /** 全景图通过过度黑色混合 */
1591
1902
  useBlackTransition: boolean;
1903
+ /** XR模式防止申请纹理显存时的黑色过渡 */
1904
+ useXRBlackTransition: boolean;
1592
1905
  perspToOrtho: number;
1593
1906
  /** 模型透明度 */
1594
1907
  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;
1908
+ /** 楼层切割参数*/
1909
+ floorInfo?: THREE_2.Vector3 | null;
1609
1910
  }
1610
1911
 
1611
1912
  /**
@@ -1613,17 +1914,25 @@ export declare interface PBMParameters {
1613
1914
  * [[include: coordinate.md]]
1614
1915
  */
1615
1916
  export declare interface Pose {
1616
- /** 相机俯仰角 */
1617
- longitude: number;
1618
1917
  /** 相机偏航角 */
1918
+ longitude: number;
1919
+ /** 相机俯仰角 */
1619
1920
  latitude: number;
1620
1921
  /** 相机可视角度(垂直)*/
1621
1922
  fov: number;
1622
1923
  /** 相机位置*/
1623
1924
  offset: THREE_2.Vector3;
1925
+ /** 相机距离 */
1926
+ distance: number;
1624
1927
  }
1625
1928
 
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"];
1929
+ 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"];
1930
+
1931
+ /** Five 场景*/
1932
+ export declare class Scene extends THREE_2.Scene {
1933
+ add(...objects: AddableObject[]): this;
1934
+ remove(...objects: AddableObject[]): this;
1935
+ }
1627
1936
 
1628
1937
  /**
1629
1938
  * 显示区域裁剪参数
@@ -1659,8 +1968,6 @@ export declare interface State extends Pose {
1659
1968
  panoIndex: number;
1660
1969
  }
1661
1970
 
1662
- export declare function stringifyWork(work: Work): LooseWork;
1663
-
1664
1971
  /**
1665
1972
  * 监听者模式
1666
1973
  * @template T - 预设的监听回调类型
@@ -1739,69 +2046,641 @@ export declare namespace SubscribeMixinType {
1739
2046
  }
1740
2047
  }
1741
2048
 
1742
- export declare interface TopviewControllerCustomInitArgs extends Omit<FloorplanControllerCustomInitArgs, "defaultLongitude" | "defaultLatitude" | "maxLatitude" | "minLatitude"> {
2049
+ /**
2050
+ * 图片参数
2051
+ */
2052
+ export declare interface TextureOptions {
2053
+ /**
2054
+ * url 地址转化
2055
+ * @param url - 原始地址
2056
+ * @param options - 当前地址参数
2057
+ * @returns 转化后地址
2058
+ */
2059
+ transform?: (url: string, options: ImageURLOptions) => string;
2060
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
2061
+ size?: number;
2062
+ /** 图片质量参数(0-100) */
2063
+ quality?: number;
2064
+ /** 图片格式参数 */
2065
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
2066
+ /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
2067
+ autoResize?: boolean;
2068
+ /** 锐化参数 海外不支持 */
2069
+ sharpen?: number;
2070
+ mappings?: ImageURLMappings;
1743
2071
  }
1744
2072
 
1745
- export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2073
+ /**
2074
+ * A Tile3DHeader represents a tile as Tileset3D. When a tile is first created, its content is not loaded;
2075
+ * the content is loaded on-demand when needed based on the view.
2076
+ * Do not construct this directly, instead access tiles through {@link Tileset3D#tileVisible}.
2077
+ */
2078
+ export declare class Tile3D {
2079
+ cacheNode?: TileCacheNode<Tile3D>;
2080
+ tileset: Tileset3D;
2081
+ header: TilesetJSONNode;
2082
+ content?: TileContent;
2083
+ parent?: Tile3D;
2084
+ boundingVolume: TileOrientedBoundingBox;
2085
+ contentState: "UNLOADED" | "LOADING" | "PROCESSING" | "READY" | "FAILED";
2086
+ children: Tile3D[];
2087
+ depth: number;
2088
+ selectionDepth: number;
2089
+ transform: Matrix4;
2090
+ computedTransform: Matrix4;
2091
+ frameNumber: number;
2092
+ touchedFrameNumber: number;
2093
+ requestedFrameNumber: number;
2094
+ selectedFrameNumber: number;
2095
+ distanceToCamera: number;
2096
+ centerZDepth: number;
2097
+ screenSpaceError: number;
2098
+ visibilityPlaneMask: number;
2099
+ visible: boolean;
2100
+ shouldRefine: boolean;
2101
+ /**
2102
+ * @constructs
2103
+ * Create a TileHeader instance
2104
+ * @param tileset - Tileset3D instance
2105
+ * @param header - tile header - JSON loaded from a dataset
2106
+ * @param parentHeader - parent TileHeader instance
2107
+ */
2108
+ constructor(tileset: Tileset3D, header: TilesetJSONNode, parentHeader?: Tile3D);
2109
+ get id(): string;
2110
+ get refine(): "REPLACE" | "ADD";
2111
+ get type(): "EMPTY" | "SCENEGRAPH" | "MESH";
2112
+ get contentUrl(): string;
2113
+ get lodMetricType(): "geometricError";
2114
+ get lodMetricValue(): number;
2115
+ get hasEmptyContent(): boolean;
2116
+ get selected(): boolean;
2117
+ /** Returns true if tile is not an empty tile and not an external tileset */
2118
+ get hasRenderContent(): boolean;
2119
+ /** Returns true if tile has children */
2120
+ get hasChildren(): boolean;
2121
+ /**
2122
+ * Determines if the tile's content is ready. This is automatically `true` for
2123
+ * tiles with empty content.
2124
+ */
2125
+ get contentReady(): boolean;
2126
+ /**
2127
+ * Determines if the tile has available content to render. `true` if the tile's
2128
+ * content is ready or if it has expired content this renders while new content loads; otherwise,
2129
+ */
2130
+ get contentAvailable(): boolean;
2131
+ /** Returns true if tile has renderable content but it's unloaded */
2132
+ get hasUnloadedContent(): boolean;
2133
+ /**
2134
+ * Determines if the tile's content has not be requested. `true` if tile's
2135
+ * content has not be requested; otherwise, `false`.
2136
+ */
2137
+ get contentUnloaded(): boolean;
2138
+ get contentFailed(): boolean;
2139
+ /** Get the tile's screen space error. */
2140
+ getScreenSpaceError(frameState: TileFrameState, useParentLodMetric: boolean): number;
2141
+ private getPriority;
2142
+ /**
2143
+ * Requests the tile's content.
2144
+ * The request may not be made if the Request Scheduler can't prioritize it.
2145
+ */
2146
+ loadContent(): Promise<boolean>;
2147
+ unloadContent(): void;
2148
+ /**
2149
+ * Update the tile's visibility
2150
+ */
2151
+ updateVisibility(frameState: TileFrameState): void;
2152
+ private visibility;
2153
+ /**
2154
+ * Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.
2155
+ * @param frameState - The frame state.
2156
+ * @returns The distance, in meters, or zero if the camera is inside the bounding volume.
2157
+ */
2158
+ private distanceToTile;
2159
+ private updateTransform;
2160
+ }
2161
+
2162
+ export declare class Tile3DModel extends PBMContainer {
2163
+ tileset?: Tileset3D;
2164
+ private options;
2165
+ private nodeGroup;
2166
+ private boundingGroup;
2167
+ private nodes;
2168
+ private boundings;
2169
+ private unloadTileQueue;
2170
+ private timer;
2171
+ private clock;
2172
+ private lastCameraTransform;
2173
+ private lastCameraAspect;
2174
+ private lastCameraFov;
2175
+ private sseDenominator;
2176
+ private lastCamera;
2177
+ private lastRenderer;
2178
+ private enabled;
2179
+ constructor(loaderOptions?: Partial<Tile3DModelLoaderOptions>);
2180
+ get enable(): boolean;
2181
+ set enable(value: boolean);
2182
+ load(url: WorkModelTiles): void;
2183
+ update(renderer: THREE_2.WebGLRenderer, camera: THREE_2.PerspectiveCamera): void;
2184
+ private tilesetUpdate;
2185
+ reset(): void;
2186
+ }
2187
+
2188
+ /** Advanced loader options */
2189
+ export declare interface Tile3DModelLoaderOptions {
2190
+ updateInterval: number;
2191
+ maxMemoryUsage: number;
2192
+ maxScreenSpaceError: number;
2193
+ viewDistanceScale: number;
2194
+ throttleRequests: boolean;
2195
+ maxRequests: number;
2196
+ onNodeCreated: (node: PBMGroup) => void;
2197
+ allowHosts?: string[];
2198
+ requestProxy?: (url: string) => string;
2199
+ networkSubscribe?: NetworkSubscribe;
2200
+ maxDepth?: number;
2201
+ }
2202
+
2203
+ export declare class TileBoundingSphere {
2204
+ center: Vector3;
2205
+ radius: number;
2206
+ constructor(center?: number[], radius?: number);
2207
+ fromCenterRadius(center: number[], radius: number): this;
2208
+ fromCornerPoints(corner: number[], oppositeCorner: number[]): this;
2209
+ equals(right: TileBoundingSphere): boolean;
2210
+ clone(): TileBoundingSphere;
2211
+ union(boundingSphere: TileBoundingSphere): TileBoundingSphere;
2212
+ expand(point: number[]): this;
2213
+ transform(transform: Matrix4): this;
2214
+ distanceSquaredTo(point: number[]): number;
2215
+ distanceTo(point: number[]): number;
2216
+ intersectPlane(plane: TilePlane): number;
2217
+ }
2218
+
2219
+ export declare interface TileBoundingVolume {
1746
2220
  /**
1747
- * webvrPolyfill 的设置对象
1748
- * @description
1749
- * 只可被设置一次,所有的 five 实例共用这个设置
2221
+ * Applies a 4x4 affine transformation matrix to a bounding sphere.
2222
+ * @param sphere - The bounding sphere to apply the transformation to.
2223
+ * @param transform - The transformation matrix to apply to the bounding sphere.
2224
+ * @returns itself, i.e. the modified BoundingVolume.
2225
+ */
2226
+ transform(transform: readonly number[]): this;
2227
+ /** Computes the estimated distance squared from the closest point on a bounding sphere to a point. */
2228
+ distanceSquaredTo(point: readonly number[]): number;
2229
+ /** Computes the estimated distance from the closest point on a bounding sphere to a point. */
2230
+ distanceTo(point: readonly number[]): number;
2231
+ /**
2232
+ * Determines which side of a plane the oriented bounding box is located.
2233
+ *
2234
+ * @param plane - The plane to test against.
2235
+ * @returns
2236
+ * - `INTERSECTION.INSIDE` if the entire box is on the side of the plane the normal is pointing.
2237
+ * - `INTERSECTION.OUTSIDE` if the entire box is on the opposite side.
2238
+ * - `INTERSECTION.INTERSECTING` if the box intersects the plane.
1750
2239
  */
1751
- webvrPolyfillConfig?: any;
2240
+ intersectPlane(plane: TilePlane): number;
2241
+ }
2242
+
2243
+ export declare class TileCacheNode<T> {
2244
+ item: T;
2245
+ previous: TileCacheNode<T> | null;
2246
+ next: TileCacheNode<T> | null;
2247
+ constructor(item: T, previous: TileCacheNode<T> | null, next: TileCacheNode<T> | null);
2248
+ }
2249
+
2250
+ export declare interface TileContent {
2251
+ version: 1;
2252
+ magic: number;
2253
+ byteLength: number;
2254
+ header: {
2255
+ featureTableJsonByteLength: number;
2256
+ featureTableBinaryByteLength: number;
2257
+ batchTableJsonByteLength: number;
2258
+ batchTableBinaryByteLength: number;
2259
+ batchLength: number;
2260
+ };
2261
+ featureTableJson: Record<string, any>;
2262
+ featureTableBinary: Uint8Array;
2263
+ batchTableJson: Record<string, any>;
2264
+ batchTableBinary: Uint8Array;
2265
+ rotateYtoZ: boolean;
2266
+ gltfUpAxis: "X" | "Y" | "Z";
2267
+ gltfArrayBuffer: ArrayBuffer;
2268
+ gltfByteOffset: number;
2269
+ gltfByteLength: number;
2270
+ rtcCenter?: Float32Array;
2271
+ }
2272
+
2273
+ export declare class TileCullingVolume {
2274
+ static get MASK_OUTSIDE(): number;
2275
+ static get MASK_INSIDE(): number;
2276
+ static get MASK_INDETERMINATE(): number;
2277
+ planes: TilePlane[];
2278
+ constructor(planes?: TilePlane[]);
2279
+ fromBoundingSphere(boundingSphere: {
2280
+ center: Vector3;
2281
+ radius: number;
2282
+ }): this;
2283
+ computeVisibilityWithPlaneMask(boundingVolume: TileBoundingVolume, parentPlaneMask: number): number;
2284
+ }
2285
+
2286
+ export declare type TileFrameState = {
2287
+ camera: {
2288
+ position: number[];
2289
+ direction: number[];
2290
+ up: number[];
2291
+ };
2292
+ height: number;
2293
+ cullingVolume: TileCullingVolume;
2294
+ frameNumber: number;
2295
+ sseDenominator: number;
2296
+ };
2297
+
2298
+ export declare class TileOrientedBoundingBox {
2299
+ center: Vector3;
2300
+ halfAxes: Matrix3;
2301
+ constructor(center?: number[], halfAxes?: number[]);
2302
+ get halfSize(): number[];
2303
+ get quaternion(): Quaternion;
2304
+ fromCenterHalfSizeQuaternion(center: number[], halfSize: number[], quaternion: number[]): this;
2305
+ clone(): TileOrientedBoundingBox;
2306
+ equals(right: TileOrientedBoundingBox): boolean;
2307
+ getBoundingSphere(result?: TileBoundingSphere): TileBoundingSphere;
2308
+ intersectPlane(plane: TilePlane): number;
2309
+ distanceTo(point: number[]): number;
2310
+ distanceSquaredTo(point: number[]): number;
2311
+ computePlaneDistances(position: Vector3, direction: Vector3, result?: number[]): number[];
2312
+ transform(transformation: number[]): this;
2313
+ }
2314
+
2315
+ export declare class TilePlane {
2316
+ normal: Vector3;
2317
+ distance: number;
2318
+ constructor(normal?: number[], distance?: number);
2319
+ fromNormalDistance(normal: number[], distance: number): this;
2320
+ fromPointNormal(point: number[], normal: number[]): this;
2321
+ fromCoefficients(a: number, b: number, c: number, d: number): this;
2322
+ clone(): TilePlane;
2323
+ equals(right: TilePlane): boolean;
2324
+ getPointDistance(point: number[]): number;
2325
+ transform(matrix4: Matrix4): this;
2326
+ projectPointOntoPlane(point: number[], result?: number[]): Vector3;
2327
+ }
2328
+
2329
+ /** Tracks one request */
2330
+ export declare type TileRequest<Identiy> = {
2331
+ identiy: Identiy;
2332
+ priority: number;
2333
+ getPriority: (identiy: Identiy) => number;
2334
+ resolve: (requestResult: TileRequestResult) => void;
2335
+ };
2336
+
2337
+ export declare type TileRequestResult = null | {
2338
+ done: () => void;
2339
+ };
2340
+
2341
+ /**
2342
+ * Used to issue a request, without having them "deeply queued" by the browser.
2343
+ * @todo - Track requests globally, across multiple servers
2344
+ */
2345
+ export declare class TileRequestScheduler<Identiy> {
2346
+ private props;
2347
+ private activeRequestCount;
2348
+ /** Tracks the number of active requests and prioritizes/cancels queued requests. */
2349
+ private requestQueue;
2350
+ private requestMap;
2351
+ private deferred;
2352
+ constructor(props?: TileRequestSchedulerOptions);
2353
+ /**
2354
+ * Called by an application that wants to issue a request, without having it deeply queued by the browser
2355
+ *
2356
+ * When the returned promise resolved, it is OK for the application to issue a request.
2357
+ * The promise resolves to an object that contains a `done` method.
2358
+ * When the application's request has completed (or failed), the application must call the `done` function
2359
+ *
2360
+ * @param identiy - Identiy
2361
+ * @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
2362
+ * @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
2363
+ */
2364
+ scheduleRequest(identiy: Identiy, getPriority?: (identiy: Identiy) => number): Promise<TileRequestResult>;
2365
+ private issueRequest;
2366
+ /** We check requests asynchronously, to prevent multiple updates */
2367
+ private issueNewRequests;
2368
+ /** Refresh all requests */
2369
+ private issueNewRequestsAsync;
2370
+ /** Ensure all requests have updated priorities, and that no longer valid requests are cancelled */
2371
+ private updateAllRequests;
2372
+ /** Update a single request by calling the callback */
2373
+ private updateRequest;
2374
+ }
2375
+
2376
+ /** RequestScheduler Options */
2377
+ export declare type TileRequestSchedulerOptions = {
2378
+ throttleRequests?: boolean;
2379
+ maxRequests?: number;
2380
+ };
2381
+
2382
+ export declare class Tileset3D {
2383
+ rawJson: any;
2384
+ options: Tileset3dOptions;
2385
+ root: Tile3D;
2386
+ traverser: Tileset3DTraverser;
2387
+ cache: TilesetCache;
2388
+ requestScheduler: TileRequestScheduler<string>;
2389
+ selectedTiles: Tile3D[];
2390
+ requestedTiles: Tile3D[];
2391
+ memoryUsageInBytes: number;
2392
+ frameNumber: number;
2393
+ private _tiles;
2394
+ private pendingCount;
2395
+ b3dmMapping: TilesetJSON['b3dmMapping'];
2396
+ /**
2397
+ * Create a new Tileset3D
2398
+ * @param json - TilesetJSON
2399
+ * @param options - Tileset3dOptions
2400
+ */
2401
+ constructor(json: TilesetJSON, options: Tileset3dOptions);
2402
+ get maxMemoryUsage(): number;
2403
+ get asset(): any;
2404
+ get type(): any;
2405
+ get basePath(): any;
2406
+ get modelMatrix(): Matrix4;
2407
+ get geometricError(): number;
2408
+ get lodMetricType(): number;
2409
+ get lodMetricValue(): number;
2410
+ get refine(): 'ADD' | "REPLACE";
2411
+ get tiles(): Tile3D[];
2412
+ get floorInfo(): TilesetJSON['floorInfo'];
2413
+ /** Release resources */
2414
+ reset(): void;
2415
+ /** Is the tileset loaded (update needs to have been called at least once) */
2416
+ isLoaded(): boolean;
2417
+ /**
2418
+ * The callback to post-process tiles after traversal procedure
2419
+ * @param frameState - frame state for tile culling
2420
+ */
2421
+ private onTraversalEnd;
2422
+ loadTile(tile: Tile3D): void;
2423
+ unloadTile(tile: Tile3D): void;
2424
+ }
2425
+
2426
+ export declare interface Tileset3dOptions {
2427
+ throttleRequests: boolean;
2428
+ maxRequests: number;
2429
+ maxMemoryUsage: number;
2430
+ modelMatrix: Matrix4;
2431
+ maxScreenSpaceError: number;
2432
+ viewDistanceScale: number;
2433
+ onTileLoad: (tile: Tile3D) => any;
2434
+ onTileUnload: (tile: Tile3D) => any;
2435
+ onTileError: (tile: Tile3D, message: string) => any;
2436
+ contentLoader: (tile: Tile3D) => Promise<void>;
2437
+ onTraversalComplete: (selectedTiles: Tile3D[]) => Tile3D[];
2438
+ allowHosts?: string[];
2439
+ requestProxy?: (url: string) => string;
2440
+ networkSubscribe?: NetworkSubscribe;
2441
+ maxDepth?: number;
2442
+ }
2443
+
2444
+ export declare class Tileset3DTraverser {
2445
+ root: Tile3D | null;
2446
+ options: TilesetTraverserProps;
2447
+ requestedTiles: Record<string, Tile3D>;
2448
+ selectedTiles: Record<string, Tile3D>;
2449
+ emptyTiles: Record<string, Tile3D>;
2450
+ private _traversalStack;
2451
+ private _emptyTraversalStack;
2452
+ private _frameNumber;
2453
+ constructor(options: TilesetTraverserProps);
2454
+ traverse(root: Tile3D, frameState: TileFrameState): void;
2455
+ reset(): void;
2456
+ private executeTraversal;
2457
+ private updateChildTiles;
2458
+ private updateAndPushChildren;
2459
+ updateTile(tile: Tile3D, frameState: TileFrameState): void;
2460
+ selectTile(tile: Tile3D, frameState: TileFrameState): void;
2461
+ loadTile(tile: Tile3D, frameState: TileFrameState): void;
2462
+ touchTile(tile: Tile3D, frameState: TileFrameState): void;
2463
+ private canTraverse;
2464
+ private shouldLoadTile;
2465
+ private shouldSelectTile;
2466
+ private shouldRefine;
2467
+ private updateTileVisibility;
2468
+ private meetsScreenSpaceErrorEarly;
2469
+ private compareDistanceToCamera;
2470
+ private anyChildrenVisible;
2471
+ private everyChildrenVisibleIsLoaded;
2472
+ private executeEmptyTraversal;
2473
+ }
2474
+
2475
+ export declare class TilesetCache {
2476
+ private list;
2477
+ private sentinel;
2478
+ constructor();
2479
+ reset(): void;
2480
+ touch(tile: Tile3D): void;
2481
+ add(tile: Tile3D, addCallback?: (tile: Tile3D) => void): void;
2482
+ unloadTile(tile: Tile3D, unloadCallback?: (tile: Tile3D) => void): void;
2483
+ unloadTiles(isOverMemory: () => boolean, unloadCallback?: (tile: Tile3D) => void): void;
2484
+ }
2485
+
2486
+ export declare interface TilesetJSON {
2487
+ asset: {
2488
+ gltfUpAxis: "X" | "Y" | "Z";
2489
+ version: "1.0";
2490
+ };
2491
+ basePath: string;
2492
+ lodMetricType: "geometricError";
2493
+ geometricError: number;
2494
+ lodMetricValue: number;
2495
+ root: TilesetJSONNode;
2496
+ type: "TILES3D";
2497
+ floorInfo: {
2498
+ ground: number;
2499
+ height: number;
2500
+ }[];
2501
+ b3dmMapping: {
2502
+ b3dm_base_url: string;
2503
+ b3dm_url: Record<string, string>;
2504
+ };
1752
2505
  }
1753
2506
 
1754
- export declare type Work = {
1755
- uuid: string;
2507
+ export declare interface TilesetJSONNode {
2508
+ boundingVolume: {
2509
+ box: number[];
2510
+ };
2511
+ content: {
2512
+ uri: string;
2513
+ };
2514
+ id: string;
2515
+ transform?: number[];
2516
+ contentUrl?: string;
2517
+ children: TilesetJSONNode[];
2518
+ lodMetricType: "geometricError";
2519
+ geometricError: number;
2520
+ lodMetricValue: number;
2521
+ refine: "REPLACE" | "ADD";
2522
+ type: "EMPTY" | "SCENEGRAPH" | "MESH";
2523
+ }
2524
+
2525
+ export declare type TilesetTraverserProps = {
2526
+ loadSiblings: boolean;
2527
+ skipLevelOfDetail: boolean;
2528
+ maxScreenSpaceError: number;
2529
+ maxDepth?: number;
2530
+ onTraversalEnd: (frameState: TileFrameState) => any;
2531
+ };
2532
+
2533
+ export declare interface TopviewControllerCustomInitArgs extends Omit<FloorplanControllerCustomInitArgs, "defaultLongitude" | "defaultLatitude" | "maxLatitude" | "minLatitude"> {
2534
+ }
2535
+
2536
+ export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2537
+ }
2538
+
2539
+ export declare type WebXREventTypes = {
2540
+ /** WebXR模式开始,session完成坐标系设置*/
2541
+ webXRSessionStart(): void;
2542
+ /** WebXR模式结束,销毁session*/
2543
+ webXRSessionEnd(): void;
2544
+ };
2545
+
2546
+ export declare type WebXRSelectType = "Select" | "Squeeze";
2547
+
2548
+ export declare class Work {
2549
+ /** 名称 */
2550
+ name: string;
2551
+ /** 编号 */
2552
+ workCode: string;
2553
+ /** 允许访问的安全域名 */
2554
+ allowHosts: string[];
2555
+ /** 过期时间 */
2556
+ expire: Date;
2557
+ /** 初始化参数 */
1756
2558
  initial: WorkInitial;
2559
+ /** 模型参数 */
1757
2560
  model?: WorkModel;
2561
+ /** 全景点位信息 */
1758
2562
  observers: WorkObserver[];
1759
- };
2563
+ /** 数据签发人 */
2564
+ issuer: string;
2565
+ /** 原始数据 */
2566
+ raw: {
2567
+ works: string[];
2568
+ options: string;
2569
+ };
2570
+ /**
2571
+ * 解析 Work 数据
2572
+ * @param obj - work 数据,从如数开发者平台获取
2573
+ * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
2574
+ * @param urlTransform - 配置参数, URL 解析规则
2575
+ * @returns - 签署过的 Work 数据结构
2576
+ */
2577
+ static parse: typeof parseWork;
2578
+ constructor();
2579
+ toJSON(): any;
2580
+ }
1760
2581
 
1761
- /** 全景图 */
1762
- export declare type WorkImages = {
2582
+ export declare interface WorkCubeImage {
2583
+ /** 全景图 up */
1763
2584
  up: string;
2585
+ /** 全景图 down */
1764
2586
  down: string;
2587
+ /** 全景图 right */
1765
2588
  right: string;
2589
+ /** 全景图 left */
1766
2590
  left: string;
2591
+ /** 全景图 front */
1767
2592
  front: string;
2593
+ /** 全景图 back */
1768
2594
  back: string;
2595
+ }
2596
+
2597
+ /** 全景图 */
2598
+ export declare interface WorkImage extends WorkCubeImage {
2599
+ /** 深度图 */
1769
2600
  depth?: string;
1770
- tiles?: string;
1771
- };
2601
+ /** 光照强度图 */
2602
+ luminance?: WorkCubeImage;
2603
+ /** 瓦片信息 */
2604
+ tiles?: WorkTile[];
2605
+ }
1772
2606
 
1773
2607
  /** 初始化位姿参数 */
1774
- export declare type WorkInitial = Omit<State, "offset">;
2608
+ export declare interface WorkInitial extends Omit<State, "offset" | "distance"> {
2609
+ }
1775
2610
 
1776
2611
  /** 模型数据 */
1777
- export declare type WorkModel = {
2612
+ export declare interface WorkModel {
2613
+ /** 模型文件地址 at3d / domez */
1778
2614
  file: string;
2615
+ /** 模型贴图文件地址 */
1779
2616
  textures: string[];
2617
+ /** 模型贴图文件地址的父目录 */
1780
2618
  textureBase: string;
2619
+ /** 是否开启 bvh 碰撞树,开启会大大加快射线碰撞的执行效率 */
1781
2620
  bvh: boolean;
1782
- async: boolean;
1783
- };
2621
+ tiles?: WorkModelTiles;
2622
+ }
2623
+
2624
+ /** 模型瓦片 */
2625
+ export declare interface WorkModelTiles {
2626
+ tileset_url: string;
2627
+ tileset_url_md5: string;
2628
+ b3md_mappings_url: string;
2629
+ b3md_mappings_url_md5: string;
2630
+ }
1784
2631
 
1785
2632
  /** 每个点位的数据 */
1786
- export declare type WorkObserver = {
2633
+ export declare interface WorkObserver {
2634
+ /** 点位序号 */
1787
2635
  panoIndex: number;
2636
+ /** 点位是否激活可用 */
1788
2637
  active: boolean;
2638
+ /** 点位是否可加载 */
1789
2639
  loadable: boolean;
1790
- images: WorkImages;
2640
+ /** 点位全景图 */
2641
+ images: WorkImage;
2642
+ /** 点位视频 */
1791
2643
  video?: WorkVideo;
2644
+ /** 可以看到的相关点位序号 */
1792
2645
  visibleNodes: number[];
2646
+ /** 可以连通的相关点位序号 */
1793
2647
  accessibleNodes: number[];
2648
+ /** 点位和模型的旋转对齐关系四元数 */
1794
2649
  quaternion: THREE_2.Quaternion;
2650
+ /** 点位和模型的地面位置坐标关系 */
1795
2651
  standingPosition: THREE_2.Vector3;
2652
+ /** 点位和模型的观察点坐标关系 */
1796
2653
  position: THREE_2.Vector3;
2654
+ /** 点位所在楼层 */
1797
2655
  floorIndex: number;
1798
- };
2656
+ }
2657
+
2658
+ export declare interface WorkTile {
2659
+ level: number;
2660
+ size: number;
2661
+ up: string;
2662
+ down: string;
2663
+ right: string;
2664
+ left: string;
2665
+ front: string;
2666
+ back: string;
2667
+ }
1799
2668
 
1800
2669
  /** 全景视频贴片 */
1801
- export declare type WorkVideo = {
2670
+ export declare interface WorkVideo {
2671
+ /** 视频源 url */
1802
2672
  source: string;
2673
+ /** 视频源变化矩阵 */
1803
2674
  matrix: THREE_2.Matrix4;
2675
+ /** 视频源长宽尺寸 */
1804
2676
  size: THREE_2.Vector2;
1805
- };
2677
+ }
2678
+
2679
+ export declare class XRButton {
2680
+ static createButton(onClickHook: () => void): HTMLAnchorElement | HTMLButtonElement;
2681
+ }
2682
+
2683
+ export declare interface XRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2684
+ }
1806
2685
 
1807
2686
  export { }