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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/docs/assets/highlight.css +1 -1
  2. package/docs/assets/main.js +2 -2
  3. package/docs/assets/search.js +1 -1
  4. package/docs/assets/style.css +28 -2
  5. package/docs/classes/five.AnimationFrameLoop.html +5 -5
  6. package/docs/classes/five.BVH.html +2 -2
  7. package/docs/classes/five.BVHIntersect.html +1 -1
  8. package/docs/classes/five.BVHNode.html +2 -2
  9. package/docs/classes/five.BVHVector3.html +1 -1
  10. package/docs/classes/five.BoxBoundingVolume.html +1 -0
  11. package/docs/classes/five.Camera.html +6 -6
  12. package/docs/classes/five.Clipper.html +1 -0
  13. package/docs/classes/five.CullingVolume.html +1 -0
  14. package/docs/classes/five.Five.html +116 -83
  15. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  16. package/docs/classes/five.IntersectMesh.html +1 -1
  17. package/docs/classes/five.Model.html +37 -37
  18. package/docs/classes/five.NetworkSubscribe.html +22 -15
  19. package/docs/classes/five.PBMContainer.html +9 -11
  20. package/docs/classes/five.PBMGroup.html +2 -18
  21. package/docs/classes/five.PBMMaterialReferenceCache.html +1 -0
  22. package/docs/classes/five.PBMMesh.html +3 -5
  23. package/docs/classes/five.PBMMeshMaterial.html +41 -0
  24. package/docs/classes/five.PanoCircleMesh.html +4 -4
  25. package/docs/classes/five.PanoCircleMeshCustom.html +7 -0
  26. package/docs/classes/five.PanoCircleMeshSolid.html +7 -0
  27. package/docs/classes/five.RegionBoundingVolume.html +1 -0
  28. package/docs/classes/five.RequestScheduler.html +16 -0
  29. package/docs/classes/five.Scene.html +2 -2
  30. package/docs/classes/five.SphereBoundingVolume.html +1 -0
  31. package/docs/classes/five.Subscribe.html +24 -17
  32. package/docs/classes/five.TextureLoader.html +1 -0
  33. package/docs/classes/five.Tile.html +1 -0
  34. package/docs/classes/five.Tile3DModel.html +1 -0
  35. package/docs/classes/five.TileCubeTextureTarget.html +1 -0
  36. package/docs/classes/five.TileNode.html +1 -0
  37. package/docs/classes/five.Tileset.html +5 -0
  38. package/docs/classes/five.TilesetCache.html +1 -0
  39. package/docs/classes/five.TilesetTraverser.html +1 -0
  40. package/docs/classes/five.Work.html +21 -10
  41. package/docs/classes/five.XRButton.html +1 -0
  42. package/docs/classes/gltf_loader.DDSLoader.html +1 -0
  43. package/docs/classes/gltf_loader.DRACOLoader.html +1 -0
  44. package/docs/classes/gltf_loader.GLTFLoader.html +8 -8
  45. package/docs/classes/gltf_loader.GLTFObject.html +3 -3
  46. package/docs/classes/gltf_loader.GLTFParser.html +1 -0
  47. package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -0
  48. package/docs/classes/line.Line.html +1 -1
  49. package/docs/classes/line.LineGeometry.html +1 -1
  50. package/docs/classes/line.LineMaterial.html +1 -1
  51. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  52. package/docs/classes/line.THREE_Line2.html +1 -1
  53. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  54. package/docs/classes/react.Store.html +13 -13
  55. package/docs/classes/sticker.Sticker.html +9 -9
  56. package/docs/classes/vfx.Airflow.html +1 -0
  57. package/docs/classes/vfx.Flame.html +1 -0
  58. package/docs/classes/vfx.Particle.html +89 -0
  59. package/docs/classes/vfx.SpotLight.html +1 -0
  60. package/docs/enums/five.PBMPointColorType.html +1 -0
  61. package/docs/enums/five.PBMPointShapeType.html +1 -0
  62. package/docs/enums/five.PBMPointSizeType.html +1 -0
  63. package/docs/enums/five.VolumePlaneIntersect.html +1 -0
  64. package/docs/index.html +2 -2
  65. package/docs/interfaces/five.AddableObject.html +9 -1
  66. package/docs/interfaces/five.AnimationFrame.html +1 -1
  67. package/docs/interfaces/five.BoundingVolume.html +1 -0
  68. package/docs/interfaces/five.CameraPose.html +1 -1
  69. package/docs/interfaces/five.ClipperParameter.html +1 -0
  70. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +12 -14
  71. package/docs/interfaces/five.EventCallback.html +107 -113
  72. package/docs/interfaces/five.FiveInitArgs.html +39 -32
  73. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
  74. package/docs/interfaces/five.ImageOptions.html +8 -6
  75. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  76. package/docs/interfaces/five.ImageURLOptions.html +15 -1
  77. package/docs/interfaces/five.IntersectMeshInterface.html +2 -2
  78. package/docs/interfaces/five.Intersection.html +4 -4
  79. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +11 -0
  80. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +9 -11
  81. package/docs/interfaces/five.ModelEventCallback.html +7 -13
  82. package/docs/interfaces/five.ModelLodOptions.html +1 -0
  83. package/docs/interfaces/five.MotionKeyframe.html +1 -0
  84. package/docs/interfaces/five.MovePanoOptions.html +17 -14
  85. package/docs/interfaces/five.NetworkOptions.html +9 -0
  86. package/docs/interfaces/five.PBMPanoPicture.html +4 -4
  87. package/docs/interfaces/five.PBMParameters.html +32 -8
  88. package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -0
  89. package/docs/interfaces/five.PanoCircleMeshInterface.html +15 -5
  90. package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -0
  91. package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -0
  92. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +19 -14
  93. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +9 -11
  94. package/docs/interfaces/five.Pose.html +9 -7
  95. package/docs/interfaces/five.Scissor.html +6 -6
  96. package/docs/interfaces/five.State.html +13 -9
  97. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -1
  98. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -1
  99. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -1
  100. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -1
  101. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -1
  102. package/docs/interfaces/five.SubscribeMixinType.waitUnitl.html +1 -0
  103. package/docs/interfaces/five.TextureOptions.html +9 -7
  104. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +3 -0
  105. package/docs/interfaces/five.TileCubeNode.html +1 -0
  106. package/docs/interfaces/five.TileCubeTree.html +1 -0
  107. package/docs/interfaces/five.TileHeader.html +1 -0
  108. package/docs/interfaces/five.TilesetHeader.html +1 -0
  109. package/docs/interfaces/five.TilesetOptions.html +1 -0
  110. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +6 -4
  111. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +17 -15
  112. package/docs/interfaces/five.WebXRControllerParams.html +1 -0
  113. package/docs/interfaces/five.WorkCubeImage.html +7 -7
  114. package/docs/interfaces/five.WorkImage.html +11 -11
  115. package/docs/interfaces/five.WorkInitial.html +13 -9
  116. package/docs/interfaces/five.WorkModel.html +7 -7
  117. package/docs/interfaces/five.WorkObserver.html +21 -15
  118. package/docs/interfaces/five.WorkOptions.html +15 -0
  119. package/docs/interfaces/five.WorkTile.html +1 -1
  120. package/docs/interfaces/five.WorkVideo.html +5 -5
  121. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +29 -0
  122. package/docs/interfaces/gltf_loader.DDS.html +1 -0
  123. package/docs/interfaces/gltf_loader.GLTF.html +2 -2
  124. package/docs/interfaces/gltf_loader.GLTFReference.html +1 -0
  125. package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -0
  126. package/docs/interfaces/react.FiveActionReactCallbacks.html +11 -21
  127. package/docs/interfaces/react.FiveInjectionTypes.html +40 -43
  128. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -1
  129. package/docs/interfaces/sticker.IntersectionLike.html +4 -4
  130. package/docs/interfaces/vfx.ParticleArgs.html +75 -0
  131. package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -0
  132. package/docs/interfaces/vue.FiveActionVueCallbacks.html +60 -0
  133. package/docs/modules/five.SubscribeMixinType.html +1 -1
  134. package/docs/modules/five.html +130 -113
  135. package/docs/modules/gltf_loader.html +1 -1
  136. package/docs/modules/line.html +1 -1
  137. package/docs/modules/react.html +36 -36
  138. package/docs/modules/sticker.html +1 -1
  139. package/docs/modules/vfx.html +1 -0
  140. package/docs/modules/vue.html +115 -0
  141. package/docs/modules.html +1 -1
  142. package/exporters/staticify.js +14 -7
  143. package/five/index.d.ts +1208 -252
  144. package/five/index.js +9 -98
  145. package/gltf-loader/index.d.ts +90 -5
  146. package/gltf-loader/index.js +3 -3
  147. package/line/index.d.ts +1 -0
  148. package/line/index.js +3 -3
  149. package/package.json +10 -6
  150. package/react/index.d.ts +61 -69
  151. package/react/index.js +3 -3
  152. package/resource/basis/1.16/basis_transcoder.js +22 -0
  153. package/resource/basis/{basis_transcoder.wasm → 1.16/basis_transcoder.wasm} +0 -0
  154. package/resource/basis/README.md +5 -0
  155. package/resource/draco/1.5.6/draco_decoder.js +34 -0
  156. package/resource/draco/1.5.6/draco_decoder.wasm +0 -0
  157. package/resource/draco/1.5.6/draco_decoder_gltf.js +33 -0
  158. package/resource/draco/1.5.6/draco_decoder_gltf.wasm +0 -0
  159. package/resource/draco/1.5.6/draco_encoder.js +35 -0
  160. package/resource/draco/1.5.6/draco_encoder.wasm +0 -0
  161. package/resource/draco/1.5.6/draco_encoder_wrapper.js +97 -0
  162. package/resource/draco/1.5.6/draco_wasm_wrapper.js +117 -0
  163. package/resource/draco/1.5.6/draco_wasm_wrapper_gltf.js +116 -0
  164. package/resource/draco/README.md +5 -0
  165. package/scripts/five-staticify.js +6 -1
  166. package/sticker/index.d.ts +2 -1
  167. package/sticker/index.js +3 -3
  168. package/umd/five-gltf-loader.js +1 -2
  169. package/umd/five-line.js +1 -2
  170. package/umd/five-react.js +1 -2
  171. package/umd/five-sticker.js +1 -2
  172. package/umd/five-vfx.js +1 -0
  173. package/umd/five-vue.js +1 -0
  174. package/umd/five.js +1 -1
  175. package/umd/five.js.LICENSE.txt +5 -202
  176. package/vfx/index.d.ts +264 -0
  177. package/vfx/index.js +260 -0
  178. package/vue/index.d.ts +443 -0
  179. package/vue/index.js +260 -0
  180. package/docs/classes/five.LegacyPanoCircleMesh.html +0 -5
  181. package/docs/classes/five.PBMMaterial.html +0 -15
  182. package/docs/classes/server.BVH.html +0 -10
  183. package/docs/classes/server.BVHIntersect.html +0 -1
  184. package/docs/classes/server.BVHNode.html +0 -7
  185. package/docs/classes/server.BVHVector3.html +0 -1
  186. package/docs/classes/server.Model.html +0 -63
  187. package/docs/classes/server.PBMGroup.html +0 -9
  188. package/docs/classes/server.PBMMesh.html +0 -7
  189. package/docs/interfaces/server.Intersection.html +0 -7
  190. package/docs/interfaces/server.ModelEventCallback.html +0 -18
  191. package/docs/modules/server.html +0 -18
  192. package/resource/basis/basis_transcoder.js +0 -22
  193. package/resource/gltf/draco_decoder.js +0 -31
  194. package/resource/gltf/draco_decoder.wasm +0 -0
  195. package/resource/gltf/draco_wasm_wrapper.js +0 -119
  196. package/server/index.d.ts +0 -556
  197. package/server/index.js +0 -367
package/vue/index.d.ts ADDED
@@ -0,0 +1,443 @@
1
+ import { AllowedComponentProps } from 'vue';
2
+ import { ComponentCustomProps } from 'vue';
3
+ import { ComponentOptionsMixin } from 'vue';
4
+ import { DeepReadonly } from 'vue';
5
+ import { DefineComponent } from 'vue';
6
+ import { EventCallback } from '@realsee/five';
7
+ import { ExtractPropTypes } from 'vue';
8
+ import { Five } from '@realsee/five';
9
+ import { FiveInitArgs } from '@realsee/five';
10
+ import { Intersection } from '@realsee/five';
11
+ import { Model } from '@realsee/five';
12
+ import { Pose } from '@realsee/five';
13
+ import { PropType } from 'vue';
14
+ import { Ref } from 'vue';
15
+ import { RendererElement } from 'vue';
16
+ import { RendererNode } from 'vue';
17
+ import { Scene } from '@realsee/five';
18
+ import { State } from '@realsee/five';
19
+ import * as THREE_2 from 'three';
20
+ import { VNode } from 'vue';
21
+ import { VNodeProps } from 'vue';
22
+ import { Work } from '@realsee/five';
23
+ import { WorkObserver } from '@realsee/five';
24
+ import { WorkPanoId } from '@realsee/five';
25
+ import { Works } from '@realsee/five';
26
+
27
+ /**
28
+ * Five 命令集合
29
+ */
30
+ export declare interface FiveActionVueCallbacks {
31
+ /**
32
+ * 移动相机。(不触发点位移动)
33
+ * @description
34
+ * 如果动画中途被打断(用户触发行为,或者调用 setState, load, changeMode)的等
35
+ * 会 Promise.reject。运动完成则 Promise.resolve
36
+ * @param pose - 相机目标位置
37
+ * @param duration - 动画触发的时常
38
+ * @returns Promise 是否移动成功
39
+ */
40
+ updateCamera(pose: Pose, duration: number): Promise<void>;
41
+ /**
42
+ * 获取画面中的像素颜色
43
+ * @param x - 获取像素区域的起始坐标 x
44
+ * @param y - 获取像素区域的起始坐标 y
45
+ * @param width - 获取像素区域的宽度
46
+ * @param height - 获取像素区域的高度
47
+ * @param pixelRatio - 获取区域的像素比
48
+ * @returns rgba颜色平铺的 Uint8Array
49
+ */
50
+ getPixels(x: number, y: number, width: number, height: number, pixelRatio?: number): Uint8Array;
51
+ /**
52
+ * 强制渲染
53
+ * @description
54
+ * 调用 `render()` 和 `needsRender()` 均可在按需渲染时,使得画面渲染一次
55
+ * 区别在于:
56
+ * - `needsRender()` 为在下帧渲染画面
57
+ * - `render()` 在当前帧渲染画面
58
+ * 推荐使用 `needsRender()`, 可以更加流畅。但是如果需要截图等同步操作,可以使用 `render()`
59
+ *
60
+ * @param callback - 渲染完成回调
61
+ */
62
+ render(callback?: () => void): void;
63
+ /**
64
+ * 下一帧渲染
65
+ * @description
66
+ * 调用 `render()` 和 `needsRender()` 均可在按需渲染时,使得画面渲染一次
67
+ * 区别在于:
68
+ * - `needsRender()` 为在下帧渲染画面
69
+ * - `render()` 在当前帧渲染画面
70
+ * 推荐使用 `needsRender()`, 可以更加流畅。但是如果需要截图等同步操作,可以使用 `render()`
71
+ */
72
+ needsRender(): void;
73
+ /**
74
+ * 预加载点位图片资源
75
+ * @param panoId - 观察点
76
+ * @param callback - 加载完成回调, 并传递加载用时。
77
+ * @returns 加载完成的 Promise 参数同 callback
78
+ */
79
+ preloadPano(panoId: WorkPanoId, callback?: (costs: number) => void): Promise<number>;
80
+ /**
81
+ * 计算三维空间的点对应到屏幕的二维坐标
82
+ * @description
83
+ * 调用 `project2d()` 和 `useFiveProject2d()` 均可用于计算三维空间的点对应到屏幕的二维坐标
84
+ * 区别在于:
85
+ * - `project2d()` 只计算一次,入参改变或 cameraUpdate 时 不会更新值
86
+ * - `useFiveProject2d()` 通过 watch 监听入参和 cameraUpdate 变化,自动更新返回值
87
+ */
88
+ project2d(vector3: THREE.Vector3, testModel?: boolean | undefined): THREE.Vector2 | null;
89
+ }
90
+
91
+ /**
92
+ * Five 渲染区域组件
93
+ * @description Five 渲染区域组件,请在 FiveProvider 内使用
94
+ * @param width - 渲染区域的宽度
95
+ * @param height - 渲染区域的高度
96
+ * @returns Vue 元素
97
+ * @example
98
+ * ```typescript
99
+ * <FiveProvider :initialWork="work">
100
+ * <FiveCanvas width="512" height="512"/>
101
+ * </FiveProvider>
102
+ * ```
103
+ */
104
+ export declare const FiveCanvas: DefineComponent< {
105
+ width: {
106
+ type: PropType<number>;
107
+ required: true;
108
+ };
109
+ height: {
110
+ type: PropType<number>;
111
+ required: true;
112
+ };
113
+ }, () => VNode<RendererNode, RendererElement, {
114
+ [key: string]: any;
115
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
116
+ width: {
117
+ type: PropType<number>;
118
+ required: true;
119
+ };
120
+ height: {
121
+ type: PropType<number>;
122
+ required: true;
123
+ };
124
+ }>>, {}>;
125
+
126
+ export declare type FiveModelIntersectRaycaster = (raycaster: Ref<THREE_2.Raycaster> | THREE_2.Raycaster) => Ref<Intersection[]>;
127
+
128
+ /**
129
+ * Five 实例化Five 组件
130
+ *
131
+ * 在 FiveProvider 下,可以使用 FiveCanvas 来创建渲染画布。
132
+ * 以及使用 useFiveState useFiveEventCallback等 Five Vue Composition API 来对 FiveProvider 进行操作
133
+ * @description Five 创建Five实例的组件
134
+ * @param FiveProviderComponent - Five 参数
135
+ * @example
136
+ * ```typescript
137
+ * <FiveProvider :initialWork="work">
138
+ * <FiveCanvas width="512" height="512"/>
139
+ * </FiveProvider>
140
+ * ```
141
+ */
142
+ export declare const FiveProvider: FiveProviderComponent;
143
+
144
+ export declare type FiveProviderComponent = DefineComponent<{
145
+ works: PropType<Work[]>;
146
+ initialWorks: PropType<Work[] | Promise<Work[]>>;
147
+ initialState: PropType<"inherit" | "initial" | Partial<Omit<State, "offset">>>;
148
+ initialUserAction: BooleanConstructor;
149
+ onWorksChange: PropType<(work: Work[]) => void>;
150
+ onStateChange: PropType<(state: State, userAction: boolean) => void>;
151
+ onCurrentStateChange: PropType<(state: State, userAction: boolean) => void>;
152
+ onError: PropType<(error: Error) => void>;
153
+ fiveInitArgs: {
154
+ type: PropType<Omit<FiveInitArgs, "renderer" | "scissor">>;
155
+ default: () => {};
156
+ };
157
+ style: ObjectConstructor;
158
+ }, {
159
+ five: Readonly<Five>;
160
+ }>;
161
+
162
+ export declare type Project2d = (vector3: THREE_2.Vector3 | Ref<THREE_2.Vector3>, testModel: boolean) => Ref<THREE_2.Vector2 | null>;
163
+
164
+ /**
165
+ * Five Vue Hooks: 获取 five 实例
166
+ * @description 不到万不得已,并不推荐直接使用。
167
+ * @deprecated 不到万不得已,并不推荐直接使用。
168
+ * @returns five 实例
169
+ */
170
+ export declare function unsafe__useFiveInject(): Five;
171
+
172
+ /**
173
+ * Five Vue Hooks: 使用 Five 的命令
174
+ *
175
+ * @function updateCamera
176
+ * ```
177
+ * 移动相机。(不触发点位移动)
178
+ * 如果动画中途被打断(用户触发行为,或者调用 setState, load, changeMode)的等
179
+ * 会 Promise.reject。运动完成则 Promise.resolve
180
+ *
181
+ * // params pose - 相机目标位置
182
+ * // params duration - 动画触发的时常
183
+ * // params Promise - 是否移动成功
184
+ * updateCamera(pose: Pose, duration: number): Promise<void>
185
+ * ```
186
+ *
187
+ * @function initBasisLoader
188
+ * ```
189
+ * 初始化 initBasisLoader
190
+ * 同初始化的 initBasisLoader 参数。用于初始化 basisLoader。
191
+ * basisLoader 只会初始化一次,一旦初始化则不会再修改。
192
+ *
193
+ * // param transcoderResourcePath
194
+ * // 如果不设置,使用默认解析器 basis 解析器。
195
+ * // 可以传入解析器的 `resourcePath`, 则使用指定的解析器
196
+ * initBasisLoader(transcoderResourcePath?: string): void,
197
+ * ```
198
+ *
199
+ * @function getPixels
200
+ * ```
201
+ * 获取画面中的像素颜色
202
+ * // param x - 获取像素区域的起始坐标 x
203
+ * // param y - 获取像素区域的起始坐标 y
204
+ * // param width - 获取像素区域的宽度
205
+ * // param height - 获取像素区域的高度
206
+ * // param pixelRatio - 获取区域的像素比
207
+ * // returns rgba颜色平铺的 Uint8Array
208
+ * getPixels(x: number, y: number, width: number, height: number, pixelRatio?: number): Uint8Array,
209
+ * ```
210
+ *
211
+ * @function render
212
+ * ```
213
+ * 强制渲染
214
+ * 调用 render() 和 needsRender() 均可在按需渲染时,使得画面渲染一次
215
+ * 区别在于:
216
+ * - needsRender() 为在下帧渲染画面
217
+ * - render() 在当前帧渲染画面
218
+ * 推荐使用 needsRender(), 可以更加流畅。但是如果需要截图等同步操作,可以使用 render()
219
+ *
220
+ * // param callback 渲染完成回调
221
+ * render(callback?: () => void): void,
222
+ * ```
223
+ *
224
+ * @function needsRender
225
+ * ```
226
+ * 下一帧渲染
227
+ * 调用 render() 和 needsRender() 均可在按需渲染时,使得画面渲染一次
228
+ * 区别在于:
229
+ * - needsRender() 为在下帧渲染画面
230
+ * - render() 在当前帧渲染画面
231
+ * 推荐使用 needsRender(), 可以更加流畅。但是如果需要截图等同步操作,可以使用 render()
232
+ * needsRender(): void,
233
+ * ```
234
+ *
235
+ * @function preloadPano
236
+ * ```
237
+ * 预加载点位图片资源
238
+ * // param panoId - 观察点
239
+ * // param callback - 加载完成回调, 并传递加载用时。
240
+ * // returns 加载完成的 Promise 参数同 callback
241
+ * preloadPano(panoId: WorkPanoId, callback?: (costs: number) => void): Promise<number>
242
+ * ```
243
+ *
244
+ * @function project2d
245
+ * ```
246
+ * 计算三维空间的点对应到屏幕的二维坐标
247
+ * 调用 `project2d()` 和 `useFiveProject2d()` 均可用于计算三维空间的点对应到屏幕的二维坐标
248
+ * 区别在于:
249
+ * - `project2d()` 只计算一次,入参改变或 cameraUpdate 时 不会更新值
250
+ * - `useFiveProject2d()` 通过 watch 监听入参和 cameraUpdate 变化,自动更新返回值
251
+ * project2d(vector3: THREE.Vector3, testModel?: boolean ): THREE.Vector2
252
+ * ```
253
+ *
254
+ * @example
255
+ * ```
256
+ * const { updateCamera, initBasisLoader, getPixels, render, needsRender, preloadPano, project2d } = useFiveAction();
257
+ * ```
258
+ */
259
+ export declare function useFiveAction(): FiveActionVueCallbacks;
260
+
261
+ /**
262
+ * Five Vue Hooks: 得到当前相机的方向(单位向量)
263
+ * @returns 当前相机方向的单位向量
264
+ */
265
+ export declare function useFiveCameraDirection(): Ref<THREE_2.Vector3>;
266
+
267
+ /**
268
+ * Five Vue Hooks: 得到当前相机的方向(射线对象)
269
+ * @returns 当前相机方向的射线对象
270
+ */
271
+ export declare function useFiveCameraRaycaster(): Ref<THREE_2.Raycaster>;
272
+
273
+ /**
274
+ * Five Vue Hooks: Five 的当前观测点
275
+ * @returns 当前观测点, 如果 work 未加载则为 null
276
+ * @example
277
+ * ```
278
+ * const observer = useFiveCurrentObserver();
279
+ * ```
280
+ */
281
+ export declare function useFiveCurrentObserver(): Ref<WorkObserver | undefined>;
282
+
283
+ /**
284
+ * Five Vue Hooks: Five 的实时状态
285
+ * @returns
286
+ * [ currentState: Five 的实时状态, setState: 设置 Five 的状态 ]
287
+ * @example
288
+ * ```
289
+ * const [ currentState, setState ] = useFiveCurrentState;
290
+ * ```
291
+ */
292
+ export declare function useFiveCurrentState(): [
293
+ currentState: Ref<State>,
294
+ setState: (state: Partial<State> | ((prevState: State) => Partial<State>), immediately?: boolean, userAction?: boolean) => void
295
+ ];
296
+
297
+ /**
298
+ * Five Vue Hooks: Five 事件监听
299
+ * 具体事件列表 请查看 Five.EventCallback
300
+ * @example
301
+ * ```
302
+ * useFiveEventCallback("cameraUpdate", pose => {});
303
+ * ```
304
+ */
305
+ export declare function useFiveEventCallback<T extends keyof EventCallback>(name: T, callback: EventCallback[T]): void;
306
+
307
+ /**
308
+ * Five Vue Hooks: Five 楼层
309
+ * @returns
310
+ * [ shownFloor: Five 当前显示的楼层, null 为都显示, showFloor: 设置显示楼层,不传参数为都显示 ]
311
+ * @example
312
+ * ```
313
+ * const [ shownFloor, showFloor ] = useFiveHelper;
314
+ * ```
315
+ */
316
+ export declare function useFiveFloor(): [
317
+ shownFloor: Ref<number | null>,
318
+ totalFloorLength: Ref<number>,
319
+ showFloor: (floorIndex?: number) => void
320
+ ];
321
+
322
+ /**
323
+ * Five Vue Hooks: Five 帮助元素的隐藏/显示
324
+ * @returns
325
+ * [ helperVisible: Five 帮助元素是否显示, toggleHelperVisible: 设置 帮助元素的隐藏/显示 ]
326
+ * @example
327
+ * ```
328
+ * const [ helperVisible, toggleHelperVisible ] = useFiveHelper;
329
+ * ```
330
+ */
331
+ export declare function useFiveHelper(): [
332
+ helperVisible: Ref<boolean>,
333
+ toggleHelperVisible: (visible: boolean) => void
334
+ ];
335
+
336
+ /**
337
+ * Five Vue Hooks: 获取当前模型
338
+ */
339
+ export declare function useFiveModel(): Ref<Model>;
340
+
341
+ /**
342
+ * Five Vue Hooks: 获取当前模型的包围盒
343
+ */
344
+ export declare function useFiveModelBounding(): Ref<THREE_2.Box3>;
345
+
346
+ /**
347
+ * Five Vue Hooks: 获取当前模型碰撞检测方法
348
+ *
349
+ * @function fiveModelIntersectRaycaster
350
+ * ```
351
+ * 计算模型射线碰撞检测
352
+ * // param raycaster THREE 射线对象
353
+ * // param floors 和某一楼层做碰撞检测, 不传为和所有楼层做碰撞检测
354
+ * // returns 返回碰撞
355
+ * intersectRaycaster(raycaster: THREE.Raycaster, floors?: number | number[]): Intersection[]
356
+ * ```
357
+ * @example
358
+ * ```
359
+ * const fiveModelIntersectRaycaster = useFiveModelIntersectRaycaster();
360
+ * const intersects = fiveModelIntersectRaycaster(raycaster);
361
+ * ```
362
+ */
363
+ export declare function useFiveModelIntersectRaycaster(): FiveModelIntersectRaycaster;
364
+
365
+ /**
366
+ * Five Vue Hooks: 获取当前模型加载状态
367
+ * @returns
368
+ * "Loaded": 加载完成
369
+ * "Empty" 加载未完成
370
+ */
371
+ export declare function useFiveModelReadyState(): Ref<"Loaded" | "Empty">;
372
+
373
+ /**
374
+ * Five Vue Hooks: 计算三维坐标对应到屏幕二维坐标
375
+ *
376
+ * @function project2d
377
+ * ```
378
+ * 计算三维坐标对应到屏幕二维坐标
379
+ * `useFiveProject2d()` 通过 watch 监听入参和 cameraUpdate 变化,自动更新返回值
380
+ * 多次调用时会创建多个 watch 监听,推荐 const { project2d } = useFiveAction();
381
+ * // param vector 三维的坐标
382
+ * // param testModel 是否和模型检测,如果检测,则被模型遮挡会返回 null
383
+ * // returns 三维的坐标 或者 null
384
+ * project2d(vector: THREE.Vector3 | Ref<THREE.Vector3>, testModel: boolean)
385
+ * v2: Ref<THREE.Vector2 | null>
386
+ * ```
387
+ *
388
+ * @example
389
+ * ```
390
+ * const project2d = useFiveProject2d();
391
+ * project2d(new THREE.Vector3(0, 0, 0));
392
+ * ```
393
+ */
394
+ export declare function useFiveProject2d(): Project2d;
395
+
396
+ /**
397
+ * Five Vue Hooks: 获取scene
398
+ */
399
+ export declare function useFiveScene(): Scene;
400
+
401
+ /**
402
+ * Five Vue Hooks: Five 的目标状态
403
+ * @returns
404
+ * [ currentState: Five 的目标状态, setState: 设置 Five 的状态 ]
405
+ * @example
406
+ * ```
407
+ * const [ state, setState ] = useFiveState;
408
+ * ```
409
+ */
410
+ export declare function useFiveState(): [
411
+ curState: Ref<State>,
412
+ setState: (state: Partial<State> | ((prevState: State) => Partial<State>), immediately?: boolean, userAction?: boolean) => void
413
+ ];
414
+
415
+ /**
416
+ * Five Vue Hooks: 获取/设置当前的 Work
417
+ *
418
+ * @returns
419
+ * [ work: 获取当前的 Work, loadWork: 设置 Work ]
420
+
421
+ * @function loadWork
422
+ * ```
423
+ * 加载 Work 数据
424
+ * // param work Work 数据
425
+ * // param state 初始化姿态
426
+ * // - "inherit" 使用当前姿态
427
+ * // - "initial" 使用 Work 数据中的 initial 姿态
428
+ * // - State 自定义姿态
429
+ * // param duration 切换时间
430
+ * (work: Work, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number) => void
431
+ * ```
432
+ *
433
+ * @example
434
+ * ```
435
+ * const [ works, loadWorks ] = useFiveWorks;
436
+ * ```
437
+ */
438
+ export declare function useFiveWorks(): [
439
+ works: DeepReadonly<Ref<Works | undefined>>,
440
+ loadWorks: (work: Work | Work[], state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number, userAction?: boolean) => Promise<void>
441
+ ];
442
+
443
+ export { }