@realsee/five 5.0.0-alpha.13 → 5.0.0-alpha.132

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 (203) 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 +303 -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 +17 -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.Tile3DModel.html +15 -0
  32. package/docs/classes/five.Work.html +30 -0
  33. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  34. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  35. package/docs/classes/line.Line.html +1 -0
  36. package/docs/classes/line.LineGeometry.html +1 -0
  37. package/docs/classes/line.LineMaterial.html +1 -0
  38. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  39. package/docs/classes/line.THREE_Line2.html +1 -0
  40. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  41. package/docs/classes/react.Store.html +29 -0
  42. package/docs/classes/server.BVH.html +10 -0
  43. package/docs/classes/server.BVHIntersect.html +1 -0
  44. package/docs/classes/server.BVHNode.html +7 -0
  45. package/docs/classes/server.BVHVector3.html +1 -0
  46. package/docs/classes/server.Model.html +63 -0
  47. package/docs/classes/server.PBMGroup.html +9 -0
  48. package/docs/classes/server.PBMMesh.html +7 -0
  49. package/docs/classes/sticker.Sticker.html +32 -0
  50. package/docs/index.html +166 -422
  51. package/docs/interfaces/five.AddableObject.html +1 -0
  52. package/docs/interfaces/five.AnimationFrame.html +1 -0
  53. package/docs/interfaces/five.CameraPose.html +1 -0
  54. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  55. package/docs/interfaces/five.EventCallback.html +391 -0
  56. package/docs/interfaces/five.FiveInitArgs.html +105 -0
  57. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
  58. package/docs/interfaces/five.ImageOptions.html +18 -0
  59. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  60. package/docs/interfaces/five.ImageURLOptions.html +17 -0
  61. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  62. package/docs/interfaces/five.Intersection.html +7 -0
  63. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
  64. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  65. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  66. package/docs/interfaces/five.MovePanoOptions.html +42 -0
  67. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  68. package/docs/interfaces/five.PBMParameters.html +17 -0
  69. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  70. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +33 -0
  71. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  72. package/docs/interfaces/five.Pose.html +37 -0
  73. package/docs/interfaces/five.Scissor.html +14 -0
  74. package/docs/interfaces/five.State.html +21 -0
  75. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  76. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  77. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  78. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  79. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  80. package/docs/interfaces/five.TextureOptions.html +20 -0
  81. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
  82. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +29 -0
  83. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  84. package/docs/interfaces/five.WorkImage.html +21 -0
  85. package/docs/interfaces/five.WorkInitial.html +13 -0
  86. package/docs/interfaces/five.WorkModel.html +11 -0
  87. package/docs/interfaces/five.WorkModelTiles.html +3 -0
  88. package/docs/interfaces/five.WorkObserver.html +25 -0
  89. package/docs/interfaces/five.WorkTile.html +1 -0
  90. package/docs/interfaces/five.WorkVideo.html +9 -0
  91. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  92. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  93. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  94. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  95. package/docs/interfaces/server.Intersection.html +7 -0
  96. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  97. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  98. package/docs/interfaces/vue.FiveActionVueCallbacks.html +62 -0
  99. package/docs/modules/five.SubscribeMixinType.html +1 -0
  100. package/docs/modules/five.html +482 -0
  101. package/docs/modules/gltf_loader.html +1 -0
  102. package/docs/modules/line.html +1 -0
  103. package/docs/modules/react.html +130 -1178
  104. package/docs/modules/server.html +18 -0
  105. package/docs/modules/sticker.html +1 -0
  106. package/docs/modules/vue.html +112 -0
  107. package/docs/modules.html +1 -120
  108. package/exporters/staticify.js +210 -0
  109. package/{index.d.ts → five/index.d.ts} +1196 -322
  110. package/five/index.js +372 -0
  111. package/gltf-loader/index.d.ts +75 -0
  112. package/gltf-loader/index.js +260 -0
  113. package/line/index.d.ts +68 -0
  114. package/line/index.js +260 -0
  115. package/package.json +25 -17
  116. package/react/index.d.ts +160 -92
  117. package/react/index.js +260 -1
  118. package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
  119. package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
  120. package/resource/gltf/draco_decoder.js +31 -0
  121. package/resource/gltf/draco_decoder.wasm +0 -0
  122. package/resource/gltf/draco_wasm_wrapper.js +119 -0
  123. package/scripts/five-staticify.js +26 -0
  124. package/server/index.d.ts +194 -25
  125. package/server/index.js +367 -1
  126. package/sticker/index.d.ts +70 -0
  127. package/sticker/index.js +260 -0
  128. package/templates/quick-start/README.md +1 -1
  129. package/templates/quick-start/package.json +1 -1
  130. package/templates/react-component/lib/index.tsx +3 -3
  131. package/umd/five-gltf-loader.js +2 -0
  132. package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
  133. package/umd/five-line.js +2 -0
  134. package/umd/five-line.js.LICENSE.txt +14 -0
  135. package/umd/five-react.js +2 -0
  136. package/umd/five-react.js.LICENSE.txt +14 -0
  137. package/umd/five-sticker.js +2 -0
  138. package/umd/five-sticker.js.LICENSE.txt +14 -0
  139. package/umd/five-vue.js +1 -0
  140. package/umd/five.js +2 -0
  141. package/umd/five.js.LICENSE.txt +116 -0
  142. package/vue/index.d.ts +433 -0
  143. package/vue/index.js +260 -0
  144. package/bundles/five.js +0 -2
  145. package/bundles/five.js.LICENSE.txt +0 -160
  146. package/docs/assets/css/main.css +0 -2660
  147. package/docs/assets/js/main.js +0 -248
  148. package/docs/assets/js/search.js +0 -1
  149. package/docs/classes/index.five.html +0 -2498
  150. package/docs/classes/index.fivecamera.html +0 -311
  151. package/docs/classes/index.fivehashcubetexture.html +0 -240
  152. package/docs/classes/index.fiveline.html +0 -342
  153. package/docs/classes/index.fivelinegeometry.html +0 -500
  154. package/docs/classes/index.fivelinematerial.html +0 -276
  155. package/docs/classes/index.fivelinesegmentsgeometry.html +0 -447
  156. package/docs/classes/index.fivescene.html +0 -186
  157. package/docs/classes/index.internalwebglrenderer.html +0 -200
  158. package/docs/classes/index.model.html +0 -883
  159. package/docs/classes/index.pbmgroup.html +0 -415
  160. package/docs/classes/index.pbmmaterial.html +0 -521
  161. package/docs/classes/index.pbmmesh.html +0 -242
  162. package/docs/classes/index.subscribe.html +0 -556
  163. package/docs/classes/react.store.html +0 -584
  164. package/docs/interfaces/index.depthpanoramacontrollercustominitargs.html +0 -408
  165. package/docs/interfaces/index.eventcallback.html +0 -2452
  166. package/docs/interfaces/index.fiveinitargs.html +0 -695
  167. package/docs/interfaces/index.floorplancontrollercustominitargs.html +0 -283
  168. package/docs/interfaces/index.imageoptions.html +0 -320
  169. package/docs/interfaces/index.intersection.html +0 -215
  170. package/docs/interfaces/index.intersectmeshinterface.html +0 -176
  171. package/docs/interfaces/index.modelcontrollercustominitargs.html +0 -354
  172. package/docs/interfaces/index.modeleventcallback.html +0 -316
  173. package/docs/interfaces/index.movepanooptions.html +0 -457
  174. package/docs/interfaces/index.panocirclemeshinterface.html +0 -349
  175. package/docs/interfaces/index.panoramacontrollercustominitargs.html +0 -433
  176. package/docs/interfaces/index.panoramalikecontrollercustominitargs.html +0 -352
  177. package/docs/interfaces/index.pbmparameters.html +0 -462
  178. package/docs/interfaces/index.pose.html +0 -258
  179. package/docs/interfaces/index.scissor.html +0 -240
  180. package/docs/interfaces/index.state.html +0 -288
  181. package/docs/interfaces/index.subscribemixintype.emit.html +0 -180
  182. package/docs/interfaces/index.subscribemixintype.haslistener.html +0 -171
  183. package/docs/interfaces/index.subscribemixintype.off.html +0 -198
  184. package/docs/interfaces/index.subscribemixintype.on.html +0 -213
  185. package/docs/interfaces/index.subscribemixintype.once.html +0 -210
  186. package/docs/interfaces/index.topviewcontrollercustominitargs.html +0 -214
  187. package/docs/interfaces/index.vrpanoramacontrollercustominitargs.html +0 -420
  188. package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -559
  189. package/docs/interfaces/react.fiveinjectiontypes.html +0 -1473
  190. package/docs/interfaces/react.injectfivetoprops.html +0 -259
  191. package/docs/modules/index.html +0 -3027
  192. package/docs/modules/index.subscribemixintype.html +0 -143
  193. package/five.js.LICENSE.txt +0 -160
  194. package/index.js +0 -1
  195. package/scripts/export-five-resource/chfs.exe +0 -0
  196. package/scripts/export-five-resource/fileify.js +0 -192
  197. package/scripts/export-five-resource/format-work.js +0 -71
  198. package/scripts/export-five-resource/staticify.js +0 -327
  199. package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
  200. package/scripts/transcode-model/LoaderSupport.js +0 -1545
  201. package/scripts/transcode-model/MTLLoader.js +0 -602
  202. package/scripts/transcode-model/OBJLoader2.js +0 -1470
  203. package/scripts/transcode-model/obj2pbm.js +0 -65
@@ -1,6 +1,172 @@
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) => 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 static sharedInstance?;
25
+ static get shared(): AnimationFrameLoop;
26
+ static getFrameTime(): number;
27
+ constructor();
28
+ private loop;
29
+ private remove;
30
+ /**
31
+ * 添加到动画循环
32
+ * @param callback - 动画循环回调
33
+ * @param once - 是否只回调一次
34
+ * @param delay - 延迟多少个动画循环回调
35
+ * @param order - 优先级,数字越小越早被调用
36
+ * @returns 移除动画循环函数
37
+ */
38
+ add(callback: AnimationFrame["callback"], once?: boolean, delay?: number, order?: number): () => void;
39
+ disponse(): void;
40
+ }
41
+
42
+ declare interface B3DMMapping {
43
+ b3dm_base_url: string;
44
+ b3dm_url: Record<string, string>;
45
+ }
46
+
47
+ declare class BoundingSphere {
48
+ center: Vector3;
49
+ radius: number;
50
+ constructor(center?: number[], radius?: number);
51
+ fromCenterRadius(center: number[], radius: number): this;
52
+ fromCornerPoints(corner: number[], oppositeCorner: number[]): this;
53
+ equals(right: BoundingSphere): boolean;
54
+ clone(): BoundingSphere;
55
+ union(boundingSphere: BoundingSphere): BoundingSphere;
56
+ expand(point: number[]): this;
57
+ transform(transform: Matrix4): this;
58
+ distanceSquaredTo(point: number[]): number;
59
+ distanceTo(point: number[]): number;
60
+ intersectPlane(plane: Plane): number;
61
+ }
62
+
63
+ declare interface BoundingVolume {
64
+ /**
65
+ * Applies a 4x4 affine transformation matrix to a bounding sphere.
66
+ * @param sphere The bounding sphere to apply the transformation to.
67
+ * @param transform The transformation matrix to apply to the bounding sphere.
68
+ * @returns itself, i.e. the modified BoundingVolume.
69
+ */
70
+ transform(transform: readonly number[]): this;
71
+ /** Computes the estimated distance squared from the closest point on a bounding sphere to a point. */
72
+ distanceSquaredTo(point: readonly number[]): number;
73
+ /** Computes the estimated distance from the closest point on a bounding sphere to a point. */
74
+ distanceTo(point: readonly number[]): number;
75
+ /**
76
+ * Determines which side of a plane the oriented bounding box is located.
77
+ *
78
+ * @param plane The plane to test against.
79
+ * @returns
80
+ * - `INTERSECTION.INSIDE` if the entire box is on the side of the plane the normal is pointing.
81
+ * - `INTERSECTION.OUTSIDE` if the entire box is on the opposite side.
82
+ * - `INTERSECTION.INTERSECTING` if the box intersects the plane.
83
+ */
84
+ intersectPlane(plane: Plane): number;
85
+ }
86
+
87
+ export declare class BVH {
88
+ trianglesArray?: Float32Array;
89
+ offsetArray?: Uint32Array;
90
+ rootNode?: BVHNode;
91
+ create(trianglesArray: Float32Array): this;
92
+ splitNode(maxTrianglesPerNode: number): this;
93
+ /**
94
+ * 计算射线与三角形的碰撞
95
+ * @param rayOrigin - 射线的原点坐标
96
+ * @param rayDirection - 设想的方向向量
97
+ * @param backfaceCulling - 是否背面剔除
98
+ * @return 碰撞焦点数组
99
+ */
100
+ intersectRay(rayOrigin: BVHVector3, rayDirection: BVHVector3, backfaceCulling: boolean): BVHIntersect[];
101
+ dispose(): void;
102
+ }
103
+
104
+ export declare class BVHIntersect {
105
+ triangle: [BVHVector3, BVHVector3, BVHVector3];
106
+ intersectionPoint: BVHVector3;
107
+ constructor(triangle: [BVHVector3, BVHVector3, BVHVector3], intersectionPoint: BVHVector3);
108
+ }
109
+
110
+ /**
111
+ * A node in the BVH structure
112
+ * @param extents - the min coords of this node's bounding box
113
+ * @param startIndex - an index in the bbox array, where the first element of this node is located
114
+ * @param endIndex - an index in the bbox array, where the last of this node is located, plus 1 (meaning that its non-inclusive).
115
+ * @param level - distance of this node from the root for the bvh tree. root node has level=0, its children have level=1 etc.
116
+ */
117
+ export declare class BVHNode {
118
+ extents: ArrayLike<number>;
119
+ startIndex: number;
120
+ endIndex: number;
121
+ node0?: BVHNode;
122
+ node1?: BVHNode;
123
+ constructor(extents: ArrayLike<number>, startIndex: number, endIndex: number);
124
+ }
125
+
126
+ export declare class BVHVector3 {
127
+ x: number;
128
+ y: number;
129
+ z: number;
130
+ constructor(x: number, y: number, z: number);
131
+ copy(v: BVHVector3): this;
132
+ set(x: number, y: number, z: number): this;
133
+ fromArray(array: number[], firstElementPos?: number): this;
134
+ add(v: BVHVector3): this;
135
+ multiplyScalar(scalar: number): this;
136
+ subVectors(a: BVHVector3, b: BVHVector3): this;
137
+ dot(v: BVHVector3): number;
138
+ cross(v: BVHVector3): this;
139
+ crossVectors(a: BVHVector3, b: BVHVector3): this;
140
+ clone(): BVHVector3;
141
+ }
142
+
143
+ declare class CacheNode<T> {
144
+ item: T;
145
+ previous: CacheNode<T> | null;
146
+ next: CacheNode<T> | null;
147
+ constructor(item: T, previous: CacheNode<T> | null, next: CacheNode<T> | null);
148
+ }
149
+
150
+ /** Five 相机 */
151
+ export declare class Camera extends THREE_2.PerspectiveCamera {
152
+ /** 相机姿态 */
153
+ pose: CameraPose;
154
+ constructor(fov: number);
155
+ /** 通过相机参数反算姿态 */
156
+ computePose(): this;
157
+ /** 设置相机姿态 */
158
+ setFromPose(pose: Partial<CameraPose>): this;
159
+ /** 拷贝相机姿态 */
160
+ copyPose(): CameraPose;
161
+ }
162
+
163
+ export declare interface CameraPose {
164
+ longitude: number;
165
+ latitude: number;
166
+ fov: number;
167
+ distance: number;
168
+ offset: THREE_2.Vector3;
169
+ }
4
170
 
5
171
  export declare type ControllerCustomInitTypes = {
6
172
  Floorplan: FloorplanControllerCustomInitArgs;
@@ -9,6 +175,7 @@ export declare type ControllerCustomInitTypes = {
9
175
  VRPanorama: VRPanoramaControllerCustomInitArgs;
10
176
  Model: ModelControllerCustomInitArgs;
11
177
  DepthPanorama: DepthPanoramaControllerCustomInitArgs;
178
+ Mapview: MapviewControllerCustomInitArgs;
12
179
  };
13
180
 
14
181
  export declare type ControllerEventTypes = {
@@ -62,7 +229,7 @@ export declare type ControllerEventTypes = {
62
229
  * 观察点位被选择
63
230
  * @param panoIndex - 选择的点位
64
231
  */
65
- panoSelected(panoIndex: number): void;
232
+ panoSelected(panoIndex: number | null): void;
66
233
  /**
67
234
  * 意图要移动到某个点位 可以通过 `return false` 阻止
68
235
  * @param panoIndex - 图要移动到的点位下标
@@ -142,6 +309,7 @@ export declare type ControllerEventTypes = {
142
309
  wantsGesture(type: GestureTypes, pointers: {
143
310
  x: number;
144
311
  y: number;
312
+ delta?: number;
145
313
  }[], final: boolean): void | false;
146
314
  /**
147
315
  * 手势 触发
@@ -152,6 +320,7 @@ export declare type ControllerEventTypes = {
152
320
  gesture(type: GestureTypes, pointers: {
153
321
  x: number;
154
322
  y: number;
323
+ delta?: number;
155
324
  }[], final: boolean): void;
156
325
  /**
157
326
  * 意图要触发 pan 手势(滑动屏幕), 可以通过 `return false` 阻止
@@ -183,15 +352,17 @@ export declare type ControllerEventTypes = {
183
352
  * 意图要触发 tap 手势(点击屏幕), 可以通过 `return false` 阻止
184
353
  * @param raycaster - 点击对应的三维射线
185
354
  * @param tapPosition - 点击对应的屏幕位置
355
+ * @param final - 是否手势结束
186
356
  * @returns 可以通过 `return false` 阻止
187
357
  */
188
- wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2): void | false;
358
+ wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void | false;
189
359
  /**
190
360
  * tap 手势(点击屏幕) 被触发
191
361
  * @param raycaster - 点击对应的三维射线
192
362
  * @param tapPosition - 点击对应的屏幕位置
363
+ * @param final - 是否手势结束
193
364
  */
194
- tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2): void;
365
+ tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void;
195
366
  /**
196
367
  * 意图要触发 pinch 手势(双指缩放),可以通过 `return false` 阻止
197
368
  * @param scale - 缩放数值
@@ -200,6 +371,23 @@ export declare type ControllerEventTypes = {
200
371
  * @returns 可以通过 `return false` 阻止
201
372
  */
202
373
  wantsPinchGesture(scale: number, nextFov: number, final: boolean): void | false;
374
+ /**
375
+ * 意图要触发 press 手势(长按屏幕), 可以通过 `return false` 阻止
376
+ * @param raycaster - 长按对应的三维射线
377
+ * @param tapPosition - 长按对应的屏幕位置
378
+ * @param duration - 长按持续时间
379
+ * @param final - 是否手势结束
380
+ * @returns 可以通过 `return false` 阻止
381
+ */
382
+ wantsPressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void | false;
383
+ /**
384
+ * tap 手势(点击屏幕) 被触发
385
+ * @param raycaster - 点击对应的三维射线
386
+ * @param tapPosition - 点击对应的屏幕位置
387
+ * @param duration - 长按持续时间
388
+ * @param final - 是否手势结束
389
+ */
390
+ pressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void;
203
391
  /**
204
392
  * pinch 手势(双指缩放) 被触发
205
393
  * @param scale - 缩放数值
@@ -269,7 +457,7 @@ export declare type ControllerEventTypes = {
269
457
  * @param panoIndex - 加载点位下标
270
458
  * @param observer - 对应的 observer 详情
271
459
  */
272
- textureLoaded(panoIndex: number, observer: WorkObserver): void;
460
+ textureLoaded(panoIndex: number, observer: WorkObserver, meta: (NetWorkMeta | null)[]): void;
273
461
  /**
274
462
  * 抛出错误
275
463
  * @param error - 抛出错误
@@ -277,72 +465,42 @@ export declare type ControllerEventTypes = {
277
465
  error(error: Error): void;
278
466
  };
279
467
 
468
+ declare class CullingVolume {
469
+ static get MASK_OUTSIDE(): number;
470
+ static get MASK_INSIDE(): number;
471
+ static get MASK_INDETERMINATE(): number;
472
+ planes: Plane[];
473
+ constructor(planes?: Plane[]);
474
+ fromBoundingSphere(boundingSphere: {
475
+ center: Vector3;
476
+ radius: number;
477
+ }): this;
478
+ computeVisibility(boundingVolume: BoundingVolume): number;
479
+ computeVisibilityWithPlaneMask(boundingVolume: BoundingVolume, parentPlaneMask: number): number;
480
+ }
481
+
482
+ /**
483
+ * URL 地址的转换
484
+ * @param source - url 原地址
485
+ * @param options - url 转换参数
486
+ * @returns url 转换结果
487
+ */
488
+ export declare function defaultImageURLTransform(source: string, options: ImageURLOptions): string;
489
+
280
490
  export declare interface DepthPanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
281
491
  /** 最远可移动观察点距离 */
282
492
  maxAccessibleDistance?: number;
493
+ /**
494
+ * 点击地面观察点标识的判定范围
495
+ * @description
496
+ * 如果在判定范围内则确定去到目标点,
497
+ * 否则寻找点击位置方向最适合的点(可能会走到一个离相机更近的点)。
498
+ */
499
+ panoTapTriggerRadius?: number;
283
500
  /** 地面观察点标识自定义创建器 */
284
501
  panoCircleMeshCreator?: () => PanoCircleMeshInterface;
285
502
  }
286
503
 
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
504
  /**
347
505
  * Five 事件列表
348
506
  * @description
@@ -363,19 +521,25 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
363
521
  */
364
522
  error(error: Error): void;
365
523
  /**
366
- * 开始加载 Work 数据
524
+ * 准备加载 Work 数据
367
525
  * @param input - 输入的 work
368
526
  * @param work - 归一化的标准 work
369
527
  * @param state - 加载时的姿态
370
528
  */
371
- willLoad(input: any, work: Work, state: Omit<State, "offset">): void;
529
+ willLoad(input: any, work: Work, state: Omit<State, "offset" | "distance">): void;
372
530
  /**
373
531
  * 开始加载 Work 数据
374
532
  * @param input - 输入的 work
375
533
  * @param work - 归一化的标准 work
376
534
  * @param state - 加载时的姿态
377
535
  */
378
- load(input: any, work: Work, state: Omit<State, "offset">): void;
536
+ load(input: any, work: Work, state: Omit<State, "offset" | "distance">): void;
537
+ /**
538
+ * 加载完 Work 数据
539
+ * @param input - 输入的 work
540
+ * @param work - 归一化的标准 work
541
+ */
542
+ loaded(input: any, work: Work): void;
379
543
  /**
380
544
  * 模型开始加载
381
545
  * @param workModel - 归一化的标准 work 中的 model 值
@@ -410,8 +574,16 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
410
574
  * @param model - 加载完的 model 本质是一个 {@link PBMGroup}
411
575
  */
412
576
  modelLoaded(model: Model): void;
413
- /** 每帧渲染完成 */
414
- renderFrame(): void;
577
+ /**
578
+ * 模型楼层切换
579
+ * @param shownFloor - 模型楼层
580
+ */
581
+ modelShownFloorChange(shownFloor: number | null, totalFloorLength: number): void;
582
+ /**
583
+ * 渲染循环
584
+ * @param rendered - 是否渲染了
585
+ */
586
+ renderFrame(rendered: boolean): void;
415
587
  /**
416
588
  * 当前 fps 变化
417
589
  * @param fps - 当前刷新率
@@ -471,6 +643,18 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
471
643
  * @param toPose - 初始化动画结束后的状态
472
644
  */
473
645
  modeChange(mode: Mode, prevMode: Mode, panoIndex: number, toPose: Pose): void;
646
+ /**
647
+ * 帮助元素显应的变换
648
+ * @param visible - 帮助元素的是否开启
649
+ */
650
+ helpersVisibleChange(visible: boolean): void;
651
+ /**
652
+ * 网络资源分析
653
+ * @param source - 资源地址
654
+ * @param state - 状态
655
+ * @param detail - 详情
656
+ */
657
+ network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
474
658
  /** five 被析构。 插件中请监听用于自身析构 */
475
659
  dispose(): void;
476
660
  };
@@ -502,64 +686,11 @@ export declare class Five extends Subscribe<EventTypes> {
502
686
  * ```
503
687
  */
504
688
  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
- };
689
+ /**
690
+ * @deprecated
691
+ * 请使用 `import { Line } from "@realsee/five/line"` 代替;
692
+ */
693
+ static Line: any;
563
694
  /**
564
695
  * 自动播放状态是否暂停
565
696
  * @description
@@ -571,9 +702,9 @@ export declare class Five extends Subscribe<EventTypes> {
571
702
  /** 当前展示的模式 */
572
703
  currentMode?: Mode;
573
704
  /** 内部使用的 `THREE.Scene` */
574
- scene: FiveScene;
705
+ scene: Scene;
575
706
  /** 内部使用的 `Camera` */
576
- camera: FiveCamera;
707
+ camera: Camera;
577
708
  /**
578
709
  * 当前设置的 `scissor`
579
710
  * @description
@@ -592,11 +723,9 @@ export declare class Five extends Subscribe<EventTypes> {
592
723
  * 如果初始化时传入了 `renderer` 则直接时该值
593
724
  * 否则会通过 `preserveDrawingBuffer` `backgroundColor` `backgroundAlpha` `antialias` 创建一个 `THREE.WebGLRenderer`
594
725
  */
595
- renderer: THREE_2.WebGLRenderer;
726
+ renderer?: THREE_2.WebGLRenderer;
596
727
  /** 当前加载的模型 */
597
728
  model: Model;
598
- /** 当前加载的 work 数据 */
599
- work?: Work;
600
729
  /**
601
730
  * 是否需要渲染
602
731
  * @description
@@ -617,7 +746,7 @@ export declare class Five extends Subscribe<EventTypes> {
617
746
  * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
618
747
  * 平衡加载时间和图片质量
619
748
  */
620
- textureOptions: ImageOptions;
749
+ textureOptions: TextureOptions;
621
750
  /**
622
751
  * 模型贴图的配置参数
623
752
  * @description
@@ -648,21 +777,35 @@ export declare class Five extends Subscribe<EventTypes> {
648
777
  plugins: {
649
778
  [key: string]: FivePluginInstance<any>;
650
779
  };
651
- private ident;
780
+ ident: string;
781
+ private stopAnimationLoop?;
782
+ private fps;
783
+ private helperGroup;
652
784
  private modeChangeDuration;
653
785
  private onlyRenderIfNeeds;
654
- private maxFps;
786
+ private poweredByRealsee;
655
787
  private controller?;
656
788
  private destroyed;
657
789
  private stateSynced;
658
790
  private controllerInits;
659
791
  private panoramaLikeSavedPose;
660
792
  private extraElements;
661
- private moveToPanoQueue?;
662
793
  private getPixelsRenderTarget;
663
- private tweenCoordinates?;
664
794
  private readyCallbacks;
665
795
  private modelPending;
796
+ private syncingState;
797
+ /**
798
+ * 是否开启 IOS EDR 模式
799
+ * 需要客户端配合
800
+ * 并且开启 five.enablepostProcessing = true
801
+ */
802
+ private _enableIOSEDR;
803
+ private lastLoadWorkTask;
804
+ private requestProxy;
805
+ private networkSubscribe;
806
+ private screenBuffer?;
807
+ private analysis?;
808
+ private renderSwitch01;
666
809
  constructor(initArgs?: FiveInitArgs);
667
810
  /**
668
811
  * 析构 five 对象。
@@ -683,6 +826,21 @@ export declare class Five extends Subscribe<EventTypes> {
683
826
  * ```
684
827
  */
685
828
  setScissor(scissor: Scissor): void;
829
+ /**
830
+ * 帮助元素显示/隐藏
831
+ */
832
+ get helperVisible(): boolean;
833
+ set helperVisible(visible: boolean);
834
+ /**
835
+ * 是否开启 IOS EDR 模式
836
+ * 需要客户端配合
837
+ * 并且开启 five.enablepostProcessing = true
838
+ */
839
+ get enableIOSEDR(): boolean;
840
+ set enableIOSEDR(enable: boolean);
841
+ get enablePostProcessing(): boolean;
842
+ set enablePostProcessing(enable: boolean);
843
+ updateConfiguration(args: Pick<FiveInitArgs, "panorama" | "model" | "floorplan" | "topview" | "mapview" | "depthPanorama" | "vrPanorama" | "imageOptions">): void;
686
844
  /**
687
845
  * 将显示区域加载到页面 DOM 中
688
846
  * @description
@@ -720,6 +878,8 @@ export declare class Five extends Subscribe<EventTypes> {
720
878
  * 获取当前相机姿态, 可以使用 getCurrentState 代替
721
879
  */
722
880
  getPose(): Pose;
881
+ getSize(target: THREE_2.Vector2): THREE_2.Vector2;
882
+ getDrawingBufferSize(target: THREE_2.Vector2): THREE_2.Vector2;
723
883
  /**
724
884
  * 移动相机。(不触发点位移动)
725
885
  * @description
@@ -727,9 +887,10 @@ export declare class Five extends Subscribe<EventTypes> {
727
887
  * 会 Promise.reject。运动完成则 Promise.resolve
728
888
  * @param pose - 相机目标位置
729
889
  * @param duration - 动画触发的时常
890
+ * @param userAction - 是否用户触发
730
891
  * @returns Promise 是否移动成功
731
892
  */
732
- updateCamera(pose: Partial<Pose>, duration: number): Promise<void>;
893
+ updateCamera(pose: Partial<Omit<Pose, "offset">>, duration: number, userAction?: boolean): Promise<void>;
733
894
  /**
734
895
  * 获取当前相机经纬度
735
896
  * @deprecated 请使用使用 getPose
@@ -769,6 +930,8 @@ export declare class Five extends Subscribe<EventTypes> {
769
930
  * ```
770
931
  */
771
932
  initBasisLoader(transcoderResourcePath?: string): void;
933
+ /** 当前加载的 work 数据 */
934
+ get work(): Work;
772
935
  /**
773
936
  * 加载 Work 数据
774
937
  * @param inputWork - Work 数据
@@ -778,15 +941,17 @@ export declare class Five extends Subscribe<EventTypes> {
778
941
  * - State 自定义姿态
779
942
  * @param duration - 切换时间
780
943
  */
781
- load(inputWork: Work | LooseWork | any, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number): Promise<void>;
944
+ load(inputWork: Work | LooseWork | any | Promise<Work | LooseWork | any>, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number, userAction?: boolean): Promise<void>;
945
+ private load_;
782
946
  /**
783
947
  * 切换模态
784
948
  * @param mode - 切换到的模态
785
949
  * @param state - 切换完成时的姿态
786
950
  * @param duration - 模态切换动画用时
787
951
  * @param userAction - 是否时用户动作触发 默认 true
952
+ * @param force - 必须重新初始化 controller
788
953
  */
789
- changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, duration?: number, userAction?: boolean): Promise<void>;
954
+ changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, duration?: number, userAction?: boolean, force?: boolean): Promise<void>;
790
955
  /**
791
956
  * 获取画面中的像素颜色
792
957
  * @param x - 获取像素区域的起始坐标 x
@@ -800,11 +965,7 @@ export declare class Five extends Subscribe<EventTypes> {
800
965
  /**
801
966
  * 获取显示用的画布(Canvas DOM节点)
802
967
  */
803
- getElement(): HTMLCanvasElement;
804
- /**
805
- * 但停自动播放
806
- */
807
- pause(): void;
968
+ getElement(): HTMLCanvasElement | undefined;
808
969
  /**
809
970
  * 强制渲染
810
971
  * @description
@@ -816,7 +977,12 @@ export declare class Five extends Subscribe<EventTypes> {
816
977
  *
817
978
  * @param callback - 渲染完成回调
818
979
  */
819
- render(callback?: () => void): void;
980
+ render(callback?: () => void, updateObjectResolution?: boolean): THREE_2.WebGLRenderTarget;
981
+ updateTime(time: number, deltaTime: number): void;
982
+ /**
983
+ * 但停自动播放
984
+ */
985
+ pause(): void;
820
986
  play(): void;
821
987
  /**
822
988
  * 转化到 Panorama 模态,并移动到对应序号的观察点。
@@ -845,7 +1011,7 @@ export declare class Five extends Subscribe<EventTypes> {
845
1011
  * 获取当前在屏幕视锥中的 mesh。
846
1012
  * @param object - 如果传入则检查这个对象中的mesh,如果不传,则检查整个 scene
847
1013
  */
848
- getRenderMeshes(object?: THREE_2.Object3D): THREE_2.Object3D[];
1014
+ getRenderObjects(object?: THREE_2.Object3D): THREE_2.Object3D[];
849
1015
  getCurrentState(): State;
850
1016
  /**
851
1017
  * 设置 State
@@ -866,34 +1032,21 @@ export declare class Five extends Subscribe<EventTypes> {
866
1032
  * ```
867
1033
  * @param state - 目标状态
868
1034
  * @param immediately - 是否马上转换,马上转换会尽快达到目标状态,尽量减少中间状态,更少动画。
1035
+ * @param userAction - 是否是用户触发的动作
869
1036
  */
870
- setState(state: Partial<State>, immediately?: boolean): void;
1037
+ setState(state: Partial<State>, immediately?: boolean, userAction?: boolean): void;
1038
+ aroundScissor(callback: () => void): void;
871
1039
  private syncState;
872
1040
  ready(): Promise<void>;
873
- private updateResolution;
1041
+ requestFullscreen(): void;
1042
+ exitFullscreen(): void;
874
1043
  private throwError;
875
1044
  private loadModel;
876
1045
  private commonParams;
877
1046
  private saveControllerPose;
878
1047
  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;
1048
+ /** 移除事件绑定 */
1049
+ private removeEventListeners;
897
1050
  }
898
1051
 
899
1052
  /** Five 初始化参数 */
@@ -979,7 +1132,7 @@ export declare interface FiveInitArgs {
979
1132
  * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
980
1133
  * 平衡加载时间和图片质量
981
1134
  */
982
- textureOptions?: ImageOptions;
1135
+ textureOptions?: TextureOptions;
983
1136
  /**
984
1137
  * 是否按需渲染
985
1138
  * @description
@@ -1029,6 +1182,8 @@ export declare interface FiveInitArgs {
1029
1182
  floorplan?: ControllerCustomInitTypes["Floorplan"];
1030
1183
  /** 户型图模式下的特定参数 */
1031
1184
  topview?: ControllerCustomInitTypes["Topview"];
1185
+ /** 地图模式下的特定参数 */
1186
+ mapview?: ControllerCustomInitTypes["Mapview"];
1032
1187
  /** 深度图游走模式下的特定参数 */
1033
1188
  depthPanorama?: ControllerCustomInitTypes["DepthPanorama"];
1034
1189
  /** VR眼镜模式下的特定参数 */
@@ -1046,58 +1201,20 @@ export declare interface FiveInitArgs {
1046
1201
  * 详见插件部分。
1047
1202
  */
1048
1203
  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;
1204
+ /**
1205
+ * 是否展示 powered by 如视
1206
+ */
1207
+ poweredByRealsee?: boolean;
1208
+ /**
1209
+ * 是否使用webgl2渲染执行环境, 默认值 false
1210
+ */
1211
+ webgl2?: boolean;
1212
+ /**
1213
+ * 请求代理
1214
+ * @param url - 发起的请求
1215
+ * @returns 返回的请求
1216
+ */
1217
+ requestProxy?(url: string): string;
1101
1218
  }
1102
1219
 
1103
1220
  /**
@@ -1127,8 +1244,9 @@ parameters: Parameters<T>[1]
1127
1244
  */
1128
1245
  export declare type FivePluginInstance<T extends FivePlugin<any, any>> = ReturnType<T>;
1129
1246
 
1130
- /** Five 场景*/
1131
- export declare class FiveScene extends THREE_2.Scene {
1247
+ declare interface FloorInfo {
1248
+ ground: number;
1249
+ height: number;
1132
1250
  }
1133
1251
 
1134
1252
  export declare interface FloorplanControllerCustomInitArgs {
@@ -1148,7 +1266,19 @@ export declare interface FloorplanControllerCustomInitArgs {
1148
1266
  minFov?: number;
1149
1267
  }
1150
1268
 
1151
- export declare type GestureTypes = "pan" | "tap" | "pinch" | "mouseWheel";
1269
+ declare type FrameState = {
1270
+ camera: {
1271
+ position: number[];
1272
+ direction: number[];
1273
+ up: number[];
1274
+ };
1275
+ height: number;
1276
+ cullingVolume: CullingVolume;
1277
+ frameNumber: number;
1278
+ sseDenominator: number;
1279
+ };
1280
+
1281
+ export declare type GestureTypes = "pan" | "tap" | "pinch" | "press" | "mouseWheel";
1152
1282
 
1153
1283
  export declare function getViewportScale(): number;
1154
1284
 
@@ -1156,33 +1286,65 @@ export declare function getViewportScale(): number;
1156
1286
  * 图片参数
1157
1287
  */
1158
1288
  export declare interface ImageOptions {
1159
- key?: string;
1160
1289
  /**
1161
1290
  * url 地址转化
1162
1291
  * @param url - 原始地址
1163
1292
  * @param options - 当前地址参数
1164
1293
  * @returns 转化后地址
1165
1294
  */
1166
- transform?: (url: string, options: ImageOptions) => string;
1167
- /** 图片尺寸参数 */
1295
+ transform?: (url: string, options: ImageURLOptions) => string;
1296
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 512 1024 2048 */
1168
1297
  size?: number;
1169
1298
  /** 图片质量参数(0-100) */
1170
1299
  quality?: number;
1171
- /** 图片格式参数(jpg, png) */
1172
- format?: string;
1173
- /** basis loader 是否初始化完成 */
1174
- basisLoaderInitialized?: boolean;
1175
- /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
1176
- autoResize?: boolean;
1300
+ /** 图片格式参数 */
1301
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
1302
+ /** 锐化参数 海外不支持 */
1303
+ sharpen?: number;
1304
+ mappings?: ImageURLMappings;
1305
+ }
1306
+
1307
+ export declare function imageSupport(): Promise<{
1308
+ avif: boolean;
1309
+ webp: boolean;
1310
+ }>;
1311
+
1312
+ export declare interface ImageURLMappings {
1313
+ [publicDomain: string]: {
1314
+ "pano": [string, string];
1315
+ "tile": [string, string];
1316
+ "texture": [string];
1317
+ "default": [string];
1318
+ };
1319
+ }
1320
+
1321
+ export declare interface ImageURLOptions {
1322
+ /** 图片类型标识 */
1323
+ key: string;
1324
+ /** basisLoader 是否初始化完成 */
1325
+ basisLoaderInitialized: boolean;
1326
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
1327
+ size?: number;
1328
+ /** 图片质量参数(0-100) */
1329
+ quality?: number;
1330
+ /** 图片格式参数 */
1331
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
1332
+ /** 图片裁切 */
1333
+ cut?: [x: number, y: number, width: number, height: number];
1334
+ /** 锐化参数 海外不支持 */
1335
+ sharpen?: number;
1336
+ /** url匹配规则 */
1337
+ mappings?: ImageURLMappings;
1177
1338
  }
1178
1339
 
1179
1340
  export declare class InternalWebGLRenderer extends THREE_2.WebGLRenderer {
1180
- constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias }: {
1341
+ constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias, webgl2 }: {
1181
1342
  preserveDrawingBuffer?: boolean;
1182
1343
  backgroundColor?: number | THREE_2.Color;
1183
1344
  backgroundAlpha?: number;
1184
1345
  pixelRatio?: number;
1185
1346
  antialias?: boolean;
1347
+ webgl2?: boolean;
1186
1348
  });
1187
1349
  }
1188
1350
 
@@ -1197,10 +1359,57 @@ export declare interface Intersection {
1197
1359
  distance: number;
1198
1360
  }
1199
1361
 
1362
+ export declare class IntersectMesh extends THREE_2.Object3D implements IntersectMeshInterface {
1363
+ private ringMesh;
1364
+ constructor();
1365
+ dispose(): void;
1366
+ }
1367
+
1368
+ /**
1369
+ * 地面提示点位接口
1370
+ */
1200
1371
  export declare interface IntersectMeshInterface extends THREE_2.Object3D {
1201
1372
  dispose(): void;
1202
1373
  }
1203
1374
 
1375
+ export declare class LegacyPanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
1376
+ needsRender: boolean;
1377
+ hitTestMesh: THREE_2.Mesh<THREE_2.BufferGeometry, THREE_2.MeshBasicMaterial>;
1378
+ current: boolean;
1379
+ loading: boolean;
1380
+ disabled: boolean;
1381
+ progress: number;
1382
+ opacity: number;
1383
+ private centerMesh;
1384
+ private loadingMesh;
1385
+ private progressMotion;
1386
+ private opacityMotion;
1387
+ private stopInterval?;
1388
+ constructor();
1389
+ setLoading(shown: boolean): void;
1390
+ setDisabled(disabled: boolean): void;
1391
+ setProgress(progress: number): void;
1392
+ setOpacity(opacity: number): void;
1393
+ setCurrent(current: boolean): void;
1394
+ updateTime(time: number, deltaTime: number): void;
1395
+ dispose(): void;
1396
+ }
1397
+
1398
+ /** Advanced loader options */
1399
+ declare interface LoaderOptions {
1400
+ updateInterval: number;
1401
+ maxMemoryUsage: number;
1402
+ maxScreenSpaceError: number;
1403
+ viewDistanceScale: number;
1404
+ throttleRequests: boolean;
1405
+ maxRequests: number;
1406
+ onNodeCreated: (node: PBMGroup) => void;
1407
+ allowHosts?: string[];
1408
+ requestProxy?: (url: string) => string;
1409
+ networkSubscribe?: NetworkSubscribe;
1410
+ maxDepth?: number;
1411
+ }
1412
+
1204
1413
  export declare type LooseWork = {
1205
1414
  bvh?: boolean;
1206
1415
  modelAsync?: boolean;
@@ -1258,7 +1467,15 @@ export declare type LooseWorkPanorama = {
1258
1467
  front: string;
1259
1468
  back: string;
1260
1469
  video?: LooseWorkVideo;
1261
- tiles?: string;
1470
+ luminance?: {
1471
+ up: string;
1472
+ down: string;
1473
+ right: string;
1474
+ left: string;
1475
+ front: string;
1476
+ back: string;
1477
+ };
1478
+ tiles?: number[];
1262
1479
  };
1263
1480
 
1264
1481
  export declare type LooseWorkVideo = {
@@ -1267,6 +1484,65 @@ export declare type LooseWorkVideo = {
1267
1484
  size: number[];
1268
1485
  };
1269
1486
 
1487
+ declare class ManagedArray<T> {
1488
+ private map;
1489
+ private array;
1490
+ private _length;
1491
+ constructor();
1492
+ /**
1493
+ * Gets or sets the length of the array.
1494
+ * If the set length is greater than the length of the internal array, the internal array is resized.
1495
+ *
1496
+ * @memberof ManagedArray.prototype
1497
+ * @type Number
1498
+ */
1499
+ get length(): number;
1500
+ /**
1501
+ * Gets the element at an index.
1502
+ * @param { Number } index The index to get.
1503
+ */
1504
+ get(index: number): T;
1505
+ /**
1506
+ * Sets the element at an index. Resizes the array if index is greater than the length of the array.
1507
+ *
1508
+ * @param {Number} index The index to set.
1509
+ * @param {*} element The element to set at index.
1510
+ */
1511
+ set(index: number, element: T): void;
1512
+ delete(element: T): void;
1513
+ /**
1514
+ * Push an element into the array.
1515
+ *
1516
+ * @param {*} element The element to push.
1517
+ */
1518
+ push(element: T): void;
1519
+ /**
1520
+ * Pop an element from the array.
1521
+ *
1522
+ * @returns {*} The last element in the array.
1523
+ */
1524
+ pop(): T;
1525
+ reset(): void;
1526
+ find(target: T): boolean;
1527
+ }
1528
+
1529
+ export declare interface MapviewControllerCustomInitArgs {
1530
+ /** 默认偏航角 */
1531
+ defaultLongitude?: number;
1532
+ /** 默认俯仰角 */
1533
+ defaultLatitude?: number;
1534
+ /** 默认相机距离 */
1535
+ defaultDistance?: number;
1536
+ /** 最大俯仰角 */
1537
+ maxLatitude?: number;
1538
+ /** 最小俯仰角 */
1539
+ minLatitude?: number;
1540
+ /** 最大相机距离 */
1541
+ maxDistance?: number;
1542
+ /** 最小相机距离 */
1543
+ minDistance?: number;
1544
+ }
1545
+
1270
1546
  export declare type Mirror<T extends string> = Record<T, T>;
1271
1547
 
1272
1548
  /**
@@ -1275,6 +1551,7 @@ export declare type Mirror<T extends string> = Record<T, T>;
1275
1551
  * - **Model**: 模型游走模式
1276
1552
  * - **Floorplan**: 模型查看模式
1277
1553
  * - **Topview**: 户型图模式
1554
+ * - **Mapview**: 地图模式
1278
1555
  * - **DepthPanorama**: 深度图游走模式
1279
1556
  * - **VRPanorama**: VR眼镜模式
1280
1557
  */
@@ -1283,6 +1560,8 @@ export declare type Mode =
1283
1560
  "Floorplan" |
1284
1561
  /** 户型图模式 */
1285
1562
  "Topview" |
1563
+ /** 地图模式 */
1564
+ "Mapview" |
1286
1565
  /** 全景图游走模式 */
1287
1566
  "Panorama" |
1288
1567
  /** VR眼镜模式 */
@@ -1300,7 +1579,7 @@ export declare type Mode =
1300
1579
  * 需要满足 your/path/filename.at3d.json_xxxxxx,
1301
1580
  * 通过 json_xxxxxx(<dataURL>) 方式返回。
1302
1581
  */
1303
- export declare class Model extends PBMGroup implements Subscribe<ModelEventType> {
1582
+ export declare class Model extends PBMContainer implements Subscribe<ModelEventType> {
1304
1583
  /** 是否加载完成 */
1305
1584
  loaded: boolean;
1306
1585
  /** 是否未加载 */
@@ -1308,7 +1587,13 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1308
1587
  /** 外接盒子的大小 */
1309
1588
  bounding: THREE_2.Box3;
1310
1589
  /** 当前显示的楼层 */
1311
- shownfloor: number | null;
1590
+ shownFloor: number | null;
1591
+ /** 楼层的数量 */
1592
+ floorLength: number;
1593
+ /** 模型瓦片 */
1594
+ originModel?: PBMContainer;
1595
+ /** 模型瓦片 */
1596
+ tiledModel?: Tile3DModel;
1312
1597
  /**
1313
1598
  * 判断是否注册了事件
1314
1599
  * 具体可查看 {@link Subscribe.hasListener}
@@ -1335,18 +1620,48 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1335
1620
  */
1336
1621
  emit: SubscribeMixinType.emit<ModelEventType>;
1337
1622
  /** bvh 树的计算结果 */
1338
- bvhs: any[] & {
1339
- loaded?: boolean;
1623
+ bvhs: BVH[] & {
1624
+ loaded: boolean;
1340
1625
  };
1341
- constructor();
1626
+ /** 网络代理 */
1627
+ private requestProxy?;
1628
+ /** 网络跟踪 */
1629
+ private networkSubscribe?;
1630
+ /** 安全域名 */
1631
+ private allowHosts?;
1632
+ constructor(options?: {
1633
+ networkSubscribe?: NetworkSubscribe;
1634
+ requestProxy?: (url: string) => string;
1635
+ allowHosts?: string[];
1636
+ });
1637
+ /**
1638
+ * 当前显示的楼层
1639
+ * @deprecated
1640
+ * 请用 shwonFloor 代替
1641
+ */
1642
+ get shownfloor(): number | null;
1643
+ /**
1644
+ * 当前模型是否支持瓦片
1645
+ */
1646
+ get hasTiles(): boolean;
1647
+ /**
1648
+ * 是否开启瓦片
1649
+ */
1650
+ get enableTiles(): boolean;
1651
+ set enableTiles(enable: boolean);
1342
1652
  /**
1343
1653
  * 获取模型边界线
1344
1654
  * @param threshold - 面片间夹角阈值
1345
1655
  * @returns 所有模型边界线
1346
1656
  */
1347
1657
  getEdges(threshold?: number): THREE_2.Line3[];
1348
- /** 获取当前楼层数 */
1658
+ /**
1659
+ * 获取当前楼层数
1660
+ * @deprecated
1661
+ * 请使用 floorLength 参数代替
1662
+ */
1349
1663
  hasFloors(): number;
1664
+ private hasFloors_;
1350
1665
  /**
1351
1666
  * 显示某楼层
1352
1667
  * @example
@@ -1357,7 +1672,9 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1357
1672
  * ```
1358
1673
  */
1359
1674
  show(): void;
1360
- show(floorIndex: number, hideOpacity?: number): void;
1675
+ show(floorIndex: number, hiddenOpacity?: number): void;
1676
+ private at3dShow;
1677
+ private b3dmShow;
1361
1678
  /**
1362
1679
  * 计算模型射线碰撞检测
1363
1680
  * @param raycaster - THREE 射线对象
@@ -1365,13 +1682,14 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1365
1682
  * @returns 返回碰撞
1366
1683
  */
1367
1684
  intersectRaycaster(raycaster: THREE_2.Raycaster, floors?: number | number[]): Intersection[];
1368
- buildBVH(): Promise<void>;
1685
+ buildBVH(): void;
1369
1686
  /**
1370
1687
  * 加载模型
1371
1688
  * @param workModel - work 的 model 内容
1372
1689
  * @param imageOptions - 图片参数
1373
1690
  */
1374
- load(workModel: WorkModel, imageOptions?: ImageOptions): void;
1691
+ load(workModel: WorkModel, textureOptions?: TextureOptions): Promise<void>;
1692
+ update(renderer: THREE_2.WebGLRenderer, camera: THREE_2.PerspectiveCamera): void;
1375
1693
  /**
1376
1694
  * 析构函数
1377
1695
  * @description
@@ -1410,6 +1728,11 @@ export declare type ModelEventType = {
1410
1728
  materialLoaded(): void;
1411
1729
  /** 模型加载完成 */
1412
1730
  loaded(): void;
1731
+ /**
1732
+ * 显示楼层改变
1733
+ * @param shownFloor - 显示的楼层
1734
+ */
1735
+ shownFloorChange(shownFloor: number | null, totalFloorLength: number): void;
1413
1736
  /**
1414
1737
  * 内部错误
1415
1738
  * @param error - 错误对象
@@ -1428,9 +1751,10 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1428
1751
  * @description
1429
1752
  * - `fly` 通过相机移动方式变化
1430
1753
  * - `fade` 通过渐变方式变化
1754
+ * - `montage` 通过渐变穿插到黑屏方式变化
1431
1755
  * - `instant` 通过插入黑屏方式变化
1432
1756
  */
1433
- effect?: "fly" | "fade" | "instant";
1757
+ effect?: "fly" | "fade" | "montage" | "instant";
1434
1758
  /**
1435
1759
  * 运动耗时
1436
1760
  * @description
@@ -1456,15 +1780,101 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1456
1780
  moveCancelCallback?: () => void;
1457
1781
  }
1458
1782
 
1783
+ export declare type NetWorkMeta = {
1784
+ source: string;
1785
+ headers: {
1786
+ [name: string]: string;
1787
+ };
1788
+ requestTime: number;
1789
+ responseTime: number;
1790
+ costs: number;
1791
+ size?: number;
1792
+ };
1793
+
1794
+ export declare type NetworkState = "ok" | "preload" | "error" | "timeout" | "forbidden";
1795
+
1796
+ export declare class NetworkSubscribe extends Subscribe<{
1797
+ network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
1798
+ }> {
1799
+ }
1800
+
1801
+ export declare type NetworkType = "XMLHttpRequest" | "Script" | "Image" | "Link";
1802
+
1803
+ declare class OrientedBoundingBox {
1804
+ center: Vector3;
1805
+ halfAxes: Matrix3;
1806
+ constructor(center?: number[], halfAxes?: number[]);
1807
+ get halfSize(): number[];
1808
+ get quaternion(): Quaternion;
1809
+ fromCenterHalfSizeQuaternion(center: number[], halfSize: number[], quaternion: number[]): this;
1810
+ clone(): OrientedBoundingBox;
1811
+ equals(right: OrientedBoundingBox): boolean;
1812
+ getBoundingSphere(result?: BoundingSphere): BoundingSphere;
1813
+ intersectPlane(plane: Plane): number;
1814
+ distanceTo(point: number[]): number;
1815
+ distanceSquaredTo(point: number[]): number;
1816
+ computePlaneDistances(position: Vector3, direction: Vector3, result?: number[]): number[];
1817
+ transform(transformation: number[]): this;
1818
+ }
1819
+
1820
+ export declare class PanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
1821
+ needsRender: boolean;
1822
+ private loadingMesh;
1823
+ private disableMesh;
1824
+ private centerMesh;
1825
+ private ringMesh;
1826
+ private progressMesh;
1827
+ private ringRotateMotion;
1828
+ private tapMotion;
1829
+ private progressMotion;
1830
+ private progressOpacityMotion;
1831
+ private opacityMotion;
1832
+ progress: number;
1833
+ opacity: number;
1834
+ current: boolean;
1835
+ loading: boolean;
1836
+ disabled: boolean;
1837
+ constructor();
1838
+ setProgress(progress: number): void;
1839
+ setOpacity(opacity: number): void;
1840
+ setCurrent(current: boolean): void;
1841
+ setLoading(loading: boolean): void;
1842
+ setDisabled(disabled: boolean): void;
1843
+ tap(): Promise<void>;
1844
+ updateTime(time: number, deltaTime: number): void;
1845
+ dispose(): void;
1846
+ }
1847
+
1848
+ /**
1849
+ * 地面提示点位接口
1850
+ *
1851
+ * 点位状态
1852
+ * 1. 默认状态: 无任何操作的情况
1853
+ * 2. 高亮状态: 高亮,认为是合适的下一个点位,或者设备选中了某个点位
1854
+ * 3. 进度状态: 点位加载中,存在进度的情况
1855
+ * 4. 加载状态: 点位加载中,不存在进度的情况
1856
+ * 5. 不可用状态:点位不可用,存在点位,但是点位是个摆设
1857
+ * 6. 点击动画: 点位被选择,触发全景图切换
1858
+ * 7. 透明度改变: 一般会处理为近的点位透明度高,远的点位透明度低
1859
+ */
1459
1860
  export declare interface PanoCircleMeshInterface extends THREE_2.Object3D {
1460
1861
  needsRender: boolean;
1862
+ hitTestMesh?: THREE_2.Mesh;
1863
+ /** 当前高亮 */
1864
+ current: boolean;
1865
+ /** 是否当前高亮 */
1866
+ setCurrent(current: boolean): void;
1461
1867
  loading: boolean;
1868
+ setLoading(loading: boolean): void;
1462
1869
  disabled: boolean;
1463
- panoIndex: number;
1464
- setLoading(shown: boolean): void;
1465
1870
  setDisabled(disabled: boolean): void;
1871
+ progress: number;
1466
1872
  setProgress(progress: number): void;
1873
+ opacity: number;
1467
1874
  setOpacity(opacity: number): void;
1875
+ updateTime?(time: number, deltaTime: number): void;
1876
+ /** 点击交互 */
1877
+ tap?(): Promise<void>;
1468
1878
  dispose(): void;
1469
1879
  }
1470
1880
 
@@ -1480,6 +1890,13 @@ export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeCo
1480
1890
  panoTapTriggerRadius?: number;
1481
1891
  /** 地面观察点标识自定义创建器 */
1482
1892
  panoCircleMeshCreator?: () => PanoCircleMeshInterface;
1893
+ /**
1894
+ * 全景瓦片登记
1895
+ * @param fov - 当前 fov
1896
+ * @param viewSize - 当前绘制区域大小
1897
+ * @returns 返回瓦片等级
1898
+ */
1899
+ tileLevelForFov?: false | ((fov: number, viewSize: THREE_2.Vector2) => number);
1483
1900
  }
1484
1901
 
1485
1902
  export declare interface PanoramaLikeControllerCustomInitArgs {
@@ -1507,14 +1924,31 @@ export declare interface PanoramaLikeControllerCustomInitArgs {
1507
1924
  intersectMeshCreator?: () => IntersectMeshInterface;
1508
1925
  }
1509
1926
 
1510
- export declare function parseWork(obj: Work | LooseWork | any): Work;
1927
+ /**
1928
+ * 解析 Work 数据
1929
+ * @param obj - work 数据,从如数开发者平台获取
1930
+ * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
1931
+ * @param urlTransform - 配置参数, URL 解析规则
1932
+ * @returns - 签署过的 Work 数据结构
1933
+ */
1934
+ export declare function parseWork(obj: Work | LooseWork | string | any, options?: ParseWorkOptions, urlTransform?: (origin: string, absolute: string, relative: string, type: "panorama" | "texture" | "model") => void): Work;
1935
+
1936
+ export declare type ParseWorkOptions = {
1937
+ /** 重写 work 中的资源前缀 */
1938
+ baseURL?: string;
1939
+ /** work 中的资源地址使用短地址 */
1940
+ shortPath?: boolean;
1941
+ /** work 中的资源使用 jsonp 方式发布 */
1942
+ jsonp?: boolean;
1943
+ /** work 中模型是否计算bvh碰撞数,默认计算 true */
1944
+ modelBvh?: boolean;
1945
+ };
1511
1946
 
1512
1947
  /** PBM 模型组 */
1513
- export declare class PBMGroup extends THREE_2.Group {
1514
- /** 楼层序号 */
1515
- floorIndex: number;
1948
+ export declare class PBMContainer extends THREE_2.Group {
1516
1949
  /** 是否需要更新按需渲染 */
1517
1950
  needsRender: boolean;
1951
+ private enableTransparent;
1518
1952
  /** 获取是否有透明参数 */
1519
1953
  getTransparent(): boolean;
1520
1954
  /** 设置透明参数 */
@@ -1529,16 +1963,18 @@ export declare class PBMGroup extends THREE_2.Group {
1529
1963
  disposeGeometry(): void;
1530
1964
  }
1531
1965
 
1966
+ /** PBM 模型组 */
1967
+ export declare class PBMGroup extends PBMContainer {
1968
+ /** 楼层序号 */
1969
+ floorIndex: number;
1970
+ }
1971
+
1532
1972
  /** PBM 材质 */
1533
1973
  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;
1974
+ /** 起始点 */
1975
+ pano0: PBMPanoPicture | null;
1976
+ /** 结束点 */
1977
+ pano1: PBMPanoPicture | null;
1542
1978
  /** 模型贴图和全景图的混合程度 [0-1] */
1543
1979
  modelAlpha: number;
1544
1980
  /** 全景图混合程度 [0-1] */
@@ -1548,20 +1984,9 @@ export declare class PBMMaterial extends THREE_2.ShaderMaterial implements PBMPa
1548
1984
  perspToOrtho: number;
1549
1985
  /** 模型透明度 */
1550
1986
  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;
1987
+ originOpacity: number;
1988
+ /** 楼层切割参数*/
1989
+ floorInfo: THREE_2.Vector3 | null;
1565
1990
  constructor(parameters?: Partial<PBMParameters>);
1566
1991
  }
1567
1992
 
@@ -1573,16 +1998,21 @@ export declare class PBMMesh extends THREE_2.Mesh<THREE_2.BufferGeometry, PBMMat
1573
1998
  needsRender: boolean;
1574
1999
  }
1575
2000
 
1576
- /** PBM 材质参数 */
1577
- export declare interface PBMParameters {
2001
+ export declare interface PBMPanoPicture {
1578
2002
  /** 起始点位全景图 */
1579
- pano0Map: FiveHashCubeTexture | null;
2003
+ map: THREE_2.CubeTexture;
2004
+ /** 亮度增益 */
2005
+ luminanceMap: THREE_2.CubeTexture | null;
1580
2006
  /** 起始点全景图变换矩阵 4x4 */
1581
- pano0Matrix: THREE_2.Matrix4;
1582
- /** 结束点位全景图 */
1583
- pano1Map: FiveHashCubeTexture | null;
1584
- /** 结束点位全景图变换矩阵 */
1585
- pano1Matrix: THREE_2.Matrix4;
2007
+ matrix: THREE_2.Matrix4;
2008
+ }
2009
+
2010
+ /** PBM 材质参数 */
2011
+ export declare interface PBMParameters {
2012
+ /** 起始点 */
2013
+ pano0: PBMPanoPicture | null;
2014
+ /** 结束点 */
2015
+ pano1: PBMPanoPicture | null;
1586
2016
  /** 模型贴图和全景图的混合程度 [0-1] */
1587
2017
  modelAlpha: number;
1588
2018
  /** 全景图混合程度 [0-1] */
@@ -1592,20 +2022,22 @@ export declare interface PBMParameters {
1592
2022
  perspToOrtho: number;
1593
2023
  /** 模型透明度 */
1594
2024
  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;
2025
+ /** 楼层切割参数*/
2026
+ floorInfo?: THREE_2.Vector3 | null;
2027
+ }
2028
+
2029
+ declare class Plane {
2030
+ normal: Vector3;
2031
+ distance: number;
2032
+ constructor(normal?: number[], distance?: number);
2033
+ fromNormalDistance(normal: number[], distance: number): this;
2034
+ fromPointNormal(point: number[], normal: number[]): this;
2035
+ fromCoefficients(a: number, b: number, c: number, d: number): this;
2036
+ clone(): Plane;
2037
+ equals(right: Plane): boolean;
2038
+ getPointDistance(point: number[]): number;
2039
+ transform(matrix4: Matrix4): this;
2040
+ projectPointOntoPlane(point: number[], result?: number[]): Vector3;
1609
2041
  }
1610
2042
 
1611
2043
  /**
@@ -1613,17 +2045,75 @@ export declare interface PBMParameters {
1613
2045
  * [[include: coordinate.md]]
1614
2046
  */
1615
2047
  export declare interface Pose {
1616
- /** 相机俯仰角 */
1617
- longitude: number;
1618
2048
  /** 相机偏航角 */
2049
+ longitude: number;
2050
+ /** 相机俯仰角 */
1619
2051
  latitude: number;
1620
2052
  /** 相机可视角度(垂直)*/
1621
2053
  fov: number;
1622
2054
  /** 相机位置*/
1623
2055
  offset: THREE_2.Vector3;
2056
+ /** 相机距离 */
2057
+ distance: number;
2058
+ }
2059
+
2060
+ 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"];
2061
+
2062
+ declare type RequestResult = null | {
2063
+ done: () => void;
2064
+ };
2065
+
2066
+ /**
2067
+ * Used to issue a request, without having them "deeply queued" by the browser.
2068
+ * @todo - Track requests globally, across multiple servers
2069
+ */
2070
+ declare class RequestScheduler<Identiy> {
2071
+ private props;
2072
+ private activeRequestCount;
2073
+ /** Tracks the number of active requests and prioritizes/cancels queued requests. */
2074
+ private requestQueue;
2075
+ private requestMap;
2076
+ private deferred;
2077
+ constructor(props?: RequestSchedulerOptions);
2078
+ /**
2079
+ * Called by an application that wants to issue a request, without having it deeply queued by the browser
2080
+ *
2081
+ * When the returned promise resolved, it is OK for the application to issue a request.
2082
+ * The promise resolves to an object that contains a `done` method.
2083
+ * When the application's request has completed (or failed), the application must call the `done` function
2084
+ *
2085
+ * @param identiy
2086
+ * @param getPriority will be called when request "slots" open up,
2087
+ * allowing the caller to update priority or cancel the request
2088
+ * Highest priority executes first, priority < 0 cancels the request
2089
+ * @returns a promise
2090
+ * - resolves to a object (with a `done` field) when the request can be issued without queueing,
2091
+ * - resolves to `null` if the request has been cancelled (by the callback return < 0).
2092
+ * In this case the application should not issue the request
2093
+ */
2094
+ scheduleRequest(identiy: Identiy, getPriority?: (identiy: Identiy) => number): Promise<RequestResult>;
2095
+ private issueRequest;
2096
+ /** We check requests asynchronously, to prevent multiple updates */
2097
+ private issueNewRequests;
2098
+ /** Refresh all requests */
2099
+ private issueNewRequestsAsync;
2100
+ /** Ensure all requests have updated priorities, and that no longer valid requests are cancelled */
2101
+ private updateAllRequests;
2102
+ /** Update a single request by calling the callback */
2103
+ private updateRequest;
1624
2104
  }
1625
2105
 
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"];
2106
+ /** RequestScheduler Options */
2107
+ declare type RequestSchedulerOptions = {
2108
+ throttleRequests?: boolean;
2109
+ maxRequests?: number;
2110
+ };
2111
+
2112
+ /** Five 场景*/
2113
+ export declare class Scene extends THREE_2.Scene {
2114
+ add(...objects: AddableObject[]): this;
2115
+ remove(...objects: AddableObject[]): this;
2116
+ }
1627
2117
 
1628
2118
  /**
1629
2119
  * 显示区域裁剪参数
@@ -1659,8 +2149,6 @@ export declare interface State extends Pose {
1659
2149
  panoIndex: number;
1660
2150
  }
1661
2151
 
1662
- export declare function stringifyWork(work: Work): LooseWork;
1663
-
1664
2152
  /**
1665
2153
  * 监听者模式
1666
2154
  * @template T - 预设的监听回调类型
@@ -1739,69 +2227,455 @@ export declare namespace SubscribeMixinType {
1739
2227
  }
1740
2228
  }
1741
2229
 
2230
+ /**
2231
+ * 图片参数
2232
+ */
2233
+ export declare interface TextureOptions {
2234
+ /**
2235
+ * url 地址转化
2236
+ * @param url - 原始地址
2237
+ * @param options - 当前地址参数
2238
+ * @returns 转化后地址
2239
+ */
2240
+ transform?: (url: string, options: ImageURLOptions) => string;
2241
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
2242
+ size?: number;
2243
+ /** 图片质量参数(0-100) */
2244
+ quality?: number;
2245
+ /** 图片格式参数 */
2246
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
2247
+ /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
2248
+ autoResize?: boolean;
2249
+ /** 锐化参数 海外不支持 */
2250
+ sharpen?: number;
2251
+ mappings?: ImageURLMappings;
2252
+ }
2253
+
2254
+ /**
2255
+ * A Tile3DHeader represents a tile as Tileset3D. When a tile is first created, its content is not loaded;
2256
+ * the content is loaded on-demand when needed based on the view.
2257
+ * Do not construct this directly, instead access tiles through {@link Tileset3D#tileVisible}.
2258
+ */
2259
+ declare class Tile3D {
2260
+ cacheNode?: CacheNode<Tile3D>;
2261
+ tileset: Tileset3D;
2262
+ header: TilesetJSONNode;
2263
+ content?: TileContent;
2264
+ parent?: Tile3D;
2265
+ boundingVolume: OrientedBoundingBox;
2266
+ contentState: "UNLOADED" | "LOADING" | "PROCESSING" | "READY" | "FAILED";
2267
+ children: Tile3D[];
2268
+ depth: number;
2269
+ selectionDepth: number;
2270
+ transform: Matrix4;
2271
+ computedTransform: Matrix4;
2272
+ frameNumber: number;
2273
+ touchedFrameNumber: number;
2274
+ requestedFrameNumber: number;
2275
+ selectedFrameNumber: number;
2276
+ distanceToCamera: number;
2277
+ centerZDepth: number;
2278
+ screenSpaceError: number;
2279
+ visibilityPlaneMask: number;
2280
+ visible: boolean;
2281
+ shouldRefine: boolean;
2282
+ /**
2283
+ * @constructs
2284
+ * Create a TileHeader instance
2285
+ * @param tileset - Tileset3D instance
2286
+ * @param header - tile header - JSON loaded from a dataset
2287
+ * @param parentHeader - parent TileHeader instance
2288
+ */
2289
+ constructor(tileset: Tileset3D, header: TilesetJSONNode, parentHeader?: Tile3D);
2290
+ get id(): string;
2291
+ get refine(): "REPLACE" | "ADD";
2292
+ get type(): "EMPTY" | "SCENEGRAPH" | "MESH";
2293
+ get contentUrl(): string;
2294
+ get lodMetricType(): "geometricError";
2295
+ get lodMetricValue(): number;
2296
+ get hasEmptyContent(): boolean;
2297
+ get selected(): boolean;
2298
+ /** Returns true if tile is not an empty tile and not an external tileset */
2299
+ get hasRenderContent(): boolean;
2300
+ /** Returns true if tile has children */
2301
+ get hasChildren(): boolean;
2302
+ /**
2303
+ * Determines if the tile's content is ready. This is automatically `true` for
2304
+ * tiles with empty content.
2305
+ */
2306
+ get contentReady(): boolean;
2307
+ /**
2308
+ * Determines if the tile has available content to render. `true` if the tile's
2309
+ * content is ready or if it has expired content this renders while new content loads; otherwise,
2310
+ */
2311
+ get contentAvailable(): boolean;
2312
+ /** Returns true if tile has renderable content but it's unloaded */
2313
+ get hasUnloadedContent(): boolean;
2314
+ /**
2315
+ * Determines if the tile's content has not be requested. `true` if tile's
2316
+ * content has not be requested; otherwise, `false`.
2317
+ */
2318
+ get contentUnloaded(): boolean;
2319
+ get contentFailed(): boolean;
2320
+ /** Get the tile's screen space error. */
2321
+ getScreenSpaceError(frameState: FrameState, useParentLodMetric: boolean): number;
2322
+ getPriority(): number;
2323
+ /**
2324
+ * Requests the tile's content.
2325
+ * The request may not be made if the Request Scheduler can't prioritize it.
2326
+ */
2327
+ loadContent(): Promise<boolean>;
2328
+ unloadContent(): void;
2329
+ /**
2330
+ * Update the tile's visibility
2331
+ */
2332
+ updateVisibility(frameState: FrameState): void;
2333
+ visibility(frameState: FrameState, parentVisibilityPlaneMask: number): number;
2334
+ /**
2335
+ * Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.
2336
+ * @param frameState The frame state.
2337
+ * @returns {Number} The distance, in meters, or zero if the camera is inside the bounding volume.
2338
+ */
2339
+ distanceToTile(frameState: FrameState): number;
2340
+ updateTransform(parentTransform?: Matrix4): void;
2341
+ }
2342
+
2343
+ export declare class Tile3DModel extends PBMContainer {
2344
+ tileset?: Tileset3D;
2345
+ private options;
2346
+ private nodeGroup;
2347
+ private boundingGroup;
2348
+ private nodes;
2349
+ private boundings;
2350
+ private unloadTileQueue;
2351
+ private timer;
2352
+ private clock;
2353
+ private lastCameraTransform;
2354
+ private lastCameraAspect;
2355
+ private lastCameraFov;
2356
+ private sseDenominator;
2357
+ private lastCamera;
2358
+ private lastRenderer;
2359
+ private enabled;
2360
+ constructor(loaderOptions?: Partial<LoaderOptions>);
2361
+ get enable(): boolean;
2362
+ set enable(value: boolean);
2363
+ load(url: WorkModelTiles_2): void;
2364
+ update(renderer: THREE_2.WebGLRenderer, camera: THREE_2.PerspectiveCamera): void;
2365
+ private tilesetUpdate;
2366
+ reset(): void;
2367
+ }
2368
+
2369
+ declare interface TileContent {
2370
+ version: 1;
2371
+ magic: number;
2372
+ byteLength: number;
2373
+ header: {
2374
+ featureTableJsonByteLength: number;
2375
+ featureTableBinaryByteLength: number;
2376
+ batchTableJsonByteLength: number;
2377
+ batchTableBinaryByteLength: number;
2378
+ batchLength: number;
2379
+ };
2380
+ featureTableJson: Record<string, any>;
2381
+ featureTableBinary: Uint8Array;
2382
+ batchTableJson: Record<string, any>;
2383
+ batchTableBinary: Uint8Array;
2384
+ rotateYtoZ: boolean;
2385
+ gltfUpAxis: "X" | "Y" | "Z";
2386
+ gltfArrayBuffer: ArrayBuffer;
2387
+ gltfByteOffset: number;
2388
+ gltfByteLength: number;
2389
+ rtcCenter?: Float32Array;
2390
+ }
2391
+
2392
+ declare class Tileset3D {
2393
+ rawJson: any;
2394
+ options: Tileset3dOptions;
2395
+ root: Tile3D;
2396
+ traverser: Tileset3DTraverser;
2397
+ cache: TilesetCache;
2398
+ requestScheduler: RequestScheduler<string>;
2399
+ selectedTiles: Tile3D[];
2400
+ requestedTiles: Tile3D[];
2401
+ memoryUsageInBytes: number;
2402
+ frameNumber: number;
2403
+ private _tiles;
2404
+ private pendingCount;
2405
+ b3dmMapping: B3DMMapping;
2406
+ /**
2407
+ * Create a new Tileset3D
2408
+ * @param json
2409
+ * @param options
2410
+ */
2411
+ constructor(json: TilesetJSON, options: Tileset3dOptions);
2412
+ get maxMemoryUsage(): number;
2413
+ get asset(): any;
2414
+ get type(): any;
2415
+ get basePath(): any;
2416
+ get modelMatrix(): Matrix4;
2417
+ get geometricError(): number;
2418
+ get lodMetricType(): number;
2419
+ get lodMetricValue(): number;
2420
+ get refine(): 'ADD' | "REPLACE";
2421
+ get tiles(): Tile3D[];
2422
+ get floorInfo(): FloorInfo[];
2423
+ /** Release resources */
2424
+ reset(): void;
2425
+ /** Is the tileset loaded (update needs to have been called at least once) */
2426
+ isLoaded(): boolean;
2427
+ /**
2428
+ * The callback to post-process tiles after traversal procedure
2429
+ * @param frameState - frame state for tile culling
2430
+ */
2431
+ private onTraversalEnd;
2432
+ loadTile(tile: Tile3D): void;
2433
+ unloadTile(tile: Tile3D): void;
2434
+ }
2435
+
2436
+ declare interface Tileset3dOptions {
2437
+ throttleRequests: boolean;
2438
+ maxRequests: number;
2439
+ maxMemoryUsage: number;
2440
+ modelMatrix: Matrix4;
2441
+ maxScreenSpaceError: number;
2442
+ viewDistanceScale: number;
2443
+ onTileLoad: (tile: Tile3D) => any;
2444
+ onTileUnload: (tile: Tile3D) => any;
2445
+ onTileError: (tile: Tile3D, message: string) => any;
2446
+ contentLoader: (tile: Tile3D) => Promise<void>;
2447
+ onTraversalComplete: (selectedTiles: Tile3D[]) => Tile3D[];
2448
+ allowHosts?: string[];
2449
+ requestProxy?: (url: string) => string;
2450
+ networkSubscribe?: NetworkSubscribe;
2451
+ maxDepth?: number;
2452
+ }
2453
+
2454
+ declare class Tileset3DTraverser {
2455
+ root: Tile3D | null;
2456
+ options: TilesetTraverserProps;
2457
+ requestedTiles: Record<string, Tile3D>;
2458
+ selectedTiles: Record<string, Tile3D>;
2459
+ emptyTiles: Record<string, Tile3D>;
2460
+ protected _traversalStack: ManagedArray<Tile3D>;
2461
+ protected _emptyTraversalStack: ManagedArray<Tile3D>;
2462
+ protected _frameNumber: number | null;
2463
+ constructor(options: TilesetTraverserProps);
2464
+ traverse(root: Tile3D, frameState: FrameState): void;
2465
+ reset(): void;
2466
+ executeTraversal(root: Tile3D, frameState: FrameState): void;
2467
+ updateChildTiles(tile: Tile3D, frameState: FrameState): boolean;
2468
+ updateAndPushChildren(tile: Tile3D, frameState: FrameState, stack: ManagedArray<Tile3D>, depth: number): boolean;
2469
+ updateTile(tile: Tile3D, frameState: FrameState): void;
2470
+ selectTile(tile: Tile3D, frameState: FrameState): void;
2471
+ loadTile(tile: Tile3D, frameState: FrameState): void;
2472
+ touchTile(tile: Tile3D, frameState: FrameState): void;
2473
+ canTraverse(tile: Tile3D, frameState: FrameState, useParentMetric?: boolean, ignoreVisibility?: boolean): boolean;
2474
+ shouldLoadTile(tile: Tile3D): boolean;
2475
+ shouldSelectTile(tile: Tile3D): boolean;
2476
+ shouldRefine(tile: Tile3D, frameState: FrameState, useParentMetric: boolean): boolean;
2477
+ updateTileVisibility(tile: Tile3D, frameState: FrameState): void;
2478
+ meetsScreenSpaceErrorEarly(tile: Tile3D, frameState: FrameState): boolean;
2479
+ compareDistanceToCamera(a: Tile3D, b: Tile3D): number;
2480
+ anyChildrenVisible(tile: Tile3D, frameState: FrameState): boolean;
2481
+ everyChildrenVisibleIsLoaded(tile: Tile3D): boolean;
2482
+ executeEmptyTraversal(root: Tile3D, frameState: FrameState): boolean;
2483
+ }
2484
+
2485
+ declare class TilesetCache {
2486
+ private list;
2487
+ private sentinel;
2488
+ constructor();
2489
+ reset(): void;
2490
+ touch(tile: Tile3D): void;
2491
+ add(tile: Tile3D, addCallback?: (tile: Tile3D) => void): void;
2492
+ unloadTile(tile: Tile3D, unloadCallback?: (tile: Tile3D) => void): void;
2493
+ unloadTiles(isOverMemory: () => boolean, unloadCallback?: (tile: Tile3D) => void): void;
2494
+ }
2495
+
2496
+ declare interface TilesetJSON {
2497
+ asset: {
2498
+ gltfUpAxis: "X" | "Y" | "Z";
2499
+ version: "1.0";
2500
+ };
2501
+ basePath: string;
2502
+ lodMetricType: "geometricError";
2503
+ geometricError: number;
2504
+ lodMetricValue: number;
2505
+ root: TilesetJSONNode;
2506
+ type: "TILES3D";
2507
+ floorInfo: FloorInfo[] | [];
2508
+ b3dmMapping: B3DMMapping;
2509
+ }
2510
+
2511
+ declare interface TilesetJSONNode {
2512
+ boundingVolume: {
2513
+ box: number[];
2514
+ };
2515
+ content: {
2516
+ uri: string;
2517
+ };
2518
+ id: string;
2519
+ transform?: number[];
2520
+ contentUrl?: string;
2521
+ children: TilesetJSONNode[];
2522
+ lodMetricType: "geometricError";
2523
+ geometricError: number;
2524
+ lodMetricValue: number;
2525
+ refine: "REPLACE" | "ADD";
2526
+ type: "EMPTY" | "SCENEGRAPH" | "MESH";
2527
+ }
2528
+
2529
+ declare type TilesetTraverserProps = {
2530
+ loadSiblings: boolean;
2531
+ skipLevelOfDetail: boolean;
2532
+ maxScreenSpaceError: number;
2533
+ maxDepth?: number;
2534
+ onTraversalEnd: (frameState: FrameState) => any;
2535
+ };
2536
+
1742
2537
  export declare interface TopviewControllerCustomInitArgs extends Omit<FloorplanControllerCustomInitArgs, "defaultLongitude" | "defaultLatitude" | "maxLatitude" | "minLatitude"> {
1743
2538
  }
1744
2539
 
1745
2540
  export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
1746
- /**
1747
- * webvrPolyfill 的设置对象
1748
- * @description
1749
- * 只可被设置一次,所有的 five 实例共用这个设置
1750
- */
1751
- webvrPolyfillConfig?: any;
1752
2541
  }
1753
2542
 
1754
- export declare type Work = {
1755
- uuid: string;
2543
+ export declare class Work {
2544
+ /** 名称 */
2545
+ name: string;
2546
+ /** 编号 */
2547
+ workCode: string;
2548
+ /** 允许访问的安全域名 */
2549
+ allowHosts: string[];
2550
+ /** 过期时间 */
2551
+ expire: Date;
2552
+ /** 初始化参数 */
1756
2553
  initial: WorkInitial;
2554
+ /** 模型参数 */
1757
2555
  model?: WorkModel;
2556
+ /** 全景点位信息 */
1758
2557
  observers: WorkObserver[];
1759
- };
2558
+ /** 数据签发人 */
2559
+ issuer: string;
2560
+ /** 原始数据 */
2561
+ raw: {
2562
+ works: string[];
2563
+ options: string;
2564
+ };
2565
+ /**
2566
+ * 解析 Work 数据
2567
+ * @param obj - work 数据,从如数开发者平台获取
2568
+ * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
2569
+ * @param urlTransform - 配置参数, URL 解析规则
2570
+ * @returns - 签署过的 Work 数据结构
2571
+ */
2572
+ static parse: typeof parseWork;
2573
+ constructor();
2574
+ toJSON(): any;
2575
+ }
1760
2576
 
1761
- /** 全景图 */
1762
- export declare type WorkImages = {
2577
+ export declare interface WorkCubeImage {
2578
+ /** 全景图 up */
1763
2579
  up: string;
2580
+ /** 全景图 down */
1764
2581
  down: string;
2582
+ /** 全景图 right */
1765
2583
  right: string;
2584
+ /** 全景图 left */
1766
2585
  left: string;
2586
+ /** 全景图 front */
1767
2587
  front: string;
2588
+ /** 全景图 back */
1768
2589
  back: string;
2590
+ }
2591
+
2592
+ /** 全景图 */
2593
+ export declare interface WorkImage extends WorkCubeImage {
2594
+ /** 深度图 */
1769
2595
  depth?: string;
1770
- tiles?: string;
1771
- };
2596
+ /** 光照强度图 */
2597
+ luminance?: WorkCubeImage;
2598
+ /** 瓦片信息 */
2599
+ tiles?: WorkTile[];
2600
+ }
1772
2601
 
1773
2602
  /** 初始化位姿参数 */
1774
- export declare type WorkInitial = Omit<State, "offset">;
2603
+ export declare interface WorkInitial extends Omit<State, "offset" | "distance"> {
2604
+ }
1775
2605
 
1776
2606
  /** 模型数据 */
1777
- export declare type WorkModel = {
2607
+ export declare interface WorkModel {
2608
+ /** 模型文件地址 at3d / domez */
1778
2609
  file: string;
2610
+ /** 模型贴图文件地址 */
1779
2611
  textures: string[];
2612
+ /** 模型贴图文件地址的父目录 */
1780
2613
  textureBase: string;
2614
+ /** 是否开启 bvh 碰撞树,开启会大大加快射线碰撞的执行效率 */
1781
2615
  bvh: boolean;
1782
- async: boolean;
1783
- };
2616
+ tiles?: WorkModelTiles;
2617
+ }
2618
+
2619
+ /** 模型瓦片 */
2620
+ export declare interface WorkModelTiles {
2621
+ tileset_url: string;
2622
+ tileset_url_md5: string;
2623
+ b3md_mappings_url: string;
2624
+ b3md_mappings_url_md5: string;
2625
+ }
2626
+
2627
+ declare interface WorkModelTiles_2 {
2628
+ tileset_url: string;
2629
+ tileset_url_md5: string;
2630
+ b3md_mappings_url: string;
2631
+ b3md_mappings_url_md5: string;
2632
+ }
1784
2633
 
1785
2634
  /** 每个点位的数据 */
1786
- export declare type WorkObserver = {
2635
+ export declare interface WorkObserver {
2636
+ /** 点位序号 */
1787
2637
  panoIndex: number;
2638
+ /** 点位是否激活可用 */
1788
2639
  active: boolean;
2640
+ /** 点位是否可加载 */
1789
2641
  loadable: boolean;
1790
- images: WorkImages;
2642
+ /** 点位全景图 */
2643
+ images: WorkImage;
2644
+ /** 点位视频 */
1791
2645
  video?: WorkVideo;
2646
+ /** 可以看到的相关点位序号 */
1792
2647
  visibleNodes: number[];
2648
+ /** 可以连通的相关点位序号 */
1793
2649
  accessibleNodes: number[];
2650
+ /** 点位和模型的旋转对齐关系四元数 */
1794
2651
  quaternion: THREE_2.Quaternion;
2652
+ /** 点位和模型的地面位置坐标关系 */
1795
2653
  standingPosition: THREE_2.Vector3;
2654
+ /** 点位和模型的观察点坐标关系 */
1796
2655
  position: THREE_2.Vector3;
2656
+ /** 点位所在楼层 */
1797
2657
  floorIndex: number;
1798
- };
2658
+ }
2659
+
2660
+ export declare interface WorkTile {
2661
+ level: number;
2662
+ size: number;
2663
+ up: string;
2664
+ down: string;
2665
+ right: string;
2666
+ left: string;
2667
+ front: string;
2668
+ back: string;
2669
+ }
1799
2670
 
1800
2671
  /** 全景视频贴片 */
1801
- export declare type WorkVideo = {
2672
+ export declare interface WorkVideo {
2673
+ /** 视频源 url */
1802
2674
  source: string;
2675
+ /** 视频源变化矩阵 */
1803
2676
  matrix: THREE_2.Matrix4;
2677
+ /** 视频源长宽尺寸 */
1804
2678
  size: THREE_2.Vector2;
1805
- };
2679
+ }
1806
2680
 
1807
2681
  export { }