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