@realsee/five 5.0.0-alpha.16 → 5.0.0-alpha.160

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