@realsee/five 5.0.0-alpha.17 → 5.0.0-alpha.171

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 (252) hide show
  1. package/README.md +21 -11
  2. package/docs/.nojekyll +1 -0
  3. package/docs/assets/highlight.css +134 -0
  4. package/docs/assets/icons.css +1043 -0
  5. package/docs/assets/{images/icons.png → icons.png} +0 -0
  6. package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
  7. package/docs/assets/main.js +52 -0
  8. package/docs/assets/search.js +1 -0
  9. package/docs/assets/style.css +1414 -0
  10. package/docs/assets/{images/widgets.png → widgets.png} +0 -0
  11. package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
  12. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  13. package/docs/classes/five.BVH.html +10 -0
  14. package/docs/classes/five.BVHIntersect.html +1 -0
  15. package/docs/classes/five.BVHNode.html +7 -0
  16. package/docs/classes/five.BVHVector3.html +1 -0
  17. package/docs/classes/five.Camera.html +11 -0
  18. package/docs/classes/five.Clipper.html +1 -0
  19. package/docs/classes/five.Five.html +338 -0
  20. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  21. package/docs/classes/five.IntersectMesh.html +1 -0
  22. package/docs/classes/five.Model.html +89 -0
  23. package/docs/classes/five.NetworkSubscribe.html +50 -0
  24. package/docs/classes/five.PBMContainer.html +17 -0
  25. package/docs/classes/five.PBMGroup.html +19 -0
  26. package/docs/classes/five.PBMMaterial.html +27 -0
  27. package/docs/classes/five.PBMMesh.html +7 -0
  28. package/docs/classes/five.PanoCircleMesh.html +7 -0
  29. package/docs/classes/five.PanoCircleMeshCustom.html +7 -0
  30. package/docs/classes/five.PanoCircleMeshSolid.html +7 -0
  31. package/docs/classes/five.Scene.html +3 -0
  32. package/docs/classes/five.Subscribe.html +56 -0
  33. package/docs/classes/five.TextureLoader.html +1 -0
  34. package/docs/classes/five.Tile3D.html +34 -0
  35. package/docs/classes/five.Tile3DModel.html +15 -0
  36. package/docs/classes/five.TileBoundingSphere.html +1 -0
  37. package/docs/classes/five.TileCacheNode.html +1 -0
  38. package/docs/classes/five.TileCubeTextureTarget.html +1 -0
  39. package/docs/classes/five.TileCullingVolume.html +1 -0
  40. package/docs/classes/five.TileOrientedBoundingBox.html +1 -0
  41. package/docs/classes/five.TileRequestScheduler.html +16 -0
  42. package/docs/classes/five.Tileset3D.html +11 -0
  43. package/docs/classes/five.Tileset3DTraverser.html +1 -0
  44. package/docs/classes/five.TilesetCache.html +1 -0
  45. package/docs/classes/five.Work.html +30 -0
  46. package/docs/classes/five.XRButton.html +1 -0
  47. package/docs/classes/gltf_loader.DDSLoader.html +1 -0
  48. package/docs/classes/gltf_loader.DRACOLoader.html +1 -0
  49. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  50. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  51. package/docs/classes/gltf_loader.GLTFParser.html +1 -0
  52. package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -0
  53. package/docs/classes/line.Line.html +1 -0
  54. package/docs/classes/line.LineGeometry.html +1 -0
  55. package/docs/classes/line.LineMaterial.html +1 -0
  56. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  57. package/docs/classes/line.THREE_Line2.html +1 -0
  58. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  59. package/docs/classes/react.Store.html +29 -0
  60. package/docs/classes/server.BVH.html +10 -0
  61. package/docs/classes/server.BVHIntersect.html +1 -0
  62. package/docs/classes/server.BVHNode.html +7 -0
  63. package/docs/classes/server.BVHVector3.html +1 -0
  64. package/docs/classes/server.Model.html +70 -0
  65. package/docs/classes/server.PBMContainer.html +7 -0
  66. package/docs/classes/server.PBMGroup.html +9 -0
  67. package/docs/classes/server.PBMMesh.html +7 -0
  68. package/docs/classes/sticker.Sticker.html +32 -0
  69. package/docs/classes/vfx.Airflow.html +1 -0
  70. package/docs/classes/vfx.Flame.html +1 -0
  71. package/docs/classes/vfx.Particle.html +89 -0
  72. package/docs/classes/vfx.SpotLight.html +1 -0
  73. package/docs/index.html +166 -434
  74. package/docs/interfaces/five.AddableObject.html +1 -0
  75. package/docs/interfaces/five.AnimationFrame.html +1 -0
  76. package/docs/interfaces/five.CameraPose.html +1 -0
  77. package/docs/interfaces/five.ClipperParameter.html +1 -0
  78. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  79. package/docs/interfaces/five.EventCallback.html +400 -0
  80. package/docs/interfaces/five.FiveInitArgs.html +109 -0
  81. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +17 -0
  82. package/docs/interfaces/five.ImageOptions.html +18 -0
  83. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  84. package/docs/interfaces/five.ImageURLOptions.html +17 -0
  85. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  86. package/docs/interfaces/five.Intersection.html +7 -0
  87. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
  88. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  89. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  90. package/docs/interfaces/five.MotionKeyframe.html +1 -0
  91. package/docs/interfaces/five.MovePanoOptions.html +42 -0
  92. package/docs/interfaces/five.NetworkOptions.html +9 -0
  93. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  94. package/docs/interfaces/five.PBMParameters.html +27 -0
  95. package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -0
  96. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  97. package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -0
  98. package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -0
  99. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +35 -0
  100. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  101. package/docs/interfaces/five.Pose.html +37 -0
  102. package/docs/interfaces/five.Scissor.html +14 -0
  103. package/docs/interfaces/five.State.html +21 -0
  104. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  105. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  106. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  107. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  108. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  109. package/docs/interfaces/five.TextureOptions.html +20 -0
  110. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +3 -0
  111. package/docs/interfaces/five.TileBoundingVolume.html +19 -0
  112. package/docs/interfaces/five.TileContent.html +1 -0
  113. package/docs/interfaces/five.TileCubeNode.html +1 -0
  114. package/docs/interfaces/five.TileCubeTree.html +1 -0
  115. package/docs/interfaces/five.Tileset3dOptions.html +1 -0
  116. package/docs/interfaces/five.TilesetJSON.html +1 -0
  117. package/docs/interfaces/five.TilesetJSONNode.html +1 -0
  118. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +9 -0
  119. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +31 -0
  120. package/docs/interfaces/five.WebXRSelectParams.html +1 -0
  121. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  122. package/docs/interfaces/five.WorkImage.html +21 -0
  123. package/docs/interfaces/five.WorkInitial.html +13 -0
  124. package/docs/interfaces/five.WorkModel.html +11 -0
  125. package/docs/interfaces/five.WorkModelTiles.html +3 -0
  126. package/docs/interfaces/five.WorkObserver.html +25 -0
  127. package/docs/interfaces/five.WorkTile.html +1 -0
  128. package/docs/interfaces/five.WorkVideo.html +9 -0
  129. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +31 -0
  130. package/docs/interfaces/gltf_loader.DDS.html +1 -0
  131. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  132. package/docs/interfaces/gltf_loader.GLTFReference.html +1 -0
  133. package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -0
  134. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  135. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  136. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  137. package/docs/interfaces/server.Intersection.html +7 -0
  138. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  139. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  140. package/docs/interfaces/vfx.ParticleArgs.html +75 -0
  141. package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -0
  142. package/docs/interfaces/vue.FiveActionVueCallbacks.html +70 -0
  143. package/docs/modules/five.SubscribeMixinType.html +1 -0
  144. package/docs/modules/five.html +479 -3002
  145. package/docs/modules/gltf_loader.html +1 -155
  146. package/docs/modules/line.html +1 -202
  147. package/docs/modules/react.html +133 -1507
  148. package/docs/modules/server.html +18 -526
  149. package/docs/modules/sticker.html +1 -151
  150. package/docs/modules/vfx.html +1 -0
  151. package/docs/modules/vue.html +115 -0
  152. package/docs/modules.html +1 -136
  153. package/exporters/staticify.js +210 -0
  154. package/five/index.d.ts +1414 -266
  155. package/five/index.js +372 -1
  156. package/gltf-loader/index.d.ts +90 -5
  157. package/gltf-loader/index.js +260 -1
  158. package/line/index.d.ts +15 -2
  159. package/line/index.js +260 -1
  160. package/package.json +12 -15
  161. package/react/index.d.ts +75 -22
  162. package/react/index.js +260 -1
  163. package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
  164. package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
  165. package/resource/{draco_decoder.js → gltf/draco_decoder.js} +0 -0
  166. package/resource/{draco_decoder.wasm → gltf/draco_decoder.wasm} +0 -0
  167. package/resource/{draco_wasm_wrapper.js → gltf/draco_wasm_wrapper.js} +0 -0
  168. package/scripts/five-staticify.js +26 -0
  169. package/server/index.d.ts +217 -27
  170. package/server/index.js +367 -1
  171. package/sticker/index.d.ts +2 -1
  172. package/sticker/index.js +260 -1
  173. package/templates/quick-start/README.md +1 -1
  174. package/templates/quick-start/package.json +1 -1
  175. package/umd/five-gltf-loader.js +1 -2
  176. package/umd/five-line.js +1 -2
  177. package/umd/five-react.js +1 -2
  178. package/umd/five-sticker.js +1 -2
  179. package/umd/five-vfx.js +1 -0
  180. package/umd/five-vue.js +1 -0
  181. package/umd/five.js +1 -1
  182. package/umd/five.js.LICENSE.txt +64 -117
  183. package/vfx/index.d.ts +264 -0
  184. package/vfx/index.js +260 -0
  185. package/vue/index.d.ts +461 -0
  186. package/vue/index.js +260 -0
  187. package/docs/assets/css/main.css +0 -2660
  188. package/docs/assets/js/main.js +0 -248
  189. package/docs/assets/js/search.js +0 -1
  190. package/docs/classes/five.camera.html +0 -323
  191. package/docs/classes/five.five-1.html +0 -2670
  192. package/docs/classes/five.hashcubetexture.html +0 -252
  193. package/docs/classes/five.internalwebglrenderer.html +0 -212
  194. package/docs/classes/five.model.html +0 -982
  195. package/docs/classes/five.pbmgroup.html +0 -427
  196. package/docs/classes/five.pbmmaterial.html +0 -533
  197. package/docs/classes/five.pbmmesh.html +0 -254
  198. package/docs/classes/five.scene.html +0 -263
  199. package/docs/classes/five.subscribe.html +0 -569
  200. package/docs/classes/gltf_loader.gltfloader.html +0 -412
  201. package/docs/classes/gltf_loader.gltfobject.html +0 -287
  202. package/docs/classes/line.line-1.html +0 -381
  203. package/docs/classes/line.linegeometry.html +0 -524
  204. package/docs/classes/line.linematerial.html +0 -300
  205. package/docs/classes/line.linesegmentsgeometry.html +0 -471
  206. package/docs/classes/react.store.html +0 -605
  207. package/docs/classes/server.model.html +0 -823
  208. package/docs/classes/server.pbmgroup.html +0 -366
  209. package/docs/classes/server.pbmmesh.html +0 -335
  210. package/docs/classes/sticker.sticker-1.html +0 -465
  211. package/docs/interfaces/five.addableobject.html +0 -234
  212. package/docs/interfaces/five.depthpanoramacontrollercustominitargs.html +0 -420
  213. package/docs/interfaces/five.eventcallback.html +0 -2548
  214. package/docs/interfaces/five.fiveinitargs.html +0 -707
  215. package/docs/interfaces/five.floorplancontrollercustominitargs.html +0 -295
  216. package/docs/interfaces/five.imageoptions.html +0 -332
  217. package/docs/interfaces/five.intersection.html +0 -227
  218. package/docs/interfaces/five.intersectmeshinterface.html +0 -188
  219. package/docs/interfaces/five.modelcontrollercustominitargs.html +0 -366
  220. package/docs/interfaces/five.modeleventcallback.html +0 -367
  221. package/docs/interfaces/five.movepanooptions.html +0 -469
  222. package/docs/interfaces/five.panocirclemeshinterface.html +0 -361
  223. package/docs/interfaces/five.panoramacontrollercustominitargs.html +0 -464
  224. package/docs/interfaces/five.panoramalikecontrollercustominitargs.html +0 -364
  225. package/docs/interfaces/five.pbmparameters.html +0 -474
  226. package/docs/interfaces/five.pose.html +0 -270
  227. package/docs/interfaces/five.scissor.html +0 -252
  228. package/docs/interfaces/five.state.html +0 -300
  229. package/docs/interfaces/five.subscribemixintype.emit.html +0 -180
  230. package/docs/interfaces/five.subscribemixintype.haslistener.html +0 -171
  231. package/docs/interfaces/five.subscribemixintype.off.html +0 -198
  232. package/docs/interfaces/five.subscribemixintype.on.html +0 -213
  233. package/docs/interfaces/five.subscribemixintype.once.html +0 -210
  234. package/docs/interfaces/five.topviewcontrollercustominitargs.html +0 -226
  235. package/docs/interfaces/five.vrpanoramacontrollercustominitargs.html +0 -452
  236. package/docs/interfaces/gltf_loader.gltf.html +0 -304
  237. package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -580
  238. package/docs/interfaces/react.fiveinjectiontypes.html +0 -1625
  239. package/docs/interfaces/react.injectfivetoprops.html +0 -280
  240. package/docs/interfaces/server.intersection.html +0 -308
  241. package/docs/interfaces/server.modeleventcallback.html +0 -409
  242. package/docs/interfaces/sticker.intersectionlike.html +0 -223
  243. package/docs/modules/five.subscribemixintype.html +0 -143
  244. package/scripts/export-five-resource/chfs.exe +0 -0
  245. package/scripts/export-five-resource/fileify.js +0 -192
  246. package/scripts/export-five-resource/format-work.js +0 -71
  247. package/scripts/export-five-resource/staticify.js +0 -327
  248. package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
  249. package/scripts/transcode-model/LoaderSupport.js +0 -1545
  250. package/scripts/transcode-model/MTLLoader.js +0 -602
  251. package/scripts/transcode-model/OBJLoader2.js +0 -1470
  252. package/scripts/transcode-model/obj2pbm.js +0 -65
package/five/index.d.ts CHANGED
@@ -1,24 +1,164 @@
1
- /// <reference types="hammerjs" />
2
-
1
+ import { Matrix3 } from 'three';
2
+ import { Matrix4 } from 'three';
3
+ import { Plane } from 'three';
3
4
  import * as THREE_2 from 'three';
5
+ import { Vector3 } from 'three';
4
6
 
5
7
  export declare interface AddableObject extends THREE_2.Object3D {
6
8
  needsRender?: boolean;
7
9
  mixer?: THREE_2.AnimationMixer;
8
10
  setResolution?(width: number, height: number): void;
11
+ setTime?(time: number): void;
12
+ }
13
+
14
+ export declare interface AnimationFrame {
15
+ callback: (time: number, deltaTime: number, ...args: any[]) => void;
16
+ once: boolean;
17
+ delay: number;
18
+ order: number;
19
+ }
20
+
21
+ export declare class AnimationFrameLoop {
22
+ private frames;
23
+ private time;
24
+ private stoped;
25
+ private context?;
26
+ private requestId;
27
+ private static sharedInstance?;
28
+ static get shared(): AnimationFrameLoop;
29
+ static getFrameTime(): number;
30
+ constructor();
31
+ private loop;
32
+ setContext(context: any): void;
33
+ getContext(): any;
34
+ private requestAnimationFrame;
35
+ private cancelAnimationFrame;
36
+ private remove;
37
+ /**
38
+ * 添加到动画循环
39
+ * @param callback - 动画循环回调
40
+ * @param once - 是否只回调一次
41
+ * @param delay - 延迟多少个动画循环回调
42
+ * @param order - 优先级,数字越小越早被调用
43
+ * @returns 移除动画循环函数
44
+ */
45
+ add(callback: AnimationFrame["callback"], once?: boolean, delay?: number, order?: number): () => void;
46
+ disponse(): void;
47
+ }
48
+
49
+ export declare class BVH {
50
+ trianglesArray?: Float32Array;
51
+ offsetArray?: Uint32Array;
52
+ rootNode?: BVHNode;
53
+ create(trianglesArray: Float32Array): this;
54
+ splitNode(maxTrianglesPerNode: number): this;
55
+ /**
56
+ * 计算射线与三角形的碰撞
57
+ * @param rayOrigin - 射线的原点坐标
58
+ * @param rayDirection - 设想的方向向量
59
+ * @param backfaceCulling - 是否背面剔除
60
+ * @return 碰撞焦点数组
61
+ */
62
+ intersectRay(rayOrigin: BVHVector3, rayDirection: BVHVector3, backfaceCulling: boolean): BVHIntersect[];
63
+ dispose(): void;
64
+ }
65
+
66
+ export declare class BVHIntersect {
67
+ triangle: [BVHVector3, BVHVector3, BVHVector3];
68
+ intersectionPoint: BVHVector3;
69
+ constructor(triangle: [BVHVector3, BVHVector3, BVHVector3], intersectionPoint: BVHVector3);
70
+ }
71
+
72
+ /**
73
+ * A node in the BVH structure
74
+ * @param extents - the min coords of this node's bounding box
75
+ * @param startIndex - an index in the bbox array, where the first element of this node is located
76
+ * @param endIndex - an index in the bbox array, where the last of this node is located, plus 1 (meaning that its non-inclusive).
77
+ * @param level - distance of this node from the root for the bvh tree. root node has level=0, its children have level=1 etc.
78
+ */
79
+ export declare class BVHNode {
80
+ extents: ArrayLike<number>;
81
+ startIndex: number;
82
+ endIndex: number;
83
+ node0?: BVHNode;
84
+ node1?: BVHNode;
85
+ constructor(extents: ArrayLike<number>, startIndex: number, endIndex: number);
86
+ }
87
+
88
+ export declare class BVHVector3 {
89
+ x: number;
90
+ y: number;
91
+ z: number;
92
+ constructor(x: number, y: number, z: number);
93
+ copy(v: BVHVector3): this;
94
+ set(x: number, y: number, z: number): this;
95
+ fromArray(array: number[], firstElementPos?: number): this;
96
+ add(v: BVHVector3): this;
97
+ multiplyScalar(scalar: number): this;
98
+ subVectors(a: BVHVector3, b: BVHVector3): this;
99
+ dot(v: BVHVector3): number;
100
+ cross(v: BVHVector3): this;
101
+ crossVectors(a: BVHVector3, b: BVHVector3): this;
102
+ clone(): BVHVector3;
9
103
  }
10
104
 
11
105
  /** Five 相机 */
12
- export declare class Camera extends THREE_2.PerspectiveCamera {
106
+ export declare class Camera extends THREE_2.Camera {
107
+ fov: number;
108
+ aspect: number;
109
+ near: number;
110
+ far: number;
111
+ perspToOrtho: THREE_2.Vector2;
112
+ orthoDistance: number;
13
113
  /** 相机姿态 */
14
- pose: Pose;
15
- constructor(fov: number);
114
+ pose: CameraPose;
115
+ private perspectiveCamera;
116
+ private orthographicCamera;
117
+ needsRender: boolean;
118
+ private lastValues;
119
+ constructor(fov: number, aspect?: number, near?: number, far?: number, perspToOrtho?: THREE_2.Vector2, orthoDistance?: number);
16
120
  /** 通过相机参数反算姿态 */
17
- computePose(): void;
121
+ computePose(): this;
18
122
  /** 设置相机姿态 */
19
- setFromPose(pose: Partial<Pose>): void;
123
+ setFromPose(pose: Partial<CameraPose>): this;
20
124
  /** 拷贝相机姿态 */
21
- copyPose(): Pose;
125
+ copyPose(): CameraPose;
126
+ private computeProjectionMatrix;
127
+ setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number): void;
128
+ clearViewOffset(): void;
129
+ updateProjectionMatrix(): void;
130
+ get perspectiveProjectionMatrix(): THREE_2.Matrix4;
131
+ get perspectiveProjectionMatrixInverse(): THREE_2.Matrix4;
132
+ get orthographicProjectionMatrix(): THREE_2.Matrix4;
133
+ get orthographicProjectionMatrixInverse(): THREE_2.Matrix4;
134
+ updateTime(_time: number, _deltaTime: number): void;
135
+ get isPerspectiveCamera(): boolean;
136
+ get isOrthographicCamera(): boolean;
137
+ copy(source: this, recursive?: boolean): this;
138
+ }
139
+
140
+ export declare interface CameraPose {
141
+ longitude: number;
142
+ latitude: number;
143
+ fov: number;
144
+ distance: number;
145
+ offset: THREE_2.Vector3;
146
+ }
147
+
148
+ export declare class Clipper {
149
+ numPlanes: number;
150
+ clipperPlanes: Float32Array | null;
151
+ clipperFloors: number[] | null;
152
+ private static sharedInstance?;
153
+ static get shared(): Clipper;
154
+ constructor();
155
+ update(clipperParameter: ClipperParameter | ClipperParameter[], camera: THREE_2.Camera): void;
156
+ private projectPlanes;
157
+ }
158
+
159
+ export declare interface ClipperParameter {
160
+ clippingBoxMatrix: THREE_2.Matrix4;
161
+ floorIndex?: number;
22
162
  }
23
163
 
24
164
  export declare type ControllerCustomInitTypes = {
@@ -28,6 +168,8 @@ export declare type ControllerCustomInitTypes = {
28
168
  VRPanorama: VRPanoramaControllerCustomInitArgs;
29
169
  Model: ModelControllerCustomInitArgs;
30
170
  DepthPanorama: DepthPanoramaControllerCustomInitArgs;
171
+ Mapview: MapviewControllerCustomInitArgs;
172
+ XRPanorama: XRPanoramaControllerCustomInitArgs;
31
173
  };
32
174
 
33
175
  export declare type ControllerEventTypes = {
@@ -81,7 +223,7 @@ export declare type ControllerEventTypes = {
81
223
  * 观察点位被选择
82
224
  * @param panoIndex - 选择的点位
83
225
  */
84
- panoSelected(panoIndex: number): void;
226
+ panoSelected(panoIndex: number | null): void;
85
227
  /**
86
228
  * 意图要移动到某个点位 可以通过 `return false` 阻止
87
229
  * @param panoIndex - 图要移动到的点位下标
@@ -161,6 +303,7 @@ export declare type ControllerEventTypes = {
161
303
  wantsGesture(type: GestureTypes, pointers: {
162
304
  x: number;
163
305
  y: number;
306
+ delta?: number;
164
307
  }[], final: boolean): void | false;
165
308
  /**
166
309
  * 手势 触发
@@ -171,6 +314,7 @@ export declare type ControllerEventTypes = {
171
314
  gesture(type: GestureTypes, pointers: {
172
315
  x: number;
173
316
  y: number;
317
+ delta?: number;
174
318
  }[], final: boolean): void;
175
319
  /**
176
320
  * 意图要触发 pan 手势(滑动屏幕), 可以通过 `return false` 阻止
@@ -202,15 +346,17 @@ export declare type ControllerEventTypes = {
202
346
  * 意图要触发 tap 手势(点击屏幕), 可以通过 `return false` 阻止
203
347
  * @param raycaster - 点击对应的三维射线
204
348
  * @param tapPosition - 点击对应的屏幕位置
349
+ * @param final - 是否手势结束
205
350
  * @returns 可以通过 `return false` 阻止
206
351
  */
207
- wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2): void | false;
352
+ wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void | false;
208
353
  /**
209
354
  * tap 手势(点击屏幕) 被触发
210
355
  * @param raycaster - 点击对应的三维射线
211
356
  * @param tapPosition - 点击对应的屏幕位置
357
+ * @param final - 是否手势结束
212
358
  */
213
- tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2): void;
359
+ tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void;
214
360
  /**
215
361
  * 意图要触发 pinch 手势(双指缩放),可以通过 `return false` 阻止
216
362
  * @param scale - 缩放数值
@@ -219,6 +365,23 @@ export declare type ControllerEventTypes = {
219
365
  * @returns 可以通过 `return false` 阻止
220
366
  */
221
367
  wantsPinchGesture(scale: number, nextFov: number, final: boolean): void | false;
368
+ /**
369
+ * 意图要触发 press 手势(长按屏幕), 可以通过 `return false` 阻止
370
+ * @param raycaster - 长按对应的三维射线
371
+ * @param tapPosition - 长按对应的屏幕位置
372
+ * @param duration - 长按持续时间
373
+ * @param final - 是否手势结束
374
+ * @returns 可以通过 `return false` 阻止
375
+ */
376
+ wantsPressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void | false;
377
+ /**
378
+ * tap 手势(点击屏幕) 被触发
379
+ * @param raycaster - 点击对应的三维射线
380
+ * @param tapPosition - 点击对应的屏幕位置
381
+ * @param duration - 长按持续时间
382
+ * @param final - 是否手势结束
383
+ */
384
+ pressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void;
222
385
  /**
223
386
  * pinch 手势(双指缩放) 被触发
224
387
  * @param scale - 缩放数值
@@ -288,80 +451,49 @@ export declare type ControllerEventTypes = {
288
451
  * @param panoIndex - 加载点位下标
289
452
  * @param observer - 对应的 observer 详情
290
453
  */
291
- textureLoaded(panoIndex: number, observer: WorkObserver): void;
454
+ textureLoaded(panoIndex: number, observer: WorkObserver, meta: (NetWorkMeta | null)[]): void;
292
455
  /**
293
456
  * 抛出错误
294
457
  * @param error - 抛出错误
295
458
  */
296
459
  error(error: Error): void;
460
+ /**
461
+ * webXR模式开始,webxr session完成坐标系矫正
462
+ */
463
+ webXRSessionStart(): void;
464
+ /**
465
+ * webXR模式结束,webxr session销毁
466
+ */
467
+ webXRSessionEnd(): void;
468
+ /**
469
+ * webXR模式结束,webxr session销毁
470
+ * axes代表控制杆,axes数组的0-1元素分别代表左控制器的左(-1)右(1),左控制器的上(-1)下(1),axes数组的2-3元素同理
471
+ */
472
+ webXRSelected(type: WebXRSelectType, params?: Partial<WebXRSelectParams>): void;
297
473
  };
298
474
 
475
+ /**
476
+ * URL 地址的转换
477
+ * @param source - url 原地址
478
+ * @param options - url 转换参数
479
+ * @returns url 转换结果
480
+ */
481
+ export declare function defaultImageURLTransform(source: string, options: ImageURLOptions): string;
482
+
299
483
  export declare interface DepthPanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
300
484
  /** 最远可移动观察点距离 */
301
485
  maxAccessibleDistance?: number;
486
+ /**
487
+ * 点击地面观察点标识的判定范围
488
+ * @description
489
+ * 如果在判定范围内则确定去到目标点,
490
+ * 否则寻找点击位置方向最适合的点(可能会走到一个离相机更近的点)。
491
+ */
492
+ panoTapTriggerRadius?: number;
302
493
  /** 地面观察点标识自定义创建器 */
303
- panoCircleMeshCreator?: () => PanoCircleMeshInterface;
494
+ panoCircleMeshCreator?: (panoIndex: number) => PanoCircleMeshInterface;
304
495
  }
305
496
 
306
- /**
307
- * 动画变化曲线
308
- */
309
- export declare const Easing: {
310
- Linear: {
311
- None: (amount: number) => number;
312
- };
313
- Quadratic: {
314
- In: (amount: number) => number;
315
- Out: (amount: number) => number;
316
- InOut: (amount: number) => number;
317
- };
318
- Cubic: {
319
- In: (amount: number) => number;
320
- Out: (amount: number) => number;
321
- InOut: (amount: number) => number;
322
- };
323
- Quartic: {
324
- In: (amount: number) => number;
325
- Out: (amount: number) => number;
326
- InOut: (amount: number) => number;
327
- };
328
- Quintic: {
329
- In: (amount: number) => number;
330
- Out: (amount: number) => number;
331
- InOut: (amount: number) => number;
332
- };
333
- Sinusoidal: {
334
- In: (amount: number) => number;
335
- Out: (amount: number) => number;
336
- InOut: (amount: number) => number;
337
- };
338
- Exponential: {
339
- In: (amount: number) => number;
340
- Out: (amount: number) => number;
341
- InOut: (amount: number) => number;
342
- };
343
- Circular: {
344
- In: (amount: number) => number;
345
- Out: (amount: number) => number;
346
- InOut: (amount: number) => number;
347
- };
348
- Elastic: {
349
- In: (amount: number) => number;
350
- Out: (amount: number) => number;
351
- InOut: (amount: number) => number;
352
- };
353
- Back: {
354
- In: (amount: number) => number;
355
- Out: (amount: number) => number;
356
- InOut: (amount: number) => number;
357
- };
358
- Bounce: {
359
- In: (amount: number) => number;
360
- Out: (amount: number) => number;
361
- InOut: (amount: number) => number;
362
- };
363
- };
364
-
365
497
  /**
366
498
  * Five 事件列表
367
499
  * @description
@@ -382,19 +514,25 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
382
514
  */
383
515
  error(error: Error): void;
384
516
  /**
385
- * 开始加载 Work 数据
517
+ * 准备加载 Work 数据
386
518
  * @param input - 输入的 work
387
519
  * @param work - 归一化的标准 work
388
520
  * @param state - 加载时的姿态
389
521
  */
390
- willLoad(input: any, work: Work, state: Omit<State, "offset">): void;
522
+ willLoad(input: any, work: Work, state: Omit<State, "offset" | "distance">): void;
391
523
  /**
392
524
  * 开始加载 Work 数据
393
525
  * @param input - 输入的 work
394
526
  * @param work - 归一化的标准 work
395
527
  * @param state - 加载时的姿态
396
528
  */
397
- load(input: any, work: Work, state: Omit<State, "offset">): void;
529
+ load(input: any, work: Work, state: Omit<State, "offset" | "distance">): void;
530
+ /**
531
+ * 加载完 Work 数据
532
+ * @param input - 输入的 work
533
+ * @param work - 归一化的标准 work
534
+ */
535
+ loaded(input: any, work: Work): void;
398
536
  /**
399
537
  * 模型开始加载
400
538
  * @param workModel - 归一化的标准 work 中的 model 值
@@ -496,13 +634,21 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
496
634
  * @param prevMode - 上本质是一个模态
497
635
  * @param panoIndex - 初始化动画结束后的点位下标
498
636
  * @param toPose - 初始化动画结束后的状态
637
+ * @param userAction - 是否用户触发
499
638
  */
500
- modeChange(mode: Mode, prevMode: Mode, panoIndex: number, toPose: Pose): void;
639
+ modeChange(mode: Mode, prevMode: Mode, panoIndex: number, toPose: Pose, userAction: boolean): void;
501
640
  /**
502
641
  * 帮助元素显应的变换
503
642
  * @param visible - 帮助元素的是否开启
504
643
  */
505
644
  helpersVisibleChange(visible: boolean): void;
645
+ /**
646
+ * 网络资源分析
647
+ * @param source - 资源地址
648
+ * @param state - 状态
649
+ * @param detail - 详情
650
+ */
651
+ network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
506
652
  /** five 被析构。 插件中请监听用于自身析构 */
507
653
  dispose(): void;
508
654
  };
@@ -521,6 +667,7 @@ export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROL
521
667
  * ```
522
668
  */
523
669
  export declare class Five extends Subscribe<EventTypes> {
670
+ static get version(): string;
524
671
  /**
525
672
  * Five 的显示模式,可以通过 `five.changeMode` `five.setState` 来切换
526
673
  * @description
@@ -531,6 +678,7 @@ export declare class Five extends Subscribe<EventTypes> {
531
678
  * Topview 户型图模式
532
679
  * DepthPanorama 深度图游走模式
533
680
  * VRPanorama VR眼镜模式
681
+ * XRPanorama VR硬件模式
534
682
  * ```
535
683
  */
536
684
  static Mode: Mirror<Mode>;
@@ -539,62 +687,6 @@ export declare class Five extends Subscribe<EventTypes> {
539
687
  * 请使用 `import { Line } from "@realsee/five/line"` 代替;
540
688
  */
541
689
  static Line: any;
542
- /** Five 的动画函数*/
543
- static Easing: {
544
- Linear: {
545
- None: (amount: number) => number;
546
- };
547
- Quadratic: {
548
- In: (amount: number) => number;
549
- Out: (amount: number) => number;
550
- InOut: (amount: number) => number;
551
- };
552
- Cubic: {
553
- In: (amount: number) => number;
554
- Out: (amount: number) => number;
555
- InOut: (amount: number) => number;
556
- };
557
- Quartic: {
558
- In: (amount: number) => number;
559
- Out: (amount: number) => number;
560
- InOut: (amount: number) => number;
561
- };
562
- Quintic: {
563
- In: (amount: number) => number;
564
- Out: (amount: number) => number;
565
- InOut: (amount: number) => number;
566
- };
567
- Sinusoidal: {
568
- In: (amount: number) => number;
569
- Out: (amount: number) => number;
570
- InOut: (amount: number) => number;
571
- };
572
- Exponential: {
573
- In: (amount: number) => number;
574
- Out: (amount: number) => number;
575
- InOut: (amount: number) => number;
576
- };
577
- Circular: {
578
- In: (amount: number) => number;
579
- Out: (amount: number) => number;
580
- InOut: (amount: number) => number;
581
- };
582
- Elastic: {
583
- In: (amount: number) => number;
584
- Out: (amount: number) => number;
585
- InOut: (amount: number) => number;
586
- };
587
- Back: {
588
- In: (amount: number) => number;
589
- Out: (amount: number) => number;
590
- InOut: (amount: number) => number;
591
- };
592
- Bounce: {
593
- In: (amount: number) => number;
594
- Out: (amount: number) => number;
595
- InOut: (amount: number) => number;
596
- };
597
- };
598
690
  /**
599
691
  * 自动播放状态是否暂停
600
692
  * @description
@@ -607,6 +699,8 @@ export declare class Five extends Subscribe<EventTypes> {
607
699
  currentMode?: Mode;
608
700
  /** 内部使用的 `THREE.Scene` */
609
701
  scene: Scene;
702
+ /** 内部使用的产生视差的物体Scene `THREE.Scene` */
703
+ parallaxScene: Scene;
610
704
  /** 内部使用的 `Camera` */
611
705
  camera: Camera;
612
706
  /**
@@ -627,11 +721,9 @@ export declare class Five extends Subscribe<EventTypes> {
627
721
  * 如果初始化时传入了 `renderer` 则直接时该值
628
722
  * 否则会通过 `preserveDrawingBuffer` `backgroundColor` `backgroundAlpha` `antialias` 创建一个 `THREE.WebGLRenderer`
629
723
  */
630
- renderer: THREE_2.WebGLRenderer;
724
+ renderer?: THREE_2.WebGLRenderer;
631
725
  /** 当前加载的模型 */
632
726
  model: Model;
633
- /** 当前加载的 work 数据 */
634
- work?: Work;
635
727
  /**
636
728
  * 是否需要渲染
637
729
  * @description
@@ -652,7 +744,7 @@ export declare class Five extends Subscribe<EventTypes> {
652
744
  * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
653
745
  * 平衡加载时间和图片质量
654
746
  */
655
- textureOptions: ImageOptions;
747
+ textureOptions: TextureOptions;
656
748
  /**
657
749
  * 模型贴图的配置参数
658
750
  * @description
@@ -683,24 +775,56 @@ export declare class Five extends Subscribe<EventTypes> {
683
775
  plugins: {
684
776
  [key: string]: FivePluginInstance<any>;
685
777
  };
686
- private ident;
778
+ ident: string;
779
+ /** 包围盒子 */
780
+ private boundingMesh;
781
+ private stopAnimationLoop?;
782
+ private fps;
687
783
  private helperGroup;
688
784
  private modeChangeDuration;
689
785
  private onlyRenderIfNeeds;
690
- private maxFps;
786
+ private poweredByRealsee;
691
787
  private controller?;
692
788
  private destroyed;
693
789
  private stateSynced;
694
790
  private controllerInits;
695
791
  private panoramaLikeSavedPose;
696
792
  private extraElements;
697
- private moveToPanoQueue?;
698
793
  private getPixelsRenderTarget;
699
- private tweenCoordinates?;
700
794
  private readyCallbacks;
701
795
  private modelPending;
702
- private screenBuffer?;
796
+ private syncingState;
797
+ /**
798
+ * 是否开启 IOS EDR 模式
799
+ * 需要客户端配合
800
+ * 并且开启 five.enablepostProcessing = true
801
+ */
802
+ private _enableIOSEDR;
803
+ private lastLoadWorkTask;
804
+ private requestProxy;
805
+ private networkSubscribe;
806
+ private screenBuffers?;
807
+ private analysis?;
808
+ private renderSwitch01;
809
+ /**
810
+ * gpu_picking
811
+ */
812
+ private gpuPickingRenderTarget;
813
+ private meshReplaceMaterialMap;
814
+ private meshOriginMaterialMap;
815
+ private copyEffect;
703
816
  constructor(initArgs?: FiveInitArgs);
817
+ /**
818
+ * GPU Picking 获取选中的 mesh
819
+ * @param x - 屏幕坐标 x
820
+ * @param y - 屏幕坐标 y
821
+ * @param colorMap - 需要选取的 mesh 的颜色与 uuid 的映射
822
+ * @param modelColor - 指定的模型颜色
823
+ * @returns 选中 mesh 的 uuid
824
+ */
825
+ getGPUPicking(x: number, y: number, colorMap: {
826
+ [key: string]: THREE_2.Color;
827
+ }, pixelRatio?: number, modelColor?: THREE_2.Vector3): string | false;
704
828
  /**
705
829
  * 析构 five 对象。
706
830
  * @description
@@ -725,6 +849,19 @@ export declare class Five extends Subscribe<EventTypes> {
725
849
  */
726
850
  get helperVisible(): boolean;
727
851
  set helperVisible(visible: boolean);
852
+ /**
853
+ * 是否开启 IOS EDR 模式
854
+ * 需要客户端配合
855
+ * 并且开启 five.enablepostProcessing = true
856
+ */
857
+ get enableIOSEDR(): boolean;
858
+ set enableIOSEDR(enable: boolean);
859
+ /**
860
+ * 是否开启后处理
861
+ */
862
+ get enablePostProcessing(): boolean;
863
+ set enablePostProcessing(enable: boolean);
864
+ updateConfiguration(args: Pick<FiveInitArgs, "panorama" | "model" | "floorplan" | "topview" | "mapview" | "depthPanorama" | "vrPanorama" | "imageOptions">): void;
728
865
  /**
729
866
  * 将显示区域加载到页面 DOM 中
730
867
  * @description
@@ -771,9 +908,21 @@ export declare class Five extends Subscribe<EventTypes> {
771
908
  * 会 Promise.reject。运动完成则 Promise.resolve
772
909
  * @param pose - 相机目标位置
773
910
  * @param duration - 动画触发的时常
911
+ * @param userAction - 是否用户触发
774
912
  * @returns Promise 是否移动成功
775
913
  */
776
- updateCamera(pose: Partial<Pose>, duration: number): Promise<void>;
914
+ updateCamera(pose: Partial<Omit<Pose, "offset">>, duration: number, userAction?: boolean): Promise<void>;
915
+ /**
916
+ * 通过帧动画移动相机。(不触发点位移动)
917
+ * @description
918
+ * 如果动画中途被打断(用户触发行为,或者调用 setState, load, changeMode)的等
919
+ * 会 Promise.reject。运动完成则 Promise.resolve
920
+ * @param keyframes - 动画帧
921
+ * @param duration - 动画触发的时常
922
+ * @param userAction - 是否用户触发
923
+ * @returns Promise 是否移动成功
924
+ */
925
+ updateCameraWithKeyframes(keyframes: MotionKeyframe<Exclude<keyof Pose, "offset">>[], duration: number, userAction?: boolean): Promise<void>;
777
926
  /**
778
927
  * 获取当前相机经纬度
779
928
  * @deprecated 请使用使用 getPose
@@ -809,10 +958,12 @@ export declare class Five extends Subscribe<EventTypes> {
809
958
  *
810
959
  * // 使用指定解析器
811
960
  * // 会调用这个目录下的 basis_transcoder.js basis_transcoder.wasm 文件作为解析器
812
- * five.initialBasisLoader("https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/");
961
+ * five.initialBasisLoader("https://vr-public.realsee-cdn.cn/release/static/image/release/five/basis/");
813
962
  * ```
814
963
  */
815
964
  initBasisLoader(transcoderResourcePath?: string): void;
965
+ /** 当前加载的 work 数据 */
966
+ get work(): Work;
816
967
  /**
817
968
  * 加载 Work 数据
818
969
  * @param inputWork - Work 数据
@@ -822,15 +973,17 @@ export declare class Five extends Subscribe<EventTypes> {
822
973
  * - State 自定义姿态
823
974
  * @param duration - 切换时间
824
975
  */
825
- load(inputWork: Work | LooseWork | any, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number): Promise<void>;
976
+ load(inputWork: Work | LooseWork | any | Promise<Work | LooseWork | any>, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number, userAction?: boolean): Promise<void>;
977
+ private load_;
826
978
  /**
827
979
  * 切换模态
828
980
  * @param mode - 切换到的模态
829
981
  * @param state - 切换完成时的姿态
830
982
  * @param duration - 模态切换动画用时
831
983
  * @param userAction - 是否时用户动作触发 默认 true
984
+ * @param force - 必须重新初始化 controller
832
985
  */
833
- changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, duration?: number, userAction?: boolean): Promise<void>;
986
+ changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, duration?: number, userAction?: boolean, force?: boolean): Promise<void>;
834
987
  /**
835
988
  * 获取画面中的像素颜色
836
989
  * @param x - 获取像素区域的起始坐标 x
@@ -844,11 +997,7 @@ export declare class Five extends Subscribe<EventTypes> {
844
997
  /**
845
998
  * 获取显示用的画布(Canvas DOM节点)
846
999
  */
847
- getElement(): HTMLCanvasElement;
848
- /**
849
- * 但停自动播放
850
- */
851
- pause(): void;
1000
+ getElement(): HTMLCanvasElement | undefined;
852
1001
  /**
853
1002
  * 强制渲染
854
1003
  * @description
@@ -860,7 +1009,12 @@ export declare class Five extends Subscribe<EventTypes> {
860
1009
  *
861
1010
  * @param callback - 渲染完成回调
862
1011
  */
863
- render(callback?: () => void, updateObjectResolution?: boolean): void;
1012
+ render(callback?: () => void, updateObjectResolution?: boolean): THREE_2.WebGLRenderTarget;
1013
+ updateTime(time: number, deltaTime: number, ...args: any[]): void;
1014
+ /**
1015
+ * 但停自动播放
1016
+ */
1017
+ pause(): void;
864
1018
  play(): void;
865
1019
  /**
866
1020
  * 转化到 Panorama 模态,并移动到对应序号的观察点。
@@ -868,7 +1022,7 @@ export declare class Five extends Subscribe<EventTypes> {
868
1022
  * @param options - 移动点位参数
869
1023
  * @param userAction - 是否用户触犯
870
1024
  */
871
- moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): void;
1025
+ moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): Promise<void>;
872
1026
  /**
873
1027
  * 预加载点位图片资源
874
1028
  * @param panoIndex - 观察点序号
@@ -910,16 +1064,34 @@ export declare class Five extends Subscribe<EventTypes> {
910
1064
  * ```
911
1065
  * @param state - 目标状态
912
1066
  * @param immediately - 是否马上转换,马上转换会尽快达到目标状态,尽量减少中间状态,更少动画。
1067
+ * @param userAction - 是否是用户触发的动作
913
1068
  */
914
- setState(state: Partial<State>, immediately?: boolean): void;
1069
+ setState(state: Partial<State>, immediately?: boolean, userAction?: boolean): void;
915
1070
  aroundScissor(callback: () => void): void;
916
1071
  private syncState;
917
- ready(): Promise<void>;
1072
+ /**
1073
+ * 当前页面静态
1074
+ */
1075
+ ready(args?: {
1076
+ tile?: boolean;
1077
+ }): Promise<void>;
1078
+ /**
1079
+ * 请求全屏
1080
+ */
1081
+ requestFullscreen(): void;
1082
+ /**
1083
+ * 退出全屏
1084
+ */
1085
+ exitFullscreen(): void;
918
1086
  private throwError;
919
1087
  private loadModel;
920
1088
  private commonParams;
921
1089
  private saveControllerPose;
922
1090
  private applyController;
1091
+ /** 移除事件绑定 */
1092
+ private removeEventListeners;
1093
+ /** 销毁GPU Picking 所用的材质 */
1094
+ private diposeGPUPickingMaterial;
923
1095
  }
924
1096
 
925
1097
  /** Five 初始化参数 */
@@ -1005,7 +1177,7 @@ export declare interface FiveInitArgs {
1005
1177
  * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
1006
1178
  * 平衡加载时间和图片质量
1007
1179
  */
1008
- textureOptions?: ImageOptions;
1180
+ textureOptions?: TextureOptions;
1009
1181
  /**
1010
1182
  * 是否按需渲染
1011
1183
  * @description
@@ -1035,7 +1207,7 @@ export declare interface FiveInitArgs {
1035
1207
  *
1036
1208
  * // 使用指定解析器
1037
1209
  * // 会调用这个目录下的 basis_transcoder.js basis_transcoder.wasm 文件作为解析器
1038
- * initialBasisLoader: "https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/"
1210
+ * initialBasisLoader: "https://vr-public.realsee-cdn.cn/release/static/image/release/five/basis/"
1039
1211
  * ```
1040
1212
  */
1041
1213
  initialBasisLoader?: boolean | string;
@@ -1055,15 +1227,19 @@ export declare interface FiveInitArgs {
1055
1227
  floorplan?: ControllerCustomInitTypes["Floorplan"];
1056
1228
  /** 户型图模式下的特定参数 */
1057
1229
  topview?: ControllerCustomInitTypes["Topview"];
1230
+ /** 地图模式下的特定参数 */
1231
+ mapview?: ControllerCustomInitTypes["Mapview"];
1058
1232
  /** 深度图游走模式下的特定参数 */
1059
1233
  depthPanorama?: ControllerCustomInitTypes["DepthPanorama"];
1060
1234
  /** VR眼镜模式下的特定参数 */
1061
1235
  vrPanorama?: ControllerCustomInitTypes["VRPanorama"];
1236
+ /** XR眼镜模式下的特定参数 */
1237
+ xrPanorama?: ControllerCustomInitTypes["XRPanorama"];
1062
1238
  /**
1063
1239
  * 模式间切换时的过度动画时间
1064
1240
  * @description
1065
1241
  * 单位毫秒
1066
- * @default `1000`
1242
+ * @default `800`
1067
1243
  */
1068
1244
  modeChangeDuration?: number;
1069
1245
  /**
@@ -1072,6 +1248,24 @@ export declare interface FiveInitArgs {
1072
1248
  * 详见插件部分。
1073
1249
  */
1074
1250
  plugins?: (FivePlugin<void> | FivePluginInit<FivePlugin<any, any>> | FivePluginInit<FivePlugin<void, any>>)[];
1251
+ /**
1252
+ * 是否展示 powered by 如视
1253
+ */
1254
+ poweredByRealsee?: boolean;
1255
+ /**
1256
+ * 是否使用webgl2渲染执行环境, 默认值 false
1257
+ */
1258
+ webgl2?: boolean;
1259
+ /**
1260
+ * 是否开启模型裁切
1261
+ */
1262
+ localClippingEnabled?: boolean;
1263
+ /**
1264
+ * 请求代理
1265
+ * @param url - 发起的请求
1266
+ * @returns 返回的请求
1267
+ */
1268
+ requestProxy?(url: string): string | Promise<string>;
1075
1269
  }
1076
1270
 
1077
1271
  /**
@@ -1116,48 +1310,77 @@ export declare interface FloorplanControllerCustomInitArgs {
1116
1310
  maxFov?: number;
1117
1311
  /** 最小相机可视角度 */
1118
1312
  minFov?: number;
1313
+ /** 鼠标焦点环自定义创建器 */
1314
+ intersectMeshCreator?: () => IntersectMeshInterface;
1119
1315
  }
1120
1316
 
1121
- export declare type GestureTypes = "pan" | "tap" | "pinch" | "mouseWheel";
1317
+ export declare type GestureTypes = "pan" | "tap" | "pinch" | "press" | "mouseWheel";
1122
1318
 
1123
1319
  export declare function getViewportScale(): number;
1124
1320
 
1125
- export declare class HashCubeTexture extends THREE_2.CubeTexture {
1126
- /** 识别哈希 */
1127
- hash: string;
1128
- }
1129
-
1130
1321
  /**
1131
1322
  * 图片参数
1132
1323
  */
1133
1324
  export declare interface ImageOptions {
1134
- key?: string;
1135
1325
  /**
1136
1326
  * url 地址转化
1137
1327
  * @param url - 原始地址
1138
1328
  * @param options - 当前地址参数
1139
1329
  * @returns 转化后地址
1140
1330
  */
1141
- transform?: (url: string, options: ImageOptions) => string;
1142
- /** 图片尺寸参数 */
1331
+ transform?: (url: string, options: ImageURLOptions) => string;
1332
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 512 1024 2048 */
1143
1333
  size?: number;
1144
1334
  /** 图片质量参数(0-100) */
1145
1335
  quality?: number;
1146
- /** 图片格式参数(jpg, png) */
1147
- format?: string;
1148
- /** basis loader 是否初始化完成 */
1149
- basisLoaderInitialized?: boolean;
1150
- /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
1151
- autoResize?: boolean;
1336
+ /** 图片格式参数 */
1337
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
1338
+ /** 锐化参数 海外不支持 */
1339
+ sharpen?: number;
1340
+ mappings?: ImageURLMappings;
1341
+ }
1342
+
1343
+ export declare function imageSupport(): Promise<{
1344
+ avif: boolean;
1345
+ webp: boolean;
1346
+ }>;
1347
+
1348
+ export declare interface ImageURLMappings {
1349
+ [publicDomain: string]: {
1350
+ "pano": [string, string];
1351
+ "tile": [string, string];
1352
+ "texture": [string];
1353
+ "default": [string];
1354
+ };
1355
+ }
1356
+
1357
+ export declare interface ImageURLOptions {
1358
+ /** 图片类型标识 */
1359
+ key: string;
1360
+ /** basisLoader 是否初始化完成 */
1361
+ basisLoaderInitialized: boolean;
1362
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
1363
+ size?: number;
1364
+ /** 图片质量参数(0-100) */
1365
+ quality?: number;
1366
+ /** 图片格式参数 */
1367
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
1368
+ /** 图片裁切 */
1369
+ cut?: [x: number, y: number, width: number, height: number];
1370
+ /** 锐化参数 海外不支持 */
1371
+ sharpen?: number;
1372
+ /** url匹配规则 */
1373
+ mappings?: ImageURLMappings;
1152
1374
  }
1153
1375
 
1154
1376
  export declare class InternalWebGLRenderer extends THREE_2.WebGLRenderer {
1155
- constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias }: {
1377
+ constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias, webgl2, }: {
1156
1378
  preserveDrawingBuffer?: boolean;
1157
1379
  backgroundColor?: number | THREE_2.Color;
1158
1380
  backgroundAlpha?: number;
1159
1381
  pixelRatio?: number;
1160
1382
  antialias?: boolean;
1383
+ webgl2?: boolean;
1161
1384
  });
1162
1385
  }
1163
1386
 
@@ -1172,6 +1395,15 @@ export declare interface Intersection {
1172
1395
  distance: number;
1173
1396
  }
1174
1397
 
1398
+ export declare class IntersectMesh extends THREE_2.Object3D implements IntersectMeshInterface {
1399
+ private ringMesh;
1400
+ constructor();
1401
+ dispose(): void;
1402
+ }
1403
+
1404
+ /**
1405
+ * 地面提示点位接口
1406
+ */
1175
1407
  export declare interface IntersectMeshInterface extends THREE_2.Object3D {
1176
1408
  dispose(): void;
1177
1409
  }
@@ -1233,7 +1465,15 @@ export declare type LooseWorkPanorama = {
1233
1465
  front: string;
1234
1466
  back: string;
1235
1467
  video?: LooseWorkVideo;
1236
- tiles?: string;
1468
+ luminance?: {
1469
+ up: string;
1470
+ down: string;
1471
+ right: string;
1472
+ left: string;
1473
+ front: string;
1474
+ back: string;
1475
+ };
1476
+ tiles?: number[];
1237
1477
  };
1238
1478
 
1239
1479
  export declare type LooseWorkVideo = {
@@ -1242,6 +1482,23 @@ export declare type LooseWorkVideo = {
1242
1482
  size: number[];
1243
1483
  };
1244
1484
 
1485
+ export declare interface MapviewControllerCustomInitArgs {
1486
+ /** 默认偏航角 */
1487
+ defaultLongitude?: number;
1488
+ /** 默认俯仰角 */
1489
+ defaultLatitude?: number;
1490
+ /** 默认相机距离 */
1491
+ defaultDistance?: number;
1492
+ /** 最大俯仰角 */
1493
+ maxLatitude?: number;
1494
+ /** 最小俯仰角 */
1495
+ minLatitude?: number;
1496
+ /** 最大相机距离 */
1497
+ maxDistance?: number;
1498
+ /** 最小相机距离 */
1499
+ minDistance?: number;
1500
+ }
1501
+
1245
1502
  export declare type Mirror<T extends string> = Record<T, T>;
1246
1503
 
1247
1504
  /**
@@ -1250,6 +1507,7 @@ export declare type Mirror<T extends string> = Record<T, T>;
1250
1507
  * - **Model**: 模型游走模式
1251
1508
  * - **Floorplan**: 模型查看模式
1252
1509
  * - **Topview**: 户型图模式
1510
+ * - **Mapview**: 地图模式
1253
1511
  * - **DepthPanorama**: 深度图游走模式
1254
1512
  * - **VRPanorama**: VR眼镜模式
1255
1513
  */
@@ -1258,6 +1516,8 @@ export declare type Mode =
1258
1516
  "Floorplan" |
1259
1517
  /** 户型图模式 */
1260
1518
  "Topview" |
1519
+ /** 地图模式 */
1520
+ "Mapview" |
1261
1521
  /** 全景图游走模式 */
1262
1522
  "Panorama" |
1263
1523
  /** VR眼镜模式 */
@@ -1265,7 +1525,9 @@ export declare type Mode =
1265
1525
  /** 模型游走模式 */
1266
1526
  "Model" |
1267
1527
  /** 深度图游走模式 */
1268
- "DepthPanorama";
1528
+ "DepthPanorama" |
1529
+ /** XR眼镜模式*/
1530
+ "XRPanorama";
1269
1531
 
1270
1532
  /**
1271
1533
  * Five 模型
@@ -1275,17 +1537,23 @@ export declare type Mode =
1275
1537
  * 需要满足 your/path/filename.at3d.json_xxxxxx,
1276
1538
  * 通过 json_xxxxxx(<dataURL>) 方式返回。
1277
1539
  */
1278
- export declare class Model extends PBMGroup implements Subscribe<ModelEventType> {
1540
+ export declare class Model extends PBMContainer implements Subscribe<ModelEventType> {
1279
1541
  /** 是否加载完成 */
1280
1542
  loaded: boolean;
1281
1543
  /** 是否未加载 */
1282
1544
  empty: boolean;
1545
+ /** WorkCode */
1546
+ workCode: string;
1283
1547
  /** 外接盒子的大小 */
1284
1548
  bounding: THREE_2.Box3;
1285
1549
  /** 当前显示的楼层 */
1286
1550
  shownFloor: number | null;
1287
1551
  /** 楼层的数量 */
1288
1552
  floorLength: number;
1553
+ /** 模型瓦片 */
1554
+ originModel?: PBMContainer;
1555
+ /** 模型瓦片 */
1556
+ tiledModel?: Tile3DModel;
1289
1557
  /**
1290
1558
  * 判断是否注册了事件
1291
1559
  * 具体可查看 {@link Subscribe.hasListener}
@@ -1312,16 +1580,35 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1312
1580
  */
1313
1581
  emit: SubscribeMixinType.emit<ModelEventType>;
1314
1582
  /** bvh 树的计算结果 */
1315
- bvhs: any[] & {
1316
- loaded?: boolean;
1583
+ bvhs: BVH[] & {
1584
+ loaded: boolean;
1317
1585
  };
1318
- constructor();
1586
+ /** 网络代理 */
1587
+ private requestProxy?;
1588
+ /** 网络跟踪 */
1589
+ private networkSubscribe?;
1590
+ /** 安全域名 */
1591
+ private allowHosts?;
1592
+ constructor(options?: {
1593
+ networkSubscribe?: NetworkSubscribe;
1594
+ requestProxy?: (url: string) => string | Promise<string>;
1595
+ allowHosts?: string[];
1596
+ });
1319
1597
  /**
1320
1598
  * 当前显示的楼层
1321
1599
  * @deprecated
1322
1600
  * 请用 shwonFloor 代替
1323
1601
  */
1324
1602
  get shownfloor(): number | null;
1603
+ /**
1604
+ * 当前模型是否支持瓦片
1605
+ */
1606
+ get hasTiles(): boolean;
1607
+ /**
1608
+ * 是否开启瓦片
1609
+ */
1610
+ get enableTiles(): boolean;
1611
+ set enableTiles(enable: boolean);
1325
1612
  /**
1326
1613
  * 获取模型边界线
1327
1614
  * @param threshold - 面片间夹角阈值
@@ -1345,7 +1632,9 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1345
1632
  * ```
1346
1633
  */
1347
1634
  show(): void;
1348
- show(floorIndex: number, hideOpacity?: number): void;
1635
+ show(floorIndex: number, hiddenOpacity?: number): void;
1636
+ private at3dShow;
1637
+ private b3dmShow;
1349
1638
  /**
1350
1639
  * 计算模型射线碰撞检测
1351
1640
  * @param raycaster - THREE 射线对象
@@ -1353,13 +1642,14 @@ export declare class Model extends PBMGroup implements Subscribe<ModelEventType>
1353
1642
  * @returns 返回碰撞
1354
1643
  */
1355
1644
  intersectRaycaster(raycaster: THREE_2.Raycaster, floors?: number | number[]): Intersection[];
1356
- buildBVH(): Promise<void>;
1645
+ buildBVH(): void;
1357
1646
  /**
1358
1647
  * 加载模型
1359
1648
  * @param workModel - work 的 model 内容
1360
1649
  * @param imageOptions - 图片参数
1361
1650
  */
1362
- load(workModel: WorkModel, imageOptions?: ImageOptions): void;
1651
+ load(workModel: WorkModel, textureOptions?: TextureOptions): Promise<void>;
1652
+ update(renderer: THREE_2.WebGLRenderer, camera: Camera): void;
1363
1653
  /**
1364
1654
  * 析构函数
1365
1655
  * @description
@@ -1389,7 +1679,7 @@ export declare type ModelEventType = {
1389
1679
  * 模型 bvh树 计算完成
1390
1680
  * @description
1391
1681
  * bvh 树用于高效的碰撞检测,可以在 `model.bvh` 属性来设置是否开启。默认开启。
1392
- * bvh 树计算需要一定事件,可能会暂时影响一些性能。计算完毕后,会对碰撞检测带来质的提升。
1682
+ * bvh 树计算需要一定时间,可能会暂时影响一些性能。计算完毕后,会对碰撞检测带来质的提升。
1393
1683
  */
1394
1684
  bvhLoaded(): void;
1395
1685
  /** 模型三角面片结构加载完成 */
@@ -1410,6 +1700,14 @@ export declare type ModelEventType = {
1410
1700
  error(error: Error): void;
1411
1701
  };
1412
1702
 
1703
+ export declare interface MotionKeyframe<K extends string> {
1704
+ progress: number;
1705
+ value: MotionValue<K>;
1706
+ key?: string;
1707
+ }
1708
+
1709
+ export declare type MotionValue<K extends string> = Record<K, number>;
1710
+
1413
1711
  /**
1414
1712
  * 点位移动参数
1415
1713
  */
@@ -1421,9 +1719,10 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1421
1719
  * @description
1422
1720
  * - `fly` 通过相机移动方式变化
1423
1721
  * - `fade` 通过渐变方式变化
1722
+ * - `montage` 通过渐变穿插到黑屏方式变化
1424
1723
  * - `instant` 通过插入黑屏方式变化
1425
1724
  */
1426
- effect?: "fly" | "fade" | "instant";
1725
+ effect?: "fly" | "fade" | "montage" | "instant";
1427
1726
  /**
1428
1727
  * 运动耗时
1429
1728
  * @description
@@ -1449,21 +1748,180 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1449
1748
  moveCancelCallback?: () => void;
1450
1749
  }
1451
1750
 
1751
+ export declare type NetWorkMeta = {
1752
+ origin: string;
1753
+ source: string;
1754
+ headers: {
1755
+ [name: string]: string;
1756
+ };
1757
+ requestTime: number;
1758
+ responseTime: number;
1759
+ costs: number;
1760
+ size?: number;
1761
+ };
1762
+
1763
+ export declare interface NetworkOptions {
1764
+ /** 超时时间 */
1765
+ timeout?: number;
1766
+ /** 请求代理 */
1767
+ requestProxy?: (url: string) => string | Promise<string>;
1768
+ /** 网络消息追踪 */
1769
+ networkSubscribe?: NetworkSubscribe;
1770
+ /** 安全域名 */
1771
+ allowHosts?: string[];
1772
+ }
1773
+
1774
+ export declare type NetworkResponse<T = any, E extends NetWorkMeta | NetWorkMeta[] = NetWorkMeta> = {
1775
+ body: T;
1776
+ meta: E;
1777
+ };
1778
+
1779
+ export declare type NetworkState = "ok" | "preload" | "error" | "proxy-error" | "timeout" | "forbidden";
1780
+
1781
+ export declare class NetworkSubscribe extends Subscribe<{
1782
+ network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
1783
+ }> {
1784
+ }
1785
+
1786
+ export declare type NetworkType = "XMLHttpRequest" | "Script" | "Image" | "Link";
1787
+
1788
+ export declare class PanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
1789
+ needsRender: boolean;
1790
+ private currentStartTime;
1791
+ private currentMotion;
1792
+ private ringMotion;
1793
+ private tapMotion;
1794
+ private loadingOpacityMotion;
1795
+ private progressMotion;
1796
+ private progressOpacityMotion;
1797
+ private opacityMotion;
1798
+ private disableMotion;
1799
+ progress: number;
1800
+ opacity: number;
1801
+ current: boolean;
1802
+ loading: boolean;
1803
+ disabled: boolean;
1804
+ private panoMesh;
1805
+ constructor(options?: PanoCircleMeshOptions);
1806
+ setProgress(progress: number): void;
1807
+ setOpacity(opacity: number): void;
1808
+ setCurrent(current: boolean): void;
1809
+ setLoading(loading: boolean): void;
1810
+ setDisabled(disabled: boolean): void;
1811
+ tap(): Promise<void>;
1812
+ updateTime(time: number, deltaTime: number): void;
1813
+ dispose(): void;
1814
+ }
1815
+
1816
+ export declare class PanoCircleMeshCustom extends THREE_2.Object3D implements PanoCircleMeshInterface {
1817
+ needsRender: boolean;
1818
+ private currentStartTime;
1819
+ private currentMotion;
1820
+ private tapMotion;
1821
+ private loadingOpacityMotion;
1822
+ private progressMotion;
1823
+ private progressOpacityMotion;
1824
+ private opacityMotion;
1825
+ private disableMotion;
1826
+ progress: number;
1827
+ opacity: number;
1828
+ current: boolean;
1829
+ loading: boolean;
1830
+ disabled: boolean;
1831
+ private panoMesh;
1832
+ constructor(options?: PanoCircleMeshCustomOptions);
1833
+ setProgress(progress: number): void;
1834
+ setOpacity(opacity: number): void;
1835
+ setCurrent(current: boolean): void;
1836
+ setLoading(loading: boolean): void;
1837
+ setDisabled(disabled: boolean): void;
1838
+ tap(): Promise<void>;
1839
+ updateTime(time: number, deltaTime: number): void;
1840
+ dispose(): void;
1841
+ }
1842
+
1843
+ export declare interface PanoCircleMeshCustomOptions {
1844
+ scale?: number;
1845
+ color?: number;
1846
+ map?: THREE_2.Texture;
1847
+ mapAlpha?: number;
1848
+ borderWidth?: number;
1849
+ borderColor?: number;
1850
+ mapUseColor?: boolean;
1851
+ mapUseReverse?: boolean;
1852
+ }
1853
+
1854
+ /**
1855
+ * 地面提示点位接口
1856
+ *
1857
+ * 点位状态
1858
+ * 1. 默认状态: 无任何操作的情况
1859
+ * 2. 高亮状态: 高亮,认为是合适的下一个点位,或者设备选中了某个点位
1860
+ * 3. 进度状态: 点位加载中,存在进度的情况
1861
+ * 4. 加载状态: 点位加载中,不存在进度的情况
1862
+ * 5. 不可用状态:点位不可用,存在点位,但是点位是个摆设
1863
+ * 6. 点击动画: 点位被选择,触发全景图切换
1864
+ * 7. 透明度改变: 一般会处理为近的点位透明度高,远的点位透明度低
1865
+ */
1452
1866
  export declare interface PanoCircleMeshInterface extends THREE_2.Object3D {
1453
1867
  needsRender: boolean;
1868
+ hitTestMesh?: THREE_2.Mesh;
1869
+ /** 当前高亮 */
1870
+ current: boolean;
1871
+ /** 是否当前高亮 */
1872
+ setCurrent(current: boolean): void;
1454
1873
  loading: boolean;
1874
+ setLoading(loading: boolean): void;
1455
1875
  disabled: boolean;
1456
- panoIndex: number;
1457
- setLoading(shown: boolean): void;
1458
1876
  setDisabled(disabled: boolean): void;
1877
+ progress: number;
1878
+ setProgress(progress: number): void;
1879
+ opacity: number;
1880
+ setOpacity(opacity: number): void;
1881
+ updateTime?(time: number, deltaTime: number): void;
1882
+ /** 点击交互 */
1883
+ tap?(): Promise<void>;
1884
+ dispose(): void;
1885
+ }
1886
+
1887
+ export declare interface PanoCircleMeshOptions {
1888
+ scale?: number;
1889
+ color?: number;
1890
+ }
1891
+
1892
+ export declare class PanoCircleMeshSolid extends THREE_2.Object3D implements PanoCircleMeshInterface {
1893
+ needsRender: boolean;
1894
+ private currentStartTime;
1895
+ private currentMotion;
1896
+ private tapMotion;
1897
+ private loadingOpacityMotion;
1898
+ private progressMotion;
1899
+ private progressOpacityMotion;
1900
+ private opacityMotion;
1901
+ private disableMotion;
1902
+ progress: number;
1903
+ opacity: number;
1904
+ current: boolean;
1905
+ loading: boolean;
1906
+ disabled: boolean;
1907
+ private panoMesh;
1908
+ constructor(options?: PanoCircleMeshSolidOptions);
1459
1909
  setProgress(progress: number): void;
1460
1910
  setOpacity(opacity: number): void;
1911
+ setCurrent(current: boolean): void;
1912
+ setLoading(loading: boolean): void;
1913
+ setDisabled(disabled: boolean): void;
1914
+ tap(): Promise<void>;
1915
+ updateTime(time: number, deltaTime: number): void;
1461
1916
  dispose(): void;
1462
1917
  }
1463
1918
 
1919
+ export declare interface PanoCircleMeshSolidOptions {
1920
+ scale?: number;
1921
+ color?: number;
1922
+ }
1923
+
1464
1924
  export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
1465
- /** 自动亮度调整 默认 false */
1466
- enableLuminanceAdaptiveEffect?: boolean;
1467
1925
  /** 最远可移动观察点距离 */
1468
1926
  maxAccessibleDistance?: number;
1469
1927
  /**
@@ -1474,7 +1932,16 @@ export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeCo
1474
1932
  */
1475
1933
  panoTapTriggerRadius?: number;
1476
1934
  /** 地面观察点标识自定义创建器 */
1477
- panoCircleMeshCreator?: () => PanoCircleMeshInterface;
1935
+ panoCircleMeshCreator?: (panoIndex: number) => PanoCircleMeshInterface;
1936
+ /**
1937
+ * 全景瓦片登记
1938
+ * @param fov - 当前 fov
1939
+ * @param viewSize - 当前绘制区域大小
1940
+ * @returns 返回瓦片等级
1941
+ */
1942
+ tileLevelForFov?: false | ((fov: number, viewSize: THREE_2.Vector2) => number);
1943
+ /** 是否开启光照自适应效果 */
1944
+ luminanceAdaptiveEffectEnable?: boolean;
1478
1945
  }
1479
1946
 
1480
1947
  export declare interface PanoramaLikeControllerCustomInitArgs {
@@ -1502,14 +1969,31 @@ export declare interface PanoramaLikeControllerCustomInitArgs {
1502
1969
  intersectMeshCreator?: () => IntersectMeshInterface;
1503
1970
  }
1504
1971
 
1505
- export declare function parseWork(obj: Work | LooseWork | any): Work;
1972
+ /**
1973
+ * 解析 Work 数据
1974
+ * @param obj - work 数据,从如数开发者平台获取
1975
+ * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
1976
+ * @param urlTransform - 配置参数, URL 解析规则
1977
+ * @returns - 签署过的 Work 数据结构
1978
+ */
1979
+ export declare function parseWork(obj: Work | LooseWork | string | any, options?: ParseWorkOptions, urlTransform?: (origin: string, absolute: string, relative: string, type: "panorama" | "texture" | "model") => void): Work;
1980
+
1981
+ export declare type ParseWorkOptions = {
1982
+ /** 重写 work 中的资源前缀 */
1983
+ baseURL?: string;
1984
+ /** work 中的资源地址使用短地址 */
1985
+ shortPath?: boolean;
1986
+ /** work 中的资源使用 jsonp 方式发布 */
1987
+ jsonp?: boolean;
1988
+ /** work 中模型是否计算bvh碰撞数,默认计算 true */
1989
+ modelBvh?: boolean;
1990
+ };
1506
1991
 
1507
1992
  /** PBM 模型组 */
1508
- export declare class PBMGroup extends THREE_2.Group {
1509
- /** 楼层序号 */
1510
- floorIndex: number;
1993
+ export declare class PBMContainer extends THREE_2.Group {
1511
1994
  /** 是否需要更新按需渲染 */
1512
1995
  needsRender: boolean;
1996
+ private enableTransparent;
1513
1997
  /** 获取是否有透明参数 */
1514
1998
  getTransparent(): boolean;
1515
1999
  /** 设置透明参数 */
@@ -1524,39 +2008,39 @@ export declare class PBMGroup extends THREE_2.Group {
1524
2008
  disposeGeometry(): void;
1525
2009
  }
1526
2010
 
2011
+ /** PBM 模型组 */
2012
+ export declare class PBMGroup extends PBMContainer {
2013
+ /** 楼层序号 */
2014
+ floorIndex: number;
2015
+ }
2016
+
1527
2017
  /** PBM 材质 */
1528
2018
  export declare class PBMMaterial extends THREE_2.ShaderMaterial implements PBMParameters {
1529
- /** 起始点位全景图 */
1530
- pano0Map: HashCubeTexture | null;
1531
- /** 起始点全景图变换矩阵 4x4 */
1532
- pano0Matrix: THREE_2.Matrix4;
1533
- /** 结束点位全景图 */
1534
- pano1Map: HashCubeTexture | null;
1535
- /** 结束点全景图变换矩阵 4x4 */
1536
- pano1Matrix: THREE_2.Matrix4;
2019
+ /** 起始点 */
2020
+ pano0: PBMPanoPicture | null;
2021
+ /** 结束点 */
2022
+ pano1: PBMPanoPicture | null;
1537
2023
  /** 模型贴图和全景图的混合程度 [0-1] */
1538
2024
  modelAlpha: number;
1539
2025
  /** 全景图混合程度 [0-1] */
1540
2026
  progress: number;
1541
2027
  /** 全景图通过过度黑色混合 */
1542
2028
  useBlackTransition: boolean;
1543
- perspToOrtho: number;
1544
2029
  /** 模型透明度 */
1545
2030
  opacity: number;
1546
- /** 起始点位深度, 需要使用深度参与计算全景图混合的话 */
1547
- pano0DepthMap: THREE_2.CubeTexture | null;
1548
- /** 全景视频贴图 */
1549
- panoVideoMap: THREE_2.VideoTexture | null;
1550
- /** 全景视频尺寸 */
1551
- panoVideoSize: THREE_2.Vector2;
1552
- /** 全景视频贴图变换矩阵 */
1553
- panoVideoMatrix: THREE_2.Matrix4;
1554
- /** 全景视频透明度 [0-1] */
1555
- panoVideoAlpha: number;
1556
- /** 瓦片材质 */
1557
- panoTileMap: THREE_2.Texture | null;
1558
- /** 瓦片寻址规则 */
1559
- panoTileMappings: THREE_2.Vector4[][] | null;
2031
+ originOpacity: number;
2032
+ /** 楼层参数*/
2033
+ floorIndex: number;
2034
+ /** 楼层切割参数*/
2035
+ floorInfo: THREE_2.Vector3 | null;
2036
+ /** 对外模型裁切参数*/
2037
+ clippers: ClipperParameter | ClipperParameter[] | null;
2038
+ /** 对内模型裁切参数 裁切平面*/
2039
+ clipperPlanesArray: Float32Array | null;
2040
+ /** 对内模型裁切参数 裁切盒关联楼层*/
2041
+ clipperFloors: number[] | null;
2042
+ /** 模型颜色*/
2043
+ modelColorInfo: THREE_2.Vector3 | null;
1560
2044
  constructor(parameters?: Partial<PBMParameters>);
1561
2045
  }
1562
2046
 
@@ -1568,39 +2052,41 @@ export declare class PBMMesh extends THREE_2.Mesh<THREE_2.BufferGeometry, PBMMat
1568
2052
  needsRender: boolean;
1569
2053
  }
1570
2054
 
1571
- /** PBM 材质参数 */
1572
- export declare interface PBMParameters {
2055
+ export declare interface PBMPanoPicture {
1573
2056
  /** 起始点位全景图 */
1574
- pano0Map: HashCubeTexture | null;
2057
+ map: THREE_2.CubeTexture | TileCubeTextureTarget;
2058
+ /** 亮度增益 */
2059
+ luminanceMap: null | THREE_2.CubeTexture | TileCubeTextureTarget;
1575
2060
  /** 起始点全景图变换矩阵 4x4 */
1576
- pano0Matrix: THREE_2.Matrix4;
1577
- /** 结束点位全景图 */
1578
- pano1Map: HashCubeTexture | null;
1579
- /** 结束点位全景图变换矩阵 */
1580
- pano1Matrix: THREE_2.Matrix4;
2061
+ matrix: THREE_2.Matrix4;
2062
+ }
2063
+
2064
+ /** PBM 材质参数 */
2065
+ export declare interface PBMParameters {
2066
+ /** 起始点 */
2067
+ pano0: PBMPanoPicture | null;
2068
+ /** 结束点 */
2069
+ pano1: PBMPanoPicture | null;
1581
2070
  /** 模型贴图和全景图的混合程度 [0-1] */
1582
2071
  modelAlpha: number;
1583
2072
  /** 全景图混合程度 [0-1] */
1584
2073
  progress: number;
1585
2074
  /** 全景图通过过度黑色混合 */
1586
2075
  useBlackTransition: boolean;
1587
- perspToOrtho: number;
1588
2076
  /** 模型透明度 */
1589
2077
  opacity: number;
1590
- /** 起始点位深度, 需要使用深度参与计算全景图混合的话 */
1591
- pano0DepthMap: THREE_2.CubeTexture | null;
1592
- /** 全景视频贴图 */
1593
- panoVideoMap: THREE_2.VideoTexture | null;
1594
- /** 全景视频尺寸 */
1595
- panoVideoSize: THREE_2.Vector2;
1596
- /** 全景视频贴图变换矩阵 */
1597
- panoVideoMatrix: THREE_2.Matrix4;
1598
- /** 全景视频透明度 [0-1] */
1599
- panoVideoAlpha: number;
1600
- /** 瓦片材质 */
1601
- panoTileMap: THREE_2.Texture | null;
1602
- /** 瓦片寻址规则 */
1603
- panoTileMappings: THREE_2.Vector4[][] | null;
2078
+ /** 楼层参数*/
2079
+ floorIndex: number;
2080
+ /** 楼层切割参数*/
2081
+ floorInfo?: THREE_2.Vector3 | null;
2082
+ /** 模型裁切参数(工程侧调用)*/
2083
+ clippers?: ClipperParameter | ClipperParameter[] | null;
2084
+ /** 模型裁切平面参数(内部调用) */
2085
+ clipperPlanesArray?: Float32Array | null;
2086
+ /** 模型裁切平面参数(内部调用) */
2087
+ clipperFloors?: number[] | null;
2088
+ /** 模型颜色*/
2089
+ modelColorInfo?: THREE_2.Vector3 | null;
1604
2090
  }
1605
2091
 
1606
2092
  /**
@@ -1608,17 +2094,19 @@ export declare interface PBMParameters {
1608
2094
  * [[include: coordinate.md]]
1609
2095
  */
1610
2096
  export declare interface Pose {
1611
- /** 相机俯仰角 */
1612
- longitude: number;
1613
2097
  /** 相机偏航角 */
2098
+ longitude: number;
2099
+ /** 相机俯仰角 */
1614
2100
  latitude: number;
1615
2101
  /** 相机可视角度(垂直)*/
1616
2102
  fov: number;
1617
2103
  /** 相机位置*/
1618
2104
  offset: THREE_2.Vector3;
2105
+ /** 相机距离 */
2106
+ distance: number;
1619
2107
  }
1620
2108
 
1621
- export declare const PROXY_CONTROLLER_EVENT_NAMES: readonly ["cameraDirectionUpdate", "cameraUpdate", "cameraPositionUpdate", "panoSelected", "moveToPano", "moveToPanoCanceled", "panoWillArrive", "movingToPano", "panoArrived", "panoWillLoad", "panoLoaded", "panoLoadError", "initAnimationEnded", "initAnimationWillStart", "wantsGesture", "gesture", "wantsTapGesture", "tapGesture", "wantsPanGesture", "wantsInteriaPan", "panGesture", "interiaPan", "wantsPinchGesture", "pinchGesture", "wantsMouseWheel", "mouseWheel", "wantsShowIntersectionOnModel", "intersectionOnModelUpdate", "intersectionHidden", "textureStartLoad", "textureLoading", "textureAbort", "textureLoaded", "textureError"];
2109
+ export declare const PROXY_CONTROLLER_EVENT_NAMES: readonly ["cameraDirectionUpdate", "cameraUpdate", "cameraPositionUpdate", "panoSelected", "moveToPano", "moveToPanoCanceled", "panoWillArrive", "movingToPano", "panoArrived", "panoWillLoad", "panoLoaded", "panoLoadError", "initAnimationEnded", "initAnimationWillStart", "wantsGesture", "gesture", "wantsTapGesture", "tapGesture", "wantsPressGesture", "pressGesture", "wantsPanGesture", "wantsInteriaPan", "panGesture", "interiaPan", "wantsPinchGesture", "pinchGesture", "wantsMouseWheel", "mouseWheel", "wantsShowIntersectionOnModel", "intersectionOnModelUpdate", "intersectionHidden", "textureStartLoad", "textureLoading", "textureAbort", "textureLoaded", "textureError", "webXRSessionStart", "webXRSessionEnd", "webXRSelected"];
1622
2110
 
1623
2111
  /** Five 场景*/
1624
2112
  export declare class Scene extends THREE_2.Scene {
@@ -1660,8 +2148,6 @@ export declare interface State extends Pose {
1660
2148
  panoIndex: number;
1661
2149
  }
1662
2150
 
1663
- export declare function stringifyWork(work: Work): LooseWork;
1664
-
1665
2151
  /**
1666
2152
  * 监听者模式
1667
2153
  * @template T - 预设的监听回调类型
@@ -1740,69 +2226,731 @@ export declare namespace SubscribeMixinType {
1740
2226
  }
1741
2227
  }
1742
2228
 
1743
- export declare interface TopviewControllerCustomInitArgs extends Omit<FloorplanControllerCustomInitArgs, "defaultLongitude" | "defaultLatitude" | "maxLatitude" | "minLatitude"> {
2229
+ export declare class TextureLoader {
2230
+ private timeout?;
2231
+ private allowHosts?;
2232
+ private requestProxy?;
2233
+ private networkSubscribe?;
2234
+ constructor(options: NetworkOptions);
2235
+ setAllowHosts(allowHosts: string[]): void;
2236
+ setRequestProxy(requestProxy: (url: string) => string): void;
2237
+ setNetworkSubscribe(networkSubscribe: NetworkSubscribe): void;
2238
+ loadTexture(source: string, options?: {
2239
+ imageURL?: {
2240
+ transform?: (source: string, options: ImageURLOptions) => string;
2241
+ options?: ImageURLOptions;
2242
+ };
2243
+ flipY?: boolean;
2244
+ format?: THREE_2.PixelFormat;
2245
+ minFilter?: THREE_2.TextureFilter;
2246
+ magFilter?: THREE_2.TextureFilter;
2247
+ wrapS?: THREE_2.Wrapping;
2248
+ wrapT?: THREE_2.Wrapping;
2249
+ maxSize?: THREE_2.Vector2;
2250
+ preInit?: boolean;
2251
+ viaAjax?: boolean;
2252
+ }, onLoad?: (response: NetworkResponse<THREE_2.Texture>) => void, onError?: (error: Error) => void, onProgress?: (percent: number) => void, renderer?: THREE_2.WebGLRenderer): Promise<NetworkResponse<THREE_2.Texture>>;
2253
+ loadCubeTexture(sources: WorkCubeImage, options: {
2254
+ imageURL?: {
2255
+ transform?: (source: string, options: ImageURLOptions) => string;
2256
+ options?: ImageURLOptions;
2257
+ };
2258
+ format?: THREE_2.PixelFormat;
2259
+ minFilter?: THREE_2.TextureFilter;
2260
+ magFilter?: THREE_2.TextureFilter;
2261
+ wrapS?: THREE_2.Wrapping;
2262
+ wrapT?: THREE_2.Wrapping;
2263
+ preInit?: boolean;
2264
+ viaAjax?: boolean;
2265
+ }, 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[]>>;
2266
+ loadTiledCubeTexture(sources: WorkCubeImage, tileSources: WorkTile[], options: {
2267
+ tileImageSize?: number;
2268
+ tileMaxLevel?: number;
2269
+ imageURL?: {
2270
+ transform?: (source: string, options: ImageURLOptions) => string;
2271
+ options?: ImageURLOptions;
2272
+ };
2273
+ format?: THREE_2.PixelFormat;
2274
+ minFilter?: THREE_2.TextureFilter;
2275
+ magFilter?: THREE_2.TextureFilter;
2276
+ wrapS?: THREE_2.Wrapping;
2277
+ wrapT?: THREE_2.Wrapping;
2278
+ viaAjax?: boolean;
2279
+ }, onLoad: (response: NetworkResponse<TileCubeTextureTarget, NetWorkMeta[]>) => void, onError: (error: Error) => void, onProgress: (percent: number) => void, renderer: THREE_2.WebGLRenderer): Promise<NetworkResponse<TileCubeTextureTarget, NetWorkMeta[]>>;
1744
2280
  }
1745
2281
 
1746
- export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2282
+ /**
2283
+ * 图片参数
2284
+ */
2285
+ export declare interface TextureOptions {
1747
2286
  /**
1748
- * webvrPolyfill 的设置对象
1749
- * @description
1750
- * 只可被设置一次,所有的 five 实例共用这个设置
2287
+ * url 地址转化
2288
+ * @param url - 原始地址
2289
+ * @param options - 当前地址参数
2290
+ * @returns 转化后地址
1751
2291
  */
1752
- webvrPolyfillConfig?: any;
2292
+ transform?: (url: string, options: ImageURLOptions) => string;
2293
+ /** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
2294
+ size?: number;
2295
+ /** 图片质量参数(0-100) */
2296
+ quality?: number;
2297
+ /** 图片格式参数 */
2298
+ format?: "jpg" | "png" | "heif" | "webp" | "avif";
2299
+ /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
2300
+ autoResize?: boolean;
2301
+ /** 锐化参数 海外不支持 */
2302
+ sharpen?: number;
2303
+ mappings?: ImageURLMappings;
1753
2304
  }
1754
2305
 
1755
- export declare type Work = {
1756
- uuid: string;
2306
+ /**
2307
+ * A Tile3DHeader represents a tile as Tileset3D. When a tile is first created, its content is not loaded;
2308
+ * the content is loaded on-demand when needed based on the view.
2309
+ * Do not construct this directly, instead access tiles through {@link Tileset3D#tileVisible}.
2310
+ */
2311
+ export declare class Tile3D {
2312
+ cacheNode?: TileCacheNode<Tile3D>;
2313
+ tileset: Tileset3D;
2314
+ header: TilesetJSONNode;
2315
+ content?: TileContent;
2316
+ parent?: Tile3D;
2317
+ boundingVolume: TileOrientedBoundingBox;
2318
+ contentState: "UNLOADED" | "LOADING" | "PROCESSING" | "READY" | "FAILED";
2319
+ children: Tile3D[];
2320
+ depth: number;
2321
+ selectionDepth: number;
2322
+ transform: Matrix4;
2323
+ computedTransform: Matrix4;
2324
+ frameNumber: number;
2325
+ touchedFrameNumber: number;
2326
+ requestedFrameNumber: number;
2327
+ selectedFrameNumber: number;
2328
+ distanceToCamera: number;
2329
+ centerZDepth: number;
2330
+ screenSpaceError: number;
2331
+ visibilityPlaneMask: number;
2332
+ visible: boolean;
2333
+ shouldRefine: boolean;
2334
+ /**
2335
+ * @constructs
2336
+ * Create a TileHeader instance
2337
+ * @param tileset - Tileset3D instance
2338
+ * @param header - tile header - JSON loaded from a dataset
2339
+ * @param parentHeader - parent TileHeader instance
2340
+ */
2341
+ constructor(tileset: Tileset3D, header: TilesetJSONNode, parentHeader?: Tile3D);
2342
+ get id(): string;
2343
+ get refine(): "REPLACE" | "ADD";
2344
+ get type(): "EMPTY" | "SCENEGRAPH" | "MESH";
2345
+ get contentUrl(): string;
2346
+ get lodMetricType(): "geometricError";
2347
+ get lodMetricValue(): number;
2348
+ get hasEmptyContent(): boolean;
2349
+ get selected(): boolean;
2350
+ /** Returns true if tile is not an empty tile and not an external tileset */
2351
+ get hasRenderContent(): boolean;
2352
+ /** Returns true if tile has children */
2353
+ get hasChildren(): boolean;
2354
+ /**
2355
+ * Determines if the tile's content is ready. This is automatically `true` for
2356
+ * tiles with empty content.
2357
+ */
2358
+ get contentReady(): boolean;
2359
+ /**
2360
+ * Determines if the tile has available content to render. `true` if the tile's
2361
+ * content is ready or if it has expired content this renders while new content loads; otherwise,
2362
+ */
2363
+ get contentAvailable(): boolean;
2364
+ /** Returns true if tile has renderable content but it's unloaded */
2365
+ get hasUnloadedContent(): boolean;
2366
+ /**
2367
+ * Determines if the tile's content has not be requested. `true` if tile's
2368
+ * content has not be requested; otherwise, `false`.
2369
+ */
2370
+ get contentUnloaded(): boolean;
2371
+ get contentFailed(): boolean;
2372
+ /** Get the tile's screen space error. */
2373
+ getScreenSpaceError(frameState: TileFrameState, useParentLodMetric: boolean): number;
2374
+ private getPriority;
2375
+ /**
2376
+ * Requests the tile's content.
2377
+ * The request may not be made if the Request Scheduler can't prioritize it.
2378
+ */
2379
+ loadContent(): Promise<boolean>;
2380
+ unloadContent(): void;
2381
+ /**
2382
+ * Update the tile's visibility
2383
+ */
2384
+ updateVisibility(frameState: TileFrameState): void;
2385
+ private visibility;
2386
+ /**
2387
+ * Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.
2388
+ * @param frameState - The frame state.
2389
+ * @returns The distance, in meters, or zero if the camera is inside the bounding volume.
2390
+ */
2391
+ private distanceToTile;
2392
+ private updateTransform;
2393
+ }
2394
+
2395
+ export declare class Tile3DModel extends PBMContainer {
2396
+ tileset?: Tileset3D;
2397
+ private options;
2398
+ private nodeGroup;
2399
+ private boundingGroup;
2400
+ private nodes;
2401
+ private boundings;
2402
+ private unloadTileQueue;
2403
+ private timer;
2404
+ private clock;
2405
+ private lastCameraTransform;
2406
+ private lastCameraAspect;
2407
+ private lastCameraFov;
2408
+ private sseDenominator;
2409
+ private lastCamera;
2410
+ private lastRenderer;
2411
+ private enabled;
2412
+ constructor(loaderOptions?: Partial<Tile3DModelLoaderOptions>);
2413
+ get enable(): boolean;
2414
+ set enable(value: boolean);
2415
+ load(url: WorkModelTiles): void;
2416
+ update(renderer: THREE_2.WebGLRenderer, camera: Camera): void;
2417
+ private tilesetUpdate;
2418
+ reset(): void;
2419
+ }
2420
+
2421
+ /** Advanced loader options */
2422
+ export declare interface Tile3DModelLoaderOptions {
2423
+ updateInterval: number;
2424
+ maxMemoryUsage: number;
2425
+ maxScreenSpaceError: number;
2426
+ viewDistanceScale: number;
2427
+ throttleRequests: boolean;
2428
+ maxRequests: number;
2429
+ onNodeCreated: (node: PBMGroup) => void;
2430
+ allowHosts?: string[];
2431
+ requestProxy?: (url: string) => string | Promise<string>;
2432
+ networkSubscribe?: NetworkSubscribe;
2433
+ maxDepth?: number;
2434
+ }
2435
+
2436
+ export declare class TileBoundingSphere {
2437
+ center: Vector3;
2438
+ radius: number;
2439
+ constructor(center?: number[], radius?: number);
2440
+ fromCenterRadius(center: number[], radius: number): this;
2441
+ fromCornerPoints(corner: number[], oppositeCorner: number[]): this;
2442
+ equals(right: TileBoundingSphere): boolean;
2443
+ clone(): TileBoundingSphere;
2444
+ union(boundingSphere: TileBoundingSphere): TileBoundingSphere;
2445
+ expand(point: number[]): this;
2446
+ transform(transform: Matrix4): this;
2447
+ distanceSquaredTo(point: number[]): number;
2448
+ distanceTo(point: number[]): number;
2449
+ intersectPlane(plane: Plane): 0 | 1 | -1;
2450
+ }
2451
+
2452
+ export declare interface TileBoundingVolume {
2453
+ /**
2454
+ * Applies a 4x4 affine transformation matrix to a bounding sphere.
2455
+ * @param sphere - The bounding sphere to apply the transformation to.
2456
+ * @param transform - The transformation matrix to apply to the bounding sphere.
2457
+ * @returns itself, i.e. the modified BoundingVolume.
2458
+ */
2459
+ transform(transform: readonly number[]): this;
2460
+ /** Computes the estimated distance squared from the closest point on a bounding sphere to a point. */
2461
+ distanceSquaredTo(point: readonly number[]): number;
2462
+ /** Computes the estimated distance from the closest point on a bounding sphere to a point. */
2463
+ distanceTo(point: readonly number[]): number;
2464
+ /**
2465
+ * Determines which side of a plane the oriented bounding box is located.
2466
+ *
2467
+ * @param plane - The plane to test against.
2468
+ * @returns
2469
+ * - `INTERSECTION.INSIDE` if the entire box is on the side of the plane the normal is pointing.
2470
+ * - `INTERSECTION.OUTSIDE` if the entire box is on the opposite side.
2471
+ * - `INTERSECTION.INTERSECTING` if the box intersects the plane.
2472
+ */
2473
+ intersectPlane(plane: Plane): number;
2474
+ }
2475
+
2476
+ export declare class TileCacheNode<T> {
2477
+ item: T;
2478
+ previous: TileCacheNode<T> | null;
2479
+ next: TileCacheNode<T> | null;
2480
+ constructor(item: T, previous: TileCacheNode<T> | null, next: TileCacheNode<T> | null);
2481
+ }
2482
+
2483
+ export declare interface TileContent {
2484
+ version: 1;
2485
+ magic: number;
2486
+ byteLength: number;
2487
+ header: {
2488
+ featureTableJsonByteLength: number;
2489
+ featureTableBinaryByteLength: number;
2490
+ batchTableJsonByteLength: number;
2491
+ batchTableBinaryByteLength: number;
2492
+ batchLength: number;
2493
+ };
2494
+ featureTableJson: Record<string, any>;
2495
+ featureTableBinary: Uint8Array;
2496
+ batchTableJson: Record<string, any>;
2497
+ batchTableBinary: Uint8Array;
2498
+ rotateYtoZ: boolean;
2499
+ gltfUpAxis: "X" | "Y" | "Z";
2500
+ gltfArrayBuffer: ArrayBuffer;
2501
+ gltfByteOffset: number;
2502
+ gltfByteLength: number;
2503
+ rtcCenter?: Float32Array;
2504
+ }
2505
+
2506
+ export declare interface TileCubeNode {
2507
+ level: number;
2508
+ face: "up" | "down" | "left" | "right" | "front" | "back";
2509
+ position: THREE_2.Vector2;
2510
+ size: number;
2511
+ box: THREE_2.Box3;
2512
+ children: TileCubeNode[];
2513
+ }
2514
+
2515
+ export declare class TileCubeTextureTarget {
2516
+ private tileTree;
2517
+ private tileSources;
2518
+ private options;
2519
+ private renderer;
2520
+ name: string;
2521
+ needsRender: boolean;
2522
+ private disposed;
2523
+ private loadedCubeNodes;
2524
+ private loadingCubeNodes;
2525
+ private baseCubeTexture;
2526
+ private _cubeRenderTarget;
2527
+ private textures;
2528
+ constructor(baseCubeTexture: THREE_2.CubeTexture, tileTree: TileCubeTree, tileSources: WorkTile[], options: {
2529
+ textureSize: number;
2530
+ tileImageSize: number;
2531
+ textureLoader: TextureLoader;
2532
+ imageURL?: {
2533
+ transform?: (source: string, options: ImageURLOptions) => string;
2534
+ options?: ImageURLOptions;
2535
+ };
2536
+ format?: THREE_2.PixelFormat;
2537
+ minFilter?: THREE_2.TextureFilter;
2538
+ magFilter?: THREE_2.TextureFilter;
2539
+ wrapS?: THREE_2.Wrapping;
2540
+ wrapT?: THREE_2.Wrapping;
2541
+ }, renderer: THREE_2.WebGLRenderer);
2542
+ get cubeRenderTarget(): THREE_2.WebGLCubeRenderTarget | null;
2543
+ set cubeRenderTarget(cubeRenderTarget: THREE_2.WebGLCubeRenderTarget | null);
2544
+ private requestTile;
2545
+ update(frustum: THREE_2.Frustum, level: number): void;
2546
+ get tilePending(): number;
2547
+ get texture(): THREE_2.Texture;
2548
+ dispose(): void;
2549
+ }
2550
+
2551
+ export declare interface TileCubeTree {
2552
+ children: TileCubeNode[];
2553
+ }
2554
+
2555
+ export declare class TileCullingVolume {
2556
+ static get MASK_OUTSIDE(): number;
2557
+ static get MASK_INSIDE(): number;
2558
+ static get MASK_INDETERMINATE(): number;
2559
+ planes: Plane[];
2560
+ constructor(planes?: Plane[]);
2561
+ fromBoundingSphere(boundingSphere: {
2562
+ center: Vector3;
2563
+ radius: number;
2564
+ }): this;
2565
+ computeVisibilityWithPlaneMask(boundingVolume: TileBoundingVolume, parentPlaneMask: number): number;
2566
+ }
2567
+
2568
+ export declare type TileFrameState = {
2569
+ camera: {
2570
+ position: number[];
2571
+ direction: number[];
2572
+ up: number[];
2573
+ };
2574
+ height: number;
2575
+ cullingVolume: TileCullingVolume;
2576
+ frameNumber: number;
2577
+ sseDenominator: number;
2578
+ };
2579
+
2580
+ export declare class TileOrientedBoundingBox {
2581
+ center: Vector3;
2582
+ halfAxes: Matrix3;
2583
+ constructor(center?: number[], halfAxes?: number[]);
2584
+ clone(): TileOrientedBoundingBox;
2585
+ equals(right: TileOrientedBoundingBox): boolean;
2586
+ getBoundingSphere(result?: TileBoundingSphere): TileBoundingSphere;
2587
+ intersectPlane(plane: Plane): 0 | 1 | -1;
2588
+ distanceTo(point: number[]): number;
2589
+ distanceSquaredTo(point: number[]): number;
2590
+ computePlaneDistances(position: Vector3, direction: Vector3, result?: number[]): number[];
2591
+ transform(transformation: number[]): this;
2592
+ }
2593
+
2594
+ /** Tracks one request */
2595
+ export declare type TileRequest<Identiy> = {
2596
+ identiy: Identiy;
2597
+ priority: number;
2598
+ getPriority: (identiy: Identiy) => number;
2599
+ resolve: (requestResult: TileRequestResult) => void;
2600
+ };
2601
+
2602
+ export declare type TileRequestResult = null | {
2603
+ done: () => void;
2604
+ };
2605
+
2606
+ /**
2607
+ * Used to issue a request, without having them "deeply queued" by the browser.
2608
+ * @todo - Track requests globally, across multiple servers
2609
+ */
2610
+ export declare class TileRequestScheduler<Identiy> {
2611
+ private props;
2612
+ private activeRequestCount;
2613
+ /** Tracks the number of active requests and prioritizes/cancels queued requests. */
2614
+ private requestQueue;
2615
+ private requestMap;
2616
+ private deferred;
2617
+ constructor(props?: TileRequestSchedulerOptions);
2618
+ /**
2619
+ * Called by an application that wants to issue a request, without having it deeply queued by the browser
2620
+ *
2621
+ * When the returned promise resolved, it is OK for the application to issue a request.
2622
+ * The promise resolves to an object that contains a `done` method.
2623
+ * When the application's request has completed (or failed), the application must call the `done` function
2624
+ *
2625
+ * @param identiy - Identiy
2626
+ * @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
2627
+ * @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
2628
+ */
2629
+ scheduleRequest(identiy: Identiy, getPriority?: (identiy: Identiy) => number): Promise<TileRequestResult>;
2630
+ private issueRequest;
2631
+ /** We check requests asynchronously, to prevent multiple updates */
2632
+ private issueNewRequests;
2633
+ /** Refresh all requests */
2634
+ private issueNewRequestsAsync;
2635
+ /** Ensure all requests have updated priorities, and that no longer valid requests are cancelled */
2636
+ private updateAllRequests;
2637
+ /** Update a single request by calling the callback */
2638
+ private updateRequest;
2639
+ }
2640
+
2641
+ /** RequestScheduler Options */
2642
+ export declare type TileRequestSchedulerOptions = {
2643
+ throttleRequests?: boolean;
2644
+ maxRequests?: number;
2645
+ };
2646
+
2647
+ export declare class Tileset3D {
2648
+ rawJson: any;
2649
+ options: Tileset3dOptions;
2650
+ root: Tile3D;
2651
+ traverser: Tileset3DTraverser;
2652
+ cache: TilesetCache;
2653
+ requestScheduler: TileRequestScheduler<string>;
2654
+ selectedTiles: Tile3D[];
2655
+ requestedTiles: Tile3D[];
2656
+ memoryUsageInBytes: number;
2657
+ frameNumber: number;
2658
+ private _tiles;
2659
+ private pendingCount;
2660
+ b3dmMapping: TilesetJSON['b3dmMapping'];
2661
+ /**
2662
+ * Create a new Tileset3D
2663
+ * @param json - TilesetJSON
2664
+ * @param options - Tileset3dOptions
2665
+ */
2666
+ constructor(json: TilesetJSON, options: Tileset3dOptions);
2667
+ get maxMemoryUsage(): number;
2668
+ get asset(): any;
2669
+ get type(): any;
2670
+ get basePath(): any;
2671
+ get modelMatrix(): Matrix4;
2672
+ get geometricError(): number;
2673
+ get lodMetricType(): number;
2674
+ get lodMetricValue(): number;
2675
+ get refine(): 'ADD' | "REPLACE";
2676
+ get tiles(): Tile3D[];
2677
+ get floorInfo(): TilesetJSON['floorInfo'];
2678
+ /** Release resources */
2679
+ reset(): void;
2680
+ /** Is the tileset loaded (update needs to have been called at least once) */
2681
+ isLoaded(): boolean;
2682
+ /**
2683
+ * The callback to post-process tiles after traversal procedure
2684
+ * @param frameState - frame state for tile culling
2685
+ */
2686
+ private onTraversalEnd;
2687
+ loadTile(tile: Tile3D): void;
2688
+ unloadTile(tile: Tile3D): void;
2689
+ }
2690
+
2691
+ export declare interface Tileset3dOptions {
2692
+ throttleRequests: boolean;
2693
+ maxRequests: number;
2694
+ maxMemoryUsage: number;
2695
+ modelMatrix: Matrix4;
2696
+ maxScreenSpaceError: number;
2697
+ viewDistanceScale: number;
2698
+ onTileLoad: (tile: Tile3D) => any;
2699
+ onTileUnload: (tile: Tile3D) => any;
2700
+ onTileError: (tile: Tile3D, message: string) => any;
2701
+ contentLoader: (tile: Tile3D) => Promise<void>;
2702
+ onTraversalComplete: (selectedTiles: Tile3D[]) => Tile3D[];
2703
+ allowHosts?: string[];
2704
+ requestProxy?: (url: string) => string | Promise<string>;
2705
+ networkSubscribe?: NetworkSubscribe;
2706
+ maxDepth?: number;
2707
+ }
2708
+
2709
+ export declare class Tileset3DTraverser {
2710
+ root: Tile3D | null;
2711
+ options: TilesetTraverserProps;
2712
+ requestedTiles: Record<string, Tile3D>;
2713
+ selectedTiles: Record<string, Tile3D>;
2714
+ emptyTiles: Record<string, Tile3D>;
2715
+ private _traversalStack;
2716
+ private _emptyTraversalStack;
2717
+ private _frameNumber;
2718
+ constructor(options: TilesetTraverserProps);
2719
+ traverse(root: Tile3D, frameState: TileFrameState): void;
2720
+ reset(): void;
2721
+ private executeTraversal;
2722
+ private updateChildTiles;
2723
+ private updateAndPushChildren;
2724
+ updateTile(tile: Tile3D, frameState: TileFrameState): void;
2725
+ selectTile(tile: Tile3D, frameState: TileFrameState): void;
2726
+ loadTile(tile: Tile3D, frameState: TileFrameState): void;
2727
+ touchTile(tile: Tile3D, frameState: TileFrameState): void;
2728
+ private canTraverse;
2729
+ private shouldLoadTile;
2730
+ private shouldSelectTile;
2731
+ private shouldRefine;
2732
+ private updateTileVisibility;
2733
+ private meetsScreenSpaceErrorEarly;
2734
+ private compareDistanceToCamera;
2735
+ private anyChildrenVisible;
2736
+ private everyChildrenVisibleIsLoaded;
2737
+ private executeEmptyTraversal;
2738
+ }
2739
+
2740
+ export declare class TilesetCache {
2741
+ private list;
2742
+ private sentinel;
2743
+ constructor();
2744
+ reset(): void;
2745
+ touch(tile: Tile3D): void;
2746
+ add(tile: Tile3D, addCallback?: (tile: Tile3D) => void): void;
2747
+ unloadTile(tile: Tile3D, unloadCallback?: (tile: Tile3D) => void): void;
2748
+ unloadTiles(isOverMemory: () => boolean, unloadCallback?: (tile: Tile3D) => void): void;
2749
+ }
2750
+
2751
+ export declare interface TilesetJSON {
2752
+ asset: {
2753
+ gltfUpAxis: "X" | "Y" | "Z";
2754
+ version: "1.0";
2755
+ };
2756
+ basePath: string;
2757
+ lodMetricType: "geometricError";
2758
+ geometricError: number;
2759
+ lodMetricValue: number;
2760
+ root: TilesetJSONNode;
2761
+ type: "TILES3D";
2762
+ floorInfo: {
2763
+ ground: number;
2764
+ height: number;
2765
+ }[];
2766
+ b3dmMapping: {
2767
+ b3dm_base_url: string;
2768
+ b3dm_url: Record<string, string>;
2769
+ };
2770
+ }
2771
+
2772
+ export declare interface TilesetJSONNode {
2773
+ boundingVolume: {
2774
+ box: number[];
2775
+ };
2776
+ content: {
2777
+ uri: string;
2778
+ };
2779
+ id: string;
2780
+ transform?: number[];
2781
+ contentUrl?: string;
2782
+ children: TilesetJSONNode[];
2783
+ lodMetricType: "geometricError";
2784
+ geometricError: number;
2785
+ lodMetricValue: number;
2786
+ refine: "REPLACE" | "ADD";
2787
+ type: "EMPTY" | "SCENEGRAPH" | "MESH";
2788
+ }
2789
+
2790
+ export declare type TilesetTraverserProps = {
2791
+ loadSiblings: boolean;
2792
+ skipLevelOfDetail: boolean;
2793
+ maxScreenSpaceError: number;
2794
+ maxDepth?: number;
2795
+ onTraversalEnd: (frameState: TileFrameState) => any;
2796
+ };
2797
+
2798
+ export declare interface TopviewControllerCustomInitArgs extends Omit<FloorplanControllerCustomInitArgs, "defaultLongitude" | "defaultLatitude" | "maxLatitude" | "minLatitude"> {
2799
+ }
2800
+
2801
+ export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2802
+ }
2803
+
2804
+ export declare type WebXREventTypes = {
2805
+ /** WebXR模式开始,session完成坐标系设置*/
2806
+ webXRSessionStart(): void;
2807
+ /** WebXR模式结束,销毁session*/
2808
+ webXRSessionEnd(): void;
2809
+ };
2810
+
2811
+ export declare interface WebXRSelectParams {
2812
+ axes: readonly number[];
2813
+ raycaster: THREE_2.Raycaster;
2814
+ }
2815
+
2816
+ export declare type WebXRSelectType = "Select" | "Squeeze" | "Axes" | "LeftButtonA" | "LeftButtonB" | "RightButtonA" | "RightButtonB" | "LeftAxesLeftTap" | "LeftAxesRightTap" | "LeftAxesUpTap" | "LeftAxesDownTap" | "RightAxesLeftTap" | "RightAxesRightTap" | "RightAxesUpTap" | "RightAxesDownTap";
2817
+
2818
+ export declare class Work {
2819
+ /** 名称 */
2820
+ name: string;
2821
+ /** 编号 */
2822
+ workCode: string;
2823
+ /** 允许访问的安全域名 */
2824
+ allowHosts: string[];
2825
+ /** 过期时间 */
2826
+ expire: Date;
2827
+ /** 初始化参数 */
1757
2828
  initial: WorkInitial;
2829
+ /** 模型参数 */
1758
2830
  model?: WorkModel;
2831
+ /** 全景点位信息 */
1759
2832
  observers: WorkObserver[];
1760
- };
2833
+ /** 数据签发人 */
2834
+ issuer: string;
2835
+ /** 原始数据 */
2836
+ raw: {
2837
+ works: string[];
2838
+ options: string;
2839
+ };
2840
+ /**
2841
+ * 解析 Work 数据
2842
+ * @param obj - work 数据,从如数开发者平台获取
2843
+ * @param options - 配置参数, 可以在此二次设置 baseURL 等参数
2844
+ * @param urlTransform - 配置参数, URL 解析规则
2845
+ * @returns - 签署过的 Work 数据结构
2846
+ */
2847
+ static parse: typeof parseWork;
2848
+ constructor();
2849
+ toJSON(): any;
2850
+ }
1761
2851
 
1762
- /** 全景图 */
1763
- export declare type WorkImages = {
2852
+ export declare interface WorkCubeImage {
2853
+ /** 全景图 up */
1764
2854
  up: string;
2855
+ /** 全景图 down */
1765
2856
  down: string;
2857
+ /** 全景图 right */
1766
2858
  right: string;
2859
+ /** 全景图 left */
1767
2860
  left: string;
2861
+ /** 全景图 front */
1768
2862
  front: string;
2863
+ /** 全景图 back */
1769
2864
  back: string;
2865
+ }
2866
+
2867
+ /** 全景图 */
2868
+ export declare interface WorkImage extends WorkCubeImage {
2869
+ /** 深度图 */
1770
2870
  depth?: string;
1771
- tiles?: string;
1772
- };
2871
+ /** 光照强度图 */
2872
+ luminance?: WorkCubeImage;
2873
+ /** 瓦片信息 */
2874
+ tiles?: WorkTile[];
2875
+ }
1773
2876
 
1774
2877
  /** 初始化位姿参数 */
1775
- export declare type WorkInitial = Omit<State, "offset">;
2878
+ export declare interface WorkInitial extends Omit<State, "offset" | "distance"> {
2879
+ }
1776
2880
 
1777
2881
  /** 模型数据 */
1778
- export declare type WorkModel = {
2882
+ export declare interface WorkModel {
2883
+ /** 模型文件地址 at3d / domez */
1779
2884
  file: string;
2885
+ /** 模型贴图文件地址 */
1780
2886
  textures: string[];
2887
+ /** 模型贴图文件地址的父目录 */
1781
2888
  textureBase: string;
2889
+ /** 是否开启 bvh 碰撞树,开启会大大加快射线碰撞的执行效率 */
1782
2890
  bvh: boolean;
1783
- async: boolean;
1784
- };
2891
+ tiles?: WorkModelTiles;
2892
+ }
2893
+
2894
+ /** 模型瓦片 */
2895
+ export declare interface WorkModelTiles {
2896
+ tileset_url: string;
2897
+ tileset_url_md5: string;
2898
+ b3md_mappings_url: string;
2899
+ b3md_mappings_url_md5: string;
2900
+ }
1785
2901
 
1786
2902
  /** 每个点位的数据 */
1787
- export declare type WorkObserver = {
2903
+ export declare interface WorkObserver {
2904
+ /** 点位序号 */
1788
2905
  panoIndex: number;
2906
+ /** 点位是否激活可用 */
1789
2907
  active: boolean;
2908
+ /** 点位是否可加载 */
1790
2909
  loadable: boolean;
1791
- images: WorkImages;
2910
+ /** 点位全景图 */
2911
+ images: WorkImage;
2912
+ /** 点位视频 */
1792
2913
  video?: WorkVideo;
2914
+ /** 可以看到的相关点位序号 */
1793
2915
  visibleNodes: number[];
2916
+ /** 可以连通的相关点位序号 */
1794
2917
  accessibleNodes: number[];
2918
+ /** 点位和模型的旋转对齐关系四元数 */
1795
2919
  quaternion: THREE_2.Quaternion;
2920
+ /** 点位和模型的地面位置坐标关系 */
1796
2921
  standingPosition: THREE_2.Vector3;
2922
+ /** 点位和模型的观察点坐标关系 */
1797
2923
  position: THREE_2.Vector3;
2924
+ /** 点位所在楼层 */
1798
2925
  floorIndex: number;
1799
- };
2926
+ }
2927
+
2928
+ export declare interface WorkTile {
2929
+ level: number;
2930
+ size: number;
2931
+ up: string;
2932
+ down: string;
2933
+ right: string;
2934
+ left: string;
2935
+ front: string;
2936
+ back: string;
2937
+ }
1800
2938
 
1801
2939
  /** 全景视频贴片 */
1802
- export declare type WorkVideo = {
2940
+ export declare interface WorkVideo {
2941
+ /** 视频源 url */
1803
2942
  source: string;
2943
+ /** 视频源变化矩阵 */
1804
2944
  matrix: THREE_2.Matrix4;
2945
+ /** 视频源长宽尺寸 */
1805
2946
  size: THREE_2.Vector2;
1806
- };
2947
+ }
2948
+
2949
+ export declare class XRButton {
2950
+ static createButton(onClickHook: () => void): HTMLAnchorElement | HTMLButtonElement;
2951
+ }
2952
+
2953
+ export declare interface XRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
2954
+ }
1807
2955
 
1808
2956
  export { }