@realsee/five 5.0.0-alpha.98 → 6.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/docs/assets/highlight.css +1 -1
  2. package/docs/assets/main.js +2 -2
  3. package/docs/assets/search.js +1 -1
  4. package/docs/assets/style.css +28 -2
  5. package/docs/classes/five.AnimationFrameLoop.html +5 -5
  6. package/docs/classes/five.BVH.html +2 -2
  7. package/docs/classes/five.BVHIntersect.html +1 -1
  8. package/docs/classes/five.BVHNode.html +2 -2
  9. package/docs/classes/five.BVHVector3.html +1 -1
  10. package/docs/classes/five.BoxBoundingVolume.html +1 -0
  11. package/docs/classes/five.Camera.html +6 -6
  12. package/docs/classes/five.Clipper.html +1 -0
  13. package/docs/classes/five.CullingVolume.html +1 -0
  14. package/docs/classes/five.Five.html +116 -83
  15. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  16. package/docs/classes/five.IntersectMesh.html +1 -1
  17. package/docs/classes/five.Model.html +37 -37
  18. package/docs/classes/five.NetworkSubscribe.html +22 -15
  19. package/docs/classes/five.PBMContainer.html +9 -11
  20. package/docs/classes/five.PBMGroup.html +2 -18
  21. package/docs/classes/five.PBMMaterialReferenceCache.html +1 -0
  22. package/docs/classes/five.PBMMesh.html +3 -5
  23. package/docs/classes/five.PBMMeshMaterial.html +41 -0
  24. package/docs/classes/five.PanoCircleMesh.html +4 -4
  25. package/docs/classes/five.PanoCircleMeshCustom.html +7 -0
  26. package/docs/classes/five.PanoCircleMeshSolid.html +7 -0
  27. package/docs/classes/five.RegionBoundingVolume.html +1 -0
  28. package/docs/classes/five.RequestScheduler.html +16 -0
  29. package/docs/classes/five.Scene.html +2 -2
  30. package/docs/classes/five.SphereBoundingVolume.html +1 -0
  31. package/docs/classes/five.Subscribe.html +24 -17
  32. package/docs/classes/five.TextureLoader.html +1 -0
  33. package/docs/classes/five.Tile.html +1 -0
  34. package/docs/classes/five.Tile3DModel.html +1 -0
  35. package/docs/classes/five.TileCubeTextureTarget.html +1 -0
  36. package/docs/classes/five.TileNode.html +1 -0
  37. package/docs/classes/five.Tileset.html +5 -0
  38. package/docs/classes/five.TilesetCache.html +1 -0
  39. package/docs/classes/five.TilesetTraverser.html +1 -0
  40. package/docs/classes/five.Work.html +21 -10
  41. package/docs/classes/five.XRButton.html +1 -0
  42. package/docs/classes/gltf_loader.DDSLoader.html +1 -0
  43. package/docs/classes/gltf_loader.DRACOLoader.html +1 -0
  44. package/docs/classes/gltf_loader.GLTFLoader.html +8 -8
  45. package/docs/classes/gltf_loader.GLTFObject.html +3 -3
  46. package/docs/classes/gltf_loader.GLTFParser.html +1 -0
  47. package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -0
  48. package/docs/classes/line.Line.html +1 -1
  49. package/docs/classes/line.LineGeometry.html +1 -1
  50. package/docs/classes/line.LineMaterial.html +1 -1
  51. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  52. package/docs/classes/line.THREE_Line2.html +1 -1
  53. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  54. package/docs/classes/react.Store.html +13 -13
  55. package/docs/classes/sticker.Sticker.html +9 -9
  56. package/docs/classes/vfx.Airflow.html +1 -0
  57. package/docs/classes/vfx.Flame.html +1 -0
  58. package/docs/classes/vfx.Particle.html +89 -0
  59. package/docs/classes/vfx.SpotLight.html +1 -0
  60. package/docs/enums/five.PBMPointColorType.html +1 -0
  61. package/docs/enums/five.PBMPointShapeType.html +1 -0
  62. package/docs/enums/five.PBMPointSizeType.html +1 -0
  63. package/docs/enums/five.VolumePlaneIntersect.html +1 -0
  64. package/docs/index.html +2 -2
  65. package/docs/interfaces/five.AddableObject.html +9 -1
  66. package/docs/interfaces/five.AnimationFrame.html +1 -1
  67. package/docs/interfaces/five.BoundingVolume.html +1 -0
  68. package/docs/interfaces/five.CameraPose.html +1 -1
  69. package/docs/interfaces/five.ClipperParameter.html +1 -0
  70. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +12 -14
  71. package/docs/interfaces/five.EventCallback.html +107 -113
  72. package/docs/interfaces/five.FiveInitArgs.html +39 -32
  73. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
  74. package/docs/interfaces/five.ImageOptions.html +8 -6
  75. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  76. package/docs/interfaces/five.ImageURLOptions.html +15 -1
  77. package/docs/interfaces/five.IntersectMeshInterface.html +2 -2
  78. package/docs/interfaces/five.Intersection.html +4 -4
  79. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +11 -0
  80. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +9 -11
  81. package/docs/interfaces/five.ModelEventCallback.html +7 -13
  82. package/docs/interfaces/five.ModelLodOptions.html +1 -0
  83. package/docs/interfaces/five.MotionKeyframe.html +1 -0
  84. package/docs/interfaces/five.MovePanoOptions.html +17 -14
  85. package/docs/interfaces/five.NetworkOptions.html +9 -0
  86. package/docs/interfaces/five.PBMPanoPicture.html +4 -4
  87. package/docs/interfaces/five.PBMParameters.html +32 -8
  88. package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -0
  89. package/docs/interfaces/five.PanoCircleMeshInterface.html +15 -5
  90. package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -0
  91. package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -0
  92. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +19 -14
  93. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +9 -11
  94. package/docs/interfaces/five.Pose.html +9 -7
  95. package/docs/interfaces/five.Scissor.html +6 -6
  96. package/docs/interfaces/five.State.html +13 -9
  97. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -1
  98. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -1
  99. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -1
  100. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -1
  101. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -1
  102. package/docs/interfaces/five.SubscribeMixinType.waitUnitl.html +1 -0
  103. package/docs/interfaces/five.TextureOptions.html +9 -7
  104. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +3 -0
  105. package/docs/interfaces/five.TileCubeNode.html +1 -0
  106. package/docs/interfaces/five.TileCubeTree.html +1 -0
  107. package/docs/interfaces/five.TileHeader.html +1 -0
  108. package/docs/interfaces/five.TilesetHeader.html +1 -0
  109. package/docs/interfaces/five.TilesetOptions.html +1 -0
  110. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +6 -4
  111. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +17 -15
  112. package/docs/interfaces/five.WebXRControllerParams.html +1 -0
  113. package/docs/interfaces/five.WorkCubeImage.html +7 -7
  114. package/docs/interfaces/five.WorkImage.html +11 -11
  115. package/docs/interfaces/five.WorkInitial.html +13 -9
  116. package/docs/interfaces/five.WorkModel.html +7 -7
  117. package/docs/interfaces/five.WorkObserver.html +21 -15
  118. package/docs/interfaces/five.WorkOptions.html +15 -0
  119. package/docs/interfaces/five.WorkTile.html +1 -1
  120. package/docs/interfaces/five.WorkVideo.html +5 -5
  121. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +29 -0
  122. package/docs/interfaces/gltf_loader.DDS.html +1 -0
  123. package/docs/interfaces/gltf_loader.GLTF.html +2 -2
  124. package/docs/interfaces/gltf_loader.GLTFReference.html +1 -0
  125. package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -0
  126. package/docs/interfaces/react.FiveActionReactCallbacks.html +11 -21
  127. package/docs/interfaces/react.FiveInjectionTypes.html +40 -43
  128. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -1
  129. package/docs/interfaces/sticker.IntersectionLike.html +4 -4
  130. package/docs/interfaces/vfx.ParticleArgs.html +75 -0
  131. package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -0
  132. package/docs/interfaces/vue.FiveActionVueCallbacks.html +60 -0
  133. package/docs/modules/five.SubscribeMixinType.html +1 -1
  134. package/docs/modules/five.html +130 -113
  135. package/docs/modules/gltf_loader.html +1 -1
  136. package/docs/modules/line.html +1 -1
  137. package/docs/modules/react.html +36 -36
  138. package/docs/modules/sticker.html +1 -1
  139. package/docs/modules/vfx.html +1 -0
  140. package/docs/modules/vue.html +115 -0
  141. package/docs/modules.html +1 -1
  142. package/exporters/staticify.js +14 -7
  143. package/five/index.d.ts +1208 -252
  144. package/five/index.js +9 -98
  145. package/gltf-loader/index.d.ts +90 -5
  146. package/gltf-loader/index.js +3 -3
  147. package/line/index.d.ts +1 -0
  148. package/line/index.js +3 -3
  149. package/package.json +10 -6
  150. package/react/index.d.ts +61 -69
  151. package/react/index.js +3 -3
  152. package/resource/basis/1.16/basis_transcoder.js +22 -0
  153. package/resource/basis/{basis_transcoder.wasm → 1.16/basis_transcoder.wasm} +0 -0
  154. package/resource/basis/README.md +5 -0
  155. package/resource/draco/1.5.6/draco_decoder.js +34 -0
  156. package/resource/draco/1.5.6/draco_decoder.wasm +0 -0
  157. package/resource/draco/1.5.6/draco_decoder_gltf.js +33 -0
  158. package/resource/draco/1.5.6/draco_decoder_gltf.wasm +0 -0
  159. package/resource/draco/1.5.6/draco_encoder.js +35 -0
  160. package/resource/draco/1.5.6/draco_encoder.wasm +0 -0
  161. package/resource/draco/1.5.6/draco_encoder_wrapper.js +97 -0
  162. package/resource/draco/1.5.6/draco_wasm_wrapper.js +117 -0
  163. package/resource/draco/1.5.6/draco_wasm_wrapper_gltf.js +116 -0
  164. package/resource/draco/README.md +5 -0
  165. package/scripts/five-staticify.js +6 -1
  166. package/sticker/index.d.ts +2 -1
  167. package/sticker/index.js +3 -3
  168. package/umd/five-gltf-loader.js +1 -2
  169. package/umd/five-line.js +1 -2
  170. package/umd/five-react.js +1 -2
  171. package/umd/five-sticker.js +1 -2
  172. package/umd/five-vfx.js +1 -0
  173. package/umd/five-vue.js +1 -0
  174. package/umd/five.js +1 -1
  175. package/umd/five.js.LICENSE.txt +5 -202
  176. package/vfx/index.d.ts +264 -0
  177. package/vfx/index.js +260 -0
  178. package/vue/index.d.ts +443 -0
  179. package/vue/index.js +260 -0
  180. package/docs/classes/five.LegacyPanoCircleMesh.html +0 -5
  181. package/docs/classes/five.PBMMaterial.html +0 -15
  182. package/docs/classes/server.BVH.html +0 -10
  183. package/docs/classes/server.BVHIntersect.html +0 -1
  184. package/docs/classes/server.BVHNode.html +0 -7
  185. package/docs/classes/server.BVHVector3.html +0 -1
  186. package/docs/classes/server.Model.html +0 -63
  187. package/docs/classes/server.PBMGroup.html +0 -9
  188. package/docs/classes/server.PBMMesh.html +0 -7
  189. package/docs/interfaces/server.Intersection.html +0 -7
  190. package/docs/interfaces/server.ModelEventCallback.html +0 -18
  191. package/docs/modules/server.html +0 -18
  192. package/resource/basis/basis_transcoder.js +0 -22
  193. package/resource/gltf/draco_decoder.js +0 -31
  194. package/resource/gltf/draco_decoder.wasm +0 -0
  195. package/resource/gltf/draco_wasm_wrapper.js +0 -119
  196. package/server/index.d.ts +0 -556
  197. package/server/index.js +0 -367
package/five/index.d.ts CHANGED
@@ -1,13 +1,18 @@
1
1
  import * as THREE_2 from 'three';
2
2
 
3
3
  export declare interface AddableObject extends THREE_2.Object3D {
4
+ /** 是否需要渲染一次 */
4
5
  needsRender?: boolean;
6
+ /** 动画 */
5
7
  mixer?: THREE_2.AnimationMixer;
8
+ /** 设置当前分辨率 */
6
9
  setResolution?(width: number, height: number): void;
10
+ /** 设置当前时间 */
11
+ setTime?(time: number): void;
7
12
  }
8
13
 
9
14
  export declare interface AnimationFrame {
10
- callback: (time: number, deltaTime: number) => void;
15
+ callback: (time: number, deltaTime: number, ...args: any[]) => void;
11
16
  once: boolean;
12
17
  delay: number;
13
18
  order: number;
@@ -17,11 +22,17 @@ export declare class AnimationFrameLoop {
17
22
  private frames;
18
23
  private time;
19
24
  private stoped;
25
+ private context?;
26
+ private requestId;
20
27
  private static sharedInstance?;
21
28
  static get shared(): AnimationFrameLoop;
22
29
  static getFrameTime(): number;
23
30
  constructor();
24
31
  private loop;
32
+ setContext(context: any): void;
33
+ getContext(): any;
34
+ private requestAnimationFrame;
35
+ private cancelAnimationFrame;
25
36
  private remove;
26
37
  /**
27
38
  * 添加到动画循环
@@ -35,6 +46,48 @@ export declare class AnimationFrameLoop {
35
46
  disponse(): void;
36
47
  }
37
48
 
49
+ export declare interface BoundingVolume {
50
+ type: 'box' | 'sphere' | 'regin';
51
+ applyMatrix4(matrix: THREE_2.Matrix4): this;
52
+ getBoundingBox(target: THREE_2.Box3): THREE_2.Box3;
53
+ toGeometry(): THREE_2.BufferGeometry;
54
+ getCenter(result: THREE_2.Vector3): THREE_2.Vector3;
55
+ distanceSquaredTo(point: THREE_2.Vector3): number;
56
+ distanceTo(point: THREE_2.Vector3): number;
57
+ intersectPlane(plane: THREE_2.Plane): VolumePlaneIntersect;
58
+ intersectRay(ray: THREE_2.Ray): boolean;
59
+ clone(): BoundingVolume;
60
+ copy(boundingVolume: this): this;
61
+ fromJson(json: any): this;
62
+ toJson(): BoundingVolumeJson;
63
+ }
64
+
65
+ export declare type BoundingVolumeJson = RegionBoundingVolumeJson | BoxBoundingVolumeJson | SphereBoundingVolumeJson;
66
+
67
+ export declare class BoxBoundingVolume implements BoundingVolume {
68
+ type: "box";
69
+ center: THREE_2.Vector3;
70
+ halfSize: THREE_2.Vector3;
71
+ rotation: THREE_2.Matrix3;
72
+ constructor();
73
+ fromJson({ box }: BoxBoundingVolumeJson): this;
74
+ toJson(): BoxBoundingVolumeJson;
75
+ copy(boxBoundingVolume: BoxBoundingVolume): this;
76
+ clone(): BoxBoundingVolume;
77
+ applyMatrix4(matrix: THREE_2.Matrix4): this;
78
+ getCenter(result: THREE_2.Vector3): THREE_2.Vector3;
79
+ distanceSquaredTo(point: THREE_2.Vector3): number;
80
+ distanceTo(point: THREE_2.Vector3): number;
81
+ getBoundingBox(target: THREE_2.Box3): THREE_2.Box3;
82
+ toGeometry(): THREE_2.BufferGeometry;
83
+ intersectPlane(plane: THREE_2.Plane): VolumePlaneIntersect;
84
+ intersectRay(ray: THREE_2.Ray): boolean;
85
+ }
86
+
87
+ export declare type BoxBoundingVolumeJson = {
88
+ box: number[];
89
+ };
90
+
38
91
  export declare class BVH {
39
92
  trianglesArray?: Float32Array;
40
93
  offsetArray?: Uint32Array;
@@ -49,6 +102,7 @@ export declare class BVH {
49
102
  * @return 碰撞焦点数组
50
103
  */
51
104
  intersectRay(rayOrigin: BVHVector3, rayDirection: BVHVector3, backfaceCulling: boolean): BVHIntersect[];
105
+ trianglesInSphere(center: BVHVector3, radius: number): Float32Array;
52
106
  dispose(): void;
53
107
  }
54
108
 
@@ -92,16 +146,44 @@ export declare class BVHVector3 {
92
146
  }
93
147
 
94
148
  /** Five 相机 */
95
- export declare class Camera extends THREE_2.PerspectiveCamera {
149
+ export declare class Camera extends THREE_2.Camera {
150
+ fov: number;
151
+ aspect: number;
152
+ near: number;
153
+ far: number;
154
+ perspToOrtho: THREE_2.Vector2;
155
+ orthoDistance: number;
96
156
  /** 相机姿态 */
97
157
  pose: CameraPose;
98
- constructor(fov: number);
158
+ private perspectiveCamera;
159
+ private orthographicCamera;
160
+ needsRender: boolean;
161
+ private lastValues;
162
+ constructor(fov: number, aspect?: number, near?: number, far?: number, perspToOrtho?: THREE_2.Vector2, orthoDistance?: number);
163
+ get zoom(): number;
164
+ get top(): number;
165
+ get bottom(): number;
166
+ get left(): number;
167
+ get right(): number;
168
+ getDirection(target: THREE_2.Vector3): THREE_2.Vector3;
99
169
  /** 通过相机参数反算姿态 */
100
- computePose(): this;
170
+ computePose(distance?: number): this;
101
171
  /** 设置相机姿态 */
102
172
  setFromPose(pose: Partial<CameraPose>): this;
103
173
  /** 拷贝相机姿态 */
104
174
  copyPose(): CameraPose;
175
+ private computeProjectionMatrix;
176
+ setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number): void;
177
+ clearViewOffset(): void;
178
+ updateProjectionMatrix(): void;
179
+ get perspectiveProjectionMatrix(): THREE_2.Matrix4;
180
+ get perspectiveProjectionMatrixInverse(): THREE_2.Matrix4;
181
+ get orthographicProjectionMatrix(): THREE_2.Matrix4;
182
+ get orthographicProjectionMatrixInverse(): THREE_2.Matrix4;
183
+ updateTime(_time: number, _deltaTime: number): void;
184
+ get isPerspectiveCamera(): boolean;
185
+ get isOrthographicCamera(): boolean;
186
+ copy(source: this, recursive?: boolean): this;
105
187
  }
106
188
 
107
189
  export declare interface CameraPose {
@@ -112,6 +194,22 @@ export declare interface CameraPose {
112
194
  offset: THREE_2.Vector3;
113
195
  }
114
196
 
197
+ export declare class Clipper {
198
+ numPlanes: number;
199
+ clipperPlanes: Float32Array | null;
200
+ clipperFloors: number[] | null;
201
+ private static sharedInstance?;
202
+ static get shared(): Clipper;
203
+ constructor();
204
+ update(clipperParameters: ClipperParameter[], camera: THREE_2.Camera): void;
205
+ private projectPlanes;
206
+ }
207
+
208
+ export declare interface ClipperParameter {
209
+ clippingBoxMatrix: THREE_2.Matrix4;
210
+ floorIndex?: number;
211
+ }
212
+
115
213
  export declare type ControllerCustomInitTypes = {
116
214
  Floorplan: FloorplanControllerCustomInitArgs;
117
215
  Topview: TopviewControllerCustomInitArgs;
@@ -119,23 +217,25 @@ export declare type ControllerCustomInitTypes = {
119
217
  VRPanorama: VRPanoramaControllerCustomInitArgs;
120
218
  Model: ModelControllerCustomInitArgs;
121
219
  DepthPanorama: DepthPanoramaControllerCustomInitArgs;
220
+ Mapview: MapviewControllerCustomInitArgs;
221
+ XRPanorama: XRPanoramaControllerCustomInitArgs;
122
222
  };
123
223
 
124
224
  export declare type ControllerEventTypes = {
125
225
  /**
126
226
  * 模态间切换动画开始
127
- * @param panoIndex - 当前点位
227
+ * @param panoId - 当前点位
128
228
  * @param pose - 相机姿态
129
229
  * @param userAction - 是否用户触发
130
230
  */
131
- initAnimationWillStart(panoIndex: number, pose: Pose, userAction: boolean): void;
231
+ initAnimationWillStart(panoId: WorkPanoId, pose: Pose, userAction: boolean): void;
132
232
  /**
133
233
  * 模态间切换动画结束
134
- * @param panoIndex - 当前点位
234
+ * @param panoId - 当前点位
135
235
  * @param pose - 相机姿态
136
236
  * @param userAction - 是否用户触发
137
237
  */
138
- initAnimationEnded(panoIndex: number, pose: Pose, userAction: boolean): void;
238
+ initAnimationEnded(panoId: WorkPanoId, pose: Pose, userAction: boolean): void;
139
239
  /**
140
240
  * 意图要变化相机的可视角度 可以通过 `return false` 阻止
141
241
  * @deprecated
@@ -170,43 +270,43 @@ export declare type ControllerEventTypes = {
170
270
  cameraDirectionUpdate(coordinates: Pick<Pose, "longitude" | "latitude">, userAction: boolean): void;
171
271
  /**
172
272
  * 观察点位被选择
173
- * @param panoIndex - 选择的点位
273
+ * @param panoId - 选择的点位
174
274
  */
175
- panoSelected(panoIndex: number | null): void;
275
+ panoSelected(panoId: WorkPanoId | null): void;
176
276
  /**
177
277
  * 意图要移动到某个点位 可以通过 `return false` 阻止
178
- * @param panoIndex - 图要移动到的点位下标
278
+ * @param panoId - 图要移动到的点位
179
279
  * @param options - 移动参数
180
280
  * @param userAction - 是否用户触发
181
281
  * @returns 可以通过 `return false` 阻止
182
282
  */
183
- wantsMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void | false;
283
+ wantsMoveToPano(panoId: WorkPanoId, options: MovePanoOptions, userAction: boolean): void | false;
184
284
  /**
185
285
  * 开始加载并移动到某个观察点位
186
286
  * @description
187
287
  * 可 panoWillArrive 相比
188
288
  * - moveToPano 在加载全景图资源前触发
189
289
  * - panoWillArrive 在加载全景图资源后触发
190
- * @param panoIndex - 移动到的点位下标
290
+ * @param panoId - 移动到的点位
191
291
  * @param userAction - 是否用户触发
192
292
  */
193
- moveToPano(panoIndex: number, userAction: boolean): void;
293
+ moveToPano(panoId: WorkPanoId, userAction: boolean): void;
194
294
  /**
195
295
  * 开始加载某个观察点的全景资源
196
- * @param panoIndex - 移动到的点位下标
296
+ * @param panoId - 移动到的点位
197
297
  */
198
- panoWillLoad(panoIndex: number): void;
298
+ panoWillLoad(panoId: WorkPanoId): void;
199
299
  /**
200
300
  * 某个观察点的全景资源加载完成
201
- * @param panoIndex - 对应的点位下标
301
+ * @param panoId - 对应的点位
202
302
  */
203
- panoLoaded(panoIndex: number): void;
303
+ panoLoaded(panoId: WorkPanoId): void;
204
304
  /**
205
305
  * 某个观察点的全景资源加载失败
206
306
  * @param error - 错误对象
207
- * @param panoIndex - 对应的点位下标
307
+ * @param panoId - 对应的点位
208
308
  */
209
- panoLoadError(error: Error, panoIndex: number): void;
309
+ panoLoadError(error: Error, panoId: WorkPanoId): void;
210
310
  /**
211
311
  * 移动到某个观察点位被取消
212
312
  * @description
@@ -214,34 +314,34 @@ export declare type ControllerEventTypes = {
214
314
  * - 移动过程中切换模态
215
315
  * - 移动过程中 five 被析构
216
316
  * - 移动过程点击切换到另一个点位
217
- * @param panoIndex - 对应的点位下标
317
+ * @param panoId - 对应的点位
218
318
  */
219
- moveToPanoCanceled(panoIndex: number): void;
319
+ moveToPanoCanceled(panoId: WorkPanoId): void;
220
320
  /**
221
321
  * 开始移动到某个观察点位
222
322
  * @description
223
323
  * 和 moveToPano 相比
224
324
  * - moveToPano 在加载全景图资源前触发
225
325
  * - panoWillArrive 在加载全景图资源后触发
226
- * @param panoIndex - 移动到点位下标
326
+ * @param panoId - 移动到点位
227
327
  * @param pose - 相机姿态
228
328
  * @param userAction - 是否用户触发
229
329
  */
230
- panoWillArrive(panoIndex: number, pose: Pose, userAction: boolean): void;
330
+ panoWillArrive(panoId: WorkPanoId, pose: Pose, userAction: boolean): void;
231
331
  /**
232
332
  * 移动到某个观察点位
233
- * @param panoIndex - 移动到点位下标
333
+ * @param panoIndex - 移动到点位
234
334
  * @param pose - 相机姿态
235
335
  * @param userAction - 是否用户触发
236
336
  */
237
- panoArrived(panoIndex: number, pose: Pose, userAction: boolean): void;
337
+ panoArrived(panoId: WorkPanoId, pose: Pose, userAction: boolean): void;
238
338
  /**
239
339
  * 移动中, 会告知移动状态(耗时百分比)
240
- * @param panoIndex - 将要移动到的点位下标
241
- * @param prevPanoIndex - 上一个点位下标
340
+ * @param panoId - 将要移动到的点位下标
341
+ * @param prevPanoId - 上一个点位下标
242
342
  * @param progress - 整个过程经度 [0-1]
243
343
  */
244
- movingToPano(panoIndex: number, prevPanoIndex: number, progress: number): void;
344
+ movingToPano(panoId: WorkPanoId, prevPanoId: WorkPanoId, progress: number): void;
245
345
  /**
246
346
  * 意图要触发手势, 可以通过 `return false` 阻止
247
347
  * @param type - 手势类型
@@ -371,50 +471,68 @@ export declare type ControllerEventTypes = {
371
471
  vrWantsToExit(): void;
372
472
  /**
373
473
  * 观察点的全景资源开始加载
374
- * @param panoIndex - 加载点位下标
375
- * @param observer - 对应的 observer 详情
474
+ * @param panoId - 加载点位
376
475
  */
377
- textureStartLoad(panoIndex: number, observer: WorkObserver): void;
476
+ textureStartLoad(panoId: WorkPanoId): void;
378
477
  /**
379
478
  * 观察点的全景资源加载中,可获取到进度
380
479
  * @param progress - 加载进度 [0-1]
381
- * @param panoIndex - 加载点位下标
382
- * @param observer - 对应的 observer 详情
480
+ * @param panoId - 加载点位下标
383
481
  */
384
- textureLoading(progress: number, panoIndex: number, observer: WorkObserver): void;
482
+ textureLoading(progress: number, panoId: WorkPanoId): void;
385
483
  /**
386
484
  * 观察点的全景资源加载被中止
387
- * @param panoIndex - 加载点位下标
388
- * @param observer - 对应的 observer 详情
485
+ * @param panoId - 加载点位
389
486
  */
390
- textureAbort(panoIndex: number, observer: WorkObserver): void;
487
+ textureAbort(panoId: WorkPanoId): void;
391
488
  /**
392
489
  * 观察点的全景资源加载失败
393
490
  * @param error - 错误对象
394
- * @param panoIndex - 加载点位下标
395
- * @param observer - 对应的 observer 详情
491
+ * @param panoId - 加载点位
396
492
  */
397
- textureError(error: Error, panoIndex: number, observer: WorkObserver): void;
493
+ textureError(error: Error, panoId: WorkPanoId): void;
398
494
  /**
399
495
  * 观察点的全景资源加载完成
400
- * @param panoIndex - 加载点位下标
401
- * @param observer - 对应的 observer 详情
496
+ * @param panoId - 加载点位
402
497
  */
403
- textureLoaded(panoIndex: number, observer: WorkObserver, meta: (NetWorkMeta | null)[]): void;
498
+ textureLoaded(panoId: WorkPanoId, meta: (NetWorkMeta | null)[]): void;
404
499
  /**
405
500
  * 抛出错误
406
501
  * @param error - 抛出错误
407
502
  */
408
503
  error(error: Error): void;
504
+ /**
505
+ * webXR模式开始,webxr session完成坐标系矫正
506
+ */
507
+ webXRSessionStart(): void;
508
+ /**
509
+ * webXR模式结束,webxr session销毁
510
+ */
511
+ webXRSessionEnd(): void;
512
+ /**
513
+ * axes代表控制杆,axes数组的0-1元素分别代表左控制器的左(-1)右(1),左控制器的上(-1)下(1),axes数组的2-3元素同理
514
+ */
515
+ webXRControllerEvent(type: WebXRControllerType, key: WebXRControllerKey, params: WebXRControllerParams): void;
409
516
  };
410
517
 
518
+ export declare class CullingVolume {
519
+ static get MASK_OUTSIDE(): number;
520
+ static get MASK_INSIDE(): number;
521
+ static get MASK_INDETERMINATE(): number;
522
+ planes: THREE_2.Plane[];
523
+ constructor(planes?: THREE_2.Plane[]);
524
+ setFromFrustum(frustum: THREE_2.Frustum): this;
525
+ computeVisibility(boundingVolume: BoundingVolume): VolumePlaneIntersect;
526
+ computeVisibilityWithPlaneMask(boundingVolume: BoundingVolume, parentPlaneMask: number): number;
527
+ }
528
+
411
529
  /**
412
530
  * URL 地址的转换
413
- * @param url - url 原地址
531
+ * @param source - url 原地址
414
532
  * @param options - url 转换参数
415
533
  * @returns url 转换结果
416
534
  */
417
- export declare function defaultImageURLTransform(url: string, options: ImageURLOptions): string;
535
+ export declare function defaultImageURLTransform(source: string, options: ImageURLOptions): string;
418
536
 
419
537
  export declare interface DepthPanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
420
538
  /** 最远可移动观察点距离 */
@@ -427,7 +545,7 @@ export declare interface DepthPanoramaControllerCustomInitArgs extends PanoramaL
427
545
  */
428
546
  panoTapTriggerRadius?: number;
429
547
  /** 地面观察点标识自定义创建器 */
430
- panoCircleMeshCreator?: () => PanoCircleMeshInterface;
548
+ panoCircleMeshCreator?: (panoId: WorkPanoId) => PanoCircleMeshInterface;
431
549
  }
432
550
 
433
551
  /**
@@ -452,23 +570,23 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
452
570
  /**
453
571
  * 准备加载 Work 数据
454
572
  * @param input - 输入的 work
455
- * @param work - 归一化的标准 work
573
+ * @param works - 归一化的标准 work
456
574
  * @param state - 加载时的姿态
457
575
  */
458
- willLoad(input: any, work: Work, state: Omit<State, "offset">): void;
576
+ willLoad(input: any, works: Works, state: Partial<State>): void;
459
577
  /**
460
578
  * 开始加载 Work 数据
461
579
  * @param input - 输入的 work
462
- * @param work - 归一化的标准 work
580
+ * @param works - 归一化的标准 work
463
581
  * @param state - 加载时的姿态
464
582
  */
465
- load(input: any, work: Work, state: Omit<State, "offset">): void;
583
+ load(input: any, works: Works, state: Partial<State>): void;
466
584
  /**
467
585
  * 加载完 Work 数据
468
586
  * @param input - 输入的 work
469
- * @param work - 归一化的标准 work
587
+ * @param works - 归一化的标准 work
470
588
  */
471
- loaded(input: any, work: Work): void;
589
+ loaded(input: any, works: Works): void;
472
590
  /**
473
591
  * 模型开始加载
474
592
  * @param workModel - 归一化的标准 work 中的 model 值
@@ -542,21 +660,21 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
542
660
  stateSynced(state: State): void;
543
661
  /**
544
662
  * 意图要移动到某个点时, 可以通过 return false 阻止
545
- * @param panoIndex - 意图要移动到点位下标
663
+ * @param panoId - 意图要移动到点位
546
664
  * @param options - 移动参数
547
665
  * @param userAction - 是否用户触发
548
666
  * @returns 可以通过 return false 阻止
549
667
  */
550
- wantsMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void | false;
668
+ wantsMoveToPano(panoId: WorkPanoId, options: MovePanoOptions, userAction: boolean): void | false;
551
669
  /**
552
670
  * 同 wantsMoveToPano
553
671
  * @description
554
- * @param panoIndex - 意图要移动到点位下标
672
+ * @param panoId - 意图要移动到点位
555
673
  * @param options - 移动参数
556
674
  * @param userAction - 是否用户触发
557
675
  * @returns 可以通过 return false 阻止
558
676
  */
559
- wantsToMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void;
677
+ wantsToMoveToPano(panoId: WorkPanoId, options: MovePanoOptions, userAction: boolean): void;
560
678
  /**
561
679
  * 意图要切换到某个模态, 可以通过 return false 阻止
562
680
  * @param mode - 意图要切换到的模态
@@ -570,8 +688,9 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
570
688
  * @param prevMode - 上本质是一个模态
571
689
  * @param panoIndex - 初始化动画结束后的点位下标
572
690
  * @param toPose - 初始化动画结束后的状态
691
+ * @param userAction - 是否用户触发
573
692
  */
574
- modeChange(mode: Mode, prevMode: Mode, panoIndex: number, toPose: Pose): void;
693
+ modeChange(mode: Mode, prevMode: Mode, panoId: WorkPanoId, toPose: Pose, userAction: boolean): void;
575
694
  /**
576
695
  * 帮助元素显应的变换
577
696
  * @param visible - 帮助元素的是否开启
@@ -602,6 +721,9 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
602
721
  * ```
603
722
  */
604
723
  export declare class Five extends Subscribe<EventTypes> {
724
+ static get version(): string;
725
+ static get dracoPath(): string;
726
+ static set dracoPath(path: string);
605
727
  /**
606
728
  * Five 的显示模式,可以通过 `five.changeMode` `five.setState` 来切换
607
729
  * @description
@@ -612,6 +734,7 @@ export declare class Five extends Subscribe<EventTypes> {
612
734
  * Topview 户型图模式
613
735
  * DepthPanorama 深度图游走模式
614
736
  * VRPanorama VR眼镜模式
737
+ * XRPanorama VR硬件模式
615
738
  * ```
616
739
  */
617
740
  static Mode: Mirror<Mode>;
@@ -627,9 +750,9 @@ export declare class Five extends Subscribe<EventTypes> {
627
750
  */
628
751
  paused: boolean;
629
752
  /** 当前点位序号 */
630
- panoIndex?: number;
753
+ panoId: WorkPanoId;
631
754
  /** 当前展示的模式 */
632
- currentMode?: Mode;
755
+ currentMode: Mode;
633
756
  /** 内部使用的 `THREE.Scene` */
634
757
  scene: Scene;
635
758
  /** 内部使用的 `Camera` */
@@ -676,6 +799,12 @@ export declare class Five extends Subscribe<EventTypes> {
676
799
  * 平衡加载时间和图片质量
677
800
  */
678
801
  textureOptions: TextureOptions;
802
+ /**
803
+ * 模型lod的配置参数
804
+ * @description
805
+ * 可以配置加载模型lod的相关参数
806
+ */
807
+ modelLodOptions: ModelLodOptions;
679
808
  /**
680
809
  * 模型贴图的配置参数
681
810
  * @description
@@ -707,6 +836,8 @@ export declare class Five extends Subscribe<EventTypes> {
707
836
  [key: string]: FivePluginInstance<any>;
708
837
  };
709
838
  ident: string;
839
+ /** 包围盒子 */
840
+ private boundingMesh;
710
841
  private stopAnimationLoop?;
711
842
  private fps;
712
843
  private helperGroup;
@@ -717,7 +848,6 @@ export declare class Five extends Subscribe<EventTypes> {
717
848
  private destroyed;
718
849
  private stateSynced;
719
850
  private controllerInits;
720
- private panoramaLikeSavedPose;
721
851
  private extraElements;
722
852
  private getPixelsRenderTarget;
723
853
  private readyCallbacks;
@@ -730,11 +860,31 @@ export declare class Five extends Subscribe<EventTypes> {
730
860
  */
731
861
  private _enableIOSEDR;
732
862
  private lastLoadWorkTask;
863
+ private requestProxy;
733
864
  private networkSubscribe;
734
- private screenBuffer?;
865
+ private screenBuffers?;
735
866
  private analysis?;
736
867
  private renderSwitch01;
868
+ /**
869
+ * gpu_picking
870
+ */
871
+ private gpuPickingRenderTarget;
872
+ private meshReplaceMaterialMap;
873
+ private meshOriginMaterialMap;
874
+ private copyEffect;
737
875
  constructor(initArgs?: FiveInitArgs);
876
+ get panoIndex(): number;
877
+ /**
878
+ * GPU Picking 获取选中的 mesh
879
+ * @param x - 屏幕坐标 x
880
+ * @param y - 屏幕坐标 y
881
+ * @param colorMap - 需要选取的 mesh 的颜色与 uuid 的映射
882
+ * @param color - 指定的模型颜色
883
+ * @returns 选中 mesh 的 uuid
884
+ */
885
+ getGPUPicking(x: number, y: number, colorMap: {
886
+ [key: string]: THREE_2.Color;
887
+ }, pixelRatio?: number, color?: THREE_2.Vector3): string | false;
738
888
  /**
739
889
  * 析构 five 对象。
740
890
  * @description
@@ -766,9 +916,17 @@ export declare class Five extends Subscribe<EventTypes> {
766
916
  */
767
917
  get enableIOSEDR(): boolean;
768
918
  set enableIOSEDR(enable: boolean);
919
+ /**
920
+ * 是否开启EDL模式
921
+ */
922
+ get enableEDL(): boolean;
923
+ set enableEDL(enable: boolean);
924
+ /**
925
+ * 是否开启后处理
926
+ */
769
927
  get enablePostProcessing(): boolean;
770
928
  set enablePostProcessing(enable: boolean);
771
- updateConfiguration(args: Pick<FiveInitArgs, "panorama" | "model" | "floorplan" | "topview" | "depthPanorama" | "vrPanorama" | "imageOptions">): void;
929
+ updateConfiguration(args: Pick<FiveInitArgs, "panorama" | "model" | "floorplan" | "topview" | "mapview" | "depthPanorama" | "vrPanorama" | "imageOptions" | "textureOptions">): void;
772
930
  /**
773
931
  * 将显示区域加载到页面 DOM 中
774
932
  * @description
@@ -819,6 +977,17 @@ export declare class Five extends Subscribe<EventTypes> {
819
977
  * @returns Promise 是否移动成功
820
978
  */
821
979
  updateCamera(pose: Partial<Omit<Pose, "offset">>, duration: number, userAction?: boolean): Promise<void>;
980
+ /**
981
+ * 通过帧动画移动相机。(不触发点位移动)
982
+ * @description
983
+ * 如果动画中途被打断(用户触发行为,或者调用 setState, load, changeMode)的等
984
+ * 会 Promise.reject。运动完成则 Promise.resolve
985
+ * @param keyframes - 动画帧
986
+ * @param duration - 动画触发的时常
987
+ * @param userAction - 是否用户触发
988
+ * @returns Promise 是否移动成功
989
+ */
990
+ updateCameraWithKeyframes(keyframes: MotionKeyframe<Exclude<keyof Pose, "offset">>[], duration: number, userAction?: boolean): Promise<void>;
822
991
  /**
823
992
  * 获取当前相机经纬度
824
993
  * @deprecated 请使用使用 getPose
@@ -838,28 +1007,9 @@ export declare class Five extends Subscribe<EventTypes> {
838
1007
  phi: number;
839
1008
  lookAtVector: THREE_2.Vector3;
840
1009
  };
841
- /**
842
- * 初始化 initBasisLoader
843
- * @description
844
- * 同初始化的 initBasisLoader 参数。用于初始化 basisLoader。
845
- * basisLoader 只会初始化一次,一旦初始化则不会再修改。
846
- *
847
- * @param transcoderResourcePath - basis 解析器路径
848
- * 如果不设置,使用默认解析器 basis 解析器。
849
- * 可以传入解析器的 `resourcePath`, 则使用指定的解析器
850
- * @example
851
- * ```
852
- * // 使用默认解析器
853
- * five.initialBasisLoader();
854
- *
855
- * // 使用指定解析器
856
- * // 会调用这个目录下的 basis_transcoder.js basis_transcoder.wasm 文件作为解析器
857
- * five.initialBasisLoader("https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/");
858
- * ```
859
- */
860
- initBasisLoader(transcoderResourcePath?: string): void;
861
1010
  /** 当前加载的 work 数据 */
862
- get work(): Work;
1011
+ get works(): Works;
1012
+ get work(): Work | undefined;
863
1013
  /**
864
1014
  * 加载 Work 数据
865
1015
  * @param inputWork - Work 数据
@@ -869,7 +1019,7 @@ export declare class Five extends Subscribe<EventTypes> {
869
1019
  * - State 自定义姿态
870
1020
  * @param duration - 切换时间
871
1021
  */
872
- load(inputWork: Work | LooseWork | any | Promise<Work | LooseWork | any>, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number, userAction?: boolean): Promise<void>;
1022
+ load(inputWork: string | Work | LooseWork | string[] | Work[] | LooseWork[] | LooseWorkWithExtrinsics[] | Promise<Work | LooseWork | Work[] | LooseWork[] | LooseWorkWithExtrinsics[]>, state?: "inherit" | "initial" | Partial<State>, duration?: number, userAction?: boolean): Promise<void>;
873
1023
  private load_;
874
1024
  /**
875
1025
  * 切换模态
@@ -906,9 +1056,9 @@ export declare class Five extends Subscribe<EventTypes> {
906
1056
  * @param callback - 渲染完成回调
907
1057
  */
908
1058
  render(callback?: () => void, updateObjectResolution?: boolean): THREE_2.WebGLRenderTarget;
909
- updateTime(time: number, deltaTime: number): void;
1059
+ updateTime(time: number, deltaTime: number, ...args: any[]): void;
910
1060
  /**
911
- * 但停自动播放
1061
+ * 暂停自动播放
912
1062
  */
913
1063
  pause(): void;
914
1064
  play(): void;
@@ -918,13 +1068,15 @@ export declare class Five extends Subscribe<EventTypes> {
918
1068
  * @param options - 移动点位参数
919
1069
  * @param userAction - 是否用户触犯
920
1070
  */
921
- moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): void;
1071
+ moveToPano(panoId: WorkPanoId, options?: MovePanoOptions, userAction?: boolean): Promise<void>;
1072
+ moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): Promise<void>;
922
1073
  /**
923
1074
  * 预加载点位图片资源
924
1075
  * @param panoIndex - 观察点序号
925
1076
  * @param callback - 加载完成回调, 并传递加载用时。
926
1077
  * @returns 加载完成的 Promise 参数同 callback
927
1078
  */
1079
+ preloadPano(panoId: WorkPanoId, callback?: (costs: number) => void): Promise<number>;
928
1080
  preloadPano(panoIndex: number, callback?: (costs: number) => void): Promise<number>;
929
1081
  /**
930
1082
  * 计算三维坐标对应到屏幕的二维坐标
@@ -965,12 +1117,28 @@ export declare class Five extends Subscribe<EventTypes> {
965
1117
  setState(state: Partial<State>, immediately?: boolean, userAction?: boolean): void;
966
1118
  aroundScissor(callback: () => void): void;
967
1119
  private syncState;
968
- ready(): Promise<void>;
1120
+ /**
1121
+ * 当前页面静态
1122
+ */
1123
+ ready(args?: {
1124
+ tile?: boolean;
1125
+ }): Promise<void>;
1126
+ /**
1127
+ * 请求全屏
1128
+ */
1129
+ requestFullscreen(): void;
1130
+ /**
1131
+ * 退出全屏
1132
+ */
1133
+ exitFullscreen(): void;
969
1134
  private throwError;
970
1135
  private loadModel;
971
1136
  private commonParams;
972
- private saveControllerPose;
973
1137
  private applyController;
1138
+ /** 移除事件绑定 */
1139
+ private removeEventListeners;
1140
+ /** 销毁GPU Picking 所用的材质 */
1141
+ private diposeGPUPickingMaterial;
974
1142
  }
975
1143
 
976
1144
  /** Five 初始化参数 */
@@ -1072,24 +1240,6 @@ export declare interface FiveInitArgs {
1072
1240
  * @default `false`
1073
1241
  */
1074
1242
  maxFps?: number | false;
1075
- /**
1076
- * 是否初始化 `basisLoader`。
1077
- * @description
1078
- * 当你需要加载 basis 格式图片时请启用。
1079
- * 如果设置为 `true` 使用默认解析器 basis 解析器。
1080
- * 如果要自定义,可以传入解析器的 `resourcePath`, 则使用指定的解析器
1081
- * @default `false`
1082
- * @example
1083
- * ```
1084
- * // 使用默认解析器
1085
- * initialBasisLoader: true
1086
- *
1087
- * // 使用指定解析器
1088
- * // 会调用这个目录下的 basis_transcoder.js basis_transcoder.wasm 文件作为解析器
1089
- * initialBasisLoader: "https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/"
1090
- * ```
1091
- */
1092
- initialBasisLoader?: boolean | string;
1093
1243
  /**
1094
1244
  * 外挂视频对象。
1095
1245
  * @description
@@ -1106,15 +1256,19 @@ export declare interface FiveInitArgs {
1106
1256
  floorplan?: ControllerCustomInitTypes["Floorplan"];
1107
1257
  /** 户型图模式下的特定参数 */
1108
1258
  topview?: ControllerCustomInitTypes["Topview"];
1259
+ /** 地图模式下的特定参数 */
1260
+ mapview?: ControllerCustomInitTypes["Mapview"];
1109
1261
  /** 深度图游走模式下的特定参数 */
1110
1262
  depthPanorama?: ControllerCustomInitTypes["DepthPanorama"];
1111
1263
  /** VR眼镜模式下的特定参数 */
1112
1264
  vrPanorama?: ControllerCustomInitTypes["VRPanorama"];
1265
+ /** XR眼镜模式下的特定参数 */
1266
+ xrPanorama?: ControllerCustomInitTypes["XRPanorama"];
1113
1267
  /**
1114
1268
  * 模式间切换时的过度动画时间
1115
1269
  * @description
1116
1270
  * 单位毫秒
1117
- * @default `1000`
1271
+ * @default `800`
1118
1272
  */
1119
1273
  modeChangeDuration?: number;
1120
1274
  /**
@@ -1127,6 +1281,26 @@ export declare interface FiveInitArgs {
1127
1281
  * 是否展示 powered by 如视
1128
1282
  */
1129
1283
  poweredByRealsee?: boolean;
1284
+ /**
1285
+ * 是否使用webgl2渲染执行环境, 默认值 false
1286
+ */
1287
+ webgl2?: boolean;
1288
+ /**
1289
+ * 是否开启模型裁切
1290
+ */
1291
+ localClippingEnabled?: boolean;
1292
+ /**
1293
+ * 请求代理
1294
+ * @param url - 发起的请求
1295
+ * @returns 返回的请求
1296
+ */
1297
+ requestProxy?(url: string): string | Promise<string>;
1298
+ /**
1299
+ * 模型lod相关的配置,maxDepth为加载的最大深度
1300
+ */
1301
+ modelLod?: {
1302
+ maxDepth?: number;
1303
+ };
1130
1304
  }
1131
1305
 
1132
1306
  /**
@@ -1157,8 +1331,6 @@ parameters: Parameters<T>[1]
1157
1331
  export declare type FivePluginInstance<T extends FivePlugin<any, any>> = ReturnType<T>;
1158
1332
 
1159
1333
  export declare interface FloorplanControllerCustomInitArgs {
1160
- /** 默认偏航角 */
1161
- defaultLongitude?: number;
1162
1334
  /** 默认俯仰角 */
1163
1335
  defaultLatitude?: number;
1164
1336
  /** 最大俯仰角 */
@@ -1171,6 +1343,8 @@ export declare interface FloorplanControllerCustomInitArgs {
1171
1343
  maxFov?: number;
1172
1344
  /** 最小相机可视角度 */
1173
1345
  minFov?: number;
1346
+ /** 鼠标焦点环自定义创建器 */
1347
+ intersectMeshCreator?: () => IntersectMeshInterface;
1174
1348
  }
1175
1349
 
1176
1350
  export declare type GestureTypes = "pan" | "tap" | "pinch" | "press" | "mouseWheel";
@@ -1194,34 +1368,61 @@ export declare interface ImageOptions {
1194
1368
  quality?: number;
1195
1369
  /** 图片格式参数 */
1196
1370
  format?: "jpg" | "png" | "heif" | "webp" | "avif";
1371
+ /** 锐化参数 海外不支持 */
1372
+ sharpen?: number;
1373
+ mappings?: ImageURLMappings;
1374
+ }
1375
+
1376
+ export declare function imageSupport(): Promise<{
1377
+ avif: boolean;
1378
+ webp: boolean;
1379
+ }>;
1380
+
1381
+ export declare interface ImageURLMappings {
1382
+ [publicDomain: string]: {
1383
+ "type"?: string;
1384
+ "pano": [string, string];
1385
+ "tile": [string, string];
1386
+ "model": [string, string];
1387
+ "texture": [string];
1388
+ "default": [string];
1389
+ };
1197
1390
  }
1198
1391
 
1199
1392
  export declare interface ImageURLOptions {
1393
+ /** 图片类型标识 */
1200
1394
  key: string;
1201
- basisLoaderInitialized: boolean;
1395
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
1202
1396
  size?: number;
1397
+ /** 图片质量参数(0-100) */
1203
1398
  quality?: number;
1399
+ /** 图片格式参数 */
1204
1400
  format?: "jpg" | "png" | "heif" | "webp" | "avif";
1401
+ /** 图片裁切 */
1205
1402
  cut?: [x: number, y: number, width: number, height: number];
1403
+ /** 锐化参数 海外不支持 */
1206
1404
  sharpen?: number;
1405
+ /** url匹配规则 */
1406
+ mappings?: ImageURLMappings;
1207
1407
  }
1208
1408
 
1209
1409
  export declare class InternalWebGLRenderer extends THREE_2.WebGLRenderer {
1210
- constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias }: {
1410
+ constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias, webgl2, }: {
1211
1411
  preserveDrawingBuffer?: boolean;
1212
1412
  backgroundColor?: number | THREE_2.Color;
1213
1413
  backgroundAlpha?: number;
1214
1414
  pixelRatio?: number;
1215
1415
  antialias?: boolean;
1416
+ webgl2?: boolean;
1216
1417
  });
1217
1418
  }
1218
1419
 
1219
1420
  export declare interface Intersection {
1220
1421
  /** 焦点坐标 */
1221
- point: THREE_2.Vector3;
1422
+ point: THREE.Vector3;
1222
1423
  /** 焦点面片 */
1223
1424
  face?: {
1224
- normal: THREE_2.Vector3;
1425
+ normal: THREE.Vector3;
1225
1426
  } | null;
1226
1427
  /** 焦点距离 */
1227
1428
  distance: number;
@@ -1240,44 +1441,24 @@ export declare interface IntersectMeshInterface extends THREE_2.Object3D {
1240
1441
  dispose(): void;
1241
1442
  }
1242
1443
 
1243
- export declare class LegacyPanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
1244
- needsRender: boolean;
1245
- current: boolean;
1246
- loading: boolean;
1247
- disabled: boolean;
1248
- progress: number;
1249
- opacity: number;
1250
- private centerMesh;
1251
- private loadingMesh;
1252
- private progressMotion;
1253
- private opacityMotion;
1254
- private stopInterval?;
1255
- constructor();
1256
- setLoading(shown: boolean): void;
1257
- setDisabled(disabled: boolean): void;
1258
- setProgress(progress: number): void;
1259
- setOpacity(opacity: number): void;
1260
- setCurrent(current: boolean): void;
1261
- updateTime(time: number, deltaTime: number): void;
1262
- dispose(): void;
1263
- }
1264
-
1265
1444
  export declare type LooseWork = {
1266
- bvh?: boolean;
1445
+ work_code?: string;
1446
+ code?: string;
1267
1447
  modelAsync?: boolean;
1268
1448
  initial?: LooseWorkInitial;
1269
1449
  base_url?: string;
1270
1450
  model?: LooseWorkModel;
1271
- panorama: {
1451
+ panorama?: {
1272
1452
  base_url?: string;
1273
1453
  pano_high_cube_base_url?: string;
1274
1454
  info?: LooseWorkPanorama[];
1275
1455
  list?: LooseWorkPanorama[];
1276
1456
  };
1277
- observers: LooseWorkObserver[];
1457
+ observers?: LooseWorkObserver[];
1278
1458
  };
1279
1459
 
1280
1460
  export declare type LooseWorkInitial = {
1461
+ mode?: string;
1281
1462
  pano_index?: number;
1282
1463
  pano?: number;
1283
1464
  longitude?: number;
@@ -1286,9 +1467,12 @@ export declare type LooseWorkInitial = {
1286
1467
  };
1287
1468
 
1288
1469
  export declare type LooseWorkModel = {
1289
- file_url: string;
1470
+ file_url?: string;
1290
1471
  material_textures?: string[];
1291
1472
  material_base_url?: string;
1473
+ tiles?: {
1474
+ tileset_url: string;
1475
+ };
1292
1476
  };
1293
1477
 
1294
1478
  export declare type LooseWorkObserver = {
@@ -1336,6 +1520,36 @@ export declare type LooseWorkVideo = {
1336
1520
  size: number[];
1337
1521
  };
1338
1522
 
1523
+ export declare type LooseWorkWithExtrinsics = {
1524
+ work: LooseWork;
1525
+ debug?: boolean;
1526
+ /** 位姿 */
1527
+ transform?: number[];
1528
+ /** 可视区域 */
1529
+ viewerRequestVolume?: BoundingVolumeJson;
1530
+ /** 模型显示最大细化层级 */
1531
+ modelMaxLevelOfDetail?: number;
1532
+ /** 模型最大内存缓存 */
1533
+ modelMaxMemoryUsage?: number;
1534
+ /** 模型网络最大请求并发数 */
1535
+ modelMaxRequests?: number;
1536
+ /** 模型屏幕空间误差计算最大值 */
1537
+ modelMaxScreenSpaceError?: number;
1538
+ };
1539
+
1540
+ export declare interface MapviewControllerCustomInitArgs {
1541
+ /** 默认俯仰角 */
1542
+ defaultLatitude?: number;
1543
+ /** 默认相机距离 */
1544
+ defaultDistance?: number;
1545
+ /** 最大俯仰角 */
1546
+ maxLatitude?: number;
1547
+ /** 最小俯仰角 */
1548
+ minLatitude?: number;
1549
+ /** 鼠标焦点环自定义创建器 */
1550
+ intersectMeshCreator?: () => IntersectMeshInterface;
1551
+ }
1552
+
1339
1553
  export declare type Mirror<T extends string> = Record<T, T>;
1340
1554
 
1341
1555
  /**
@@ -1344,6 +1558,7 @@ export declare type Mirror<T extends string> = Record<T, T>;
1344
1558
  * - **Model**: 模型游走模式
1345
1559
  * - **Floorplan**: 模型查看模式
1346
1560
  * - **Topview**: 户型图模式
1561
+ * - **Mapview**: 地图模式
1347
1562
  * - **DepthPanorama**: 深度图游走模式
1348
1563
  * - **VRPanorama**: VR眼镜模式
1349
1564
  */
@@ -1352,6 +1567,8 @@ export declare type Mode =
1352
1567
  "Floorplan" |
1353
1568
  /** 户型图模式 */
1354
1569
  "Topview" |
1570
+ /** 地图模式 */
1571
+ "Mapview" |
1355
1572
  /** 全景图游走模式 */
1356
1573
  "Panorama" |
1357
1574
  /** VR眼镜模式 */
@@ -1359,7 +1576,9 @@ export declare type Mode =
1359
1576
  /** 模型游走模式 */
1360
1577
  "Model" |
1361
1578
  /** 深度图游走模式 */
1362
- "DepthPanorama";
1579
+ "DepthPanorama" |
1580
+ /** XR眼镜模式*/
1581
+ "XRPanorama";
1363
1582
 
1364
1583
  /**
1365
1584
  * Five 模型
@@ -1370,16 +1589,20 @@ export declare type Mode =
1370
1589
  * 通过 json_xxxxxx(<dataURL>) 方式返回。
1371
1590
  */
1372
1591
  export declare class Model extends PBMContainer implements Subscribe<ModelEventType> {
1373
- /** 是否加载完成 */
1374
- loaded: boolean;
1375
- /** 是否未加载 */
1376
- empty: boolean;
1592
+ static get dracoPath(): string;
1593
+ static set dracoPath(path: string);
1377
1594
  /** 外接盒子的大小 */
1378
1595
  bounding: THREE_2.Box3;
1379
1596
  /** 当前显示的楼层 */
1380
1597
  shownFloor: number | null;
1381
1598
  /** 楼层的数量 */
1382
1599
  floorLength: number;
1600
+ /** 材质贴图参数 */
1601
+ textureOptions: TextureOptions;
1602
+ /** 模型是否已经细化 */
1603
+ refined: boolean;
1604
+ /** 模型已经加载 */
1605
+ loaded: boolean;
1383
1606
  /**
1384
1607
  * 判断是否注册了事件
1385
1608
  * 具体可查看 {@link Subscribe.hasListener}
@@ -1405,37 +1628,27 @@ export declare class Model extends PBMContainer implements Subscribe<ModelEventT
1405
1628
  * 具体可查看 {@link Subscribe.emit}
1406
1629
  */
1407
1630
  emit: SubscribeMixinType.emit<ModelEventType>;
1408
- /** bvh 树的计算结果 */
1409
- bvhs: BVH[] & {
1410
- loaded: boolean;
1411
- };
1412
- /** 网络跟踪 */
1413
- private networkSubscribe?;
1414
- /** 安全域名 */
1415
- private allowHosts?;
1416
- constructor(options?: {
1417
- networkSubscribe?: NetworkSubscribe;
1418
- allowHosts?: string[];
1419
- });
1631
+ /**
1632
+ * 等待事件
1633
+ * 具体可查看 {@link Subscribe.waitUnitl}
1634
+ */
1635
+ waitUnitl: SubscribeMixinType.waitUnitl<ModelEventType>;
1636
+ private renderer?;
1637
+ constructor(renderer?: THREE_2.WebGLRenderer);
1420
1638
  /**
1421
1639
  * 当前显示的楼层
1422
1640
  * @deprecated
1423
1641
  * 请用 shwonFloor 代替
1424
1642
  */
1425
1643
  get shownfloor(): number | null;
1644
+ get empty(): boolean;
1426
1645
  /**
1427
1646
  * 获取模型边界线
1647
+ * @param sphere - 获取区域
1428
1648
  * @param threshold - 面片间夹角阈值
1429
1649
  * @returns 所有模型边界线
1430
1650
  */
1431
- getEdges(threshold?: number): THREE_2.Line3[];
1432
- /**
1433
- * 获取当前楼层数
1434
- * @deprecated
1435
- * 请使用 floorLength 参数代替
1436
- */
1437
- hasFloors(): number;
1438
- private hasFloors_;
1651
+ getEdgesBySphere(sphere: THREE_2.Sphere, threshold?: number): THREE_2.Line3[];
1439
1652
  /**
1440
1653
  * 显示某楼层
1441
1654
  * @example
@@ -1445,8 +1658,7 @@ export declare class Model extends PBMContainer implements Subscribe<ModelEventT
1445
1658
  * model.show(1, 0) //显示第一楼层, 并且其他楼层透明度为 0
1446
1659
  * ```
1447
1660
  */
1448
- show(): void;
1449
- show(floorIndex: number, hiddenOpacity?: number): void;
1661
+ show(floorIndex?: number | null): void;
1450
1662
  /**
1451
1663
  * 计算模型射线碰撞检测
1452
1664
  * @param raycaster - THREE 射线对象
@@ -1454,13 +1666,17 @@ export declare class Model extends PBMContainer implements Subscribe<ModelEventT
1454
1666
  * @returns 返回碰撞
1455
1667
  */
1456
1668
  intersectRaycaster(raycaster: THREE_2.Raycaster, floors?: number | number[]): Intersection[];
1457
- buildBVH(): void;
1458
1669
  /**
1459
1670
  * 加载模型
1460
- * @param workModel - work 的 model 内容
1671
+ * @param work - work 的
1461
1672
  * @param imageOptions - 图片参数
1462
1673
  */
1463
- load(workModel: WorkModel, textureOptions?: TextureOptions): Promise<void>;
1674
+ load(work: Work, options?: {
1675
+ networkSubscribe?: NetworkSubscribe;
1676
+ requestProxy?: (url: string) => string | Promise<string>;
1677
+ textureOptions?: TextureOptions;
1678
+ }): Promise<Tile3DModel | null>;
1679
+ update(renderer: THREE_2.WebGLRenderer, camera: Camera): void;
1464
1680
  /**
1465
1681
  * 析构函数
1466
1682
  * @description
@@ -1486,19 +1702,10 @@ export declare interface ModelEventCallback extends ModelEventType {
1486
1702
  * 具体事件列表 请查看 {@link ModelEventCallback}
1487
1703
  */
1488
1704
  export declare type ModelEventType = {
1489
- /**
1490
- * 模型 bvh树 计算完成
1491
- * @description
1492
- * bvh 树用于高效的碰撞检测,可以在 `model.bvh` 属性来设置是否开启。默认开启。
1493
- * bvh 树计算需要一定事件,可能会暂时影响一些性能。计算完毕后,会对碰撞检测带来质的提升。
1494
- */
1495
- bvhLoaded(): void;
1496
- /** 模型三角面片结构加载完成 */
1497
- geometryLoaded(): void;
1498
- /** 模型材质结构加载完成 */
1499
- materialLoaded(): void;
1500
1705
  /** 模型加载完成 */
1501
1706
  loaded(): void;
1707
+ /** 模型细化 */
1708
+ refined(): void;
1502
1709
  /**
1503
1710
  * 显示楼层改变
1504
1711
  * @param shownFloor - 显示的楼层
@@ -1511,6 +1718,18 @@ export declare type ModelEventType = {
1511
1718
  error(error: Error): void;
1512
1719
  };
1513
1720
 
1721
+ export declare interface ModelLodOptions {
1722
+ maxDepth?: number;
1723
+ }
1724
+
1725
+ export declare interface MotionKeyframe<K extends string> {
1726
+ progress: number;
1727
+ value: MotionValue<K>;
1728
+ key?: string;
1729
+ }
1730
+
1731
+ export declare type MotionValue<K extends string> = Record<K, number>;
1732
+
1514
1733
  /**
1515
1734
  * 点位移动参数
1516
1735
  */
@@ -1522,9 +1741,10 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1522
1741
  * @description
1523
1742
  * - `fly` 通过相机移动方式变化
1524
1743
  * - `fade` 通过渐变方式变化
1744
+ * - `montage` 通过渐变穿插到黑屏方式变化
1525
1745
  * - `instant` 通过插入黑屏方式变化
1526
1746
  */
1527
- effect?: "fly" | "fade" | "instant";
1747
+ effect?: "fly" | "fade" | "montage" | "instant";
1528
1748
  /**
1529
1749
  * 运动耗时
1530
1750
  * @description
@@ -1536,9 +1756,9 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1536
1756
  /** 运动曲线函数 */
1537
1757
  easing?: (k: number) => number;
1538
1758
  /** 运动开始回调 */
1539
- moveStartCallback?: (panoIndex: number, toPose: Pose) => void;
1759
+ moveStartCallback?: (panoId: WorkPanoId, toPose: Pose) => void;
1540
1760
  /** 运动结束回调 */
1541
- moveEndCallback?: (panoIndex: number, pose: Pose) => void;
1761
+ moveEndCallback?: (panoId: WorkPanoId, pose: Pose) => void;
1542
1762
  /**
1543
1763
  * 运动被取消回调
1544
1764
  * @description
@@ -1551,6 +1771,7 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1551
1771
  }
1552
1772
 
1553
1773
  export declare type NetWorkMeta = {
1774
+ origin: string;
1554
1775
  source: string;
1555
1776
  headers: {
1556
1777
  [name: string]: string;
@@ -1561,7 +1782,23 @@ export declare type NetWorkMeta = {
1561
1782
  size?: number;
1562
1783
  };
1563
1784
 
1564
- export declare type NetworkState = "ok" | "preload" | "error" | "timeout" | "forbidden";
1785
+ export declare interface NetworkOptions {
1786
+ /** 超时时间 */
1787
+ timeout?: number;
1788
+ /** 请求代理 */
1789
+ requestProxy?: (url: string) => string | Promise<string>;
1790
+ /** 网络消息追踪 */
1791
+ networkSubscribe?: NetworkSubscribe;
1792
+ /** 安全域名 */
1793
+ allowHosts?: string[];
1794
+ }
1795
+
1796
+ export declare type NetworkResponse<T = any, E extends NetWorkMeta | NetWorkMeta[] = NetWorkMeta> = {
1797
+ body: T;
1798
+ meta: E;
1799
+ };
1800
+
1801
+ export declare type NetworkState = "ok" | "preload" | "error" | "proxy-error" | "timeout" | "forbidden";
1565
1802
 
1566
1803
  export declare class NetworkSubscribe extends Subscribe<{
1567
1804
  network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
@@ -1572,22 +1809,22 @@ export declare type NetworkType = "XMLHttpRequest" | "Script" | "Image" | "Link"
1572
1809
 
1573
1810
  export declare class PanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
1574
1811
  needsRender: boolean;
1575
- private loadingMesh;
1576
- private disableMesh;
1577
- private centerMesh;
1578
- private ringMesh;
1579
- private progressMesh;
1580
- private ringRotateMotion;
1812
+ private currentStartTime;
1813
+ private currentMotion;
1814
+ private ringMotion;
1581
1815
  private tapMotion;
1816
+ private loadingOpacityMotion;
1582
1817
  private progressMotion;
1583
1818
  private progressOpacityMotion;
1584
1819
  private opacityMotion;
1820
+ private disableMotion;
1585
1821
  progress: number;
1586
1822
  opacity: number;
1587
1823
  current: boolean;
1588
1824
  loading: boolean;
1589
1825
  disabled: boolean;
1590
- constructor();
1826
+ private panoMesh;
1827
+ constructor(options?: PanoCircleMeshOptions);
1591
1828
  setProgress(progress: number): void;
1592
1829
  setOpacity(opacity: number): void;
1593
1830
  setCurrent(current: boolean): void;
@@ -1598,11 +1835,59 @@ export declare class PanoCircleMesh extends THREE_2.Object3D implements PanoCirc
1598
1835
  dispose(): void;
1599
1836
  }
1600
1837
 
1838
+ export declare class PanoCircleMeshCustom extends THREE_2.Object3D implements PanoCircleMeshInterface {
1839
+ needsRender: boolean;
1840
+ private currentStartTime;
1841
+ private currentMotion;
1842
+ private tapMotion;
1843
+ private loadingOpacityMotion;
1844
+ private progressMotion;
1845
+ private progressOpacityMotion;
1846
+ private opacityMotion;
1847
+ private disableMotion;
1848
+ progress: number;
1849
+ opacity: number;
1850
+ current: boolean;
1851
+ loading: boolean;
1852
+ disabled: boolean;
1853
+ private panoMesh;
1854
+ constructor(options?: PanoCircleMeshCustomOptions);
1855
+ setProgress(progress: number): void;
1856
+ setOpacity(opacity: number): void;
1857
+ setCurrent(current: boolean): void;
1858
+ setLoading(loading: boolean): void;
1859
+ setDisabled(disabled: boolean): void;
1860
+ tap(): Promise<void>;
1861
+ updateTime(time: number, deltaTime: number): void;
1862
+ dispose(): void;
1863
+ }
1864
+
1865
+ export declare interface PanoCircleMeshCustomOptions {
1866
+ scale?: number;
1867
+ color?: number;
1868
+ map?: THREE_2.Texture;
1869
+ mapAlpha?: number;
1870
+ borderWidth?: number;
1871
+ borderColor?: number;
1872
+ mapUseColor?: boolean;
1873
+ mapUseReverse?: boolean;
1874
+ }
1875
+
1601
1876
  /**
1602
1877
  * 地面提示点位接口
1878
+ *
1879
+ * 点位状态
1880
+ * 1. 默认状态: 无任何操作的情况
1881
+ * 2. 高亮状态: 高亮,认为是合适的下一个点位,或者设备选中了某个点位
1882
+ * 3. 进度状态: 点位加载中,存在进度的情况
1883
+ * 4. 加载状态: 点位加载中,不存在进度的情况
1884
+ * 5. 不可用状态:点位不可用,存在点位,但是点位是个摆设
1885
+ * 6. 点击动画: 点位被选择,触发全景图切换
1886
+ * 7. 透明度改变: 一般会处理为近的点位透明度高,远的点位透明度低
1603
1887
  */
1604
1888
  export declare interface PanoCircleMeshInterface extends THREE_2.Object3D {
1605
1889
  needsRender: boolean;
1890
+ hitTestMesh?: THREE_2.Mesh;
1606
1891
  /** 当前高亮 */
1607
1892
  current: boolean;
1608
1893
  /** 是否当前高亮 */
@@ -1621,6 +1906,43 @@ export declare interface PanoCircleMeshInterface extends THREE_2.Object3D {
1621
1906
  dispose(): void;
1622
1907
  }
1623
1908
 
1909
+ export declare interface PanoCircleMeshOptions {
1910
+ scale?: number;
1911
+ color?: number;
1912
+ }
1913
+
1914
+ export declare class PanoCircleMeshSolid extends THREE_2.Object3D implements PanoCircleMeshInterface {
1915
+ needsRender: boolean;
1916
+ private currentStartTime;
1917
+ private currentMotion;
1918
+ private tapMotion;
1919
+ private loadingOpacityMotion;
1920
+ private progressMotion;
1921
+ private progressOpacityMotion;
1922
+ private opacityMotion;
1923
+ private disableMotion;
1924
+ progress: number;
1925
+ opacity: number;
1926
+ current: boolean;
1927
+ loading: boolean;
1928
+ disabled: boolean;
1929
+ private panoMesh;
1930
+ constructor(options?: PanoCircleMeshSolidOptions);
1931
+ setProgress(progress: number): void;
1932
+ setOpacity(opacity: number): void;
1933
+ setCurrent(current: boolean): void;
1934
+ setLoading(loading: boolean): void;
1935
+ setDisabled(disabled: boolean): void;
1936
+ tap(): Promise<void>;
1937
+ updateTime(time: number, deltaTime: number): void;
1938
+ dispose(): void;
1939
+ }
1940
+
1941
+ export declare interface PanoCircleMeshSolidOptions {
1942
+ scale?: number;
1943
+ color?: number;
1944
+ }
1945
+
1624
1946
  export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
1625
1947
  /** 最远可移动观察点距离 */
1626
1948
  maxAccessibleDistance?: number;
@@ -1632,13 +1954,19 @@ export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeCo
1632
1954
  */
1633
1955
  panoTapTriggerRadius?: number;
1634
1956
  /** 地面观察点标识自定义创建器 */
1635
- panoCircleMeshCreator?: () => PanoCircleMeshInterface;
1957
+ panoCircleMeshCreator?: (panoId: WorkPanoId) => PanoCircleMeshInterface;
1958
+ /**
1959
+ * 全景瓦片登记
1960
+ * @param fov - 当前 fov
1961
+ * @param viewSize - 当前绘制区域大小
1962
+ * @returns 返回瓦片等级
1963
+ */
1636
1964
  tileLevelForFov?: false | ((fov: number, viewSize: THREE_2.Vector2) => number);
1965
+ /** 是否开启光照自适应效果 */
1966
+ luminanceAdaptiveEffectEnable?: boolean;
1637
1967
  }
1638
1968
 
1639
1969
  export declare interface PanoramaLikeControllerCustomInitArgs {
1640
- /** 默认相机偏航角 */
1641
- defaultLongitude?: number;
1642
1970
  /** 默认相机俯仰角 */
1643
1971
  defaultLatitude?: number;
1644
1972
  /** 最大相机俯仰角 */
@@ -1667,32 +1995,45 @@ export declare interface PanoramaLikeControllerCustomInitArgs {
1667
1995
  * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
1668
1996
  * @returns - 签署过的 Work 数据结构
1669
1997
  */
1670
- export declare function parseWork(obj: Work | LooseWork | string | any, options?: ParseWorkOptions, urlTransform?: (origin: string, absolute: string, relative: string, type: "panorama" | "texture" | "model") => void): Work;
1998
+ export declare function parseWork(obj: Work | LooseWork | string | any, options?: ParseWorkOptions): Work;
1671
1999
 
1672
2000
  export declare type ParseWorkOptions = {
1673
- /** 重写 work 中的资源前缀 */
2001
+ /** 重写资源前缀 */
1674
2002
  baseURL?: string;
1675
- /** work 中的资源地址使用短地址 */
2003
+ /** 资源地址使用短地址 */
1676
2004
  shortPath?: boolean;
1677
- /** work 中的资源使用 jsonp 方式发布 */
2005
+ /** 资源使用 jsonp 方式发布 */
1678
2006
  jsonp?: boolean;
1679
- /** work 中模型是否计算bvh碰撞数,默认计算 true */
1680
- modelBvh?: boolean;
2007
+ /** 调试 */
2008
+ debug?: boolean;
2009
+ /** 位姿 */
2010
+ transform?: THREE_2.Matrix4 | number[];
2011
+ /** 可视区域 */
2012
+ viewerRequestVolume?: BoundingVolume | BoundingVolumeJson;
2013
+ /** 模型显示最大细化层级 */
2014
+ modelMaxLevelOfDetail?: number;
2015
+ /** 模型最大内存缓存 */
2016
+ modelMaxMemoryUsage?: number;
2017
+ /** 模型网络最大请求并发数 */
2018
+ modelMaxRequests?: number;
2019
+ /** 模型屏幕空间误差计算最大值 */
2020
+ modelMaxScreenSpaceError?: number;
1681
2021
  };
1682
2022
 
1683
2023
  /** PBM 模型组 */
1684
2024
  export declare class PBMContainer extends THREE_2.Group {
2025
+ pbmMaterialParametersVersion: number;
1685
2026
  /** 是否需要更新按需渲染 */
1686
2027
  needsRender: boolean;
1687
- private enableTransparent;
1688
- /** 获取是否有透明参数 */
1689
- getTransparent(): boolean;
1690
- /** 设置透明参数 */
1691
- setTransparent(bool: boolean): void;
2028
+ /** 当前样式参数 */
2029
+ materialParameters: PBMParameters;
2030
+ cache: PBMMaterialReferenceCache;
2031
+ constructor();
1692
2032
  /** 获取材质参数 */
1693
- getMaterial(): PBMParameters | null;
2033
+ getMaterial(): PBMParameters;
1694
2034
  /** 设置材质参数 */
1695
2035
  setMaterial(parameters: Partial<PBMParameters>): void;
2036
+ update(renderer: THREE_2.WebGLRenderer, camera: Camera): void;
1696
2037
  /** 析构材质 */
1697
2038
  disposeMaterial(): void;
1698
2039
  /** 析构模型网格 */
@@ -1700,13 +2041,33 @@ export declare class PBMContainer extends THREE_2.Group {
1700
2041
  }
1701
2042
 
1702
2043
  /** PBM 模型组 */
1703
- export declare class PBMGroup extends PBMContainer {
1704
- /** 楼层序号 */
1705
- floorIndex: number;
2044
+ export declare class PBMGroup extends THREE_2.Group {
2045
+ needsRender: boolean;
2046
+ }
2047
+
2048
+ export declare class PBMMaterialReferenceCache {
2049
+ cache: Record<string, {
2050
+ count: number;
2051
+ value: any;
2052
+ dispose: () => void;
2053
+ }>;
2054
+ clear(): void;
2055
+ get<T>(key: string, create: () => {
2056
+ value: T;
2057
+ dispose: () => void;
2058
+ }): T;
2059
+ }
2060
+
2061
+ /** PBM 对象 */
2062
+ export declare class PBMMesh extends THREE_2.Mesh<THREE_2.BufferGeometry, PBMMeshMaterial[]> {
2063
+ /** 是否需要更新按需渲染 */
2064
+ needsRender: boolean;
1706
2065
  }
1707
2066
 
1708
2067
  /** PBM 材质 */
1709
- export declare class PBMMaterial extends THREE_2.ShaderMaterial implements PBMParameters {
2068
+ export declare class PBMMeshMaterial extends THREE_2.ShaderMaterial implements PBMParameters {
2069
+ /** 更新版本 */
2070
+ pbmMaterialParametersVersion: number;
1710
2071
  /** 起始点 */
1711
2072
  pano0: PBMPanoPicture | null;
1712
2073
  /** 结束点 */
@@ -1717,26 +2078,41 @@ export declare class PBMMaterial extends THREE_2.ShaderMaterial implements PBMPa
1717
2078
  progress: number;
1718
2079
  /** 全景图通过过度黑色混合 */
1719
2080
  useBlackTransition: boolean;
1720
- perspToOrtho: number;
1721
2081
  /** 模型透明度 */
1722
2082
  opacity: number;
1723
- originOpacity: number;
1724
- constructor(parameters?: Partial<PBMParameters>);
1725
- }
1726
-
1727
- /** PBM 对象 */
1728
- export declare class PBMMesh extends THREE_2.Mesh<THREE_2.BufferGeometry, PBMMaterial[]> {
1729
- /** 楼层序号 */
2083
+ /** 模型颜色*/
2084
+ constantColor: THREE_2.Vector3 | null;
2085
+ /** 楼层参数*/
1730
2086
  floorIndex: number;
1731
- /** 是否需要更新按需渲染 */
1732
- needsRender: boolean;
2087
+ /** 对外模型裁切参数*/
2088
+ clippers: ClipperParameter[] | null;
2089
+ /** edl*/
2090
+ useEDL: boolean;
2091
+ /** 点云着色方式*/
2092
+ pointColorType: PBMPointColorType;
2093
+ /** 点云大小绘制方式*/
2094
+ pointSizeType: PBMPointSizeType;
2095
+ /** 点云形状*/
2096
+ pointShape: PBMPointShapeType;
2097
+ /** 点云基础大小*/
2098
+ pointSize: number;
2099
+ /** 自适应点云大小因子*/
2100
+ pointSizeAdaptiveScale: number;
2101
+ /** 点云最大尺寸*/
2102
+ pointMinSize: number;
2103
+ /** 点云最小尺寸*/
2104
+ pointMaxSize: number;
2105
+ /** 高程彩色图*/
2106
+ gradientTexture: THREE_2.Texture | null;
2107
+ constructor(parameters?: Partial<PBMParameters>);
2108
+ update(renderer: THREE_2.WebGLRenderer, camera: Camera, cache: PBMMaterialReferenceCache): void;
1733
2109
  }
1734
2110
 
1735
2111
  export declare interface PBMPanoPicture {
1736
2112
  /** 起始点位全景图 */
1737
- map: THREE_2.CubeTexture;
2113
+ map: THREE_2.CubeTexture | TileCubeTextureTarget;
1738
2114
  /** 亮度增益 */
1739
- luminanceMap: THREE_2.CubeTexture | null;
2115
+ luminanceMap: null | THREE_2.CubeTexture | TileCubeTextureTarget;
1740
2116
  /** 起始点全景图变换矩阵 4x4 */
1741
2117
  matrix: THREE_2.Matrix4;
1742
2118
  }
@@ -1753,9 +2129,47 @@ export declare interface PBMParameters {
1753
2129
  progress: number;
1754
2130
  /** 全景图通过过度黑色混合 */
1755
2131
  useBlackTransition: boolean;
1756
- perspToOrtho: number;
1757
2132
  /** 模型透明度 */
1758
2133
  opacity: number;
2134
+ /** 楼层参数*/
2135
+ floorIndex: number;
2136
+ /** 模型裁切参数(工程侧调用)*/
2137
+ clippers: ClipperParameter[] | null;
2138
+ /** 模型颜色*/
2139
+ constantColor: THREE_2.Vector3 | null;
2140
+ /** 是否使用EDL*/
2141
+ useEDL: boolean;
2142
+ /** 点云形状*/
2143
+ pointShape: PBMPointShapeType;
2144
+ /** 点云着色方式*/
2145
+ pointColorType: PBMPointColorType;
2146
+ /** 点云大小绘制方式*/
2147
+ pointSizeType: PBMPointSizeType;
2148
+ /** 点云基础大小*/
2149
+ pointSize: number;
2150
+ /** 点云最大尺寸*/
2151
+ pointMinSize: number;
2152
+ /** 点云最小尺寸*/
2153
+ pointMaxSize: number;
2154
+ /** 自适应点云尺寸因子*/
2155
+ pointSizeAdaptiveScale: number;
2156
+ /** 高程彩色图*/
2157
+ gradientTexture: THREE_2.Texture | null;
2158
+ }
2159
+
2160
+ export declare enum PBMPointColorType {
2161
+ RGB = "rgb",
2162
+ ALTITUDE = "altitude"
2163
+ }
2164
+
2165
+ export declare enum PBMPointShapeType {
2166
+ SQUARE = "square",
2167
+ CIRCLE = "circle"
2168
+ }
2169
+
2170
+ export declare enum PBMPointSizeType {
2171
+ FIXED = "fixed",
2172
+ ADAPTIVE = "adaptive"
1759
2173
  }
1760
2174
 
1761
2175
  /**
@@ -1763,17 +2177,87 @@ export declare interface PBMParameters {
1763
2177
  * [[include: coordinate.md]]
1764
2178
  */
1765
2179
  export declare interface Pose {
1766
- /** 相机俯仰角 */
1767
- longitude: number;
1768
2180
  /** 相机偏航角 */
2181
+ longitude: number;
2182
+ /** 相机俯仰角 */
1769
2183
  latitude: number;
1770
2184
  /** 相机可视角度(垂直)*/
1771
2185
  fov: number;
1772
2186
  /** 相机位置*/
1773
2187
  offset: THREE_2.Vector3;
2188
+ /** 相机距离 */
2189
+ distance: number;
2190
+ }
2191
+
2192
+ 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", "webXRControllerEvent"];
2193
+
2194
+ export declare class RegionBoundingVolume implements BoundingVolume {
2195
+ type: "regin";
2196
+ west: number;
2197
+ south: number;
2198
+ east: number;
2199
+ north: number;
2200
+ minHeight: number;
2201
+ maxHeight: number;
2202
+ constructor();
2203
+ fromJson({ region }: RegionBoundingVolumeJson): this;
2204
+ toJson(): RegionBoundingVolumeJson;
2205
+ copy(regionBoundingVolume: RegionBoundingVolume): this;
2206
+ clone(): RegionBoundingVolume;
2207
+ getBoundingBox(target: THREE_2.Box3): THREE_2.Box3;
2208
+ toGeometry(): THREE_2.BufferGeometry;
2209
+ applyMatrix4(matrix: THREE_2.Matrix4): this;
2210
+ getCenter(result: THREE_2.Vector3): THREE_2.Vector3;
2211
+ distanceTo(point: THREE_2.Vector3): number;
2212
+ distanceSquaredTo(point: THREE_2.Vector3): number;
2213
+ intersectPlane(plane: THREE_2.Plane): VolumePlaneIntersect;
2214
+ intersectRay(ray: THREE_2.Ray): boolean;
1774
2215
  }
1775
2216
 
1776
- 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"];
2217
+ export declare type RegionBoundingVolumeJson = {
2218
+ region: number[];
2219
+ };
2220
+
2221
+ export declare type RequestResult = null | {
2222
+ done: () => void;
2223
+ };
2224
+
2225
+ /**
2226
+ * Used to issue a request, without having them "deeply queued" by the browser.
2227
+ * @todo - Track requests globally, across multiple servers
2228
+ */
2229
+ export declare class RequestScheduler<Identiy> {
2230
+ static DEFAULT_MAX_REQUESTS: number;
2231
+ maxRequests: number;
2232
+ private activeRequests;
2233
+ /** Tracks the number of active requests and prioritizes/cancels queued requests. */
2234
+ private requestQueue;
2235
+ private requestMap;
2236
+ private deferred;
2237
+ constructor();
2238
+ /**
2239
+ * Called by an application that wants to issue a request, without having it deeply queued by the browser
2240
+ *
2241
+ * When the returned promise resolved, it is OK for the application to issue a request.
2242
+ * The promise resolves to an object that contains a `done` method.
2243
+ * When the application's request has completed (or failed), the application must call the `done` function
2244
+ *
2245
+ * @param identiy - Identiy
2246
+ * @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
2247
+ * @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
2248
+ */
2249
+ scheduleRequest(identiy: Identiy, getPriority: (identiy: Identiy) => number): Promise<RequestResult>;
2250
+ reset(): void;
2251
+ private issueRequest;
2252
+ /** We check requests asynchronously, to prevent multiple updates */
2253
+ private issueNewRequests;
2254
+ /** Refresh all requests */
2255
+ private issueNewRequestsAsync;
2256
+ /** Ensure all requests have updated priorities, and that no longer valid requests are cancelled */
2257
+ private updateAllRequests;
2258
+ /** Update a single request by calling the callback */
2259
+ private updateRequest;
2260
+ }
1777
2261
 
1778
2262
  /** Five 场景*/
1779
2263
  export declare class Scene extends THREE_2.Scene {
@@ -1799,6 +2283,29 @@ export declare interface Scissor {
1799
2283
  height: number;
1800
2284
  }
1801
2285
 
2286
+ export declare class SphereBoundingVolume implements BoundingVolume {
2287
+ type: "sphere";
2288
+ center: THREE_2.Vector3;
2289
+ radius: number;
2290
+ constructor();
2291
+ fromJson({ sphere }: SphereBoundingVolumeJson): this;
2292
+ toJson(): SphereBoundingVolumeJson;
2293
+ copy(sphereBoundingVolume: SphereBoundingVolume): this;
2294
+ clone(): SphereBoundingVolume;
2295
+ getBoundingBox(target: THREE_2.Box3): THREE_2.Box3;
2296
+ toGeometry(): THREE_2.BufferGeometry;
2297
+ applyMatrix4(matrix: THREE_2.Matrix4): this;
2298
+ getCenter(result: THREE_2.Vector3): THREE_2.Vector3;
2299
+ distanceSquaredTo(point: THREE_2.Vector3): number;
2300
+ distanceTo(point: THREE_2.Vector3): number;
2301
+ intersectPlane(plane: THREE_2.Plane): VolumePlaneIntersect;
2302
+ intersectRay(ray: THREE_2.Ray): boolean;
2303
+ }
2304
+
2305
+ export declare type SphereBoundingVolumeJson = {
2306
+ sphere: number[];
2307
+ };
2308
+
1802
2309
  /**
1803
2310
  * 状态
1804
2311
  * @description
@@ -1813,6 +2320,8 @@ export declare interface State extends Pose {
1813
2320
  mode: Mode;
1814
2321
  /** 观察点序号 */
1815
2322
  panoIndex: number;
2323
+ /** 观察点id */
2324
+ panoId: string;
1816
2325
  }
1817
2326
 
1818
2327
  /**
@@ -1869,6 +2378,13 @@ export declare class Subscribe<T extends SubscribeEventMap> {
1869
2378
  * @template K - 预设的监听事件名称
1870
2379
  */
1871
2380
  emit<K extends keyof T>(name: K, ...data: Parameters<T[K]>): boolean;
2381
+ /**
2382
+ * 等待事件
2383
+ * @param name - 事件类型
2384
+ * @returns 触发事件的数据
2385
+ * @template K - 预设的监听事件名称
2386
+ */
2387
+ waitUnitl<K extends keyof T>(name: K): Promise<Parameters<T[K]>>;
1872
2388
  }
1873
2389
 
1874
2390
  export declare type SubscribeEventMap = {
@@ -1891,6 +2407,52 @@ export declare namespace SubscribeMixinType {
1891
2407
  export interface emit<T extends SubscribeEventMap> {
1892
2408
  <K extends keyof T>(name: K, ...data: Parameters<T[K]>): boolean;
1893
2409
  }
2410
+ export interface waitUnitl<T extends SubscribeEventMap> {
2411
+ <K extends keyof T>(name: K): Promise<Parameters<T[K]>>;
2412
+ }
2413
+ }
2414
+
2415
+ export declare class TextureLoader {
2416
+ loadTexture(source: string, options?: {
2417
+ imageURL?: {
2418
+ transform?: (source: string, options: ImageURLOptions) => string;
2419
+ options?: ImageURLOptions;
2420
+ };
2421
+ flipY?: boolean;
2422
+ format?: THREE_2.PixelFormat;
2423
+ minFilter?: THREE_2.TextureFilter;
2424
+ magFilter?: THREE_2.TextureFilter;
2425
+ wrapS?: THREE_2.Wrapping;
2426
+ wrapT?: THREE_2.Wrapping;
2427
+ maxSize?: THREE_2.Vector2;
2428
+ viaAjax?: boolean;
2429
+ } & NetworkOptions, onLoad?: (response: NetworkResponse<THREE_2.Texture>) => void, onError?: (error: Error) => void, onProgress?: (percent: number) => void, renderer?: THREE_2.WebGLRenderer): Promise<NetworkResponse<THREE_2.Texture>>;
2430
+ loadCubeTexture(sources: WorkCubeImage, options: {
2431
+ imageURL?: {
2432
+ transform?: (source: string, options: ImageURLOptions) => string;
2433
+ options?: ImageURLOptions;
2434
+ };
2435
+ format?: THREE_2.PixelFormat;
2436
+ minFilter?: THREE_2.TextureFilter;
2437
+ magFilter?: THREE_2.TextureFilter;
2438
+ wrapS?: THREE_2.Wrapping;
2439
+ wrapT?: THREE_2.Wrapping;
2440
+ viaAjax?: boolean;
2441
+ } & NetworkOptions, onLoad: (response: NetworkResponse<THREE_2.CubeTexture, NetWorkMeta[]>) => void, onError: (error: Error) => void, onProgress: (percent: number) => void, renderer: THREE_2.WebGLRenderer): Promise<NetworkResponse<THREE_2.CubeTexture, NetWorkMeta[]>>;
2442
+ loadTiledCubeTexture(sources: WorkCubeImage, tileSources: WorkTile[], options: {
2443
+ tileImageSize?: number;
2444
+ tileMaxLevel?: number;
2445
+ imageURL?: {
2446
+ transform?: (source: string, options: ImageURLOptions) => string;
2447
+ options?: ImageURLOptions;
2448
+ };
2449
+ format?: THREE_2.PixelFormat;
2450
+ minFilter?: THREE_2.TextureFilter;
2451
+ magFilter?: THREE_2.TextureFilter;
2452
+ wrapS?: THREE_2.Wrapping;
2453
+ wrapT?: THREE_2.Wrapping;
2454
+ viaAjax?: boolean;
2455
+ } & NetworkOptions, onLoad: (response: NetworkResponse<TileCubeTextureTarget, NetWorkMeta[]>) => void, onError: (error: Error) => void, onProgress: (percent: number) => void, renderer: THREE_2.WebGLRenderer): Promise<NetworkResponse<TileCubeTextureTarget, NetWorkMeta[]>>;
1894
2456
  }
1895
2457
 
1896
2458
  /**
@@ -1912,25 +2474,350 @@ export declare interface TextureOptions {
1912
2474
  format?: "jpg" | "png" | "heif" | "webp" | "avif";
1913
2475
  /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
1914
2476
  autoResize?: boolean;
2477
+ /** 锐化参数 海外不支持 */
2478
+ sharpen?: number;
2479
+ mappings?: ImageURLMappings;
2480
+ }
2481
+
2482
+ export declare class Tile {
2483
+ id: string;
2484
+ tileset: Tileset;
2485
+ parent: Tile | null;
2486
+ geometricError: number;
2487
+ type: 'SCENEGRAPH' | 'EMPTY' | 'TILESET' | 'MESH';
2488
+ content: {
2489
+ uri: string;
2490
+ group?: number;
2491
+ boundingVolume?: BoundingVolume;
2492
+ data?: TileContentData;
2493
+ loadState: 'LOADING' | 'UNLOADED' | 'READY' | 'FAILED';
2494
+ byteLength: number;
2495
+ } | null;
2496
+ extras: Record<string, any>;
2497
+ refine: TileHeader['refine'];
2498
+ boundingVolume?: BoundingVolume;
2499
+ viewerRequestVolume?: BoundingVolume;
2500
+ transform: THREE_2.Matrix4;
2501
+ children: Tile[];
2502
+ state: {
2503
+ visible: boolean;
2504
+ frameNumber: number;
2505
+ selectedFrameNumber: number;
2506
+ requestedFrameNumber: number;
2507
+ touchedFrameNumber: number;
2508
+ selectionDepth: number;
2509
+ centerZDepth: number;
2510
+ shouldRefine: boolean;
2511
+ distanceToCamera: number;
2512
+ screenSpaceError: number;
2513
+ inRequestVolume: boolean;
2514
+ visibilityPlaneMask: number;
2515
+ };
2516
+ constructor(id: string, header: TileHeader, tileset: Tileset, parent?: Tile);
2517
+ updateState(frameState: TilesetFrameState): void;
2518
+ get selected(): boolean;
2519
+ get hasChildren(): boolean;
2520
+ get siblingIndex(): number;
2521
+ get hasTilesetContent(): boolean;
2522
+ get hasRenderContent(): boolean;
2523
+ get contentAvailable(): boolean;
2524
+ get hasUnloadedContent(): boolean;
2525
+ get hasEmptyContent(): boolean;
2526
+ get contentReady(): boolean;
2527
+ get contentByteLength(): number;
2528
+ loadContent(): Promise<boolean>;
2529
+ unloadContent(): boolean;
2530
+ getScreenSpaceError(frameState: TilesetFrameState, distanceToCamera: number, useParentGeometricError: boolean): number;
2531
+ private getPriority;
2532
+ }
2533
+
2534
+ export declare class Tile3DModel extends THREE_2.Object3D {
2535
+ static DEFAULT_MAX_LEVEL_OF_DETAIL: number;
2536
+ static DEFAULT_MAX_MEMORY_USAGE: number;
2537
+ static DEFAULT_MAX_SCREEN_SPACE_ERROR: number;
2538
+ static DEFAULT_MAX_REQUESTS: number;
2539
+ workCode: string;
2540
+ tileset: Tileset;
2541
+ maxLevelOfDetail: number;
2542
+ boundingBox: THREE_2.Box3;
2543
+ needsRefined: boolean;
2544
+ refined: boolean;
2545
+ disposed: boolean;
2546
+ needsRender: boolean;
2547
+ lastRefineTime: number;
2548
+ private nodeGroup;
2549
+ private debugBoundingGroup;
2550
+ private nodes;
2551
+ private debugBoundings;
2552
+ private unloadTileQueue;
2553
+ constructor(workCode: string, tilesetHeader: TilesetHeader, options: Partial<Tile3DModelLoaderOptions>);
2554
+ get debug(): boolean;
2555
+ set debug(value: boolean);
2556
+ get maxMemoryUsage(): number;
2557
+ set maxMemoryUsage(value: number);
2558
+ get viewDistanceScale(): number;
2559
+ set viewDistanceScale(value: number);
2560
+ get maxRequests(): number;
2561
+ set maxRequests(value: number);
2562
+ get maxScreenSpaceError(): number;
2563
+ set maxScreenSpaceError(value: number);
2564
+ loadContent(tile: Tile, options: {
2565
+ allowHosts?: string[];
2566
+ requestProxy?: (url: string) => string | Promise<string>;
2567
+ networkSubscribe?: NetworkSubscribe;
2568
+ }): Promise<boolean>;
2569
+ intersectRaycaster(raycaster: THREE_2.Raycaster): Intersection[];
2570
+ update(renderer: THREE_2.WebGLRenderer, camera: Camera): void;
2571
+ dispose(): void;
2572
+ }
2573
+
2574
+ /** Advanced loader options */
2575
+ export declare interface Tile3DModelLoaderOptions {
2576
+ resourcePath: string;
2577
+ allowHosts?: string[];
2578
+ requestProxy?: (url: string) => string | Promise<string>;
2579
+ networkSubscribe?: NetworkSubscribe;
2580
+ }
2581
+
2582
+ export declare type TileContentData = {
2583
+ type: 'b3dm' | 'pnts' | 'at3d' | 'pbm';
2584
+ byteLength: number;
2585
+ uri: string;
2586
+ object: TileNode;
2587
+ };
2588
+
2589
+ export declare interface TileCubeNode {
2590
+ level: number;
2591
+ face: "up" | "down" | "left" | "right" | "front" | "back";
2592
+ position: THREE_2.Vector2;
2593
+ size: number;
2594
+ box: THREE_2.Box3;
2595
+ children: TileCubeNode[];
2596
+ }
2597
+
2598
+ export declare class TileCubeTextureTarget {
2599
+ private tileTree;
2600
+ private tileSources;
2601
+ private options;
2602
+ private renderer;
2603
+ name: string;
2604
+ needsRender: boolean;
2605
+ private disposed;
2606
+ private loadedCubeNodes;
2607
+ private loadingCubeNodes;
2608
+ private baseCubeTexture;
2609
+ private _cubeRenderTarget;
2610
+ private textures;
2611
+ constructor(baseCubeTexture: THREE_2.CubeTexture, tileTree: TileCubeTree, tileSources: WorkTile[], options: {
2612
+ textureSize: number;
2613
+ tileImageSize: number;
2614
+ textureLoader: TextureLoader;
2615
+ imageURL?: {
2616
+ transform?: (source: string, options: ImageURLOptions) => string;
2617
+ options?: ImageURLOptions;
2618
+ };
2619
+ format?: THREE_2.PixelFormat;
2620
+ minFilter?: THREE_2.TextureFilter;
2621
+ magFilter?: THREE_2.TextureFilter;
2622
+ wrapS?: THREE_2.Wrapping;
2623
+ wrapT?: THREE_2.Wrapping;
2624
+ } & NetworkOptions, renderer: THREE_2.WebGLRenderer);
2625
+ get cubeRenderTarget(): THREE_2.WebGLCubeRenderTarget | null;
2626
+ set cubeRenderTarget(cubeRenderTarget: THREE_2.WebGLCubeRenderTarget | null);
2627
+ private requestTile;
2628
+ update(frustum: THREE_2.Frustum, level: number): void;
2629
+ get tilePending(): number;
2630
+ get texture(): THREE_2.Texture;
2631
+ dispose(): void;
2632
+ }
2633
+
2634
+ export declare interface TileCubeTree {
2635
+ children: TileCubeNode[];
2636
+ }
2637
+
2638
+ export declare interface TileHeader {
2639
+ content?: {
2640
+ uri: string;
2641
+ group?: number;
2642
+ boundingVolume?: BoundingVolumeJson;
2643
+ };
2644
+ geometricError: number;
2645
+ refine?: "REPLACE" | "ADD";
2646
+ boundingVolume?: BoundingVolumeJson;
2647
+ viewerRequestVolume?: BoundingVolumeJson;
2648
+ transform?: number[];
2649
+ children?: TileHeader[];
2650
+ extras?: Record<string, any>;
2651
+ }
2652
+
2653
+ export declare class TileNode extends THREE_2.Group {
2654
+ bvhTree: BVH | undefined;
2655
+ objType: 'mesh' | 'points';
2656
+ constructor(obj: THREE_2.Object3D, objType: 'mesh' | 'points');
2657
+ buildBvhTree(): void;
2658
+ intersectRaycaster(raycaster: THREE_2.Raycaster): Intersection[];
2659
+ dispose(): void;
2660
+ }
2661
+
2662
+ export declare class Tileset {
2663
+ static DEFAULT_VIEW_DISTANCE_SCALE: number;
2664
+ static DEFAULT_MAX_MEMORY_USAGE: number;
2665
+ static DEFAULT_MAX_SCREEN_SPACE_ERROR: number;
2666
+ static DEFAULT_MAX_REQUESTS: number;
2667
+ asset: {
2668
+ version: string;
2669
+ tilesetVersion: string;
2670
+ gltfUpAxis: "X" | "Y" | "Z";
2671
+ };
2672
+ id: string;
2673
+ frameNumber: number;
2674
+ properties: Record<string, any>;
2675
+ options: TilesetOptions;
2676
+ root: Tile;
2677
+ transfrom: THREE_2.Matrix4;
2678
+ geometricError: number;
2679
+ traverser: TilesetTraverser;
2680
+ cache: TilesetCache;
2681
+ requestScheduler: RequestScheduler<string>;
2682
+ private memoryUsageInBytes;
2683
+ maxMemoryUsage: number;
2684
+ viewDistanceScale: number;
2685
+ tiles: Map<string, Tile>;
2686
+ private pendingCount;
2687
+ constructor(id: string, header: TilesetHeader, options: TilesetOptions);
2688
+ get maxRequests(): number;
2689
+ set maxRequests(value: number);
2690
+ get maxScreenSpaceError(): number;
2691
+ set maxScreenSpaceError(value: number);
2692
+ get selectedTiles(): Map<string, Tile>;
2693
+ get needsRefinedTiles(): Map<string, Tile>;
2694
+ /** Release resources */
2695
+ reset(): void;
2696
+ /** Is the tileset loaded (update needs to have been called at least once) */
2697
+ isLoaded(): boolean;
2698
+ /**
2699
+ * The callback to post-process tiles after traversal procedure
2700
+ * @param frameState - frame state for tile culling
2701
+ */
2702
+ private onTraversalEnd;
2703
+ loadTile(tile: Tile): void;
2704
+ unloadTile(tile: Tile): void;
2705
+ }
2706
+
2707
+ export declare class TilesetCache {
2708
+ private cacheNodeMap;
2709
+ private list;
2710
+ private sentinel;
2711
+ constructor();
2712
+ reset(): void;
2713
+ touch(tile: Tile): void;
2714
+ add(tile: Tile, addCallback?: (tile: Tile) => void): void;
2715
+ unloadTile(tile: Tile, unloadCallback?: (tile: Tile) => void): void;
2716
+ unloadTiles(isOverMemory: () => boolean, unloadCallback?: (tile: Tile) => void): void;
2717
+ toArray(): Tile[];
2718
+ }
2719
+
2720
+ export declare type TilesetFrameState = {
2721
+ camera: {
2722
+ position: THREE.Vector3;
2723
+ direction: THREE.Vector3;
2724
+ up: THREE.Vector3;
2725
+ };
2726
+ height: number;
2727
+ cullingVolume: CullingVolume;
2728
+ frameNumber: number;
2729
+ sseDenominator: number;
2730
+ maxLevelOfDetail: number;
2731
+ };
2732
+
2733
+ export declare interface TilesetHeader {
2734
+ asset: {
2735
+ version: string;
2736
+ tilesetVersion?: string;
2737
+ gltfUpAxis?: "X" | "Y" | "Z";
2738
+ };
2739
+ properties?: Record<string, any>;
2740
+ geometricError: number;
2741
+ root: TileHeader;
2742
+ }
2743
+
2744
+ export declare interface TilesetOptions {
2745
+ onTileLoad: (tile: Tile) => any;
2746
+ onTileUnload: (tile: Tile) => any;
2747
+ onTileError: (tile: Tile, message: string) => any;
2748
+ contentLoader: (tile: Tile) => Promise<boolean>;
2749
+ allowHosts?: string[];
2750
+ requestProxy?: (url: string) => string | Promise<string>;
2751
+ networkSubscribe?: NetworkSubscribe;
2752
+ }
2753
+
2754
+ export declare class TilesetTraverser {
2755
+ static DEFAULT_SKIP_LEVEL_OF_DETAIL: boolean;
2756
+ static DEFAULT_LOAD_SIBLINGS: boolean;
2757
+ static DEFAULT_MAX_SCREEN_SPACE_ERROR: number;
2758
+ root: Tile | null;
2759
+ loadSiblings: boolean;
2760
+ skipLevelOfDetail: boolean;
2761
+ maxScreenSpaceError: number;
2762
+ onTraversalEnd: (frameState: TilesetFrameState) => any;
2763
+ requestedTiles: Map<string, Tile>;
2764
+ selectedTiles: Map<string, Tile>;
2765
+ needsRefinedTiles: Map<string, Tile>;
2766
+ emptyTiles: Map<string, Tile>;
2767
+ private _traversalStack;
2768
+ private _emptyTraversalStack;
2769
+ constructor(onTraversalEnd: (frameState: TilesetFrameState) => any);
2770
+ traverse(root: Tile, frameState: TilesetFrameState): void;
2771
+ reset(): void;
2772
+ private executeTraversal;
2773
+ private updateChildTiles;
2774
+ private updateAndPushChildren;
2775
+ updateTile(tile: Tile, frameState: TilesetFrameState): void;
2776
+ selectTile(tile: Tile, frameState: TilesetFrameState): void;
2777
+ loadTile(tile: Tile, frameNumber: number): void;
2778
+ touchTile(tile: Tile, frameState: TilesetFrameState): void;
2779
+ private canTraverse;
2780
+ private shouldLoadTile;
2781
+ private shouldSelectTile;
2782
+ private shouldRefine;
2783
+ private updateTileVisibility;
2784
+ private meetsScreenSpaceErrorEarly;
2785
+ private compareDistanceToCamera;
2786
+ private executeEmptyTraversal;
1915
2787
  }
1916
2788
 
1917
2789
  export declare interface TopviewControllerCustomInitArgs extends Omit<FloorplanControllerCustomInitArgs, "defaultLongitude" | "defaultLatitude" | "maxLatitude" | "minLatitude"> {
1918
2790
  }
1919
2791
 
2792
+ export declare enum VolumePlaneIntersect {
2793
+ Outside = -1,
2794
+ Intersecting = 0,
2795
+ Inside = 1
2796
+ }
2797
+
1920
2798
  export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
1921
- /**
1922
- * webvrPolyfill 的设置对象
1923
- * @description
1924
- * 只可被设置一次,所有的 five 实例共用这个设置
1925
- */
1926
- webvrPolyfillConfig?: any;
1927
2799
  }
1928
2800
 
2801
+ export declare type WebXRControllerKey = 'A' | 'B' | 'X' | 'Y' | 'RightTrigger' | 'RightPinch' | 'LeftTrigger' | 'LeftPinch' | 'LeftAxesLeft' | 'LeftAxesRight' | 'LeftAxesUp' | 'LeftAxesDown' | 'RightAxesLeft' | 'RightAxesRight' | 'RightAxesUp' | 'RightAxesDown';
2802
+
2803
+ export declare interface WebXRControllerParams {
2804
+ raycaster: THREE_2.Raycaster[];
2805
+ }
2806
+
2807
+ export declare type WebXRControllerType = 'tap' | 'press' | 'axes';
2808
+
2809
+ export declare type WebXREventTypes = {
2810
+ /** WebXR模式开始,session完成坐标系设置*/
2811
+ webXRSessionStart(): void;
2812
+ /** WebXR模式结束,销毁session*/
2813
+ webXRSessionEnd(): void;
2814
+ };
2815
+
1929
2816
  export declare class Work {
1930
2817
  /** 名称 */
1931
2818
  name: string;
1932
2819
  /** 编号 */
1933
- workCode: string;
2820
+ workCode: WorkCode;
1934
2821
  /** 允许访问的安全域名 */
1935
2822
  allowHosts: string[];
1936
2823
  /** 过期时间 */
@@ -1943,12 +2830,26 @@ export declare class Work {
1943
2830
  observers: WorkObserver[];
1944
2831
  /** 数据签发人 */
1945
2832
  issuer: string;
2833
+ /** 控制参数 */
2834
+ options: WorkOptions;
1946
2835
  /** 原始数据 */
1947
- raw: any;
1948
- constructor();
2836
+ raw: {
2837
+ works: string[];
2838
+ options: string;
2839
+ };
2840
+ /**
2841
+ * 解析 Work 数据
2842
+ * @param obj - work 数据,从如数开发者平台获取
2843
+ * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
2844
+ * @returns - 签署过的 Work 数据结构
2845
+ */
2846
+ static parse: typeof parseWork;
2847
+ constructor(obj: Work | LooseWork | (Work | LooseWork)[] | any, options: ParseWorkOptions);
1949
2848
  toJSON(): any;
1950
2849
  }
1951
2850
 
2851
+ export declare type WorkCode = string;
2852
+
1952
2853
  export declare interface WorkCubeImage {
1953
2854
  /** 全景图 up */
1954
2855
  up: string;
@@ -1975,25 +2876,48 @@ export declare interface WorkImage extends WorkCubeImage {
1975
2876
  }
1976
2877
 
1977
2878
  /** 初始化位姿参数 */
1978
- export declare interface WorkInitial extends Omit<State, "offset"> {
2879
+ export declare interface WorkInitial {
2880
+ /** 模态 */
2881
+ mode?: Mode;
2882
+ /** 点位序号 */
2883
+ panoId?: string;
2884
+ /** 相机水平角 */
2885
+ longitude?: number;
2886
+ /** 相机俯仰角 */
2887
+ latitude?: number;
2888
+ /** 相机可视角度(垂直)*/
2889
+ fov?: number;
2890
+ /** 相机观察点位置 [x, y, z] */
2891
+ offset?: THREE_2.Vector3;
2892
+ /** 相机距离观察点距离 */
2893
+ distance?: number;
1979
2894
  }
1980
2895
 
1981
2896
  /** 模型数据 */
1982
2897
  export declare interface WorkModel {
2898
+ /** work */
2899
+ work: Work;
1983
2900
  /** 模型文件地址 at3d / domez */
1984
- file: string;
2901
+ file?: string;
1985
2902
  /** 模型贴图文件地址 */
1986
- textures: string[];
2903
+ textures?: string[];
1987
2904
  /** 模型贴图文件地址的父目录 */
1988
- textureBase: string;
1989
- /** 是否开启 bvh 碰撞树,开启会大大加快射线碰撞的执行效率 */
1990
- bvh: boolean;
2905
+ textureBase?: string;
2906
+ tileset?: string;
1991
2907
  }
1992
2908
 
1993
2909
  /** 每个点位的数据 */
1994
2910
  export declare interface WorkObserver {
2911
+ /** work */
2912
+ work: Work;
2913
+ /** 序号 */
2914
+ index: number;
1995
2915
  /** 点位序号 */
1996
- panoIndex: number;
2916
+ panoId: WorkPanoId;
2917
+ /** 点位所在楼层 */
2918
+ floorIndex: number;
2919
+ /** 点位 derived_id */
2920
+ derivedId?: number;
1997
2921
  /** 点位是否激活可用 */
1998
2922
  active: boolean;
1999
2923
  /** 点位是否可加载 */
@@ -2003,19 +2927,44 @@ export declare interface WorkObserver {
2003
2927
  /** 点位视频 */
2004
2928
  video?: WorkVideo;
2005
2929
  /** 可以看到的相关点位序号 */
2006
- visibleNodes: number[];
2930
+ visibleIds: string[];
2007
2931
  /** 可以连通的相关点位序号 */
2008
- accessibleNodes: number[];
2009
- /** 点位和模型的旋转对齐关系四元数 */
2010
- quaternion: THREE_2.Quaternion;
2011
- /** 点位和模型的地面位置坐标关系 */
2932
+ accessibleIds: string[];
2933
+ /** 点位和模型的地面坐标 */
2012
2934
  standingPosition: THREE_2.Vector3;
2013
- /** 点位和模型的观察点坐标关系 */
2935
+ /** 点位和模型的观察点坐标 */
2014
2936
  position: THREE_2.Vector3;
2015
- /** 点位所在楼层 */
2016
- floorIndex: number;
2937
+ /** 点位和模型的旋转对齐关系四元数 */
2938
+ quaternion: THREE_2.Quaternion;
2017
2939
  }
2018
2940
 
2941
+ export declare interface WorkOptions {
2942
+ /** 调试 */
2943
+ debug?: boolean;
2944
+ /** 位姿修正 */
2945
+ transform: THREE_2.Matrix4;
2946
+ /** 可观测区域 */
2947
+ viewerRequestVolume?: BoundingVolume;
2948
+ /** 模型显示最大细化层级 */
2949
+ modelMaxLevelOfDetail?: number;
2950
+ /** 模型最大内存缓存 */
2951
+ modelMaxMemoryUsage?: number;
2952
+ /** 模型网络最大请求并发数 */
2953
+ modelMaxRequests?: number;
2954
+ /** 模型屏幕空间误差计算最大值 */
2955
+ modelMaxScreenSpaceError?: number;
2956
+ }
2957
+
2958
+ export declare type WorkPanoId = string;
2959
+
2960
+ export declare type Works = ReadonlyArray<Work> & {
2961
+ resolvedObservers: WorkObserver[];
2962
+ initial: WorkInitial;
2963
+ getWork(workCode: WorkCode): Work | undefined;
2964
+ getResolvedObserver(panoId: WorkPanoId): WorkObserver | undefined;
2965
+ update(): void;
2966
+ };
2967
+
2019
2968
  export declare interface WorkTile {
2020
2969
  level: number;
2021
2970
  size: number;
@@ -2037,4 +2986,11 @@ export declare interface WorkVideo {
2037
2986
  size: THREE_2.Vector2;
2038
2987
  }
2039
2988
 
2989
+ export declare class XRButton {
2990
+ static createButton(onClickHook: () => void): HTMLAnchorElement | HTMLButtonElement;
2991
+ }
2992
+
2993
+ export declare interface XRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2994
+ }
2995
+
2040
2996
  export { }