@realsee/five 5.0.0-alpha.15 → 5.0.0-alpha.150

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 (238) 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 +323 -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 +7 -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/index.html +166 -422
  71. package/docs/interfaces/five.AddableObject.html +1 -0
  72. package/docs/interfaces/five.AnimationFrame.html +1 -0
  73. package/docs/interfaces/five.CameraPose.html +1 -0
  74. package/docs/interfaces/five.ClipperParameter.html +1 -0
  75. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  76. package/docs/interfaces/five.EventCallback.html +399 -0
  77. package/docs/interfaces/five.FiveInitArgs.html +109 -0
  78. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
  79. package/docs/interfaces/five.ImageOptions.html +18 -0
  80. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  81. package/docs/interfaces/five.ImageURLOptions.html +17 -0
  82. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  83. package/docs/interfaces/five.Intersection.html +7 -0
  84. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
  85. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  86. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  87. package/docs/interfaces/five.MovePanoOptions.html +42 -0
  88. package/docs/interfaces/five.NetworkOptions.html +9 -0
  89. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  90. package/docs/interfaces/five.PBMParameters.html +27 -0
  91. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  92. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +33 -0
  93. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  94. package/docs/interfaces/five.Pose.html +37 -0
  95. package/docs/interfaces/five.Scissor.html +14 -0
  96. package/docs/interfaces/five.State.html +21 -0
  97. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  98. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  99. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  100. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  101. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  102. package/docs/interfaces/five.TextureOptions.html +20 -0
  103. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +3 -0
  104. package/docs/interfaces/five.TileBoundingVolume.html +19 -0
  105. package/docs/interfaces/five.TileContent.html +1 -0
  106. package/docs/interfaces/five.TileCubeNode.html +1 -0
  107. package/docs/interfaces/five.TileCubeTree.html +1 -0
  108. package/docs/interfaces/five.Tileset3dOptions.html +1 -0
  109. package/docs/interfaces/five.TilesetJSON.html +1 -0
  110. package/docs/interfaces/five.TilesetJSONNode.html +1 -0
  111. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
  112. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +29 -0
  113. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  114. package/docs/interfaces/five.WorkImage.html +21 -0
  115. package/docs/interfaces/five.WorkInitial.html +13 -0
  116. package/docs/interfaces/five.WorkModel.html +11 -0
  117. package/docs/interfaces/five.WorkModelTiles.html +3 -0
  118. package/docs/interfaces/five.WorkObserver.html +25 -0
  119. package/docs/interfaces/five.WorkTile.html +1 -0
  120. package/docs/interfaces/five.WorkVideo.html +9 -0
  121. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +29 -0
  122. package/docs/interfaces/gltf_loader.DDS.html +1 -0
  123. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  124. package/docs/interfaces/gltf_loader.GLTFReference.html +1 -0
  125. package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -0
  126. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  127. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  128. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  129. package/docs/interfaces/server.Intersection.html +7 -0
  130. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  131. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  132. package/docs/interfaces/vue.FiveActionVueCallbacks.html +62 -0
  133. package/docs/modules/five.SubscribeMixinType.html +1 -0
  134. package/docs/modules/five.html +496 -0
  135. package/docs/modules/gltf_loader.html +1 -0
  136. package/docs/modules/line.html +1 -0
  137. package/docs/modules/react.html +133 -1374
  138. package/docs/modules/server.html +18 -0
  139. package/docs/modules/sticker.html +1 -0
  140. package/docs/modules/vue.html +112 -0
  141. package/docs/modules.html +1 -120
  142. package/exporters/staticify.js +210 -0
  143. package/five/index.d.ts +2922 -0
  144. package/five/index.js +372 -0
  145. package/gltf-loader/index.d.ts +160 -0
  146. package/gltf-loader/index.js +260 -0
  147. package/line/index.d.ts +69 -0
  148. package/line/index.js +260 -0
  149. package/package.json +25 -17
  150. package/react/index.d.ts +86 -24
  151. package/react/index.js +260 -1
  152. package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
  153. package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
  154. package/resource/gltf/draco_decoder.js +31 -0
  155. package/resource/gltf/draco_decoder.wasm +0 -0
  156. package/resource/gltf/draco_wasm_wrapper.js +119 -0
  157. package/scripts/five-staticify.js +26 -0
  158. package/server/index.d.ts +197 -26
  159. package/server/index.js +367 -1
  160. package/sticker/index.d.ts +71 -0
  161. package/sticker/index.js +260 -0
  162. package/templates/quick-start/README.md +1 -1
  163. package/templates/quick-start/package.json +1 -1
  164. package/templates/react-component/lib/index.tsx +3 -3
  165. package/umd/five-gltf-loader.js +1 -0
  166. package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
  167. package/umd/five-line.js +1 -0
  168. package/umd/five-line.js.LICENSE.txt +14 -0
  169. package/umd/five-react.js +1 -0
  170. package/umd/five-react.js.LICENSE.txt +14 -0
  171. package/umd/five-sticker.js +1 -0
  172. package/umd/five-sticker.js.LICENSE.txt +14 -0
  173. package/umd/five-vue.js +1 -0
  174. package/umd/five.js +2 -0
  175. package/umd/five.js.LICENSE.txt +107 -0
  176. package/vue/index.d.ts +440 -0
  177. package/vue/index.js +260 -0
  178. package/bundles/five.js +0 -2
  179. package/bundles/five.js.LICENSE.txt +0 -160
  180. package/docs/assets/css/main.css +0 -2660
  181. package/docs/assets/js/main.js +0 -248
  182. package/docs/assets/js/search.js +0 -1
  183. package/docs/classes/index.five.html +0 -2498
  184. package/docs/classes/index.fivecamera.html +0 -311
  185. package/docs/classes/index.fivehashcubetexture.html +0 -240
  186. package/docs/classes/index.fiveline.html +0 -342
  187. package/docs/classes/index.fivelinegeometry.html +0 -500
  188. package/docs/classes/index.fivelinematerial.html +0 -276
  189. package/docs/classes/index.fivelinesegmentsgeometry.html +0 -447
  190. package/docs/classes/index.fivescene.html +0 -186
  191. package/docs/classes/index.internalwebglrenderer.html +0 -200
  192. package/docs/classes/index.model.html +0 -883
  193. package/docs/classes/index.pbmgroup.html +0 -415
  194. package/docs/classes/index.pbmmaterial.html +0 -521
  195. package/docs/classes/index.pbmmesh.html +0 -242
  196. package/docs/classes/index.subscribe.html +0 -556
  197. package/docs/classes/react.store.html +0 -584
  198. package/docs/interfaces/index.depthpanoramacontrollercustominitargs.html +0 -408
  199. package/docs/interfaces/index.eventcallback.html +0 -2452
  200. package/docs/interfaces/index.fiveinitargs.html +0 -695
  201. package/docs/interfaces/index.floorplancontrollercustominitargs.html +0 -283
  202. package/docs/interfaces/index.imageoptions.html +0 -320
  203. package/docs/interfaces/index.intersection.html +0 -215
  204. package/docs/interfaces/index.intersectmeshinterface.html +0 -176
  205. package/docs/interfaces/index.modelcontrollercustominitargs.html +0 -354
  206. package/docs/interfaces/index.modeleventcallback.html +0 -316
  207. package/docs/interfaces/index.movepanooptions.html +0 -457
  208. package/docs/interfaces/index.panocirclemeshinterface.html +0 -349
  209. package/docs/interfaces/index.panoramacontrollercustominitargs.html +0 -433
  210. package/docs/interfaces/index.panoramalikecontrollercustominitargs.html +0 -352
  211. package/docs/interfaces/index.pbmparameters.html +0 -462
  212. package/docs/interfaces/index.pose.html +0 -258
  213. package/docs/interfaces/index.scissor.html +0 -240
  214. package/docs/interfaces/index.state.html +0 -288
  215. package/docs/interfaces/index.subscribemixintype.emit.html +0 -180
  216. package/docs/interfaces/index.subscribemixintype.haslistener.html +0 -171
  217. package/docs/interfaces/index.subscribemixintype.off.html +0 -198
  218. package/docs/interfaces/index.subscribemixintype.on.html +0 -213
  219. package/docs/interfaces/index.subscribemixintype.once.html +0 -210
  220. package/docs/interfaces/index.topviewcontrollercustominitargs.html +0 -214
  221. package/docs/interfaces/index.vrpanoramacontrollercustominitargs.html +0 -420
  222. package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -559
  223. package/docs/interfaces/react.fiveinjectiontypes.html +0 -1473
  224. package/docs/interfaces/react.injectfivetoprops.html +0 -259
  225. package/docs/modules/index.html +0 -3027
  226. package/docs/modules/index.subscribemixintype.html +0 -143
  227. package/five.js.LICENSE.txt +0 -160
  228. package/index.d.ts +0 -1807
  229. package/index.js +0 -1
  230. package/scripts/export-five-resource/chfs.exe +0 -0
  231. package/scripts/export-five-resource/fileify.js +0 -192
  232. package/scripts/export-five-resource/format-work.js +0 -71
  233. package/scripts/export-five-resource/staticify.js +0 -327
  234. package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
  235. package/scripts/transcode-model/LoaderSupport.js +0 -1545
  236. package/scripts/transcode-model/MTLLoader.js +0 -602
  237. package/scripts/transcode-model/OBJLoader2.js +0 -1470
  238. package/scripts/transcode-model/obj2pbm.js +0 -65
package/index.d.ts DELETED
@@ -1,1807 +0,0 @@
1
- /// <reference types="hammerjs" />
2
-
3
- import * as THREE_2 from 'three';
4
-
5
- export declare type ControllerCustomInitTypes = {
6
- Floorplan: FloorplanControllerCustomInitArgs;
7
- Topview: TopviewControllerCustomInitArgs;
8
- Panorama: PanoramaControllerCustomInitArgs;
9
- VRPanorama: VRPanoramaControllerCustomInitArgs;
10
- Model: ModelControllerCustomInitArgs;
11
- DepthPanorama: DepthPanoramaControllerCustomInitArgs;
12
- };
13
-
14
- export declare type ControllerEventTypes = {
15
- /**
16
- * 模态间切换动画开始
17
- * @param panoIndex - 当前点位
18
- * @param pose - 相机姿态
19
- * @param userAction - 是否用户触发
20
- */
21
- initAnimationWillStart(panoIndex: number, pose: Pose, userAction: boolean): void;
22
- /**
23
- * 模态间切换动画结束
24
- * @param panoIndex - 当前点位
25
- * @param pose - 相机姿态
26
- * @param userAction - 是否用户触发
27
- */
28
- initAnimationEnded(panoIndex: number, pose: Pose, userAction: boolean): void;
29
- /**
30
- * 意图要变化相机的可视角度 可以通过 `return false` 阻止
31
- * @deprecated
32
- * 建议通过 初始化设置的 `defaultFov`, `maxFov`, `minFov` 来限制
33
- * @param fov - 意图要变化相机的可视角度
34
- * @returns 可以通过 `return false` 阻止
35
- */
36
- wantsChangeCameraFov(fov: number): void | false;
37
- /**
38
- * 相机姿态变化
39
- * @param pose - 相机姿态
40
- * @param userAction - 是否用户触发
41
- */
42
- cameraUpdate(pose: Pose, userAction: boolean): void;
43
- /**
44
- * 相机姿态中可视角度变化
45
- * @param fov - 相机的可视角度
46
- * @param userAction - 是否用户触发
47
- */
48
- cameraFovUpdate(fov: Pose["fov"], userAction: boolean): void;
49
- /**
50
- * 相机姿态中相机位置变化
51
- * @param offset - 相机位置
52
- * @param userAction - 是否用户触发
53
- */
54
- cameraPositionUpdate(offset: Pose["offset"], userAction: boolean): void;
55
- /**
56
- * 相机姿态中相机方向变化
57
- * @param coordinates - 相机姿态的俯仰角和偏航角
58
- * @param userAction - 是否用户触发
59
- */
60
- cameraDirectionUpdate(coordinates: Pick<Pose, "longitude" | "latitude">, userAction: boolean): void;
61
- /**
62
- * 观察点位被选择
63
- * @param panoIndex - 选择的点位
64
- */
65
- panoSelected(panoIndex: number): void;
66
- /**
67
- * 意图要移动到某个点位 可以通过 `return false` 阻止
68
- * @param panoIndex - 图要移动到的点位下标
69
- * @param options - 移动参数
70
- * @param userAction - 是否用户触发
71
- * @returns 可以通过 `return false` 阻止
72
- */
73
- wantsMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void | false;
74
- /**
75
- * 开始加载并移动到某个观察点位
76
- * @description
77
- * 可 panoWillArrive 相比
78
- * - moveToPano 在加载全景图资源前触发
79
- * - panoWillArrive 在加载全景图资源后触发
80
- * @param panoIndex - 移动到的点位下标
81
- * @param userAction - 是否用户触发
82
- */
83
- moveToPano(panoIndex: number, userAction: boolean): void;
84
- /**
85
- * 开始加载某个观察点的全景资源
86
- * @param panoIndex - 移动到的点位下标
87
- */
88
- panoWillLoad(panoIndex: number): void;
89
- /**
90
- * 某个观察点的全景资源加载完成
91
- * @param panoIndex - 对应的点位下标
92
- */
93
- panoLoaded(panoIndex: number): void;
94
- /**
95
- * 某个观察点的全景资源加载失败
96
- * @param error - 错误对象
97
- * @param panoIndex - 对应的点位下标
98
- */
99
- panoLoadError(error: Error, panoIndex: number): void;
100
- /**
101
- * 移动到某个观察点位被取消
102
- * @description
103
- * 这个有一些情况会导致
104
- * - 移动过程中切换模态
105
- * - 移动过程中 five 被析构
106
- * - 移动过程点击切换到另一个点位
107
- * @param panoIndex - 对应的点位下标
108
- */
109
- moveToPanoCanceled(panoIndex: number): void;
110
- /**
111
- * 开始移动到某个观察点位
112
- * @description
113
- * 和 moveToPano 相比
114
- * - moveToPano 在加载全景图资源前触发
115
- * - panoWillArrive 在加载全景图资源后触发
116
- * @param panoIndex - 移动到点位下标
117
- * @param pose - 相机姿态
118
- * @param userAction - 是否用户触发
119
- */
120
- panoWillArrive(panoIndex: number, pose: Pose, userAction: boolean): void;
121
- /**
122
- * 移动到某个观察点位
123
- * @param panoIndex - 移动到点位下标
124
- * @param pose - 相机姿态
125
- * @param userAction - 是否用户触发
126
- */
127
- panoArrived(panoIndex: number, pose: Pose, userAction: boolean): void;
128
- /**
129
- * 移动中, 会告知移动状态(耗时百分比)
130
- * @param panoIndex - 将要移动到的点位下标
131
- * @param prevPanoIndex - 上一个点位下标
132
- * @param progress - 整个过程经度 [0-1]
133
- */
134
- movingToPano(panoIndex: number, prevPanoIndex: number, progress: number): void;
135
- /**
136
- * 意图要触发手势, 可以通过 `return false` 阻止
137
- * @param type - 手势类型
138
- * @param pointers - 手指位置
139
- * @param final - 是否手势结束
140
- * @returns 可以通过 `return false` 阻止
141
- */
142
- wantsGesture(type: GestureTypes, pointers: {
143
- x: number;
144
- y: number;
145
- }[], final: boolean): void | false;
146
- /**
147
- * 手势 触发
148
- * @param type - 手势类型
149
- * @param pointers - 手指位置
150
- * @param final - 是否手势结束
151
- */
152
- gesture(type: GestureTypes, pointers: {
153
- x: number;
154
- y: number;
155
- }[], final: boolean): void;
156
- /**
157
- * 意图要触发 pan 手势(滑动屏幕), 可以通过 `return false` 阻止
158
- * @param pose - 意图的相机姿态
159
- * @param final - 是否手势结束
160
- * @returns 可以通过 `return false` 阻止
161
- */
162
- wantsPanGesture(pose: Pose, final: boolean): void | false;
163
- /**
164
- * pan 手势(滑动屏幕) 被触发
165
- * @param pose - 相机姿态
166
- * @param final - 是否手势结束
167
- */
168
- panGesture(pose: Pose, final: boolean): void;
169
- /**
170
- * 意图要触发 pan 手势(滑动屏幕) 的惯性运动, 可以通过 `return false` 阻止
171
- * @param pose - 意图的相机姿态
172
- * @param final - 是否手势结束
173
- * @returns 可以通过 `return false` 阻止
174
- */
175
- wantsInteriaPan(pose: Pose): void | false;
176
- /**
177
- * pan 手势(滑动屏幕) 的惯性运动
178
- * @param pose - 意图的相机姿态
179
- * @param final - 是否手势结束
180
- */
181
- interiaPan(pose: Pose, final: boolean): void;
182
- /**
183
- * 意图要触发 tap 手势(点击屏幕), 可以通过 `return false` 阻止
184
- * @param raycaster - 点击对应的三维射线
185
- * @param tapPosition - 点击对应的屏幕位置
186
- * @returns 可以通过 `return false` 阻止
187
- */
188
- wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2): void | false;
189
- /**
190
- * tap 手势(点击屏幕) 被触发
191
- * @param raycaster - 点击对应的三维射线
192
- * @param tapPosition - 点击对应的屏幕位置
193
- */
194
- tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2): void;
195
- /**
196
- * 意图要触发 pinch 手势(双指缩放),可以通过 `return false` 阻止
197
- * @param scale - 缩放数值
198
- * @param nextFov - 意图的fov变更
199
- * @param final - 是否手势结束
200
- * @returns 可以通过 `return false` 阻止
201
- */
202
- wantsPinchGesture(scale: number, nextFov: number, final: boolean): void | false;
203
- /**
204
- * pinch 手势(双指缩放) 被触发
205
- * @param scale - 缩放数值
206
- * @param nextFov - 意图的fov变更
207
- * @param final - 是否手势结束
208
- */
209
- pinchGesture(scale: number, fov: number, final: boolean): void;
210
- /**
211
- * 意图要触发 鼠标滚轮 可以通过 `return false` 阻止
212
- * @param delta - 滚轮数值
213
- * @param nextFov - 意图的fov变更
214
- * @param final - 是否手势结束
215
- * @returns 可以通过 `return false` 阻止
216
- */
217
- wantsMouseWheel(delta: number, nextFov: number, final: boolean): void | false;
218
- /**
219
- * 鼠标滚轮被触发
220
- * @param delta - 滚轮数值
221
- * @param nextFov - 意图的fov变更
222
- * @param final - 是否手势结束
223
- */
224
- mouseWheel(delta: number, fov: number, final: boolean): void;
225
- /**
226
- * 鼠标焦点环位置被重新计算
227
- * @param intersection - 焦点碰撞结果
228
- * @param mesh - 焦点环 mesh
229
- */
230
- intersectionOnModelUpdate(intersection: Intersection, mesh: IntersectMeshInterface): void;
231
- /**
232
- * 意图要展示鼠标焦点环,可以通过 `return false` 阻止
233
- * @param intersection - 焦点碰撞结果
234
- * @returns 可以通过 `return false` 阻止
235
- */
236
- wantsShowIntersectionOnModel(raycaster: THREE_2.Raycaster): void | false;
237
- /** 鼠标焦点环被隐藏 */
238
- intersectionHidden(): void;
239
- /** 意图要退出VR眼镜模式 */
240
- vrWantsToExit(): void;
241
- /**
242
- * 观察点的全景资源开始加载
243
- * @param panoIndex - 加载点位下标
244
- * @param observer - 对应的 observer 详情
245
- */
246
- textureStartLoad(panoIndex: number, observer: WorkObserver): void;
247
- /**
248
- * 观察点的全景资源加载中,可获取到进度
249
- * @param progress - 加载进度 [0-1]
250
- * @param panoIndex - 加载点位下标
251
- * @param observer - 对应的 observer 详情
252
- */
253
- textureLoading(progress: number, panoIndex: number, observer: WorkObserver): void;
254
- /**
255
- * 观察点的全景资源加载被中止
256
- * @param panoIndex - 加载点位下标
257
- * @param observer - 对应的 observer 详情
258
- */
259
- textureAbort(panoIndex: number, observer: WorkObserver): void;
260
- /**
261
- * 观察点的全景资源加载失败
262
- * @param error - 错误对象
263
- * @param panoIndex - 加载点位下标
264
- * @param observer - 对应的 observer 详情
265
- */
266
- textureError(error: Error, panoIndex: number, observer: WorkObserver): void;
267
- /**
268
- * 观察点的全景资源加载完成
269
- * @param panoIndex - 加载点位下标
270
- * @param observer - 对应的 observer 详情
271
- */
272
- textureLoaded(panoIndex: number, observer: WorkObserver): void;
273
- /**
274
- * 抛出错误
275
- * @param error - 抛出错误
276
- */
277
- error(error: Error): void;
278
- };
279
-
280
- export declare interface DepthPanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
281
- /** 最远可移动观察点距离 */
282
- maxAccessibleDistance?: number;
283
- /** 地面观察点标识自定义创建器 */
284
- panoCircleMeshCreator?: () => PanoCircleMeshInterface;
285
- }
286
-
287
- /**
288
- * 动画变化曲线
289
- */
290
- export declare const Easing: {
291
- Linear: {
292
- None: (amount: number) => number;
293
- };
294
- Quadratic: {
295
- In: (amount: number) => number;
296
- Out: (amount: number) => number;
297
- InOut: (amount: number) => number;
298
- };
299
- Cubic: {
300
- In: (amount: number) => number;
301
- Out: (amount: number) => number;
302
- InOut: (amount: number) => number;
303
- };
304
- Quartic: {
305
- In: (amount: number) => number;
306
- Out: (amount: number) => number;
307
- InOut: (amount: number) => number;
308
- };
309
- Quintic: {
310
- In: (amount: number) => number;
311
- Out: (amount: number) => number;
312
- InOut: (amount: number) => number;
313
- };
314
- Sinusoidal: {
315
- In: (amount: number) => number;
316
- Out: (amount: number) => number;
317
- InOut: (amount: number) => number;
318
- };
319
- Exponential: {
320
- In: (amount: number) => number;
321
- Out: (amount: number) => number;
322
- InOut: (amount: number) => number;
323
- };
324
- Circular: {
325
- In: (amount: number) => number;
326
- Out: (amount: number) => number;
327
- InOut: (amount: number) => number;
328
- };
329
- Elastic: {
330
- In: (amount: number) => number;
331
- Out: (amount: number) => number;
332
- InOut: (amount: number) => number;
333
- };
334
- Back: {
335
- In: (amount: number) => number;
336
- Out: (amount: number) => number;
337
- InOut: (amount: number) => number;
338
- };
339
- Bounce: {
340
- In: (amount: number) => number;
341
- Out: (amount: number) => number;
342
- InOut: (amount: number) => number;
343
- };
344
- };
345
-
346
- /**
347
- * Five 事件列表
348
- * @description
349
- * 可以通过 `five.on(METHOD_NAME, METHOD)` 调用
350
- */
351
- export declare interface EventCallback extends EventTypes {
352
- }
353
-
354
- /**
355
- * Five 事件列表
356
- * @description
357
- * 具体事件列表 请查看 {@link EventCallback}
358
- */
359
- export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROLLER_EVENT_NAMES[number]> & {
360
- /**
361
- * 内部错误
362
- * @param error - 错误对象
363
- */
364
- error(error: Error): void;
365
- /**
366
- * 开始加载 Work 数据
367
- * @param input - 输入的 work
368
- * @param work - 归一化的标准 work
369
- * @param state - 加载时的姿态
370
- */
371
- willLoad(input: any, work: Work, state: Omit<State, "offset">): void;
372
- /**
373
- * 开始加载 Work 数据
374
- * @param input - 输入的 work
375
- * @param work - 归一化的标准 work
376
- * @param state - 加载时的姿态
377
- */
378
- load(input: any, work: Work, state: Omit<State, "offset">): void;
379
- /**
380
- * 模型开始加载
381
- * @param workModel - 归一化的标准 work 中的 model 值
382
- */
383
- modelWillLoad(workModel: WorkModel): void;
384
- /**
385
- * 模型三角面片结构加载完成
386
- * @param model - 加载完的 model 本质是一个 {@link PBMGroup}
387
- */
388
- modelGeometryLoaded(model: Model): void;
389
- /**
390
- * 模型材质结构加载完成
391
- * @param model - 加载完的 model 本质是一个 {@link PBMGroup}
392
- */
393
- modelMaterialLoaded(model: Model): void;
394
- /**
395
- * 模型 bvh树 计算完成
396
- * @description
397
- * bvh 树用于高效的碰撞检测,可以在 `model.bvh` 属性来设置是否开启。默认开启。
398
- * bvh 树计算需要一定事件,可能会暂时影响一些性能。计算完毕后,会对碰撞检测带来质的提升。
399
- * @param model - 加载完的 model 本质是一个 {@link PBMGroup}
400
- */
401
- modelBvhLoaded(model: Model): void;
402
- /**
403
- * 模型加载错误
404
- * @param error - 错误对象
405
- * @param model - 加载完的 model 本质是一个 {@link PBMGroup}
406
- */
407
- modelLoadError(error: Error, model: Model): void;
408
- /**
409
- * 模型加载完成
410
- * @param model - 加载完的 model 本质是一个 {@link PBMGroup}
411
- */
412
- modelLoaded(model: Model): void;
413
- /** 每帧渲染完成 */
414
- renderFrame(): void;
415
- /**
416
- * 当前 fps 变化
417
- * @param fps - 当前刷新率
418
- */
419
- fps(fps: number): void;
420
- /**
421
- * 当目标 state 变化时
422
- * @param state - 当前姿态状态
423
- * @param userAction - 是否用户触发
424
- */
425
- stateChange(state: State, userAction: boolean): void;
426
- /**
427
- * 当前实时 state 变化时
428
- * @param state - 当前姿态状态
429
- * @param userAction - 是否用户触发
430
- */
431
- currentStateChange(state: State, userAction: boolean): void;
432
- /**
433
- * 当 setState 方法被调用
434
- * @param state - 当前姿态状态
435
- */
436
- setState(state: State): void;
437
- /**
438
- * 当 state 被同步完成时
439
- * @param state - 当前姿态状态
440
- */
441
- stateSynced(state: State): void;
442
- /**
443
- * 意图要移动到某个点时, 可以通过 return false 阻止
444
- * @param panoIndex - 意图要移动到点位下标
445
- * @param options - 移动参数
446
- * @param userAction - 是否用户触发
447
- * @returns 可以通过 return false 阻止
448
- */
449
- wantsMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void | false;
450
- /**
451
- * 同 wantsMoveToPano
452
- * @description
453
- * @param panoIndex - 意图要移动到点位下标
454
- * @param options - 移动参数
455
- * @param userAction - 是否用户触发
456
- * @returns 可以通过 return false 阻止
457
- */
458
- wantsToMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void;
459
- /**
460
- * 意图要切换到某个模态, 可以通过 return false 阻止
461
- * @param mode - 意图要切换到的模态
462
- * @param prevMode - 当前模态
463
- * @returns 可以通过 return false 阻止
464
- */
465
- wantsChangeMode(mode: Mode, prevMode: Mode): void | false;
466
- /**
467
- * 模态切换完成
468
- * @param mode - 切换到的模态
469
- * @param prevMode - 上本质是一个模态
470
- * @param panoIndex - 初始化动画结束后的点位下标
471
- * @param toPose - 初始化动画结束后的状态
472
- */
473
- modeChange(mode: Mode, prevMode: Mode, panoIndex: number, toPose: Pose): void;
474
- /** five 被析构。 插件中请监听用于自身析构 */
475
- dispose(): void;
476
- };
477
-
478
- /**
479
- * 如视 VR Web展示器
480
- *
481
- * @example
482
- * ```
483
- * // 初始化构造函数
484
- * const five = new Five();
485
- * // 将绘制区域添加到页面上
486
- * five.appendTo(document.body);
487
- * // 加载 Work 数据
488
- * five.load({...});
489
- * ```
490
- */
491
- export declare class Five extends Subscribe<EventTypes> {
492
- /**
493
- * Five 的显示模式,可以通过 `five.changeMode` `five.setState` 来切换
494
- * @description
495
- * ```text
496
- * Panorama 全景图游走模式
497
- * Model 模型游走模式
498
- * Floorplan 模型查看模式
499
- * Topview 户型图模式
500
- * DepthPanorama 深度图游走模式
501
- * VRPanorama VR眼镜模式
502
- * ```
503
- */
504
- static Mode: Mirror<Mode>;
505
- /** Five 线条*/
506
- static FiveLine: typeof FiveLine;
507
- /** Five 的动画函数*/
508
- static Easing: {
509
- Linear: {
510
- None: (amount: number) => number;
511
- };
512
- Quadratic: {
513
- In: (amount: number) => number;
514
- Out: (amount: number) => number;
515
- InOut: (amount: number) => number;
516
- };
517
- Cubic: {
518
- In: (amount: number) => number;
519
- Out: (amount: number) => number;
520
- InOut: (amount: number) => number;
521
- };
522
- Quartic: {
523
- In: (amount: number) => number;
524
- Out: (amount: number) => number;
525
- InOut: (amount: number) => number;
526
- };
527
- Quintic: {
528
- In: (amount: number) => number;
529
- Out: (amount: number) => number;
530
- InOut: (amount: number) => number;
531
- };
532
- Sinusoidal: {
533
- In: (amount: number) => number;
534
- Out: (amount: number) => number;
535
- InOut: (amount: number) => number;
536
- };
537
- Exponential: {
538
- In: (amount: number) => number;
539
- Out: (amount: number) => number;
540
- InOut: (amount: number) => number;
541
- };
542
- Circular: {
543
- In: (amount: number) => number;
544
- Out: (amount: number) => number;
545
- InOut: (amount: number) => number;
546
- };
547
- Elastic: {
548
- In: (amount: number) => number;
549
- Out: (amount: number) => number;
550
- InOut: (amount: number) => number;
551
- };
552
- Back: {
553
- In: (amount: number) => number;
554
- Out: (amount: number) => number;
555
- InOut: (amount: number) => number;
556
- };
557
- Bounce: {
558
- In: (amount: number) => number;
559
- Out: (amount: number) => number;
560
- InOut: (amount: number) => number;
561
- };
562
- };
563
- /**
564
- * 自动播放状态是否暂停
565
- * @description
566
- * 可以通过 `five.play` `five.pause` 方法播放或暂停
567
- */
568
- paused: boolean;
569
- /** 当前点位序号 */
570
- panoIndex?: number;
571
- /** 当前展示的模式 */
572
- currentMode?: Mode;
573
- /** 内部使用的 `THREE.Scene` */
574
- scene: FiveScene;
575
- /** 内部使用的 `Camera` */
576
- camera: FiveCamera;
577
- /**
578
- * 当前设置的 `scissor`
579
- * @description
580
- * 可通过初始化,或者 setScissor 方式设置
581
- * `scissor` 是将屏幕中的内容渲染到 `renderer` 的指定区域。
582
- * 页面整体长宽均为 `1`。通过类似 css 的 `left` `bottom` `width` `height` 来确定区域。
583
- * @example
584
- * ```
585
- * scissor: { left: 0.75, bottom: 0, width: 0.25, height: 1 }
586
- * ```
587
- */
588
- scissor: Scissor;
589
- /**
590
- * 当前使用的 THREE.WebGLRenderer。
591
- * @description
592
- * 如果初始化时传入了 `renderer` 则直接时该值
593
- * 否则会通过 `preserveDrawingBuffer` `backgroundColor` `backgroundAlpha` `antialias` 创建一个 `THREE.WebGLRenderer`
594
- */
595
- renderer: THREE_2.WebGLRenderer;
596
- /** 当前加载的模型 */
597
- model: Model;
598
- /** 当前加载的 work 数据 */
599
- work?: Work;
600
- /**
601
- * 是否需要渲染
602
- * @description
603
- * 如果初始化设置了 `onlyRenderIfNeeds: true`, 则会激活按需渲染
604
- * 可以通过设置 `five.needsRender = true` 来告知,five 会在下一帧渲染画面。
605
- */
606
- needsRender: boolean;
607
- /**
608
- * 全景图的配置参数
609
- * @description
610
- * 可以动态对配置在 `work` 数据中的全景图片在 runtime 做 url 调整。
611
- * 平衡加载时间和图片质量
612
- */
613
- imageOptions: ImageOptions;
614
- /**
615
- * 模型贴图的配置参数
616
- * @description
617
- * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
618
- * 平衡加载时间和图片质量
619
- */
620
- textureOptions: ImageOptions;
621
- /**
622
- * 模型贴图的配置参数
623
- * @description
624
- * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
625
- * 平衡加载时间和图片质量
626
- */
627
- videoTexture: THREE_2.VideoTexture;
628
- /**
629
- * 当前状态
630
- * @description
631
- * ```text
632
- * five 设置了以下状态
633
- *
634
- * - mode: Mode
635
- * - panoIndex: number
636
- * - longitude: number
637
- * - latitude: number
638
- * - fov: number
639
- * - offset: THREE.Vector3
640
- *
641
- * 可以通过 five.state 和 five.setState 来获取和设置。
642
- * 通过 state 设置后,five 会通过合适的动画运动来达到设置的位置。
643
- * 来迎合一些通过数据驱动的场景。
644
- * ```
645
- */
646
- state: State;
647
- /** 插件暴露的方法 */
648
- plugins: {
649
- [key: string]: FivePluginInstance<any>;
650
- };
651
- private ident;
652
- private modeChangeDuration;
653
- private onlyRenderIfNeeds;
654
- private maxFps;
655
- private controller?;
656
- private destroyed;
657
- private stateSynced;
658
- private controllerInits;
659
- private panoramaLikeSavedPose;
660
- private extraElements;
661
- private moveToPanoQueue?;
662
- private getPixelsRenderTarget;
663
- private tweenCoordinates?;
664
- private readyCallbacks;
665
- private modelPending;
666
- constructor(initArgs?: FiveInitArgs);
667
- /**
668
- * 析构 five 对象。
669
- * @description
670
- * 一旦调用了析构方法,则不能再使用当前 five 对象了。
671
- * 你可以新建一个新的。
672
- */
673
- dispose(): void;
674
- /**
675
- * 设置 `scissor`
676
- * @param scissor - 指定区域
677
- * `scissor` 是将屏幕中的内容渲染到 `renderer` 的指定区域。
678
- * 请确保在 five 初始化时传入 `renderer` 对象
679
- * 页面整体长宽均为 `1`。通过类似 css 的 `left` `bottom` `width` `height` 来确定区域。
680
- * @example
681
- * ```
682
- * five.setScissor({ left: 0.75, bottom: 0, width: 0.25, height: 1 })
683
- * ```
684
- */
685
- setScissor(scissor: Scissor): void;
686
- /**
687
- * 将显示区域加载到页面 DOM 中
688
- * @description
689
- * 如果你是传入的 `renderer`. 则你需要自行来方式显示区域该方法并不生效
690
- *
691
- * @param element - 加载到页面的 DOM 元素
692
- * @param size - 显示区域尺寸 默认铺满这个 DOM 元素
693
- */
694
- appendTo(element: HTMLElement, size?: {
695
- width?: number;
696
- height?: number;
697
- }): void;
698
- /**
699
- * 设置显示区域尺寸
700
- * @description
701
- * 如果你是传入的 `renderer`. 则你需要自行来设置显示区域尺寸,该方法并不生效
702
- *
703
- * @param size - 显示区域尺寸 默认铺满这个 DOM 元素
704
- * @param pixelRatio - 像素比 默认继承之前的设置
705
- */
706
- refresh(size?: {
707
- width?: number;
708
- height?: number;
709
- }, pixelRatio?: number): void;
710
- /**
711
- * 绑定一个额外 DOM 区域,接受触控/鼠标事件
712
- * @returns 解除该绑定
713
- */
714
- addExtraElement(element: HTMLElement): () => void;
715
- /**
716
- * 解除绑定的一个额外 DOM 区域
717
- */
718
- removeExtraElement(element: HTMLElement): void;
719
- /**
720
- * 获取当前相机姿态, 可以使用 getCurrentState 代替
721
- */
722
- getPose(): Pose;
723
- /**
724
- * 移动相机。(不触发点位移动)
725
- * @description
726
- * 如果动画中途被打断(用户触发行为,或者调用 setState, load, changeMode)的等
727
- * 会 Promise.reject。运动完成则 Promise.resolve
728
- * @param pose - 相机目标位置
729
- * @param duration - 动画触发的时常
730
- * @returns Promise 是否移动成功
731
- */
732
- updateCamera(pose: Partial<Pose>, duration: number): Promise<void>;
733
- /**
734
- * 获取当前相机经纬度
735
- * @deprecated 请使用使用 getPose
736
- */
737
- getLongitudeAndLatitude(): Pick<Pose, "longitude" | "latitude">;
738
- /**
739
- * 获取当前相机位置
740
- * @deprecated 请使用使用 getPose
741
- */
742
- getOffset(): Pose["offset"];
743
- /**
744
- * 获取当前相机的姿态(用于内部的 python 脚本截图)
745
- * @deprecated 这是用于内部的 python 脚本截图
746
- */
747
- getCameraLocal(): {
748
- theta: number;
749
- phi: number;
750
- lookAtVector: THREE_2.Vector3;
751
- };
752
- /**
753
- * 初始化 initBasisLoader
754
- * @description
755
- * 同初始化的 initBasisLoader 参数。用于初始化 basisLoader。
756
- * basisLoader 只会初始化一次,一旦初始化则不会再修改。
757
- *
758
- * @param transcoderResourcePath - basis 解析器路径
759
- * 如果不设置,使用默认解析器 basis 解析器。
760
- * 可以传入解析器的 `resourcePath`, 则使用指定的解析器
761
- * @example
762
- * ```
763
- * // 使用默认解析器
764
- * five.initialBasisLoader();
765
- *
766
- * // 使用指定解析器
767
- * // 会调用这个目录下的 basis_transcoder.js basis_transcoder.wasm 文件作为解析器
768
- * five.initialBasisLoader("https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/");
769
- * ```
770
- */
771
- initBasisLoader(transcoderResourcePath?: string): void;
772
- /**
773
- * 加载 Work 数据
774
- * @param inputWork - Work 数据
775
- * @param state - 初始化姿态
776
- * - "inherit" 使用当前姿态
777
- * - "initial" 使用 Work 数据中的 initial 姿态
778
- * - State 自定义姿态
779
- * @param duration - 切换时间
780
- */
781
- load(inputWork: Work | LooseWork | any, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number): Promise<void>;
782
- /**
783
- * 切换模态
784
- * @param mode - 切换到的模态
785
- * @param state - 切换完成时的姿态
786
- * @param duration - 模态切换动画用时
787
- * @param userAction - 是否时用户动作触发 默认 true
788
- */
789
- changeMode<T extends Mode>(mode: T, state?: Partial<Omit<State, "mode">>, duration?: number, userAction?: boolean): Promise<void>;
790
- /**
791
- * 获取画面中的像素颜色
792
- * @param x - 获取像素区域的起始坐标 x
793
- * @param y - 获取像素区域的起始坐标 y
794
- * @param width - 获取像素区域的宽度
795
- * @param height - 获取像素区域的高度
796
- * @param pixelRatio - 获取区域的像素比
797
- * @returns rgba颜色平铺的 Uint8Array
798
- */
799
- getPixels(x: number, y: number, width: number, height: number, pixelRatio?: number): Uint8Array;
800
- /**
801
- * 获取显示用的画布(Canvas DOM节点)
802
- */
803
- getElement(): HTMLCanvasElement;
804
- /**
805
- * 但停自动播放
806
- */
807
- pause(): void;
808
- /**
809
- * 强制渲染
810
- * @description
811
- * 调用 `five.render()` 和设置 `five.needsRender = true` 均可在按需渲染时,使得画面渲染一次
812
- * 区别在于:
813
- * - `five.needsRender = true` 为在下帧渲染画面
814
- * - `five.render()` 在当前帧渲染画面
815
- * 推荐使用 `five.needsRender = true`, 可以更加流畅。但是如果需要截图等同步操作,可以使用 `five.render()`
816
- *
817
- * @param callback - 渲染完成回调
818
- */
819
- render(callback?: () => void): void;
820
- play(): void;
821
- /**
822
- * 转化到 Panorama 模态,并移动到对应序号的观察点。
823
- * @param panoIndex - 观察点序号
824
- * @param options - 移动点位参数
825
- * @param userAction - 是否用户触犯
826
- */
827
- moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): void;
828
- /**
829
- * 预加载点位图片资源
830
- * @param panoIndex - 观察点序号
831
- * @param callback - 加载完成回调, 并传递加载用时。
832
- * @returns 加载完成的 Promise 参数同 callback
833
- */
834
- preloadPano(panoIndex: number, callback?: (costs: number) => void): Promise<number>;
835
- /**
836
- * 计算三维坐标对应到屏幕的二维坐标
837
- * @description
838
- * 如果三维坐标不在屏幕中,则返回 null
839
- * @param vector - 三维坐标
840
- * @param testModel - 是否计算模型遮挡
841
- * @returns 二维坐标 或者 null
842
- */
843
- project2d(vector: THREE_2.Vector3, testModel?: boolean): THREE_2.Vector2 | null;
844
- /**
845
- * 获取当前在屏幕视锥中的 mesh。
846
- * @param object - 如果传入则检查这个对象中的mesh,如果不传,则检查整个 scene
847
- */
848
- getRenderMeshes(object?: THREE_2.Object3D): THREE_2.Object3D[];
849
- getCurrentState(): State;
850
- /**
851
- * 设置 State
852
- * @description
853
- * ```text
854
- * five 设置了以下状态
855
- *
856
- * - mode: Mode
857
- * - panoIndex: number
858
- * - longitude: number
859
- * - latitude: number
860
- * - fov: number
861
- * - offset: THREE.Vector3
862
- *
863
- * 可以通过 five.state 和 five.setState 来获取和设置。
864
- * 通过 state 设置后,five 会通过合适的动画运动来达到设置的位置。
865
- * 来迎合一些通过数据驱动的场景。
866
- * ```
867
- * @param state - 目标状态
868
- * @param immediately - 是否马上转换,马上转换会尽快达到目标状态,尽量减少中间状态,更少动画。
869
- */
870
- setState(state: Partial<State>, immediately?: boolean): void;
871
- private syncState;
872
- ready(): Promise<void>;
873
- private updateResolution;
874
- private throwError;
875
- private loadModel;
876
- private commonParams;
877
- private saveControllerPose;
878
- private applyController;
879
- }
880
-
881
- /** Five 相机 */
882
- export declare class FiveCamera extends THREE_2.PerspectiveCamera {
883
- /** 相机姿态 */
884
- pose: Pose;
885
- constructor(fov: number);
886
- /** 通过相机参数反算姿态 */
887
- computePose(): void;
888
- /** 设置相机姿态 */
889
- setFromPose(pose: Partial<Pose>): void;
890
- /** 拷贝相机姿态 */
891
- copyPose(): Pose;
892
- }
893
-
894
- export declare class FiveHashCubeTexture extends THREE_2.CubeTexture {
895
- /** 识别哈希 */
896
- hash: string;
897
- }
898
-
899
- /** Five 初始化参数 */
900
- export declare interface FiveInitArgs {
901
- /**
902
- * 外部传入的 `THREE.WebGLRenderer`。
903
- * @description
904
- * 如果需要使用 `scissor` 分割画布功能,则必须使用外部传入 renderer,
905
- * 并且设置为 `preserveDrawingBuffer: false`。
906
- * 如果设置了 `renderer`, 则 `preserveDrawingBuffer`
907
- * `backgroundColor` `backgroundAlpha` `antialias`
908
- * 均不再生效。
909
- */
910
- renderer?: THREE_2.WebGLRenderer;
911
- /**
912
- * 内部 `THREE.WebGLRenderer` 是否通过像素拷贝的方式绘制。
913
- * @description
914
- * 当你想做屏幕截图等要确定取得屏幕像素时,请设置为 `true`。
915
- * 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
916
- * @default `false`
917
- */
918
- preserveDrawingBuffer?: boolean;
919
- /**
920
- * 输出画面的背景颜色。
921
- * @description
922
- * 通过数字类型传入。
923
- * 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
924
- * @default `0x181A1C`
925
- * @example
926
- * ```
927
- * backgroundColor: 0xffffff // 白色
928
- * backgroundColor: 0xff0000 // 红色
929
- * ```
930
- */
931
- backgroundColor?: number;
932
- /**
933
- * 输出画面的背景透明度
934
- * @description
935
- * 通过数字类型传入。取值范围 [0-1]
936
- * 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
937
- * @default `1`
938
- */
939
- backgroundAlpha?: number;
940
- /**
941
- * 是否开启 `THREE.WebGLRenderer` 的抗锯齿功能
942
- * @description
943
- * 这个抗锯齿功能是 `WEBGL` 自带的抗锯齿,并不是类似 fxaa taa 等后处理方式,比较吃性能。
944
- * 如果设置了参数 `renderer` 参数,则不生效,请对传入的 `renderer` 自行设置。
945
- * @default `false`
946
- */
947
- antialias?: boolean;
948
- /**
949
- * 屏幕渲染区域
950
- * @description
951
- * 请确保设置了 `renderer` 参数,`scissor` 参数才可生效
952
- * `scissor` 是将屏幕中的内容渲染到 `renderer` 的指定区域。
953
- * 页面整体长宽均为 `1`。通过类似 css 的 `left` `bottom` `width` `height` 来确定区域。
954
- * @example
955
- * ```
956
- * scissor: { left: 0.75, bottom: 0, width: 0.25, height: 1 }
957
- * ```
958
- */
959
- scissor?: Scissor;
960
- /**
961
- * 是否自动播放。
962
- * @description
963
- * 播放即把内存中计算的内容渲染到画面上。play则是进行每帧播放。
964
- * 如果 `play: false` 则不自动播放。屏幕不显示。
965
- * 你还可以通过 `five.play()` `five.pause()` 的方式来控制播放。
966
- * @default `true`
967
- */
968
- play?: boolean;
969
- /**
970
- * 全景图的配置参数
971
- * @description
972
- * 可以动态对配置在 `work` 数据中的全景图片在 runtime 做 url 调整。
973
- * 平衡加载时间和图片质量
974
- */
975
- imageOptions?: ImageOptions;
976
- /**
977
- * 模型贴图的配置参数
978
- * @description
979
- * 可以动态对配置在 `work` 数据中的模型贴图在 runtime 做 url 调整。
980
- * 平衡加载时间和图片质量
981
- */
982
- textureOptions?: ImageOptions;
983
- /**
984
- * 是否按需渲染
985
- * @description
986
- * 按需渲染时,如果页面中的渲染有 `needsRender: true` 属性。或者 `five.needsRender: true` 时
987
- * 才会重新渲染屏幕,降低无用渲染产生的消耗。
988
- * @default `true`
989
- */
990
- onlyRenderIfNeeds?: boolean;
991
- /**
992
- * 最高 fps 限制
993
- * @description
994
- * 如果为 `false`, 则不限制。最好也就是屏幕刷新率,不会再高了。
995
- * @default `false`
996
- */
997
- maxFps?: number | false;
998
- /**
999
- * 是否初始化 `basisLoader`。
1000
- * @description
1001
- * 当你需要加载 basis 格式图片时请启用。
1002
- * 如果设置为 `true` 使用默认解析器 basis 解析器。
1003
- * 如果要自定义,可以传入解析器的 `resourcePath`, 则使用指定的解析器
1004
- * @default `false`
1005
- * @example
1006
- * ```
1007
- * // 使用默认解析器
1008
- * initialBasisLoader: true
1009
- *
1010
- * // 使用指定解析器
1011
- * // 会调用这个目录下的 basis_transcoder.js basis_transcoder.wasm 文件作为解析器
1012
- * initialBasisLoader: "https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/"
1013
- * ```
1014
- */
1015
- initialBasisLoader?: boolean | string;
1016
- /**
1017
- * 外挂视频对象。
1018
- * @description
1019
- * 当点位中有视频元素,则会使用。如果不传入也会外部新建,
1020
- * 加入传入的原因是,视频自动播放在不同浏览器或者 webview 中有不同的特性。
1021
- * 给予更多外部操作的空间。
1022
- */
1023
- videoInstance?: HTMLVideoElement;
1024
- /** 全景图游走模式下的特定参数 */
1025
- panorama?: ControllerCustomInitTypes["Panorama"];
1026
- /** 模型游走模式下的特定参数 */
1027
- model?: ControllerCustomInitTypes["Model"];
1028
- /** 模型查看模式下的特定参数 */
1029
- floorplan?: ControllerCustomInitTypes["Floorplan"];
1030
- /** 户型图模式下的特定参数 */
1031
- topview?: ControllerCustomInitTypes["Topview"];
1032
- /** 深度图游走模式下的特定参数 */
1033
- depthPanorama?: ControllerCustomInitTypes["DepthPanorama"];
1034
- /** VR眼镜模式下的特定参数 */
1035
- vrPanorama?: ControllerCustomInitTypes["VRPanorama"];
1036
- /**
1037
- * 模式间切换时的过度动画时间
1038
- * @description
1039
- * 单位毫秒
1040
- * @default `1000`
1041
- */
1042
- modeChangeDuration?: number;
1043
- /**
1044
- * 插件定义
1045
- * @description
1046
- * 详见插件部分。
1047
- */
1048
- plugins?: (FivePlugin<void> | FivePluginInit<FivePlugin<any, any>> | FivePluginInit<FivePlugin<void, any>>)[];
1049
- }
1050
-
1051
- export declare class FiveLine extends THREE_2.Object3D {
1052
- private line;
1053
- private points;
1054
- constructor(vector0?: THREE_2.Vector3, vector1?: THREE_2.Vector3);
1055
- setPoints(vector0: THREE_2.Vector3, vector1: THREE_2.Vector3): void;
1056
- getPoints(): THREE_2.Vector3[];
1057
- setMaterial(map: ConstructorParameters<typeof FiveLineMaterial>[0]): void;
1058
- setResolution(width: number, height: number): void;
1059
- }
1060
-
1061
- export declare class FiveLineGeometry extends FiveLineSegmentsGeometry {
1062
- constructor();
1063
- setPositions(array: ArrayLike<number>): this;
1064
- setColors(array: ArrayLike<number>): this;
1065
- fromLine(line: THREE_2.Line): this;
1066
- copy(): this;
1067
- }
1068
-
1069
- export declare class FiveLineMaterial extends THREE_2.ShaderMaterial {
1070
- color: number | THREE_2.Vector3;
1071
- dashed: boolean;
1072
- dashScale: number;
1073
- dashSize: number;
1074
- gapSize: number;
1075
- resolution: THREE_2.Vector2;
1076
- constructor(parameters: FiveLineMaterialParameters);
1077
- }
1078
-
1079
- export declare type FiveLineMaterialParameters = {
1080
- color?: number | THREE_2.Vector3;
1081
- linewidth?: number;
1082
- dashed?: boolean;
1083
- dashScale?: number;
1084
- dashSize?: number;
1085
- gapSize?: number;
1086
- resolution?: THREE_2.Vector2;
1087
- };
1088
-
1089
- export declare class FiveLineSegmentsGeometry extends THREE_2.InstancedBufferGeometry {
1090
- constructor();
1091
- applyMatrix4(matrix: THREE_2.Matrix4): this;
1092
- setPositions(array: ArrayLike<number> | number[]): this;
1093
- setColors(array: Float32Array | number[]): this;
1094
- fromWireframeGeometry(geometry: THREE_2.WireframeGeometry): this;
1095
- fromEdgesGeometry(geometry: THREE_2.EdgesGeometry): this;
1096
- fromMesh(mesh: THREE_2.Mesh): this;
1097
- fromLineSegments(lineSegments: THREE_2.LineSegments): this;
1098
- computeBoundingBox(): void;
1099
- computeBoundingSphere(): void;
1100
- toJSON(): void;
1101
- }
1102
-
1103
- /**
1104
- * Five 插件
1105
- * [[include:plugins.md]]
1106
- * @template Parameters - 插件参数, 没有参数则为 void
1107
- * @template Returns - 如果有参数则插件暴露的 api,没有参数则不传
1108
- */
1109
- export declare type FivePlugin<Parameters = void, Returns = void> = Parameters extends void ? ((five: Five) => Returns) : ((five: Five, parameters: Parameters) => Returns);
1110
-
1111
- /**
1112
- * 获取插件在Five中的初始化结构
1113
- * @template T - Five 插件
1114
- */
1115
- export declare type FivePluginInit<T extends FivePlugin<any, any>> = Parameters<T>[1] extends undefined ? [
1116
- Plugin: T,
1117
- instanceName: null | string
1118
- ] : [
1119
- Plugin: T,
1120
- instanceName: null | string,
1121
- parameters: Parameters<T>[1]
1122
- ];
1123
-
1124
- /**
1125
- * 获取插件暴露的 api
1126
- * @template T - Five 插件
1127
- */
1128
- export declare type FivePluginInstance<T extends FivePlugin<any, any>> = ReturnType<T>;
1129
-
1130
- /** Five 场景*/
1131
- export declare class FiveScene extends THREE_2.Scene {
1132
- }
1133
-
1134
- export declare interface FloorplanControllerCustomInitArgs {
1135
- /** 默认偏航角 */
1136
- defaultLongitude?: number;
1137
- /** 默认俯仰角 */
1138
- defaultLatitude?: number;
1139
- /** 最大俯仰角 */
1140
- maxLatitude?: number;
1141
- /** 最小俯仰角 */
1142
- minLatitude?: number;
1143
- /** 默认相机可视角度(垂直),可作为 `zoom` */
1144
- defaultFov?: number;
1145
- /** 最大相机可视角度 */
1146
- maxFov?: number;
1147
- /** 最小相机可视角度 */
1148
- minFov?: number;
1149
- }
1150
-
1151
- export declare type GestureTypes = "pan" | "tap" | "pinch" | "mouseWheel";
1152
-
1153
- export declare function getViewportScale(): number;
1154
-
1155
- /**
1156
- * 图片参数
1157
- */
1158
- export declare interface ImageOptions {
1159
- key?: string;
1160
- /**
1161
- * url 地址转化
1162
- * @param url - 原始地址
1163
- * @param options - 当前地址参数
1164
- * @returns 转化后地址
1165
- */
1166
- transform?: (url: string, options: ImageOptions) => string;
1167
- /** 图片尺寸参数 */
1168
- size?: number;
1169
- /** 图片质量参数(0-100) */
1170
- quality?: number;
1171
- /** 图片格式参数(jpg, png) */
1172
- format?: string;
1173
- /** basis loader 是否初始化完成 */
1174
- basisLoaderInitialized?: boolean;
1175
- /** 针对 textureOptions 是否自动通过模型贴图的数量计算需要的模型贴图的尺寸 默认 true */
1176
- autoResize?: boolean;
1177
- }
1178
-
1179
- export declare class InternalWebGLRenderer extends THREE_2.WebGLRenderer {
1180
- constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias }: {
1181
- preserveDrawingBuffer?: boolean;
1182
- backgroundColor?: number | THREE_2.Color;
1183
- backgroundAlpha?: number;
1184
- pixelRatio?: number;
1185
- antialias?: boolean;
1186
- });
1187
- }
1188
-
1189
- export declare interface Intersection {
1190
- /** 焦点坐标 */
1191
- point: THREE_2.Vector3;
1192
- /** 焦点面片 */
1193
- face?: {
1194
- normal: THREE_2.Vector3;
1195
- } | null;
1196
- /** 焦点距离 */
1197
- distance: number;
1198
- }
1199
-
1200
- export declare interface IntersectMeshInterface extends THREE_2.Object3D {
1201
- dispose(): void;
1202
- }
1203
-
1204
- export declare type LooseWork = {
1205
- bvh?: boolean;
1206
- modelAsync?: boolean;
1207
- initial?: LooseWorkInitial;
1208
- base_url?: string;
1209
- model?: LooseWorkModel;
1210
- panorama: {
1211
- base_url?: string;
1212
- pano_high_cube_base_url?: string;
1213
- info?: LooseWorkPanorama[];
1214
- list?: LooseWorkPanorama[];
1215
- };
1216
- observers: LooseWorkObserver[];
1217
- };
1218
-
1219
- export declare type LooseWorkInitial = {
1220
- pano_index?: number;
1221
- pano?: number;
1222
- longitude?: number;
1223
- latitude?: number;
1224
- heading?: number;
1225
- };
1226
-
1227
- export declare type LooseWorkModel = {
1228
- file_url: string;
1229
- material_textures?: string[];
1230
- material_base_url?: string;
1231
- };
1232
-
1233
- export declare type LooseWorkObserver = {
1234
- active?: boolean;
1235
- index?: number;
1236
- visible_nodes: number[];
1237
- accessible_nodes: number[];
1238
- quaternion: {
1239
- y: number;
1240
- x: number;
1241
- z: number;
1242
- w: number;
1243
- };
1244
- standing_position: number[];
1245
- position: number[];
1246
- floor?: number;
1247
- floor_index?: number;
1248
- };
1249
-
1250
- export declare type LooseWorkPanorama = {
1251
- active?: boolean;
1252
- loadable?: boolean;
1253
- index?: number;
1254
- up: string;
1255
- down: string;
1256
- right: string;
1257
- left: string;
1258
- front: string;
1259
- back: string;
1260
- video?: LooseWorkVideo;
1261
- tiles?: string;
1262
- };
1263
-
1264
- export declare type LooseWorkVideo = {
1265
- source: string;
1266
- matrix: number[];
1267
- size: number[];
1268
- };
1269
-
1270
- export declare type Mirror<T extends string> = Record<T, T>;
1271
-
1272
- /**
1273
- * Five 的显示模式,可以通过 `five.changeMode` `five.setState` 来切换
1274
- * - **Panorama**: 全景图游走模式
1275
- * - **Model**: 模型游走模式
1276
- * - **Floorplan**: 模型查看模式
1277
- * - **Topview**: 户型图模式
1278
- * - **DepthPanorama**: 深度图游走模式
1279
- * - **VRPanorama**: VR眼镜模式
1280
- */
1281
- export declare type Mode =
1282
- /** 模型查看模式 */
1283
- "Floorplan" |
1284
- /** 户型图模式 */
1285
- "Topview" |
1286
- /** 全景图游走模式 */
1287
- "Panorama" |
1288
- /** VR眼镜模式 */
1289
- "VRPanorama" |
1290
- /** 模型游走模式 */
1291
- "Model" |
1292
- /** 深度图游走模式 */
1293
- "DepthPanorama";
1294
-
1295
- /**
1296
- * Five 模型
1297
- * @description
1298
- * 通过 work 数据加载, 适配 at3d、pbm、dome、domez 格式的文件
1299
- * 可以通过 jsonp 解析 base64 的 dataURL 内容,
1300
- * 需要满足 your/path/filename.at3d.json_xxxxxx,
1301
- * 通过 json_xxxxxx(<dataURL>) 方式返回。
1302
- */
1303
- export declare class Model extends PBMGroup implements Subscribe<ModelEventType> {
1304
- /** 是否加载完成 */
1305
- loaded: boolean;
1306
- /** 是否未加载 */
1307
- empty: boolean;
1308
- /** 外接盒子的大小 */
1309
- bounding: THREE_2.Box3;
1310
- /** 当前显示的楼层 */
1311
- shownfloor: number | null;
1312
- /**
1313
- * 判断是否注册了事件
1314
- * 具体可查看 {@link Subscribe.hasListener}
1315
- */
1316
- hasListener: SubscribeMixinType.hasListener<ModelEventType>;
1317
- /**
1318
- * 注册事件
1319
- * 具体可查看 {@link Subscribe.on}
1320
- */
1321
- on: SubscribeMixinType.on<ModelEventType>;
1322
- /**
1323
- * 注册事件(是否只执行一次)
1324
- * 具体可查看 {@link Subscribe.once}
1325
- */
1326
- once: SubscribeMixinType.once<ModelEventType>;
1327
- /**
1328
- * 解除事件
1329
- * 具体可查看 {@link Subscribe.off}
1330
- */
1331
- off: SubscribeMixinType.off<ModelEventType>;
1332
- /**
1333
- * 触发事件
1334
- * 具体可查看 {@link Subscribe.emit}
1335
- */
1336
- emit: SubscribeMixinType.emit<ModelEventType>;
1337
- /** bvh 树的计算结果 */
1338
- bvhs: any[] & {
1339
- loaded?: boolean;
1340
- };
1341
- constructor();
1342
- /**
1343
- * 获取模型边界线
1344
- * @param threshold - 面片间夹角阈值
1345
- * @returns 所有模型边界线
1346
- */
1347
- getEdges(threshold?: number): THREE_2.Line3[];
1348
- /** 获取当前楼层数 */
1349
- hasFloors(): number;
1350
- /**
1351
- * 显示某楼层
1352
- * @example
1353
- * ```
1354
- * model.show() //显示全部楼层
1355
- * model.show(1) //显示第一楼层
1356
- * model.show(1, 0) //显示第一楼层, 并且其他楼层透明度为 0
1357
- * ```
1358
- */
1359
- show(): void;
1360
- show(floorIndex: number, hideOpacity?: number): void;
1361
- /**
1362
- * 计算模型射线碰撞检测
1363
- * @param raycaster - THREE 射线对象
1364
- * @param floors - 和某一楼层做碰撞检测, 不传为和所有楼层做碰撞检测
1365
- * @returns 返回碰撞
1366
- */
1367
- intersectRaycaster(raycaster: THREE_2.Raycaster, floors?: number | number[]): Intersection[];
1368
- buildBVH(): Promise<void>;
1369
- /**
1370
- * 加载模型
1371
- * @param workModel - work 的 model 内容
1372
- * @param imageOptions - 图片参数
1373
- */
1374
- load(workModel: WorkModel, imageOptions?: ImageOptions): void;
1375
- /**
1376
- * 析构函数
1377
- * @description
1378
- * 一旦析构,则不能使用
1379
- */
1380
- dispose(): void;
1381
- }
1382
-
1383
- export declare interface ModelControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
1384
- }
1385
-
1386
- /**
1387
- * Five 模型事件列表
1388
- * @description
1389
- * 可以通过 `five.model.on(METHOD_NAME, METHOD)` 调用
1390
- */
1391
- export declare interface ModelEventCallback extends ModelEventType {
1392
- }
1393
-
1394
- /**
1395
- * 模型事件列表
1396
- * @description
1397
- * 具体事件列表 请查看 {@link ModelEventCallback}
1398
- */
1399
- export declare type ModelEventType = {
1400
- /**
1401
- * 模型 bvh树 计算完成
1402
- * @description
1403
- * bvh 树用于高效的碰撞检测,可以在 `model.bvh` 属性来设置是否开启。默认开启。
1404
- * bvh 树计算需要一定事件,可能会暂时影响一些性能。计算完毕后,会对碰撞检测带来质的提升。
1405
- */
1406
- bvhLoaded(): void;
1407
- /** 模型三角面片结构加载完成 */
1408
- geometryLoaded(): void;
1409
- /** 模型材质结构加载完成 */
1410
- materialLoaded(): void;
1411
- /** 模型加载完成 */
1412
- loaded(): void;
1413
- /**
1414
- * 内部错误
1415
- * @param error - 错误对象
1416
- */
1417
- error(error: Error): void;
1418
- };
1419
-
1420
- /**
1421
- * 点位移动参数
1422
- */
1423
- export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
1424
- /** 是否通过初始化参数限制 fov, latitude */
1425
- limit?: boolean;
1426
- /**
1427
- * 动画模式
1428
- * @description
1429
- * - `fly` 通过相机移动方式变化
1430
- * - `fade` 通过渐变方式变化
1431
- * - `instant` 通过插入黑屏方式变化
1432
- */
1433
- effect?: "fly" | "fade" | "instant";
1434
- /**
1435
- * 运动耗时
1436
- * @description
1437
- * - `数字或者字符串类型` 直接当作运动耗时
1438
- * - `函数类型` 传入 距离和速度(速度为five初始化设置) 返回运动耗时
1439
- * - `不传或者null` 通过距离和速度(速度为five初始化设置)
1440
- */
1441
- duration?: number | ((distance: number, speed: number) => number) | string | null;
1442
- /** 运动曲线函数 */
1443
- easing?: (k: number) => number;
1444
- /** 运动开始回调 */
1445
- moveStartCallback?: (panoIndex: number, toPose: Pose) => void;
1446
- /** 运动结束回调 */
1447
- moveEndCallback?: (panoIndex: number, pose: Pose) => void;
1448
- /**
1449
- * 运动被取消回调
1450
- * @description
1451
- * 这个有一些情况会导致
1452
- * - 移动过程中切换模态
1453
- * - 移动过程中 five 被析构
1454
- * - 移动过程点击切换到另一个点位
1455
- */
1456
- moveCancelCallback?: () => void;
1457
- }
1458
-
1459
- export declare interface PanoCircleMeshInterface extends THREE_2.Object3D {
1460
- needsRender: boolean;
1461
- loading: boolean;
1462
- disabled: boolean;
1463
- panoIndex: number;
1464
- setLoading(shown: boolean): void;
1465
- setDisabled(disabled: boolean): void;
1466
- setProgress(progress: number): void;
1467
- setOpacity(opacity: number): void;
1468
- dispose(): void;
1469
- }
1470
-
1471
- export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
1472
- /** 最远可移动观察点距离 */
1473
- maxAccessibleDistance?: number;
1474
- /**
1475
- * 点击地面观察点标识的判定范围
1476
- * @description
1477
- * 如果在判定范围内则确定去到目标点,
1478
- * 否则寻找点击位置方向最适合的点(可能会走到一个离相机更近的点)。
1479
- */
1480
- panoTapTriggerRadius?: number;
1481
- /** 地面观察点标识自定义创建器 */
1482
- panoCircleMeshCreator?: () => PanoCircleMeshInterface;
1483
- }
1484
-
1485
- export declare interface PanoramaLikeControllerCustomInitArgs {
1486
- /** 默认相机偏航角 */
1487
- defaultLongitude?: number;
1488
- /** 默认相机俯仰角 */
1489
- defaultLatitude?: number;
1490
- /** 最大相机俯仰角 */
1491
- maxLatitude?: number;
1492
- /** 最小相机俯仰角 */
1493
- minLatitude?: number;
1494
- /** 默认相机可视角度(垂直),可作为 `zoom` */
1495
- defaultFov?: number;
1496
- /** 最大默认相机可视角度(垂直) */
1497
- maxFov?: number;
1498
- /** 最小默认相机可视角度(垂直) */
1499
- minFov?: number;
1500
- /**
1501
- * 点位间移动动画速度 单位 m/s
1502
- * @description
1503
- * 这边设置的是速度,整体耗时会通过距离除速度计算得到
1504
- */
1505
- moveSpeed?: number;
1506
- /** 鼠标焦点环自定义创建器 */
1507
- intersectMeshCreator?: () => IntersectMeshInterface;
1508
- }
1509
-
1510
- export declare function parseWork(obj: Work | LooseWork | any): Work;
1511
-
1512
- /** PBM 模型组 */
1513
- export declare class PBMGroup extends THREE_2.Group {
1514
- /** 楼层序号 */
1515
- floorIndex: number;
1516
- /** 是否需要更新按需渲染 */
1517
- needsRender: boolean;
1518
- /** 获取是否有透明参数 */
1519
- getTransparent(): boolean;
1520
- /** 设置透明参数 */
1521
- setTransparent(bool: boolean): void;
1522
- /** 获取材质参数 */
1523
- getMaterial(): PBMParameters | null;
1524
- /** 设置材质参数 */
1525
- setMaterial(parameters: Partial<PBMParameters>): void;
1526
- /** 析构材质 */
1527
- disposeMaterial(): void;
1528
- /** 析构模型网格 */
1529
- disposeGeometry(): void;
1530
- }
1531
-
1532
- /** PBM 材质 */
1533
- export declare class PBMMaterial extends THREE_2.ShaderMaterial implements PBMParameters {
1534
- /** 起始点位全景图 */
1535
- pano0Map: FiveHashCubeTexture | null;
1536
- /** 起始点全景图变换矩阵 4x4 */
1537
- pano0Matrix: THREE_2.Matrix4;
1538
- /** 结束点位全景图 */
1539
- pano1Map: FiveHashCubeTexture | null;
1540
- /** 结束点全景图变换矩阵 4x4 */
1541
- pano1Matrix: THREE_2.Matrix4;
1542
- /** 模型贴图和全景图的混合程度 [0-1] */
1543
- modelAlpha: number;
1544
- /** 全景图混合程度 [0-1] */
1545
- progress: number;
1546
- /** 全景图通过过度黑色混合 */
1547
- useBlackTransition: boolean;
1548
- perspToOrtho: number;
1549
- /** 模型透明度 */
1550
- opacity: number;
1551
- /** 起始点位深度, 需要使用深度参与计算全景图混合的话 */
1552
- pano0DepthMap: THREE_2.CubeTexture | null;
1553
- /** 全景视频贴图 */
1554
- panoVideoMap: THREE_2.VideoTexture | null;
1555
- /** 全景视频尺寸 */
1556
- panoVideoSize: THREE_2.Vector2;
1557
- /** 全景视频贴图变换矩阵 */
1558
- panoVideoMatrix: THREE_2.Matrix4;
1559
- /** 全景视频透明度 [0-1] */
1560
- panoVideoAlpha: number;
1561
- /** 瓦片材质 */
1562
- panoTileMap: THREE_2.Texture | null;
1563
- /** 瓦片寻址规则 */
1564
- panoTileMappings: THREE_2.Vector4[][] | null;
1565
- constructor(parameters?: Partial<PBMParameters>);
1566
- }
1567
-
1568
- /** PBM 对象 */
1569
- export declare class PBMMesh extends THREE_2.Mesh<THREE_2.BufferGeometry, PBMMaterial[]> {
1570
- /** 楼层序号 */
1571
- floorIndex: number;
1572
- /** 是否需要更新按需渲染 */
1573
- needsRender: boolean;
1574
- }
1575
-
1576
- /** PBM 材质参数 */
1577
- export declare interface PBMParameters {
1578
- /** 起始点位全景图 */
1579
- pano0Map: FiveHashCubeTexture | null;
1580
- /** 起始点全景图变换矩阵 4x4 */
1581
- pano0Matrix: THREE_2.Matrix4;
1582
- /** 结束点位全景图 */
1583
- pano1Map: FiveHashCubeTexture | null;
1584
- /** 结束点位全景图变换矩阵 */
1585
- pano1Matrix: THREE_2.Matrix4;
1586
- /** 模型贴图和全景图的混合程度 [0-1] */
1587
- modelAlpha: number;
1588
- /** 全景图混合程度 [0-1] */
1589
- progress: number;
1590
- /** 全景图通过过度黑色混合 */
1591
- useBlackTransition: boolean;
1592
- perspToOrtho: number;
1593
- /** 模型透明度 */
1594
- opacity: number;
1595
- /** 起始点位深度, 需要使用深度参与计算全景图混合的话 */
1596
- pano0DepthMap: THREE_2.CubeTexture | null;
1597
- /** 全景视频贴图 */
1598
- panoVideoMap: THREE_2.VideoTexture | null;
1599
- /** 全景视频尺寸 */
1600
- panoVideoSize: THREE_2.Vector2;
1601
- /** 全景视频贴图变换矩阵 */
1602
- panoVideoMatrix: THREE_2.Matrix4;
1603
- /** 全景视频透明度 [0-1] */
1604
- panoVideoAlpha: number;
1605
- /** 瓦片材质 */
1606
- panoTileMap: THREE_2.Texture | null;
1607
- /** 瓦片寻址规则 */
1608
- panoTileMappings: THREE_2.Vector4[][] | null;
1609
- }
1610
-
1611
- /**
1612
- * 相机位姿
1613
- * [[include: coordinate.md]]
1614
- */
1615
- export declare interface Pose {
1616
- /** 相机俯仰角 */
1617
- longitude: number;
1618
- /** 相机偏航角 */
1619
- latitude: number;
1620
- /** 相机可视角度(垂直)*/
1621
- fov: number;
1622
- /** 相机位置*/
1623
- offset: THREE_2.Vector3;
1624
- }
1625
-
1626
- export declare const PROXY_CONTROLLER_EVENT_NAMES: readonly ["cameraDirectionUpdate", "cameraUpdate", "cameraPositionUpdate", "panoSelected", "moveToPano", "moveToPanoCanceled", "panoWillArrive", "movingToPano", "panoArrived", "panoWillLoad", "panoLoaded", "panoLoadError", "initAnimationEnded", "initAnimationWillStart", "wantsGesture", "gesture", "wantsTapGesture", "tapGesture", "wantsPanGesture", "wantsInteriaPan", "panGesture", "interiaPan", "wantsPinchGesture", "pinchGesture", "wantsMouseWheel", "mouseWheel", "wantsShowIntersectionOnModel", "intersectionOnModelUpdate", "intersectionHidden", "textureStartLoad", "textureLoading", "textureAbort", "textureLoaded", "textureError"];
1627
-
1628
- /**
1629
- * 显示区域裁剪参数
1630
- * @description
1631
- * 可通过初始化,或者 setScissor 方式设置
1632
- * `scissor` 是将屏幕中的内容渲染到 `renderer` 的指定区域。
1633
- * 页面整体长宽均为 `1`。通过类似 css 的 `left` `bottom` `width` `height` 来确定区域。
1634
- */
1635
- export declare interface Scissor {
1636
- /** 距离左侧 */
1637
- left: number;
1638
- /** 距离下侧 */
1639
- bottom: number;
1640
- /** 宽度 */
1641
- width: number;
1642
- /** 高度 */
1643
- height: number;
1644
- }
1645
-
1646
- /**
1647
- * 状态
1648
- * @description
1649
- * ```text
1650
- * 可以通过 five.state 和 five.setState 来获取和设置。
1651
- * 通过 state 设置后,five 会通过合适的动画运动来达到设置的位置。
1652
- * 来迎合一些通过数据驱动的场景。
1653
- * ```
1654
- */
1655
- export declare interface State extends Pose {
1656
- /** 模态 */
1657
- mode: Mode;
1658
- /** 观察点序号 */
1659
- panoIndex: number;
1660
- }
1661
-
1662
- export declare function stringifyWork(work: Work): LooseWork;
1663
-
1664
- /**
1665
- * 监听者模式
1666
- * @template T - 预设的监听回调类型
1667
- * @example
1668
- * ```
1669
- * new Subscribe<{
1670
- * "foo": [arg1: number, arg2: string],
1671
- * "bar": [arg: boolean],
1672
- * }>()
1673
- * ```
1674
- */
1675
- export declare class Subscribe<T extends SubscribeEventMap> {
1676
- /**
1677
- * 判断是否注册了事件
1678
- * @param name - 事件类型
1679
- */
1680
- hasListener(name: keyof T): boolean;
1681
- /**
1682
- * 注册事件
1683
- * @param name - 事件类型
1684
- * @param callback - 事件回调函数
1685
- * @param once - 是否只执行一次
1686
- * @returns 解除事件
1687
- * @template K - 预设的监听事件名称
1688
- * @template C - 回调函数函数上下文
1689
- */
1690
- on<K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>, once?: boolean): () => void;
1691
- /**
1692
- * 注册事件(是否只执行一次)
1693
- * @param name - 事件类型
1694
- * @param callback - 事件回调函数
1695
- * @returns 解除事件
1696
- * @template K - 预设的监听事件名称
1697
- * @template C - 回调函数函数上下文
1698
- */
1699
- once<K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>): () => void;
1700
- /**
1701
- * 解除事件
1702
- *
1703
- * 如果 name 不传的话解除对应所有事件
1704
- * 如果 name, callback 不传的话解除所有name的所有事件
1705
- * @param name - 事件类型
1706
- * @param callback - 事件回调函数
1707
- * @template K - 预设的监听事件名称
1708
- */
1709
- off<K extends keyof T>(name?: K, callback?: (...args: Parameters<T[K]>) => ReturnType<T[K]>): void;
1710
- /**
1711
- * 触发事件
1712
- * @param name - 事件类型
1713
- * @param data - 触发事件的数据
1714
- * @returns canceled 是否被触发取消
1715
- * @template K - 预设的监听事件名称
1716
- */
1717
- emit<K extends keyof T>(name: K, ...data: Parameters<T[K]>): boolean;
1718
- }
1719
-
1720
- export declare type SubscribeEventMap = {
1721
- [name: string]: (...args: any[]) => void | boolean;
1722
- };
1723
-
1724
- export declare namespace SubscribeMixinType {
1725
- export interface hasListener<T extends SubscribeEventMap> {
1726
- (name: keyof T): boolean;
1727
- }
1728
- export interface on<T extends SubscribeEventMap> {
1729
- <K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>, once?: boolean): () => void;
1730
- }
1731
- export interface once<T extends SubscribeEventMap> {
1732
- <K extends keyof T>(name: K, callback: (...args: Parameters<T[K]>) => ReturnType<T[K]>): () => void;
1733
- }
1734
- export interface off<T extends SubscribeEventMap> {
1735
- <K extends keyof T>(names?: K | K[], callback?: (...args: any[]) => any): void;
1736
- }
1737
- export interface emit<T extends SubscribeEventMap> {
1738
- <K extends keyof T>(name: K, ...data: Parameters<T[K]>): boolean;
1739
- }
1740
- }
1741
-
1742
- export declare interface TopviewControllerCustomInitArgs extends Omit<FloorplanControllerCustomInitArgs, "defaultLongitude" | "defaultLatitude" | "maxLatitude" | "minLatitude"> {
1743
- }
1744
-
1745
- export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
1746
- /**
1747
- * webvrPolyfill 的设置对象
1748
- * @description
1749
- * 只可被设置一次,所有的 five 实例共用这个设置
1750
- */
1751
- webvrPolyfillConfig?: any;
1752
- }
1753
-
1754
- export declare type Work = {
1755
- uuid: string;
1756
- initial: WorkInitial;
1757
- model?: WorkModel;
1758
- observers: WorkObserver[];
1759
- };
1760
-
1761
- /** 全景图 */
1762
- export declare type WorkImages = {
1763
- up: string;
1764
- down: string;
1765
- right: string;
1766
- left: string;
1767
- front: string;
1768
- back: string;
1769
- depth?: string;
1770
- tiles?: string;
1771
- };
1772
-
1773
- /** 初始化位姿参数 */
1774
- export declare type WorkInitial = Omit<State, "offset">;
1775
-
1776
- /** 模型数据 */
1777
- export declare type WorkModel = {
1778
- file: string;
1779
- textures: string[];
1780
- textureBase: string;
1781
- bvh: boolean;
1782
- async: boolean;
1783
- };
1784
-
1785
- /** 每个点位的数据 */
1786
- export declare type WorkObserver = {
1787
- panoIndex: number;
1788
- active: boolean;
1789
- loadable: boolean;
1790
- images: WorkImages;
1791
- video?: WorkVideo;
1792
- visibleNodes: number[];
1793
- accessibleNodes: number[];
1794
- quaternion: THREE_2.Quaternion;
1795
- standingPosition: THREE_2.Vector3;
1796
- position: THREE_2.Vector3;
1797
- floorIndex: number;
1798
- };
1799
-
1800
- /** 全景视频贴片 */
1801
- export declare type WorkVideo = {
1802
- source: string;
1803
- matrix: THREE_2.Matrix4;
1804
- size: THREE_2.Vector2;
1805
- };
1806
-
1807
- export { }