@realsee/five 6.0.0-alpha.1 → 6.0.0-alpha.3
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.
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.AnimationFrameLoop.html +1 -1
- package/docs/classes/five.BVH.html +1 -1
- package/docs/classes/five.BVHIntersect.html +1 -1
- package/docs/classes/five.BVHNode.html +1 -1
- package/docs/classes/five.BVHVector3.html +1 -1
- package/docs/classes/five.BoxBoundingVolume.html +1 -1
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.Clipper.html +1 -1
- package/docs/classes/five.CullingVolume.html +1 -1
- package/docs/classes/five.Five.html +71 -69
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.IntersectMesh.html +1 -1
- package/docs/classes/five.Model.html +20 -22
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMaterialReferenceCache.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +1 -1
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.RegionBoundingVolume.html +1 -1
- package/docs/classes/five.RequestScheduler.html +1 -1
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.SphereBoundingVolume.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.TextureLoader.html +1 -1
- package/docs/classes/five.Tile.html +1 -1
- package/docs/classes/five.Tile3DModel.html +1 -1
- package/docs/classes/five.TileCubeTextureTarget.html +1 -1
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.Tileset.html +1 -1
- package/docs/classes/five.TilesetCache.html +1 -1
- package/docs/classes/five.TilesetTraverser.html +1 -1
- package/docs/classes/five.Work.html +12 -12
- package/docs/classes/five.XRButton.html +1 -1
- package/docs/classes/gltf_loader.DDSLoader.html +1 -1
- package/docs/classes/gltf_loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf_loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf_loader.GLTFObject.html +1 -1
- package/docs/classes/gltf_loader.GLTFParser.html +1 -1
- package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/react.Store.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/enums/five.PBMPointColorType.html +1 -1
- package/docs/enums/five.PBMPointShapeType.html +1 -1
- package/docs/enums/five.PBMPointSizeType.html +1 -1
- package/docs/enums/five.VolumePlaneIntersect.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AnimationFrame.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +1 -0
- package/docs/interfaces/five.BoundingVolume.html +1 -1
- package/docs/interfaces/five.CameraPose.html +1 -1
- package/docs/interfaces/five.ClipperParameter.html +1 -1
- package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +10 -10
- package/docs/interfaces/five.EventCallback.html +185 -93
- package/docs/interfaces/five.FiveInitArgs.html +1 -1
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +7 -7
- package/docs/interfaces/five.GestureEvent.html +1 -0
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.ImageURLMappings.html +1 -1
- package/docs/interfaces/five.ImageURLOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +1 -0
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +1 -1
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModeChangeEvent.html +1 -0
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +8 -8
- package/docs/interfaces/five.ModelEvent.html +1 -0
- package/docs/interfaces/five.ModelLodOptions.html +1 -1
- package/docs/interfaces/five.ModelsEvent.html +1 -0
- package/docs/interfaces/five.MotionKeyframe.html +1 -1
- package/docs/interfaces/five.MovePanoOptions.html +9 -7
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +1 -0
- package/docs/interfaces/five.ObjectEvent.html +1 -0
- package/docs/interfaces/five.PBMPanoPicture.html +1 -1
- package/docs/interfaces/five.PBMParameters.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -1
- package/docs/interfaces/five.PanoEvent.html +1 -0
- package/docs/interfaces/five.PanoTextureEvent.html +1 -0
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +10 -10
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +8 -8
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +1 -0
- package/docs/interfaces/five.Scissor.html +1 -1
- package/docs/interfaces/five.State.html +6 -6
- package/docs/interfaces/five.StateEvent.html +1 -0
- package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.off.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.on.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.once.html +1 -1
- package/docs/interfaces/five.SubscribeMixinType.waitUnitl.html +1 -1
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.Tile3DModelLoaderOptions.html +1 -1
- package/docs/interfaces/five.TileCubeNode.html +1 -1
- package/docs/interfaces/five.TileCubeTree.html +1 -1
- package/docs/interfaces/five.TileHeader.html +1 -1
- package/docs/interfaces/five.TilesetHeader.html +1 -1
- package/docs/interfaces/five.TilesetOptions.html +1 -1
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +4 -4
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +8 -8
- package/docs/interfaces/five.WebXRControllerParams.html +1 -1
- package/docs/interfaces/five.WorkCubeImage.html +6 -6
- package/docs/interfaces/five.WorkImage.html +10 -10
- package/docs/interfaces/five.WorkInitial.html +9 -9
- package/docs/interfaces/five.WorkModel.html +6 -6
- package/docs/interfaces/five.WorkObserver.html +24 -16
- package/docs/interfaces/five.WorkOptions.html +7 -7
- package/docs/interfaces/five.WorkResolvedObserver.html +37 -0
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorkVideo.html +4 -4
- package/docs/interfaces/five.WorksEvent.html +1 -0
- package/docs/interfaces/five.XRGestureEvent.html +1 -0
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +8 -8
- package/docs/interfaces/five.XRSessionEvent.html +1 -0
- package/docs/interfaces/gltf_loader.DDS.html +1 -1
- package/docs/interfaces/gltf_loader.GLTF.html +1 -1
- package/docs/interfaces/gltf_loader.GLTFReference.html +1 -1
- package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -1
- package/docs/interfaces/react.FiveActionReactCallbacks.html +3 -5
- package/docs/interfaces/react.FiveInjectionTypes.html +10 -15
- package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -1
- package/docs/interfaces/sticker.IntersectionLike.html +1 -1
- package/docs/interfaces/vfx.ParticleArgs.html +1 -1
- package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -1
- package/docs/interfaces/vue.FiveActionVueCallbacks.html +3 -3
- package/docs/modules/five.SubscribeMixinType.html +1 -1
- package/docs/modules/five.html +375 -225
- package/docs/modules/gltf_loader.html +1 -1
- package/docs/modules/line.html +1 -1
- package/docs/modules/react.html +1 -1
- package/docs/modules/sticker.html +1 -1
- package/docs/modules/vfx.html +1 -1
- package/docs/modules/vue.html +1 -1
- package/docs/modules.html +1 -1
- package/five/index.d.ts +855 -618
- package/five/index.js +6 -6
- package/gltf-loader/index.js +3 -3
- package/line/index.js +3 -3
- package/package.json +1 -1
- package/react/index.d.ts +3 -2
- package/react/index.js +3 -3
- package/sticker/index.js +3 -3
- package/umd/five-gltf-loader.js +1 -1
- package/umd/five-line.js +1 -1
- package/umd/five-react.js +1 -1
- package/umd/five-sticker.js +1 -1
- package/umd/five-vue.js +1 -1
- package/umd/five.js +1 -1
- package/vfx/index.js +2 -2
- package/vue/index.d.ts +4 -3
- package/vue/index.js +3 -3
package/five/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="webxr" />
|
|
2
|
+
|
|
1
3
|
import * as THREE_2 from 'three';
|
|
2
4
|
|
|
3
5
|
export declare interface AddableObject extends THREE_2.Object3D {
|
|
@@ -46,6 +48,13 @@ export declare class AnimationFrameLoop {
|
|
|
46
48
|
disponse(): void;
|
|
47
49
|
}
|
|
48
50
|
|
|
51
|
+
export declare interface BaseEvent {
|
|
52
|
+
type: string;
|
|
53
|
+
timeStamp: number;
|
|
54
|
+
preventDefault(): void;
|
|
55
|
+
defaultPrevented: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
49
58
|
export declare interface BoundingVolume {
|
|
50
59
|
type: 'box' | 'sphere' | 'regin';
|
|
51
60
|
applyMatrix4(matrix: THREE_2.Matrix4): this;
|
|
@@ -222,297 +231,61 @@ export declare type ControllerCustomInitTypes = {
|
|
|
222
231
|
};
|
|
223
232
|
|
|
224
233
|
export declare type ControllerEventTypes = {
|
|
225
|
-
/**
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
* @param userAction - 是否用户触发
|
|
281
|
-
* @returns 可以通过 `return false` 阻止
|
|
282
|
-
*/
|
|
283
|
-
wantsMoveToPano(panoId: WorkPanoId, options: MovePanoOptions, userAction: boolean): void | false;
|
|
284
|
-
/**
|
|
285
|
-
* 开始加载并移动到某个观察点位
|
|
286
|
-
* @description
|
|
287
|
-
* 可 panoWillArrive 相比
|
|
288
|
-
* - moveToPano 在加载全景图资源前触发
|
|
289
|
-
* - panoWillArrive 在加载全景图资源后触发
|
|
290
|
-
* @param panoId - 移动到的点位
|
|
291
|
-
* @param userAction - 是否用户触发
|
|
292
|
-
*/
|
|
293
|
-
moveToPano(panoId: WorkPanoId, userAction: boolean): void;
|
|
294
|
-
/**
|
|
295
|
-
* 开始加载某个观察点的全景资源
|
|
296
|
-
* @param panoId - 移动到的点位
|
|
297
|
-
*/
|
|
298
|
-
panoWillLoad(panoId: WorkPanoId): void;
|
|
299
|
-
/**
|
|
300
|
-
* 某个观察点的全景资源加载完成
|
|
301
|
-
* @param panoId - 对应的点位
|
|
302
|
-
*/
|
|
303
|
-
panoLoaded(panoId: WorkPanoId): void;
|
|
304
|
-
/**
|
|
305
|
-
* 某个观察点的全景资源加载失败
|
|
306
|
-
* @param error - 错误对象
|
|
307
|
-
* @param panoId - 对应的点位
|
|
308
|
-
*/
|
|
309
|
-
panoLoadError(error: Error, panoId: WorkPanoId): void;
|
|
310
|
-
/**
|
|
311
|
-
* 移动到某个观察点位被取消
|
|
312
|
-
* @description
|
|
313
|
-
* 这个有一些情况会导致
|
|
314
|
-
* - 移动过程中切换模态
|
|
315
|
-
* - 移动过程中 five 被析构
|
|
316
|
-
* - 移动过程点击切换到另一个点位
|
|
317
|
-
* @param panoId - 对应的点位
|
|
318
|
-
*/
|
|
319
|
-
moveToPanoCanceled(panoId: WorkPanoId): void;
|
|
320
|
-
/**
|
|
321
|
-
* 开始移动到某个观察点位
|
|
322
|
-
* @description
|
|
323
|
-
* 和 moveToPano 相比
|
|
324
|
-
* - moveToPano 在加载全景图资源前触发
|
|
325
|
-
* - panoWillArrive 在加载全景图资源后触发
|
|
326
|
-
* @param panoId - 移动到点位
|
|
327
|
-
* @param pose - 相机姿态
|
|
328
|
-
* @param userAction - 是否用户触发
|
|
329
|
-
*/
|
|
330
|
-
panoWillArrive(panoId: WorkPanoId, pose: Pose, userAction: boolean): void;
|
|
331
|
-
/**
|
|
332
|
-
* 移动到某个观察点位
|
|
333
|
-
* @param panoIndex - 移动到点位
|
|
334
|
-
* @param pose - 相机姿态
|
|
335
|
-
* @param userAction - 是否用户触发
|
|
336
|
-
*/
|
|
337
|
-
panoArrived(panoId: WorkPanoId, pose: Pose, userAction: boolean): void;
|
|
338
|
-
/**
|
|
339
|
-
* 移动中, 会告知移动状态(耗时百分比)
|
|
340
|
-
* @param panoId - 将要移动到的点位下标
|
|
341
|
-
* @param prevPanoId - 上一个点位下标
|
|
342
|
-
* @param progress - 整个过程经度 [0-1]
|
|
343
|
-
*/
|
|
344
|
-
movingToPano(panoId: WorkPanoId, prevPanoId: WorkPanoId, progress: number): void;
|
|
345
|
-
/**
|
|
346
|
-
* 意图要触发手势, 可以通过 `return false` 阻止
|
|
347
|
-
* @param type - 手势类型
|
|
348
|
-
* @param pointers - 手指位置
|
|
349
|
-
* @param final - 是否手势结束
|
|
350
|
-
* @returns 可以通过 `return false` 阻止
|
|
351
|
-
*/
|
|
352
|
-
wantsGesture(type: GestureTypes, pointers: {
|
|
353
|
-
x: number;
|
|
354
|
-
y: number;
|
|
355
|
-
delta?: number;
|
|
356
|
-
}[], final: boolean): void | false;
|
|
357
|
-
/**
|
|
358
|
-
* 手势 触发
|
|
359
|
-
* @param type - 手势类型
|
|
360
|
-
* @param pointers - 手指位置
|
|
361
|
-
* @param final - 是否手势结束
|
|
362
|
-
*/
|
|
363
|
-
gesture(type: GestureTypes, pointers: {
|
|
364
|
-
x: number;
|
|
365
|
-
y: number;
|
|
366
|
-
delta?: number;
|
|
367
|
-
}[], final: boolean): void;
|
|
368
|
-
/**
|
|
369
|
-
* 意图要触发 pan 手势(滑动屏幕), 可以通过 `return false` 阻止
|
|
370
|
-
* @param pose - 意图的相机姿态
|
|
371
|
-
* @param final - 是否手势结束
|
|
372
|
-
* @returns 可以通过 `return false` 阻止
|
|
373
|
-
*/
|
|
374
|
-
wantsPanGesture(pose: Pose, final: boolean): void | false;
|
|
375
|
-
/**
|
|
376
|
-
* pan 手势(滑动屏幕) 被触发
|
|
377
|
-
* @param pose - 相机姿态
|
|
378
|
-
* @param final - 是否手势结束
|
|
379
|
-
*/
|
|
380
|
-
panGesture(pose: Pose, final: boolean): void;
|
|
381
|
-
/**
|
|
382
|
-
* 意图要触发 pan 手势(滑动屏幕) 的惯性运动, 可以通过 `return false` 阻止
|
|
383
|
-
* @param pose - 意图的相机姿态
|
|
384
|
-
* @param final - 是否手势结束
|
|
385
|
-
* @returns 可以通过 `return false` 阻止
|
|
386
|
-
*/
|
|
387
|
-
wantsInteriaPan(pose: Pose): void | false;
|
|
388
|
-
/**
|
|
389
|
-
* pan 手势(滑动屏幕) 的惯性运动
|
|
390
|
-
* @param pose - 意图的相机姿态
|
|
391
|
-
* @param final - 是否手势结束
|
|
392
|
-
*/
|
|
393
|
-
interiaPan(pose: Pose, final: boolean): void;
|
|
394
|
-
/**
|
|
395
|
-
* 意图要触发 tap 手势(点击屏幕), 可以通过 `return false` 阻止
|
|
396
|
-
* @param raycaster - 点击对应的三维射线
|
|
397
|
-
* @param tapPosition - 点击对应的屏幕位置
|
|
398
|
-
* @param final - 是否手势结束
|
|
399
|
-
* @returns 可以通过 `return false` 阻止
|
|
400
|
-
*/
|
|
401
|
-
wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void | false;
|
|
402
|
-
/**
|
|
403
|
-
* tap 手势(点击屏幕) 被触发
|
|
404
|
-
* @param raycaster - 点击对应的三维射线
|
|
405
|
-
* @param tapPosition - 点击对应的屏幕位置
|
|
406
|
-
* @param final - 是否手势结束
|
|
407
|
-
*/
|
|
408
|
-
tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void;
|
|
409
|
-
/**
|
|
410
|
-
* 意图要触发 pinch 手势(双指缩放),可以通过 `return false` 阻止
|
|
411
|
-
* @param scale - 缩放数值
|
|
412
|
-
* @param nextFov - 意图的fov变更
|
|
413
|
-
* @param final - 是否手势结束
|
|
414
|
-
* @returns 可以通过 `return false` 阻止
|
|
415
|
-
*/
|
|
416
|
-
wantsPinchGesture(scale: number, nextFov: number, final: boolean): void | false;
|
|
417
|
-
/**
|
|
418
|
-
* 意图要触发 press 手势(长按屏幕), 可以通过 `return false` 阻止
|
|
419
|
-
* @param raycaster - 长按对应的三维射线
|
|
420
|
-
* @param tapPosition - 长按对应的屏幕位置
|
|
421
|
-
* @param duration - 长按持续时间
|
|
422
|
-
* @param final - 是否手势结束
|
|
423
|
-
* @returns 可以通过 `return false` 阻止
|
|
424
|
-
*/
|
|
425
|
-
wantsPressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void | false;
|
|
426
|
-
/**
|
|
427
|
-
* tap 手势(点击屏幕) 被触发
|
|
428
|
-
* @param raycaster - 点击对应的三维射线
|
|
429
|
-
* @param tapPosition - 点击对应的屏幕位置
|
|
430
|
-
* @param duration - 长按持续时间
|
|
431
|
-
* @param final - 是否手势结束
|
|
432
|
-
*/
|
|
433
|
-
pressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void;
|
|
434
|
-
/**
|
|
435
|
-
* pinch 手势(双指缩放) 被触发
|
|
436
|
-
* @param scale - 缩放数值
|
|
437
|
-
* @param nextFov - 意图的fov变更
|
|
438
|
-
* @param final - 是否手势结束
|
|
439
|
-
*/
|
|
440
|
-
pinchGesture(scale: number, fov: number, final: boolean): void;
|
|
441
|
-
/**
|
|
442
|
-
* 意图要触发 鼠标滚轮 可以通过 `return false` 阻止
|
|
443
|
-
* @param delta - 滚轮数值
|
|
444
|
-
* @param nextFov - 意图的fov变更
|
|
445
|
-
* @param final - 是否手势结束
|
|
446
|
-
* @returns 可以通过 `return false` 阻止
|
|
447
|
-
*/
|
|
448
|
-
wantsMouseWheel(delta: number, nextFov: number, final: boolean): void | false;
|
|
449
|
-
/**
|
|
450
|
-
* 鼠标滚轮被触发
|
|
451
|
-
* @param delta - 滚轮数值
|
|
452
|
-
* @param nextFov - 意图的fov变更
|
|
453
|
-
* @param final - 是否手势结束
|
|
454
|
-
*/
|
|
455
|
-
mouseWheel(delta: number, fov: number, final: boolean): void;
|
|
456
|
-
/**
|
|
457
|
-
* 鼠标焦点环位置被重新计算
|
|
458
|
-
* @param intersection - 焦点碰撞结果
|
|
459
|
-
* @param mesh - 焦点环 mesh
|
|
460
|
-
*/
|
|
461
|
-
intersectionOnModelUpdate(intersection: Intersection, mesh: IntersectMeshInterface): void;
|
|
462
|
-
/**
|
|
463
|
-
* 意图要展示鼠标焦点环,可以通过 `return false` 阻止
|
|
464
|
-
* @param intersection - 焦点碰撞结果
|
|
465
|
-
* @returns 可以通过 `return false` 阻止
|
|
466
|
-
*/
|
|
467
|
-
wantsShowIntersectionOnModel(raycaster: THREE_2.Raycaster): void | false;
|
|
468
|
-
/** 鼠标焦点环被隐藏 */
|
|
469
|
-
intersectionHidden(): void;
|
|
470
|
-
/** 意图要退出VR眼镜模式 */
|
|
471
|
-
vrWantsToExit(): void;
|
|
472
|
-
/**
|
|
473
|
-
* 观察点的全景资源开始加载
|
|
474
|
-
* @param panoId - 加载点位
|
|
475
|
-
*/
|
|
476
|
-
textureStartLoad(panoId: WorkPanoId): void;
|
|
477
|
-
/**
|
|
478
|
-
* 观察点的全景资源加载中,可获取到进度
|
|
479
|
-
* @param progress - 加载进度 [0-1]
|
|
480
|
-
* @param panoId - 加载点位下标
|
|
481
|
-
*/
|
|
482
|
-
textureLoading(progress: number, panoId: WorkPanoId): void;
|
|
483
|
-
/**
|
|
484
|
-
* 观察点的全景资源加载被中止
|
|
485
|
-
* @param panoId - 加载点位
|
|
486
|
-
*/
|
|
487
|
-
textureAbort(panoId: WorkPanoId): void;
|
|
488
|
-
/**
|
|
489
|
-
* 观察点的全景资源加载失败
|
|
490
|
-
* @param error - 错误对象
|
|
491
|
-
* @param panoId - 加载点位
|
|
492
|
-
*/
|
|
493
|
-
textureError(error: Error, panoId: WorkPanoId): void;
|
|
494
|
-
/**
|
|
495
|
-
* 观察点的全景资源加载完成
|
|
496
|
-
* @param panoId - 加载点位
|
|
497
|
-
*/
|
|
498
|
-
textureLoaded(panoId: WorkPanoId, meta: (NetWorkMeta | null)[]): void;
|
|
499
|
-
/**
|
|
500
|
-
* 抛出错误
|
|
501
|
-
* @param error - 抛出错误
|
|
502
|
-
*/
|
|
503
|
-
error(error: Error): void;
|
|
504
|
-
/**
|
|
505
|
-
* webXR模式开始,webxr session完成坐标系矫正
|
|
506
|
-
*/
|
|
507
|
-
webXRSessionStart(): void;
|
|
508
|
-
/**
|
|
509
|
-
* webXR模式结束,webxr session销毁
|
|
510
|
-
*/
|
|
511
|
-
webXRSessionEnd(): void;
|
|
512
|
-
/**
|
|
513
|
-
* axes代表控制杆,axes数组的0-1元素分别代表左控制器的左(-1)右(1),左控制器的上(-1)下(1),axes数组的2-3元素同理
|
|
514
|
-
*/
|
|
515
|
-
webXRControllerEvent(type: WebXRControllerType, key: WebXRControllerKey, params: WebXRControllerParams): void;
|
|
234
|
+
/** 手势 滑动屏幕 */
|
|
235
|
+
"gesture.pan"(event: GestureEvent): void;
|
|
236
|
+
/** 手势 点击屏幕 */
|
|
237
|
+
"gesture.tap"(event: GestureEvent): void;
|
|
238
|
+
/** 手势 长按屏幕 */
|
|
239
|
+
"gesture.press"(event: GestureEvent): void;
|
|
240
|
+
/** 手势 双指缩放 */
|
|
241
|
+
"gesture.pinch"(event: GestureEvent): void;
|
|
242
|
+
/** 手势 鼠标滚轮 */
|
|
243
|
+
"gesture.mousewheel"(event: GestureEvent): void;
|
|
244
|
+
/** 手势 鼠标移动 */
|
|
245
|
+
"gesture.mousemove"(event: GestureEvent): void;
|
|
246
|
+
/** 手势 惯性 */
|
|
247
|
+
"gesture.momentum"(event: GestureEvent): void;
|
|
248
|
+
/** 模态切换动画 开始 */
|
|
249
|
+
"initAnimation.start"(event: StateEvent): void;
|
|
250
|
+
/** 模态切换动画 结束 */
|
|
251
|
+
"initAnimation.end"(event: StateEvent): void;
|
|
252
|
+
/** 相机改变 */
|
|
253
|
+
"camera.update"(event: StateEvent): void;
|
|
254
|
+
"intersect.update"(event: IntersectEvent): void;
|
|
255
|
+
/** 选择 */
|
|
256
|
+
"pano.select"(event: PanoEvent): void;
|
|
257
|
+
/** 请求点位 */
|
|
258
|
+
"pano.request"(event: PanoEvent): void;
|
|
259
|
+
/** 运动去点位 */
|
|
260
|
+
"pano.moveTo"(event: PanoEvent): void;
|
|
261
|
+
/** 运动点位过程 */
|
|
262
|
+
"pano.moving"(event: PanoEvent): void;
|
|
263
|
+
/** 运动到达点位 */
|
|
264
|
+
"pano.arrived"(event: PanoEvent): void;
|
|
265
|
+
/** 取消运动点位 */
|
|
266
|
+
"pano.cancel"(event: PanoEvent): void;
|
|
267
|
+
/** 运动点位出错 */
|
|
268
|
+
"pano.error"(event: PanoEvent): void;
|
|
269
|
+
/** 加载全景材质 */
|
|
270
|
+
"pano.texture.load"(event: PanoTextureEvent): void;
|
|
271
|
+
/** 加载全景材质进度 */
|
|
272
|
+
"pano.texture.progress"(event: PanoTextureEvent): void;
|
|
273
|
+
/** 加载全景材质成功 */
|
|
274
|
+
"pano.texture.success"(event: PanoTextureEvent): void;
|
|
275
|
+
/** 加载全景材质失败 */
|
|
276
|
+
"pano.texture.error"(event: PanoTextureEvent): void;
|
|
277
|
+
/** 加载全景材质中止 */
|
|
278
|
+
"pano.texture.abort"(event: PanoTextureEvent): void;
|
|
279
|
+
/** VRPanorama 请求退出 */
|
|
280
|
+
"vr.requestExit"(event: BaseEvent): void;
|
|
281
|
+
/** XR 退出 */
|
|
282
|
+
"xr.session.end"(event: XRSessionEvent_2): void;
|
|
283
|
+
/** XR 进入 */
|
|
284
|
+
"xr.session.start"(event: XRSessionEvent_2): void;
|
|
285
|
+
/** XR 手势(按钮) */
|
|
286
|
+
"xr.gesture.tap"(event: XRGestureEvent): void;
|
|
287
|
+
/** 抛出错误 */
|
|
288
|
+
"error"(error: Error): void;
|
|
516
289
|
};
|
|
517
290
|
|
|
518
291
|
export declare class CullingVolume {
|
|
@@ -545,7 +318,7 @@ export declare interface DepthPanoramaControllerCustomInitArgs extends PanoramaL
|
|
|
545
318
|
*/
|
|
546
319
|
panoTapTriggerRadius?: number;
|
|
547
320
|
/** 地面观察点标识自定义创建器 */
|
|
548
|
-
panoCircleMeshCreator?: (
|
|
321
|
+
panoCircleMeshCreator?: (pano: Pano) => PanoCircleMeshInterface;
|
|
549
322
|
}
|
|
550
323
|
|
|
551
324
|
/**
|
|
@@ -561,132 +334,49 @@ export declare interface EventCallback extends EventTypes {
|
|
|
561
334
|
* @description
|
|
562
335
|
* 具体事件列表 请查看 {@link EventCallback}
|
|
563
336
|
*/
|
|
564
|
-
export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROLLER_EVENT_NAMES[number]> & {
|
|
565
|
-
/**
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
modelLoaded(models: Models): void;
|
|
606
|
-
/**
|
|
607
|
-
* 模型楼层切换
|
|
608
|
-
* @param shownFloor - 模型楼层
|
|
609
|
-
*/
|
|
610
|
-
modelShownFloorChange(shownFloor: number | null): void;
|
|
611
|
-
/**
|
|
612
|
-
* 渲染循环
|
|
613
|
-
* @param rendered - 是否渲染了
|
|
614
|
-
*/
|
|
615
|
-
renderFrame(rendered: boolean): void;
|
|
616
|
-
/**
|
|
617
|
-
* 当前 fps 变化
|
|
618
|
-
* @param fps - 当前刷新率
|
|
619
|
-
*/
|
|
620
|
-
fps(fps: number): void;
|
|
621
|
-
/**
|
|
622
|
-
* 当目标 state 变化时
|
|
623
|
-
* @param state - 当前姿态状态
|
|
624
|
-
* @param userAction - 是否用户触发
|
|
625
|
-
*/
|
|
626
|
-
stateChange(state: State, userAction: boolean): void;
|
|
627
|
-
/**
|
|
628
|
-
* 当前实时 state 变化时
|
|
629
|
-
* @param state - 当前姿态状态
|
|
630
|
-
* @param userAction - 是否用户触发
|
|
631
|
-
*/
|
|
632
|
-
currentStateChange(state: State, userAction: boolean): void;
|
|
633
|
-
/**
|
|
634
|
-
* 当 setState 方法被调用
|
|
635
|
-
* @param state - 当前姿态状态
|
|
636
|
-
*/
|
|
637
|
-
setState(state: State): void;
|
|
638
|
-
/**
|
|
639
|
-
* 当 state 被同步完成时
|
|
640
|
-
* @param state - 当前姿态状态
|
|
641
|
-
*/
|
|
642
|
-
stateSynced(state: State): void;
|
|
643
|
-
/**
|
|
644
|
-
* 意图要移动到某个点时, 可以通过 return false 阻止
|
|
645
|
-
* @param panoId - 意图要移动到点位
|
|
646
|
-
* @param options - 移动参数
|
|
647
|
-
* @param userAction - 是否用户触发
|
|
648
|
-
* @returns 可以通过 return false 阻止
|
|
649
|
-
*/
|
|
650
|
-
wantsMoveToPano(panoId: WorkPanoId, options: MovePanoOptions, userAction: boolean): void | false;
|
|
651
|
-
/**
|
|
652
|
-
* 同 wantsMoveToPano
|
|
653
|
-
* @description
|
|
654
|
-
* @param panoId - 意图要移动到点位
|
|
655
|
-
* @param options - 移动参数
|
|
656
|
-
* @param userAction - 是否用户触发
|
|
657
|
-
* @returns 可以通过 return false 阻止
|
|
658
|
-
*/
|
|
659
|
-
wantsToMoveToPano(panoId: WorkPanoId, options: MovePanoOptions, userAction: boolean): void;
|
|
660
|
-
/**
|
|
661
|
-
* 意图要切换到某个模态, 可以通过 return false 阻止
|
|
662
|
-
* @param mode - 意图要切换到的模态
|
|
663
|
-
* @param prevMode - 当前模态
|
|
664
|
-
* @returns 可以通过 return false 阻止
|
|
665
|
-
*/
|
|
666
|
-
wantsChangeMode(mode: Mode, prevMode: Mode): void | false;
|
|
667
|
-
/**
|
|
668
|
-
* 模态切换完成
|
|
669
|
-
* @param mode - 切换到的模态
|
|
670
|
-
* @param prevMode - 上本质是一个模态
|
|
671
|
-
* @param panoIndex - 初始化动画结束后的点位下标
|
|
672
|
-
* @param toPose - 初始化动画结束后的状态
|
|
673
|
-
* @param userAction - 是否用户触发
|
|
674
|
-
*/
|
|
675
|
-
modeChange(mode: Mode, prevMode: Mode, panoId: WorkPanoId, toPose: Pose, userAction: boolean): void;
|
|
676
|
-
/**
|
|
677
|
-
* 帮助元素显应的变换
|
|
678
|
-
* @param visible - 帮助元素的是否开启
|
|
679
|
-
*/
|
|
680
|
-
helpersVisibleChange(visible: boolean): void;
|
|
681
|
-
/**
|
|
682
|
-
* 网络资源分析
|
|
683
|
-
* @param source - 资源地址
|
|
684
|
-
* @param state - 状态
|
|
685
|
-
* @param detail - 详情
|
|
686
|
-
*/
|
|
687
|
-
network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
|
|
337
|
+
export declare type EventTypes = Pick<ControllerEventTypes, typeof PROXY_CONTROLLER_EVENT_NAMES[number]> & LegacyEventType & {
|
|
338
|
+
/** 请求点位 */
|
|
339
|
+
"pano.request"(event: PanoEvent): void;
|
|
340
|
+
/** 内部错误 */
|
|
341
|
+
"error"(error: Error): void;
|
|
342
|
+
/** 请求 work数据 */
|
|
343
|
+
"works.request"(event: WorksEvent): void;
|
|
344
|
+
/** 加载 work */
|
|
345
|
+
"works.load"(event: WorksEvent): void;
|
|
346
|
+
/** 设置 state */
|
|
347
|
+
"state.set"(event: StateEvent): void;
|
|
348
|
+
/** 当 state 变化 */
|
|
349
|
+
"state.change"(event: StateEvent): void;
|
|
350
|
+
/** 当 state 同步完成 */
|
|
351
|
+
"state.synced"(event: StateEvent): void;
|
|
352
|
+
/** 当前 state 变化 */
|
|
353
|
+
"currentState.change"(event: StateEvent): void;
|
|
354
|
+
/** 当模型加载 */
|
|
355
|
+
"model.request"(event: ModelEvent): void;
|
|
356
|
+
/** 当模型修改楼层 */
|
|
357
|
+
"model.load"(event: ModelEvent): void;
|
|
358
|
+
/** 当模型错误 */
|
|
359
|
+
"model.error"(event: ModelEvent): void;
|
|
360
|
+
/** 当模型修改楼层 */
|
|
361
|
+
"model.changeShownFloor"(event: ModelEvent): void;
|
|
362
|
+
/** 模型加载完成 */
|
|
363
|
+
"models.load"(event: ModelsEvent): void;
|
|
364
|
+
/** 渲染前 */
|
|
365
|
+
"render.prepare"(event: RenderEvent): void;
|
|
366
|
+
/** 渲染后 */
|
|
367
|
+
"render"(event: RenderEvent): void;
|
|
368
|
+
/** 请求改变 mode */
|
|
369
|
+
"mode.change.request"(event: ModeChangeEvent): void;
|
|
370
|
+
/** 改变 mode */
|
|
371
|
+
"mode.change"(event: ModeChangeEvent): void;
|
|
372
|
+
/** 改变 helpers 元素可见 */
|
|
373
|
+
"helpers.visible"(event: ObjectEvent): void;
|
|
374
|
+
/** 网络资源 */
|
|
375
|
+
"network.resource"(event: NetworkResourceEvent): void;
|
|
376
|
+
/** 当前 fps 变化 */
|
|
377
|
+
"fps"(fps: number): void;
|
|
688
378
|
/** five 被析构。 插件中请监听用于自身析构 */
|
|
689
|
-
dispose(): void;
|
|
379
|
+
"dispose"(): void;
|
|
690
380
|
};
|
|
691
381
|
|
|
692
382
|
/**
|
|
@@ -732,7 +422,7 @@ export declare class Five extends Subscribe<EventTypes> {
|
|
|
732
422
|
*/
|
|
733
423
|
paused: boolean;
|
|
734
424
|
/** 当前点位序号 */
|
|
735
|
-
|
|
425
|
+
pano: Pano;
|
|
736
426
|
/** 当前展示的模式 */
|
|
737
427
|
currentMode: Mode;
|
|
738
428
|
/** 内部使用的 `THREE.Scene` */
|
|
@@ -760,6 +450,7 @@ export declare class Five extends Subscribe<EventTypes> {
|
|
|
760
450
|
renderer?: THREE_2.WebGLRenderer;
|
|
761
451
|
/** 当前加载的模型 */
|
|
762
452
|
models: Models;
|
|
453
|
+
private lastModels;
|
|
763
454
|
/**
|
|
764
455
|
* 是否需要渲染
|
|
765
456
|
* @description
|
|
@@ -813,6 +504,19 @@ export declare class Five extends Subscribe<EventTypes> {
|
|
|
813
504
|
* ```
|
|
814
505
|
*/
|
|
815
506
|
state: State;
|
|
507
|
+
info: null | {
|
|
508
|
+
memory: {
|
|
509
|
+
geometries: number;
|
|
510
|
+
textures: number;
|
|
511
|
+
};
|
|
512
|
+
render: {
|
|
513
|
+
calls: number;
|
|
514
|
+
frame: number;
|
|
515
|
+
lines: number;
|
|
516
|
+
points: number;
|
|
517
|
+
triangles: number;
|
|
518
|
+
};
|
|
519
|
+
};
|
|
816
520
|
/** 插件暴露的方法 */
|
|
817
521
|
plugins: {
|
|
818
522
|
[key: string]: FivePluginInstance<any>;
|
|
@@ -834,7 +538,6 @@ export declare class Five extends Subscribe<EventTypes> {
|
|
|
834
538
|
private extraElements;
|
|
835
539
|
private getPixelsRenderTarget;
|
|
836
540
|
private readyCallbacks;
|
|
837
|
-
private modelPending;
|
|
838
541
|
private syncingState;
|
|
839
542
|
/**
|
|
840
543
|
* 是否开启 IOS EDR 模式
|
|
@@ -1031,7 +734,7 @@ export declare class Five extends Subscribe<EventTypes> {
|
|
|
1031
734
|
/**
|
|
1032
735
|
* 获取观测点
|
|
1033
736
|
*/
|
|
1034
|
-
get observers():
|
|
737
|
+
get observers(): WorkResolvedObserver[];
|
|
1035
738
|
/**
|
|
1036
739
|
* 强制渲染
|
|
1037
740
|
* @description
|
|
@@ -1056,16 +759,14 @@ export declare class Five extends Subscribe<EventTypes> {
|
|
|
1056
759
|
* @param options - 移动点位参数
|
|
1057
760
|
* @param userAction - 是否用户触犯
|
|
1058
761
|
*/
|
|
1059
|
-
moveToPano(
|
|
1060
|
-
moveToPano(panoIndex: number, options?: MovePanoOptions, userAction?: boolean): Promise<void>;
|
|
762
|
+
moveToPano(pano: Pano | PanoId | number, options?: MovePanoOptions, userAction?: boolean): Promise<void>;
|
|
1061
763
|
/**
|
|
1062
764
|
* 预加载点位图片资源
|
|
1063
|
-
* @param
|
|
765
|
+
* @param pano - 观察点序号
|
|
1064
766
|
* @param callback - 加载完成回调, 并传递加载用时。
|
|
1065
767
|
* @returns 加载完成的 Promise 参数同 callback
|
|
1066
768
|
*/
|
|
1067
|
-
preloadPano(
|
|
1068
|
-
preloadPano(panoIndex: number, callback?: (costs: number) => void): Promise<number>;
|
|
769
|
+
preloadPano(pano: Pano | PanoId | number, callback?: (costs: number) => void): Promise<number>;
|
|
1069
770
|
/**
|
|
1070
771
|
* 计算三维坐标对应到屏幕的二维坐标
|
|
1071
772
|
* @description
|
|
@@ -1125,8 +826,6 @@ export declare class Five extends Subscribe<EventTypes> {
|
|
|
1125
826
|
private applyController;
|
|
1126
827
|
/** 移除事件绑定 */
|
|
1127
828
|
private removeEventListeners;
|
|
1128
|
-
/** 销毁GPU Picking 所用的材质 */
|
|
1129
|
-
private diposeGPUPickingMaterial;
|
|
1130
829
|
}
|
|
1131
830
|
|
|
1132
831
|
/** Five 初始化参数 */
|
|
@@ -1258,176 +957,608 @@ export declare interface FiveInitArgs {
|
|
|
1258
957
|
* 单位毫秒
|
|
1259
958
|
* @default `800`
|
|
1260
959
|
*/
|
|
1261
|
-
modeChangeDuration?: number;
|
|
960
|
+
modeChangeDuration?: number;
|
|
961
|
+
/**
|
|
962
|
+
* 插件定义
|
|
963
|
+
* @description
|
|
964
|
+
* 详见插件部分。
|
|
965
|
+
*/
|
|
966
|
+
plugins?: (FivePlugin<void> | FivePluginInit<FivePlugin<any, any>> | FivePluginInit<FivePlugin<void, any>>)[];
|
|
967
|
+
/**
|
|
968
|
+
* 是否展示 powered by 如视
|
|
969
|
+
*/
|
|
970
|
+
poweredByRealsee?: boolean;
|
|
971
|
+
/**
|
|
972
|
+
* 是否使用webgl2渲染执行环境, 默认值 false
|
|
973
|
+
*/
|
|
974
|
+
webgl2?: boolean;
|
|
975
|
+
/**
|
|
976
|
+
* 是否开启模型裁切
|
|
977
|
+
*/
|
|
978
|
+
localClippingEnabled?: boolean;
|
|
979
|
+
/**
|
|
980
|
+
* 请求代理
|
|
981
|
+
* @param url - 发起的请求
|
|
982
|
+
* @returns 返回的请求
|
|
983
|
+
*/
|
|
984
|
+
requestProxy?(url: string): string | Promise<string>;
|
|
985
|
+
/**
|
|
986
|
+
* 模型lod相关的配置,maxDepth为加载的最大深度
|
|
987
|
+
*/
|
|
988
|
+
modelLod?: {
|
|
989
|
+
maxDepth?: number;
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* Five 插件
|
|
995
|
+
* [[include:plugins.md]]
|
|
996
|
+
* @template Parameters - 插件参数, 没有参数则为 void
|
|
997
|
+
* @template Returns - 如果有参数则插件暴露的 api,没有参数则不传
|
|
998
|
+
*/
|
|
999
|
+
export declare type FivePlugin<Parameters = void, Returns = void> = Parameters extends void ? ((five: Five) => Returns) : ((five: Five, parameters: Parameters) => Returns);
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* 获取插件在Five中的初始化结构
|
|
1003
|
+
* @template T - Five 插件
|
|
1004
|
+
*/
|
|
1005
|
+
export declare type FivePluginInit<T extends FivePlugin<any, any>> = Parameters<T>[1] extends undefined ? [
|
|
1006
|
+
Plugin: T,
|
|
1007
|
+
instanceName: null | string
|
|
1008
|
+
] : [
|
|
1009
|
+
Plugin: T,
|
|
1010
|
+
instanceName: null | string,
|
|
1011
|
+
parameters: Parameters<T>[1]
|
|
1012
|
+
];
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* 获取插件暴露的 api
|
|
1016
|
+
* @template T - Five 插件
|
|
1017
|
+
*/
|
|
1018
|
+
export declare type FivePluginInstance<T extends FivePlugin<any, any>> = ReturnType<T>;
|
|
1019
|
+
|
|
1020
|
+
export declare interface FloorplanControllerCustomInitArgs {
|
|
1021
|
+
/** 默认俯仰角 */
|
|
1022
|
+
defaultLatitude?: number;
|
|
1023
|
+
/** 最大俯仰角 */
|
|
1024
|
+
maxLatitude?: number;
|
|
1025
|
+
/** 最小俯仰角 */
|
|
1026
|
+
minLatitude?: number;
|
|
1027
|
+
/** 默认相机可视角度(垂直),可作为 `zoom` */
|
|
1028
|
+
defaultFov?: number;
|
|
1029
|
+
/** 最大相机可视角度 */
|
|
1030
|
+
maxFov?: number;
|
|
1031
|
+
/** 最小相机可视角度 */
|
|
1032
|
+
minFov?: number;
|
|
1033
|
+
/** 鼠标焦点环自定义创建器 */
|
|
1034
|
+
intersectMeshCreator?: () => IntersectMeshInterface;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
export declare interface GestureEvent extends StateEvent {
|
|
1038
|
+
target: EventTarget | null;
|
|
1039
|
+
pointerType: 'touch' | 'pen' | 'mouse' | 'kinect';
|
|
1040
|
+
srcEvent: MouseEvent | TouchEvent | PointerEvent;
|
|
1041
|
+
pointers: {
|
|
1042
|
+
x: number;
|
|
1043
|
+
y: number;
|
|
1044
|
+
delta: number;
|
|
1045
|
+
buttons: number;
|
|
1046
|
+
coords: THREE_2.Vector2;
|
|
1047
|
+
raycaster: THREE_2.Raycaster;
|
|
1048
|
+
}[];
|
|
1049
|
+
isFirst: boolean;
|
|
1050
|
+
isFinal: boolean;
|
|
1051
|
+
scale: number;
|
|
1052
|
+
center: {
|
|
1053
|
+
x: number;
|
|
1054
|
+
y: number;
|
|
1055
|
+
delta: number;
|
|
1056
|
+
buttons: number;
|
|
1057
|
+
coords: THREE_2.Vector2;
|
|
1058
|
+
raycaster: THREE_2.Raycaster;
|
|
1059
|
+
};
|
|
1060
|
+
velocityX: number;
|
|
1061
|
+
velocityY: number;
|
|
1062
|
+
overallVelocityX: number;
|
|
1063
|
+
overallVelocityY: number;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
export declare type GestureTypes = "pan" | "tap" | "pinch" | "press" | "mouseWheel" | "mouseMove";
|
|
1067
|
+
|
|
1068
|
+
export declare function getViewportScale(): number;
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* 图片参数
|
|
1072
|
+
*/
|
|
1073
|
+
export declare interface ImageOptions {
|
|
1074
|
+
/**
|
|
1075
|
+
* url 地址转化
|
|
1076
|
+
* @param url - 原始地址
|
|
1077
|
+
* @param options - 当前地址参数
|
|
1078
|
+
* @returns 转化后地址
|
|
1079
|
+
*/
|
|
1080
|
+
transform?: (url: string, options: ImageURLOptions) => string;
|
|
1081
|
+
/** 图片尺寸参数 尽量使用 2 的幂次 如 512 1024 2048 */
|
|
1082
|
+
size?: number;
|
|
1083
|
+
/** 图片质量参数(0-100) */
|
|
1084
|
+
quality?: number;
|
|
1085
|
+
/** 图片格式参数 */
|
|
1086
|
+
format?: "jpg" | "png" | "heif" | "webp" | "avif";
|
|
1087
|
+
/** 锐化参数 海外不支持 */
|
|
1088
|
+
sharpen?: number;
|
|
1089
|
+
mappings?: ImageURLMappings;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
export declare function imageSupport(): Promise<{
|
|
1093
|
+
avif: boolean;
|
|
1094
|
+
webp: boolean;
|
|
1095
|
+
}>;
|
|
1096
|
+
|
|
1097
|
+
export declare interface ImageURLMappings {
|
|
1098
|
+
[publicDomain: string]: {
|
|
1099
|
+
"type"?: string;
|
|
1100
|
+
"pano": [string, string];
|
|
1101
|
+
"tile": [string, string];
|
|
1102
|
+
"model": [string, string];
|
|
1103
|
+
"texture": [string];
|
|
1104
|
+
"default": [string];
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
export declare interface ImageURLOptions {
|
|
1109
|
+
/** 图片类型标识 */
|
|
1110
|
+
key: string;
|
|
1111
|
+
/** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
|
|
1112
|
+
size?: number;
|
|
1113
|
+
/** 图片质量参数(0-100) */
|
|
1114
|
+
quality?: number;
|
|
1115
|
+
/** 图片格式参数 */
|
|
1116
|
+
format?: "jpg" | "png" | "heif" | "webp" | "avif";
|
|
1117
|
+
/** 图片裁切 */
|
|
1118
|
+
cut?: [x: number, y: number, width: number, height: number];
|
|
1119
|
+
/** 锐化参数 海外不支持 */
|
|
1120
|
+
sharpen?: number;
|
|
1121
|
+
/** url匹配规则 */
|
|
1122
|
+
mappings?: ImageURLMappings;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
export declare class InternalWebGLRenderer extends THREE_2.WebGLRenderer {
|
|
1126
|
+
constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias, webgl2, }: {
|
|
1127
|
+
preserveDrawingBuffer?: boolean;
|
|
1128
|
+
backgroundColor?: number | THREE_2.Color;
|
|
1129
|
+
backgroundAlpha?: number;
|
|
1130
|
+
pixelRatio?: number;
|
|
1131
|
+
antialias?: boolean;
|
|
1132
|
+
webgl2?: boolean;
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
export declare interface IntersectEvent extends BaseEvent {
|
|
1137
|
+
object: THREE_2.Object3D;
|
|
1138
|
+
raycaster: THREE_2.Raycaster;
|
|
1139
|
+
intersection: Intersection | null;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
export declare interface Intersection {
|
|
1143
|
+
/** 焦点坐标 */
|
|
1144
|
+
point: THREE.Vector3;
|
|
1145
|
+
/** 焦点面片 */
|
|
1146
|
+
face?: {
|
|
1147
|
+
normal: THREE.Vector3;
|
|
1148
|
+
} | null;
|
|
1149
|
+
/** 焦点距离 */
|
|
1150
|
+
distance: number;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
export declare class IntersectMesh extends THREE_2.Object3D implements IntersectMeshInterface {
|
|
1154
|
+
private ringMesh;
|
|
1155
|
+
constructor();
|
|
1156
|
+
dispose(): void;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* 地面提示点位接口
|
|
1161
|
+
*/
|
|
1162
|
+
export declare interface IntersectMeshInterface extends THREE_2.Object3D {
|
|
1163
|
+
dispose(): void;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
export declare function isPanoId(id: any): id is PanoId;
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* 过时的事件列表
|
|
1170
|
+
*/
|
|
1171
|
+
export declare type LegacyEventType = {
|
|
1172
|
+
/**
|
|
1173
|
+
* 模态间切换动画开始
|
|
1174
|
+
* @param panoIndex - 当前点位
|
|
1175
|
+
* @param pose - 相机姿态
|
|
1176
|
+
* @param userAction - 是否用户触发
|
|
1177
|
+
*/
|
|
1178
|
+
initAnimationWillStart(panoIndex: number, pose: Pose, userAction: boolean): void;
|
|
1179
|
+
/**
|
|
1180
|
+
* 模态间切换动画结束
|
|
1181
|
+
* @param panoIndex - 当前点位
|
|
1182
|
+
* @param pose - 相机姿态
|
|
1183
|
+
* @param userAction - 是否用户触发
|
|
1184
|
+
*/
|
|
1185
|
+
initAnimationEnded(panoIndex: number, pose: Pose, userAction: boolean): void;
|
|
1186
|
+
/**
|
|
1187
|
+
* 意图要触发手势, 可以通过 `return false` 阻止
|
|
1188
|
+
* @param type - 手势类型
|
|
1189
|
+
* @param pointers - 手指位置
|
|
1190
|
+
* @param final - 是否手势结束
|
|
1191
|
+
* @returns 可以通过 `return false` 阻止
|
|
1192
|
+
*/
|
|
1193
|
+
wantsGesture(type: GestureTypes, pointers: {
|
|
1194
|
+
x: number;
|
|
1195
|
+
y: number;
|
|
1196
|
+
delta?: number;
|
|
1197
|
+
}[], final: boolean): void | false;
|
|
1198
|
+
/**
|
|
1199
|
+
* 手势 触发
|
|
1200
|
+
* @param type - 手势类型
|
|
1201
|
+
* @param pointers - 手指位置
|
|
1202
|
+
* @param final - 是否手势结束
|
|
1203
|
+
*/
|
|
1204
|
+
gesture(type: GestureTypes, pointers: {
|
|
1205
|
+
x: number;
|
|
1206
|
+
y: number;
|
|
1207
|
+
delta?: number;
|
|
1208
|
+
}[], final: boolean): void;
|
|
1209
|
+
/**
|
|
1210
|
+
* 意图要触发 pan 手势(滑动屏幕), 可以通过 `return false` 阻止
|
|
1211
|
+
* @param pose - 意图的相机姿态
|
|
1212
|
+
* @param final - 是否手势结束
|
|
1213
|
+
* @returns 可以通过 `return false` 阻止
|
|
1214
|
+
*/
|
|
1215
|
+
wantsPanGesture(pose: Pose, final: boolean): void | false;
|
|
1216
|
+
/**
|
|
1217
|
+
* pan 手势(滑动屏幕) 被触发
|
|
1218
|
+
* @param pose - 相机姿态
|
|
1219
|
+
* @param final - 是否手势结束
|
|
1220
|
+
*/
|
|
1221
|
+
panGesture(pose: Pose, final: boolean): void;
|
|
1222
|
+
/**
|
|
1223
|
+
* 意图要触发 tap 手势(点击屏幕), 可以通过 `return false` 阻止
|
|
1224
|
+
* @param raycaster - 点击对应的三维射线
|
|
1225
|
+
* @param tapPosition - 点击对应的屏幕位置
|
|
1226
|
+
* @param final - 是否手势结束
|
|
1227
|
+
* @returns 可以通过 `return false` 阻止
|
|
1228
|
+
*/
|
|
1229
|
+
wantsTapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void | false;
|
|
1230
|
+
/**
|
|
1231
|
+
* tap 手势(点击屏幕) 被触发
|
|
1232
|
+
* @param raycaster - 点击对应的三维射线
|
|
1233
|
+
* @param tapPosition - 点击对应的屏幕位置
|
|
1234
|
+
* @param final - 是否手势结束
|
|
1235
|
+
*/
|
|
1236
|
+
tapGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, final: boolean): void;
|
|
1237
|
+
/**
|
|
1238
|
+
* 意图要触发 pinch 手势(双指缩放),可以通过 `return false` 阻止
|
|
1239
|
+
* @param scale - 缩放数值
|
|
1240
|
+
* @param nextFov - 意图的fov变更
|
|
1241
|
+
* @param final - 是否手势结束
|
|
1242
|
+
* @returns 可以通过 `return false` 阻止
|
|
1243
|
+
*/
|
|
1244
|
+
wantsPinchGesture(scale: number, nextFov: number, final: boolean): void | false;
|
|
1245
|
+
/**
|
|
1246
|
+
* 意图要触发 press 手势(长按屏幕), 可以通过 `return false` 阻止
|
|
1247
|
+
* @param raycaster - 长按对应的三维射线
|
|
1248
|
+
* @param tapPosition - 长按对应的屏幕位置
|
|
1249
|
+
* @param duration - 长按持续时间
|
|
1250
|
+
* @param final - 是否手势结束
|
|
1251
|
+
* @returns 可以通过 `return false` 阻止
|
|
1252
|
+
*/
|
|
1253
|
+
wantsPressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void | false;
|
|
1254
|
+
/**
|
|
1255
|
+
* tap 手势(点击屏幕) 被触发
|
|
1256
|
+
* @param raycaster - 点击对应的三维射线
|
|
1257
|
+
* @param tapPosition - 点击对应的屏幕位置
|
|
1258
|
+
* @param duration - 长按持续时间
|
|
1259
|
+
* @param final - 是否手势结束
|
|
1260
|
+
*/
|
|
1261
|
+
pressGesture(raycaster: THREE_2.Raycaster, tapPosition: THREE_2.Vector2, duration: number, isFinal: boolean): void;
|
|
1262
|
+
/**
|
|
1263
|
+
* pinch 手势(双指缩放) 被触发
|
|
1264
|
+
* @param scale - 缩放数值
|
|
1265
|
+
* @param nextFov - 意图的fov变更
|
|
1266
|
+
* @param final - 是否手势结束
|
|
1267
|
+
*/
|
|
1268
|
+
pinchGesture(scale: number, fov: number, final: boolean): void;
|
|
1269
|
+
/**
|
|
1270
|
+
* 意图要触发 鼠标滚轮 可以通过 `return false` 阻止
|
|
1271
|
+
* @param delta - 滚轮数值
|
|
1272
|
+
* @param nextFov - 意图的fov变更
|
|
1273
|
+
* @param final - 是否手势结束
|
|
1274
|
+
* @returns 可以通过 `return false` 阻止
|
|
1275
|
+
*/
|
|
1276
|
+
wantsMouseWheel(delta: number, nextFov: number, final: boolean): void | false;
|
|
1277
|
+
/**
|
|
1278
|
+
* 鼠标滚轮被触发
|
|
1279
|
+
* @param delta - 滚轮数值
|
|
1280
|
+
* @param nextFov - 意图的fov变更
|
|
1281
|
+
* @param final - 是否手势结束
|
|
1282
|
+
*/
|
|
1283
|
+
mouseWheel(delta: number, fov: number, final: boolean): void;
|
|
1284
|
+
/**
|
|
1285
|
+
* 意图要触发 pan 手势(滑动屏幕) 的惯性运动, 可以通过 `return false` 阻止
|
|
1286
|
+
* @param pose - 意图的相机姿态
|
|
1287
|
+
* @param final - 是否手势结束
|
|
1288
|
+
* @returns 可以通过 `return false` 阻止
|
|
1289
|
+
*/
|
|
1290
|
+
wantsInteriaPan(pose: Pose): void | false;
|
|
1291
|
+
/**
|
|
1292
|
+
* pan 手势(滑动屏幕) 的惯性运动
|
|
1293
|
+
* @param pose - 意图的相机姿态
|
|
1294
|
+
* @param final - 是否手势结束
|
|
1295
|
+
*/
|
|
1296
|
+
interiaPan(pose: Pose, final: boolean): void;
|
|
1297
|
+
/**
|
|
1298
|
+
* 意图要变化相机的可视角度 可以通过 `return false` 阻止
|
|
1299
|
+
* @deprecated
|
|
1300
|
+
* 建议通过 初始化设置的 `defaultFov`, `maxFov`, `minFov` 来限制
|
|
1301
|
+
* @param fov - 意图要变化相机的可视角度
|
|
1302
|
+
* @returns 可以通过 `return false` 阻止
|
|
1303
|
+
*/
|
|
1304
|
+
wantsChangeCameraFov(fov: number): void | false;
|
|
1305
|
+
/**
|
|
1306
|
+
* 相机姿态变化
|
|
1307
|
+
* @param pose - 相机姿态
|
|
1308
|
+
* @param userAction - 是否用户触发
|
|
1309
|
+
*/
|
|
1310
|
+
cameraUpdate(pose: Pose, userAction: boolean): void;
|
|
1311
|
+
/**
|
|
1312
|
+
* 相机姿态中可视角度变化
|
|
1313
|
+
* @param fov - 相机的可视角度
|
|
1314
|
+
* @param userAction - 是否用户触发
|
|
1315
|
+
*/
|
|
1316
|
+
cameraFovUpdate(fov: Pose["fov"], userAction: boolean): void;
|
|
1317
|
+
/**
|
|
1318
|
+
* 相机姿态中相机位置变化
|
|
1319
|
+
* @param offset - 相机位置
|
|
1320
|
+
* @param userAction - 是否用户触发
|
|
1321
|
+
*/
|
|
1322
|
+
cameraPositionUpdate(offset: Pose["offset"], userAction: boolean): void;
|
|
1323
|
+
/**
|
|
1324
|
+
* 相机姿态中相机方向变化
|
|
1325
|
+
* @param coordinates - 相机姿态的俯仰角和偏航角
|
|
1326
|
+
* @param userAction - 是否用户触发
|
|
1327
|
+
*/
|
|
1328
|
+
cameraDirectionUpdate(coordinates: Pick<Pose, "longitude" | "latitude">, userAction: boolean): void;
|
|
1329
|
+
/**
|
|
1330
|
+
* 鼠标焦点环位置被重新计算
|
|
1331
|
+
* @param intersection - 焦点碰撞结果
|
|
1332
|
+
* @param mesh - 焦点环 mesh
|
|
1333
|
+
*/
|
|
1334
|
+
intersectionOnModelUpdate(intersection: Intersection, mesh: THREE_2.Object3D): void;
|
|
1335
|
+
/**
|
|
1336
|
+
* 意图要展示鼠标焦点环,可以通过 `return false` 阻止
|
|
1337
|
+
* @param intersection - 焦点碰撞结果
|
|
1338
|
+
* @returns 可以通过 `return false` 阻止
|
|
1339
|
+
*/
|
|
1340
|
+
wantsShowIntersectionOnModel(raycaster: THREE_2.Raycaster): void | false;
|
|
1341
|
+
/** 鼠标焦点环被隐藏 */
|
|
1342
|
+
intersectionHidden(): void;
|
|
1343
|
+
/**
|
|
1344
|
+
* 意图要移动到某个点时, 可以通过 return false 阻止
|
|
1345
|
+
* @param panoIndex - 意图要移动到点位
|
|
1346
|
+
* @param options - 移动参数
|
|
1347
|
+
* @param userAction - 是否用户触发
|
|
1348
|
+
* @returns 可以通过 return false 阻止
|
|
1349
|
+
*/
|
|
1350
|
+
wantsMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void | false;
|
|
1351
|
+
/**
|
|
1352
|
+
* 同 wantsMoveToPano
|
|
1353
|
+
* @description
|
|
1354
|
+
* @param panoIndex - 意图要移动到点位
|
|
1355
|
+
* @param options - 移动参数
|
|
1356
|
+
* @param userAction - 是否用户触发
|
|
1357
|
+
* @returns 可以通过 return false 阻止
|
|
1358
|
+
*/
|
|
1359
|
+
wantsToMoveToPano(panoIndex: number, options: MovePanoOptions, userAction: boolean): void;
|
|
1360
|
+
/**
|
|
1361
|
+
* 观察点位被选择
|
|
1362
|
+
* @param panoIndex - 选择的点位
|
|
1363
|
+
*/
|
|
1364
|
+
panoSelected(panoIndex: number | null): void;
|
|
1365
|
+
/**
|
|
1366
|
+
* 开始加载并移动到某个观察点位
|
|
1367
|
+
* @description
|
|
1368
|
+
* 可 panoWillArrive 相比
|
|
1369
|
+
* - moveToPano 在加载全景图资源前触发
|
|
1370
|
+
* - panoWillArrive 在加载全景图资源后触发
|
|
1371
|
+
* @param panoIndex - 移动到的点位
|
|
1372
|
+
* @param userAction - 是否用户触发
|
|
1373
|
+
*/
|
|
1374
|
+
moveToPano(panoIndex: number, userAction: boolean): void;
|
|
1375
|
+
/**
|
|
1376
|
+
* 移动中, 会告知移动状态(耗时百分比)
|
|
1377
|
+
* @param panoIndex - 将要移动到的点位下标
|
|
1378
|
+
* @param prevPanoIndex - 上一个点位下标
|
|
1379
|
+
* @param progress - 整个过程经度 [0-1]
|
|
1380
|
+
*/
|
|
1381
|
+
movingToPano(panoIndex: number, prevPanoIndex: number, progress: number): void;
|
|
1382
|
+
/**
|
|
1383
|
+
* 开始加载某个观察点的全景资源
|
|
1384
|
+
* @param pano - 移动到的点位
|
|
1385
|
+
*/
|
|
1386
|
+
panoWillLoad(panoIndex: number): void;
|
|
1387
|
+
/**
|
|
1388
|
+
* 某个观察点的全景资源加载完成
|
|
1389
|
+
* @param panoIndex - 对应的点位
|
|
1390
|
+
*/
|
|
1391
|
+
panoLoaded(panoIndex: number): void;
|
|
1392
|
+
/**
|
|
1393
|
+
* 开始移动到某个观察点位
|
|
1394
|
+
* @description
|
|
1395
|
+
* 和 moveToPano 相比
|
|
1396
|
+
* - moveToPano 在加载全景图资源前触发
|
|
1397
|
+
* - panoWillArrive 在加载全景图资源后触发
|
|
1398
|
+
* @param panoIndex - 移动到点位
|
|
1399
|
+
* @param pose - 相机姿态
|
|
1400
|
+
* @param userAction - 是否用户触发
|
|
1401
|
+
*/
|
|
1402
|
+
panoWillArrive(panoIndex: number, pose: Pose, userAction: boolean): void;
|
|
1403
|
+
/**
|
|
1404
|
+
* 移动到某个观察点位
|
|
1405
|
+
* @param panoIndex - 移动到点位
|
|
1406
|
+
* @param pose - 相机姿态
|
|
1407
|
+
* @param userAction - 是否用户触发
|
|
1408
|
+
*/
|
|
1409
|
+
panoArrived(panoIndex: number, pose: Pose, userAction: boolean): void;
|
|
1410
|
+
/**
|
|
1411
|
+
* 某个观察点的全景资源加载失败
|
|
1412
|
+
* @param error - 错误对象
|
|
1413
|
+
* @param panoIndex - 对应的点位
|
|
1414
|
+
*/
|
|
1415
|
+
panoLoadError(error: Error, panoIndex: number): void;
|
|
1416
|
+
/**
|
|
1417
|
+
* 移动到某个观察点位被取消
|
|
1418
|
+
* @description
|
|
1419
|
+
* 这个有一些情况会导致
|
|
1420
|
+
* - 移动过程中切换模态
|
|
1421
|
+
* - 移动过程中 five 被析构
|
|
1422
|
+
* - 移动过程点击切换到另一个点位
|
|
1423
|
+
* @param panoIndex - 对应的点位
|
|
1424
|
+
*/
|
|
1425
|
+
moveToPanoCanceled(panoIndex: number): void;
|
|
1426
|
+
/**
|
|
1427
|
+
* 观察点的全景资源开始加载
|
|
1428
|
+
* @param panoIndex - 加载点位
|
|
1429
|
+
*/
|
|
1430
|
+
textureStartLoad(panoIndex: number): void;
|
|
1431
|
+
/**
|
|
1432
|
+
* 观察点的全景资源加载中,可获取到进度
|
|
1433
|
+
* @param progress - 加载进度 [0-1]
|
|
1434
|
+
* @param panoIndex - 加载点位下标
|
|
1435
|
+
*/
|
|
1436
|
+
textureLoading(progress: number, panoIndex: number): void;
|
|
1437
|
+
/**
|
|
1438
|
+
* 观察点的全景资源加载被中止
|
|
1439
|
+
* @param panoIndex - 加载点位
|
|
1440
|
+
*/
|
|
1441
|
+
textureAbort(panoIndex: number): void;
|
|
1442
|
+
/**
|
|
1443
|
+
* 观察点的全景资源加载失败
|
|
1444
|
+
* @param error - 错误对象
|
|
1445
|
+
* @param panoIndex - 加载点位
|
|
1446
|
+
*/
|
|
1447
|
+
textureError(error: Error, panoIndex: number): void;
|
|
1448
|
+
/**
|
|
1449
|
+
* 观察点的全景资源加载完成
|
|
1450
|
+
* @param panoIndex - 加载点位
|
|
1451
|
+
*/
|
|
1452
|
+
textureLoaded(panoIndex: number, meta: (NetWorkMeta | null)[]): void;
|
|
1453
|
+
/**
|
|
1454
|
+
* webXR模式开始,webxr session完成坐标系矫正
|
|
1455
|
+
*/
|
|
1456
|
+
webXRSessionStart(): void;
|
|
1457
|
+
/**
|
|
1458
|
+
* webXR模式结束,webxr session销毁
|
|
1459
|
+
*/
|
|
1460
|
+
webXRSessionEnd(): void;
|
|
1461
|
+
/**
|
|
1462
|
+
* axes代表控制杆,axes数组的0-1元素分别代表左控制器的左(-1)右(1),左控制器的上(-1)下(1),axes数组的2-3元素同理
|
|
1463
|
+
*/
|
|
1464
|
+
webXRControllerEvent(type: WebXRControllerType, key: WebXRControllerKey, params: WebXRControllerParams): void;
|
|
1465
|
+
/**
|
|
1466
|
+
* 准备加载 Work 数据
|
|
1467
|
+
* @param input - 输入的 work
|
|
1468
|
+
* @param work - 归一化的标准 work
|
|
1469
|
+
* @param state - 加载时的姿态
|
|
1470
|
+
*/
|
|
1471
|
+
willLoad(input: any, work: Work, state: Partial<State>): void;
|
|
1472
|
+
/**
|
|
1473
|
+
* 开始加载 Work 数据
|
|
1474
|
+
* @param input - 输入的 work
|
|
1475
|
+
* @param work - 归一化的标准 work
|
|
1476
|
+
* @param state - 加载时的姿态
|
|
1477
|
+
*/
|
|
1478
|
+
load(input: any, work: Work, state: Partial<State>): void;
|
|
1479
|
+
/**
|
|
1480
|
+
* 加载完 Work 数据
|
|
1481
|
+
* @param input - 输入的 work
|
|
1482
|
+
* @param work - 归一化的标准 work
|
|
1483
|
+
*/
|
|
1484
|
+
loaded(input: any, work: Work): void;
|
|
1485
|
+
/**
|
|
1486
|
+
* 当目标 state 变化时
|
|
1487
|
+
* @param state - 当前姿态状态
|
|
1488
|
+
* @param userAction - 是否用户触发
|
|
1489
|
+
*/
|
|
1490
|
+
stateChange(state: State, userAction: boolean): void;
|
|
1491
|
+
/**
|
|
1492
|
+
* 当前实时 state 变化时
|
|
1493
|
+
* @param state - 当前姿态状态
|
|
1494
|
+
* @param userAction - 是否用户触发
|
|
1495
|
+
*/
|
|
1496
|
+
currentStateChange(state: State, userAction: boolean): void;
|
|
1497
|
+
/**
|
|
1498
|
+
* 当 setState 方法被调用
|
|
1499
|
+
* @param state - 当前姿态状态
|
|
1500
|
+
*/
|
|
1501
|
+
setState(state: State): void;
|
|
1502
|
+
/**
|
|
1503
|
+
* 当 state 被同步完成时
|
|
1504
|
+
* @param state - 当前姿态状态
|
|
1505
|
+
*/
|
|
1506
|
+
stateSynced(state: State): void;
|
|
1507
|
+
/**
|
|
1508
|
+
* 模型开始加载
|
|
1509
|
+
* @param workModel - 归一化的标准 work 中的 model 值
|
|
1510
|
+
*/
|
|
1511
|
+
modelWillLoad(workModel: WorkModel): void;
|
|
1512
|
+
/**
|
|
1513
|
+
* 模型加载错误
|
|
1514
|
+
* @param error - 错误对象
|
|
1515
|
+
* @param model - 加载完的 model
|
|
1516
|
+
*/
|
|
1517
|
+
modelLoadError(error: Error, model: Model): void;
|
|
1262
1518
|
/**
|
|
1263
|
-
*
|
|
1264
|
-
* @
|
|
1265
|
-
* 详见插件部分。
|
|
1519
|
+
* 模型加载完成
|
|
1520
|
+
* @param models - 加载完的 model
|
|
1266
1521
|
*/
|
|
1267
|
-
|
|
1522
|
+
modelLoaded(model: Model): void;
|
|
1268
1523
|
/**
|
|
1269
|
-
*
|
|
1524
|
+
* 模型楼层切换
|
|
1525
|
+
* @param shownFloor - 模型楼层
|
|
1270
1526
|
*/
|
|
1271
|
-
|
|
1527
|
+
modelShownFloorChange(shownFloor: number | null, floorLength: number): void;
|
|
1272
1528
|
/**
|
|
1273
|
-
*
|
|
1529
|
+
* 渲染循环
|
|
1530
|
+
* @param rendered - 是否渲染了
|
|
1274
1531
|
*/
|
|
1275
|
-
|
|
1532
|
+
renderFrame(rendered: boolean): void;
|
|
1276
1533
|
/**
|
|
1277
|
-
*
|
|
1534
|
+
* 意图要切换到某个模态, 可以通过 return false 阻止
|
|
1535
|
+
* @param mode - 意图要切换到的模态
|
|
1536
|
+
* @param prevMode - 当前模态
|
|
1537
|
+
* @returns 可以通过 return false 阻止
|
|
1278
1538
|
*/
|
|
1279
|
-
|
|
1539
|
+
wantsChangeMode(mode: Mode, prevMode: Mode): void | false;
|
|
1280
1540
|
/**
|
|
1281
|
-
*
|
|
1282
|
-
* @param
|
|
1283
|
-
* @
|
|
1541
|
+
* 模态切换完成
|
|
1542
|
+
* @param mode - 切换到的模态
|
|
1543
|
+
* @param prevMode - 上本质是一个模态
|
|
1544
|
+
* @param panoIndex - 初始化动画结束后的点位下标
|
|
1545
|
+
* @param toPose - 初始化动画结束后的状态
|
|
1546
|
+
* @param userAction - 是否用户触发
|
|
1284
1547
|
*/
|
|
1285
|
-
|
|
1548
|
+
modeChange(mode: Mode, prevMode: Mode, panoIndex: number, toPose: Pose, userAction: boolean): void;
|
|
1286
1549
|
/**
|
|
1287
|
-
*
|
|
1550
|
+
* 帮助元素显应的变换
|
|
1551
|
+
* @param visible - 帮助元素的是否开启
|
|
1288
1552
|
*/
|
|
1289
|
-
|
|
1290
|
-
maxDepth?: number;
|
|
1291
|
-
};
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
/**
|
|
1295
|
-
* Five 插件
|
|
1296
|
-
* [[include:plugins.md]]
|
|
1297
|
-
* @template Parameters - 插件参数, 没有参数则为 void
|
|
1298
|
-
* @template Returns - 如果有参数则插件暴露的 api,没有参数则不传
|
|
1299
|
-
*/
|
|
1300
|
-
export declare type FivePlugin<Parameters = void, Returns = void> = Parameters extends void ? ((five: Five) => Returns) : ((five: Five, parameters: Parameters) => Returns);
|
|
1301
|
-
|
|
1302
|
-
/**
|
|
1303
|
-
* 获取插件在Five中的初始化结构
|
|
1304
|
-
* @template T - Five 插件
|
|
1305
|
-
*/
|
|
1306
|
-
export declare type FivePluginInit<T extends FivePlugin<any, any>> = Parameters<T>[1] extends undefined ? [
|
|
1307
|
-
Plugin: T,
|
|
1308
|
-
instanceName: null | string
|
|
1309
|
-
] : [
|
|
1310
|
-
Plugin: T,
|
|
1311
|
-
instanceName: null | string,
|
|
1312
|
-
parameters: Parameters<T>[1]
|
|
1313
|
-
];
|
|
1314
|
-
|
|
1315
|
-
/**
|
|
1316
|
-
* 获取插件暴露的 api
|
|
1317
|
-
* @template T - Five 插件
|
|
1318
|
-
*/
|
|
1319
|
-
export declare type FivePluginInstance<T extends FivePlugin<any, any>> = ReturnType<T>;
|
|
1320
|
-
|
|
1321
|
-
export declare interface FloorplanControllerCustomInitArgs {
|
|
1322
|
-
/** 默认俯仰角 */
|
|
1323
|
-
defaultLatitude?: number;
|
|
1324
|
-
/** 最大俯仰角 */
|
|
1325
|
-
maxLatitude?: number;
|
|
1326
|
-
/** 最小俯仰角 */
|
|
1327
|
-
minLatitude?: number;
|
|
1328
|
-
/** 默认相机可视角度(垂直),可作为 `zoom` */
|
|
1329
|
-
defaultFov?: number;
|
|
1330
|
-
/** 最大相机可视角度 */
|
|
1331
|
-
maxFov?: number;
|
|
1332
|
-
/** 最小相机可视角度 */
|
|
1333
|
-
minFov?: number;
|
|
1334
|
-
/** 鼠标焦点环自定义创建器 */
|
|
1335
|
-
intersectMeshCreator?: () => IntersectMeshInterface;
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
export declare type GestureTypes = "pan" | "tap" | "pinch" | "press" | "mouseWheel";
|
|
1339
|
-
|
|
1340
|
-
export declare function getViewportScale(): number;
|
|
1341
|
-
|
|
1342
|
-
/**
|
|
1343
|
-
* 图片参数
|
|
1344
|
-
*/
|
|
1345
|
-
export declare interface ImageOptions {
|
|
1553
|
+
helpersVisibleChange(visible: boolean): void;
|
|
1346
1554
|
/**
|
|
1347
|
-
*
|
|
1348
|
-
* @param
|
|
1349
|
-
* @param
|
|
1350
|
-
* @
|
|
1555
|
+
* 网络资源分析
|
|
1556
|
+
* @param source - 资源地址
|
|
1557
|
+
* @param state - 状态
|
|
1558
|
+
* @param detail - 详情
|
|
1351
1559
|
*/
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
size?: number;
|
|
1355
|
-
/** 图片质量参数(0-100) */
|
|
1356
|
-
quality?: number;
|
|
1357
|
-
/** 图片格式参数 */
|
|
1358
|
-
format?: "jpg" | "png" | "heif" | "webp" | "avif";
|
|
1359
|
-
/** 锐化参数 海外不支持 */
|
|
1360
|
-
sharpen?: number;
|
|
1361
|
-
mappings?: ImageURLMappings;
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
export declare function imageSupport(): Promise<{
|
|
1365
|
-
avif: boolean;
|
|
1366
|
-
webp: boolean;
|
|
1367
|
-
}>;
|
|
1368
|
-
|
|
1369
|
-
export declare interface ImageURLMappings {
|
|
1370
|
-
[publicDomain: string]: {
|
|
1371
|
-
"type"?: string;
|
|
1372
|
-
"pano": [string, string];
|
|
1373
|
-
"tile": [string, string];
|
|
1374
|
-
"model": [string, string];
|
|
1375
|
-
"texture": [string];
|
|
1376
|
-
"default": [string];
|
|
1377
|
-
};
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1380
|
-
export declare interface ImageURLOptions {
|
|
1381
|
-
/** 图片类型标识 */
|
|
1382
|
-
key: string;
|
|
1383
|
-
/** 图片尺寸参数 尽量使用 2 的幂次 如 256 512 1024 */
|
|
1384
|
-
size?: number;
|
|
1385
|
-
/** 图片质量参数(0-100) */
|
|
1386
|
-
quality?: number;
|
|
1387
|
-
/** 图片格式参数 */
|
|
1388
|
-
format?: "jpg" | "png" | "heif" | "webp" | "avif";
|
|
1389
|
-
/** 图片裁切 */
|
|
1390
|
-
cut?: [x: number, y: number, width: number, height: number];
|
|
1391
|
-
/** 锐化参数 海外不支持 */
|
|
1392
|
-
sharpen?: number;
|
|
1393
|
-
/** url匹配规则 */
|
|
1394
|
-
mappings?: ImageURLMappings;
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
export declare class InternalWebGLRenderer extends THREE_2.WebGLRenderer {
|
|
1398
|
-
constructor({ preserveDrawingBuffer, backgroundColor, backgroundAlpha, pixelRatio, antialias, webgl2, }: {
|
|
1399
|
-
preserveDrawingBuffer?: boolean;
|
|
1400
|
-
backgroundColor?: number | THREE_2.Color;
|
|
1401
|
-
backgroundAlpha?: number;
|
|
1402
|
-
pixelRatio?: number;
|
|
1403
|
-
antialias?: boolean;
|
|
1404
|
-
webgl2?: boolean;
|
|
1405
|
-
});
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
export declare interface Intersection {
|
|
1409
|
-
/** 焦点坐标 */
|
|
1410
|
-
point: THREE.Vector3;
|
|
1411
|
-
/** 焦点面片 */
|
|
1412
|
-
face?: {
|
|
1413
|
-
normal: THREE.Vector3;
|
|
1414
|
-
} | null;
|
|
1415
|
-
/** 焦点距离 */
|
|
1416
|
-
distance: number;
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
export declare class IntersectMesh extends THREE_2.Object3D implements IntersectMeshInterface {
|
|
1420
|
-
private ringMesh;
|
|
1421
|
-
constructor();
|
|
1422
|
-
dispose(): void;
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
/**
|
|
1426
|
-
* 地面提示点位接口
|
|
1427
|
-
*/
|
|
1428
|
-
export declare interface IntersectMeshInterface extends THREE_2.Object3D {
|
|
1429
|
-
dispose(): void;
|
|
1430
|
-
}
|
|
1560
|
+
network(source: string, type: NetworkType, state: NetworkState, detail: string): void;
|
|
1561
|
+
};
|
|
1431
1562
|
|
|
1432
1563
|
export declare type LooseWork = {
|
|
1433
1564
|
work_code?: string;
|
|
@@ -1579,6 +1710,11 @@ export declare type Mode =
|
|
|
1579
1710
|
/** XR眼镜模式*/
|
|
1580
1711
|
"XRPanorama";
|
|
1581
1712
|
|
|
1713
|
+
export declare interface ModeChangeEvent extends StateEvent {
|
|
1714
|
+
prevMode: Mode;
|
|
1715
|
+
mode: Mode;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1582
1718
|
/**
|
|
1583
1719
|
* Five 模型
|
|
1584
1720
|
* @description
|
|
@@ -1600,11 +1736,10 @@ export declare class Model extends THREE_2.Object3D {
|
|
|
1600
1736
|
}[];
|
|
1601
1737
|
onError: (error: Error) => void;
|
|
1602
1738
|
onShownFloorChange: (floorIndex: number | null) => void;
|
|
1739
|
+
onLoad: () => void;
|
|
1603
1740
|
/** 外接盒子的大小 */
|
|
1604
1741
|
bounding: THREE_2.Box3;
|
|
1605
|
-
/**
|
|
1606
|
-
shownFloor: number | null;
|
|
1607
|
-
/** 楼层的数量 */
|
|
1742
|
+
/** 所有楼层 */
|
|
1608
1743
|
floorLength: number;
|
|
1609
1744
|
/** 材质贴图参数 */
|
|
1610
1745
|
textureOptions: TextureOptions;
|
|
@@ -1625,6 +1760,7 @@ export declare class Model extends THREE_2.Object3D {
|
|
|
1625
1760
|
constructor(options?: {
|
|
1626
1761
|
onError?: (error: Error) => void;
|
|
1627
1762
|
onShownFloorChange?: (floorIndex: number | null) => void;
|
|
1763
|
+
onLoad?: () => void;
|
|
1628
1764
|
});
|
|
1629
1765
|
get empty(): boolean;
|
|
1630
1766
|
/** 获取材质参数 */
|
|
@@ -1634,13 +1770,10 @@ export declare class Model extends THREE_2.Object3D {
|
|
|
1634
1770
|
/**
|
|
1635
1771
|
* 当前显示的楼层
|
|
1636
1772
|
*/
|
|
1773
|
+
get shownFloor(): PBMParameters['floorIndex'] | null;
|
|
1774
|
+
set shownFloor(floorIndex: PBMParameters['floorIndex'] | null);
|
|
1637
1775
|
get shownfloor(): PBMParameters['floorIndex'] | null;
|
|
1638
1776
|
set shownfloor(floorIndex: PBMParameters['floorIndex'] | null);
|
|
1639
|
-
/**
|
|
1640
|
-
* 裁切
|
|
1641
|
-
*/
|
|
1642
|
-
get clippers(): PBMParameters['clippers'];
|
|
1643
|
-
set clippers(clippers: PBMParameters['clippers']);
|
|
1644
1777
|
/**
|
|
1645
1778
|
* 显示某楼层
|
|
1646
1779
|
* @example
|
|
@@ -1649,7 +1782,12 @@ export declare class Model extends THREE_2.Object3D {
|
|
|
1649
1782
|
* model.show(1) //显示第一楼层
|
|
1650
1783
|
* ```
|
|
1651
1784
|
*/
|
|
1652
|
-
show(floorIndex?:
|
|
1785
|
+
show(floorIndex?: PBMParameters['floorIndex'] | null): void;
|
|
1786
|
+
/**
|
|
1787
|
+
* 裁切
|
|
1788
|
+
*/
|
|
1789
|
+
get clippers(): PBMParameters['clippers'];
|
|
1790
|
+
set clippers(clippers: PBMParameters['clippers']);
|
|
1653
1791
|
/**
|
|
1654
1792
|
* 获取模型边界线
|
|
1655
1793
|
* @param sphere - 获取区域
|
|
@@ -1686,6 +1824,12 @@ export declare class Model extends THREE_2.Object3D {
|
|
|
1686
1824
|
export declare interface ModelControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
|
|
1687
1825
|
}
|
|
1688
1826
|
|
|
1827
|
+
export declare interface ModelEvent extends BaseEvent {
|
|
1828
|
+
model: Model;
|
|
1829
|
+
work: Work;
|
|
1830
|
+
error: Error | null;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1689
1833
|
export declare interface ModelLodOptions {
|
|
1690
1834
|
maxDepth?: number;
|
|
1691
1835
|
}
|
|
@@ -1697,12 +1841,17 @@ export declare type Models = Model[] & {
|
|
|
1697
1841
|
bounding: THREE_2.Box3;
|
|
1698
1842
|
loaded: boolean;
|
|
1699
1843
|
refined: boolean;
|
|
1844
|
+
materialVersion: string;
|
|
1700
1845
|
intersectRaycaster(raycaster: THREE_2.Raycaster): Intersection[];
|
|
1701
1846
|
setMaterial(values: Partial<ModelMaterialValues>): void;
|
|
1702
1847
|
getMaterial(): ModelMaterialValues;
|
|
1703
1848
|
update(renderer: THREE_2.WebGLRenderer, camera: Camera, mode: Mode): void;
|
|
1704
1849
|
};
|
|
1705
1850
|
|
|
1851
|
+
export declare interface ModelsEvent extends BaseEvent {
|
|
1852
|
+
models: Models;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1706
1855
|
export declare interface MotionKeyframe<K extends string> {
|
|
1707
1856
|
progress: number;
|
|
1708
1857
|
value: MotionValue<K>;
|
|
@@ -1714,7 +1863,7 @@ export declare type MotionValue<K extends string> = Record<K, number>;
|
|
|
1714
1863
|
/**
|
|
1715
1864
|
* 点位移动参数
|
|
1716
1865
|
*/
|
|
1717
|
-
export declare interface MovePanoOptions extends Partial<Omit<
|
|
1866
|
+
export declare interface MovePanoOptions extends Partial<Omit<State, "offset" | 'distance' | 'mode'>> {
|
|
1718
1867
|
/** 是否通过初始化参数限制 fov, latitude */
|
|
1719
1868
|
limit?: boolean;
|
|
1720
1869
|
/**
|
|
@@ -1737,9 +1886,9 @@ export declare interface MovePanoOptions extends Partial<Omit<Pose, "offset">> {
|
|
|
1737
1886
|
/** 运动曲线函数 */
|
|
1738
1887
|
easing?: (k: number) => number;
|
|
1739
1888
|
/** 运动开始回调 */
|
|
1740
|
-
moveStartCallback?: (
|
|
1889
|
+
moveStartCallback?: (toState: State) => void;
|
|
1741
1890
|
/** 运动结束回调 */
|
|
1742
|
-
moveEndCallback?: (
|
|
1891
|
+
moveEndCallback?: (state: State) => void;
|
|
1743
1892
|
/**
|
|
1744
1893
|
* 运动被取消回调
|
|
1745
1894
|
* @description
|
|
@@ -1774,6 +1923,13 @@ export declare interface NetworkOptions {
|
|
|
1774
1923
|
allowHosts?: string[];
|
|
1775
1924
|
}
|
|
1776
1925
|
|
|
1926
|
+
export declare interface NetworkResourceEvent extends BaseEvent {
|
|
1927
|
+
source: string;
|
|
1928
|
+
requestType: NetworkType;
|
|
1929
|
+
requestState: NetworkState;
|
|
1930
|
+
detail: string;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1777
1933
|
export declare type NetworkResponse<T = any, E extends NetWorkMeta | NetWorkMeta[] = NetWorkMeta> = {
|
|
1778
1934
|
body: T;
|
|
1779
1935
|
meta: E;
|
|
@@ -1788,6 +1944,15 @@ export declare class NetworkSubscribe extends Subscribe<{
|
|
|
1788
1944
|
|
|
1789
1945
|
export declare type NetworkType = "XMLHttpRequest" | "Script" | "Image" | "Link";
|
|
1790
1946
|
|
|
1947
|
+
export declare interface ObjectEvent extends BaseEvent {
|
|
1948
|
+
object: THREE_2.Object3D;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
export declare type Pano = {
|
|
1952
|
+
workCode: string;
|
|
1953
|
+
panoIndex: number;
|
|
1954
|
+
};
|
|
1955
|
+
|
|
1791
1956
|
export declare class PanoCircleMesh extends THREE_2.Object3D implements PanoCircleMeshInterface {
|
|
1792
1957
|
needsRender: boolean;
|
|
1793
1958
|
private currentStartTime;
|
|
@@ -1924,6 +2089,19 @@ export declare interface PanoCircleMeshSolidOptions {
|
|
|
1924
2089
|
color?: number;
|
|
1925
2090
|
}
|
|
1926
2091
|
|
|
2092
|
+
export declare function panoEqual(a: Pano, b: Pano): boolean;
|
|
2093
|
+
|
|
2094
|
+
export declare interface PanoEvent extends StateEvent {
|
|
2095
|
+
prevPano: Pano;
|
|
2096
|
+
progress: number;
|
|
2097
|
+
options: MovePanoOptions;
|
|
2098
|
+
error: Error | null;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
export declare type PanoId = `${Pano['workCode']}[${number}]`;
|
|
2102
|
+
|
|
2103
|
+
export declare function panoParse(panoId: PanoId): Pano;
|
|
2104
|
+
|
|
1927
2105
|
export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeControllerCustomInitArgs {
|
|
1928
2106
|
/** 最远可移动观察点距离 */
|
|
1929
2107
|
maxAccessibleDistance?: number;
|
|
@@ -1935,7 +2113,7 @@ export declare interface PanoramaControllerCustomInitArgs extends PanoramaLikeCo
|
|
|
1935
2113
|
*/
|
|
1936
2114
|
panoTapTriggerRadius?: number;
|
|
1937
2115
|
/** 地面观察点标识自定义创建器 */
|
|
1938
|
-
panoCircleMeshCreator?: (
|
|
2116
|
+
panoCircleMeshCreator?: (pano: Pano) => PanoCircleMeshInterface;
|
|
1939
2117
|
/**
|
|
1940
2118
|
* 全景瓦片登记
|
|
1941
2119
|
* @param fov - 当前 fov
|
|
@@ -1970,6 +2148,15 @@ export declare interface PanoramaLikeControllerCustomInitArgs {
|
|
|
1970
2148
|
intersectMeshCreator?: () => IntersectMeshInterface;
|
|
1971
2149
|
}
|
|
1972
2150
|
|
|
2151
|
+
export declare function panoStringify(pano: Pano): PanoId;
|
|
2152
|
+
|
|
2153
|
+
export declare interface PanoTextureEvent extends BaseEvent {
|
|
2154
|
+
pano: Pano;
|
|
2155
|
+
progress: number;
|
|
2156
|
+
meta: NetWorkMeta[] | null;
|
|
2157
|
+
error: Error | null;
|
|
2158
|
+
}
|
|
2159
|
+
|
|
1973
2160
|
/**
|
|
1974
2161
|
* 解析 Work 数据
|
|
1975
2162
|
* @param obj - work 数据,从如数开发者平台获取
|
|
@@ -1979,6 +2166,8 @@ export declare interface PanoramaLikeControllerCustomInitArgs {
|
|
|
1979
2166
|
export declare function parseWork(obj: Work | LooseWork | string | any, options?: ParseWorkOptions): Work;
|
|
1980
2167
|
|
|
1981
2168
|
export declare type ParseWorkOptions = {
|
|
2169
|
+
/** 重置 WorkCode */
|
|
2170
|
+
workCode?: string | ((input: any) => string);
|
|
1982
2171
|
/** 重写资源前缀 */
|
|
1983
2172
|
baseURL?: string;
|
|
1984
2173
|
/** 资源地址使用短地址 */
|
|
@@ -2168,7 +2357,7 @@ export declare interface Pose {
|
|
|
2168
2357
|
distance: number;
|
|
2169
2358
|
}
|
|
2170
2359
|
|
|
2171
|
-
export declare const PROXY_CONTROLLER_EVENT_NAMES: readonly ["
|
|
2360
|
+
export declare const PROXY_CONTROLLER_EVENT_NAMES: readonly ["gesture.pan", "gesture.tap", "gesture.press", "gesture.pinch", "gesture.mousewheel", "gesture.mousemove", "gesture.momentum", "initAnimation.start", "initAnimation.end", "camera.update", "intersect.update", "pano.select", "pano.moveTo", "pano.moving", "pano.arrived", "pano.cancel", "pano.error", "pano.texture.load", "pano.texture.progress", "pano.texture.success", "pano.texture.error", "pano.texture.abort", "xr.session.start", "xr.session.end", "xr.gesture.tap"];
|
|
2172
2361
|
|
|
2173
2362
|
export declare class RegionBoundingVolume implements BoundingVolume {
|
|
2174
2363
|
type: "regin";
|
|
@@ -2197,6 +2386,23 @@ export declare type RegionBoundingVolumeJson = {
|
|
|
2197
2386
|
region: number[];
|
|
2198
2387
|
};
|
|
2199
2388
|
|
|
2389
|
+
export declare interface RenderEvent extends BaseEvent {
|
|
2390
|
+
needsRender: boolean;
|
|
2391
|
+
info: null | {
|
|
2392
|
+
memory: {
|
|
2393
|
+
geometries: number;
|
|
2394
|
+
textures: number;
|
|
2395
|
+
};
|
|
2396
|
+
render: {
|
|
2397
|
+
calls: number;
|
|
2398
|
+
frame: number;
|
|
2399
|
+
lines: number;
|
|
2400
|
+
points: number;
|
|
2401
|
+
triangles: number;
|
|
2402
|
+
};
|
|
2403
|
+
};
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2200
2406
|
export declare type RequestResult = null | {
|
|
2201
2407
|
done: () => void;
|
|
2202
2408
|
};
|
|
@@ -2297,10 +2503,15 @@ export declare type SphereBoundingVolumeJson = {
|
|
|
2297
2503
|
export declare interface State extends Pose {
|
|
2298
2504
|
/** 模态 */
|
|
2299
2505
|
mode: Mode;
|
|
2506
|
+
/** workCode */
|
|
2507
|
+
workCode: string;
|
|
2300
2508
|
/** 观察点序号 */
|
|
2301
2509
|
panoIndex: number;
|
|
2302
|
-
|
|
2303
|
-
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
export declare interface StateEvent extends BaseEvent {
|
|
2513
|
+
state: State;
|
|
2514
|
+
userAction: boolean;
|
|
2304
2515
|
}
|
|
2305
2516
|
|
|
2306
2517
|
/**
|
|
@@ -2779,7 +2990,7 @@ export declare enum VolumePlaneIntersect {
|
|
|
2779
2990
|
export declare interface VRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
|
|
2780
2991
|
}
|
|
2781
2992
|
|
|
2782
|
-
export declare type WebXRControllerKey = '
|
|
2993
|
+
export declare type WebXRControllerKey = XRGestureEvent['buttons'];
|
|
2783
2994
|
|
|
2784
2995
|
export declare interface WebXRControllerParams {
|
|
2785
2996
|
raycaster: THREE_2.Raycaster[];
|
|
@@ -2787,18 +2998,11 @@ export declare interface WebXRControllerParams {
|
|
|
2787
2998
|
|
|
2788
2999
|
export declare type WebXRControllerType = 'tap' | 'press' | 'axes';
|
|
2789
3000
|
|
|
2790
|
-
export declare type WebXREventTypes = {
|
|
2791
|
-
/** WebXR模式开始,session完成坐标系设置*/
|
|
2792
|
-
webXRSessionStart(): void;
|
|
2793
|
-
/** WebXR模式结束,销毁session*/
|
|
2794
|
-
webXRSessionEnd(): void;
|
|
2795
|
-
};
|
|
2796
|
-
|
|
2797
3001
|
export declare class Work {
|
|
2798
3002
|
/** 名称 */
|
|
2799
3003
|
name: string;
|
|
2800
3004
|
/** 编号 */
|
|
2801
|
-
workCode:
|
|
3005
|
+
workCode: string;
|
|
2802
3006
|
/** 允许访问的安全域名 */
|
|
2803
3007
|
allowHosts: string[];
|
|
2804
3008
|
/** 过期时间 */
|
|
@@ -2829,8 +3033,6 @@ export declare class Work {
|
|
|
2829
3033
|
toJSON(): any;
|
|
2830
3034
|
}
|
|
2831
3035
|
|
|
2832
|
-
export declare type WorkCode = string;
|
|
2833
|
-
|
|
2834
3036
|
export declare interface WorkCubeImage {
|
|
2835
3037
|
/** 全景图 up */
|
|
2836
3038
|
up: string;
|
|
@@ -2858,10 +3060,11 @@ export declare interface WorkImage extends WorkCubeImage {
|
|
|
2858
3060
|
|
|
2859
3061
|
/** 初始化位姿参数 */
|
|
2860
3062
|
export declare interface WorkInitial {
|
|
3063
|
+
work: Work;
|
|
2861
3064
|
/** 模态 */
|
|
2862
3065
|
mode?: Mode;
|
|
2863
3066
|
/** 点位序号 */
|
|
2864
|
-
|
|
3067
|
+
panoIndex?: number;
|
|
2865
3068
|
/** 相机水平角 */
|
|
2866
3069
|
longitude?: number;
|
|
2867
3070
|
/** 相机俯仰角 */
|
|
@@ -2899,8 +3102,12 @@ export declare interface WorkObserver {
|
|
|
2899
3102
|
work: Work;
|
|
2900
3103
|
/** 序号 */
|
|
2901
3104
|
index: number;
|
|
3105
|
+
/** 序号 */
|
|
3106
|
+
panoIndex: number;
|
|
3107
|
+
/** 点位序号 */
|
|
3108
|
+
panoId: PanoId;
|
|
2902
3109
|
/** 点位序号 */
|
|
2903
|
-
|
|
3110
|
+
pano: Pano;
|
|
2904
3111
|
/** 点位所在楼层 */
|
|
2905
3112
|
floorIndex: number;
|
|
2906
3113
|
/** 点位 derived_id */
|
|
@@ -2914,9 +3121,13 @@ export declare interface WorkObserver {
|
|
|
2914
3121
|
/** 点位视频 */
|
|
2915
3122
|
video?: WorkVideo;
|
|
2916
3123
|
/** 可以看到的相关点位序号 */
|
|
2917
|
-
|
|
3124
|
+
visibleNodes: number[];
|
|
3125
|
+
/** 可以看到的相关点位序号 */
|
|
3126
|
+
visibleIds: PanoId[];
|
|
2918
3127
|
/** 可以连通的相关点位序号 */
|
|
2919
|
-
|
|
3128
|
+
accessibleNodes: number[];
|
|
3129
|
+
/** 可以看到的相关点位序号 */
|
|
3130
|
+
accessibleIds: PanoId[];
|
|
2920
3131
|
/** 点位和模型的地面坐标 */
|
|
2921
3132
|
standingPosition: THREE_2.Vector3;
|
|
2922
3133
|
/** 点位和模型的观察点坐标 */
|
|
@@ -2942,16 +3153,25 @@ export declare interface WorkOptions {
|
|
|
2942
3153
|
modelMaxScreenSpaceError?: number;
|
|
2943
3154
|
}
|
|
2944
3155
|
|
|
2945
|
-
export declare
|
|
3156
|
+
export declare interface WorkResolvedObserver extends WorkObserver {
|
|
3157
|
+
isResolved: true;
|
|
3158
|
+
}
|
|
2946
3159
|
|
|
2947
3160
|
export declare type Works = ReadonlyArray<Work> & {
|
|
2948
|
-
resolvedObservers:
|
|
3161
|
+
resolvedObservers: WorkResolvedObserver[];
|
|
2949
3162
|
initial: WorkInitial;
|
|
2950
|
-
getWork(workCode:
|
|
2951
|
-
getResolvedObserver(
|
|
3163
|
+
getWork(workCode: string): Work | undefined;
|
|
3164
|
+
getResolvedObserver(pano: PanoId | Pano | number): WorkResolvedObserver | undefined;
|
|
2952
3165
|
update(): void;
|
|
2953
3166
|
};
|
|
2954
3167
|
|
|
3168
|
+
export declare interface WorksEvent extends BaseEvent {
|
|
3169
|
+
input: any;
|
|
3170
|
+
works: Works;
|
|
3171
|
+
state: Partial<State>;
|
|
3172
|
+
userAction: boolean;
|
|
3173
|
+
}
|
|
3174
|
+
|
|
2955
3175
|
export declare interface WorkTile {
|
|
2956
3176
|
level: number;
|
|
2957
3177
|
size: number;
|
|
@@ -2977,7 +3197,24 @@ export declare class XRButton {
|
|
|
2977
3197
|
static createButton(onClickHook: () => void): HTMLAnchorElement | HTMLButtonElement;
|
|
2978
3198
|
}
|
|
2979
3199
|
|
|
3200
|
+
export declare interface XRGestureEvent extends BaseEvent {
|
|
3201
|
+
session: XRSession | null;
|
|
3202
|
+
buttons: null | 'A' | 'B' | 'X' | 'Y' | 'RightTrigger' | 'RightPinch' | 'LeftTrigger' | 'LeftPinch' | 'LeftAxesLeft' | 'LeftAxesRight' | 'LeftAxesUp' | 'LeftAxesDown' | 'RightAxesLeft' | 'RightAxesRight' | 'RightAxesUp' | 'RightAxesDown';
|
|
3203
|
+
machineType: 'Pico' | 'Oculus';
|
|
3204
|
+
isFirst: boolean;
|
|
3205
|
+
isFinal: boolean;
|
|
3206
|
+
controllers: {
|
|
3207
|
+
raycaster: THREE_2.Raycaster;
|
|
3208
|
+
}[];
|
|
3209
|
+
}
|
|
3210
|
+
|
|
2980
3211
|
export declare interface XRPanoramaControllerCustomInitArgs extends Omit<PanoramaControllerCustomInitArgs, "maxLatitude" | "minLatitude"> {
|
|
2981
3212
|
}
|
|
2982
3213
|
|
|
3214
|
+
declare interface XRSessionEvent_2 extends BaseEvent {
|
|
3215
|
+
session: XRSession | null;
|
|
3216
|
+
machineType: 'Pico' | 'Oculus';
|
|
3217
|
+
}
|
|
3218
|
+
export { XRSessionEvent_2 as XRSessionEvent }
|
|
3219
|
+
|
|
2983
3220
|
export { }
|