soonspacejs 2.13.5 → 2.13.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +8 -8
  2. package/dist/index.esm.js +2 -2
  3. package/dist/src/Animation/createPathAnimation.d.ts +61 -0
  4. package/dist/src/Animation/index.d.ts +4 -0
  5. package/dist/src/Animation/path-animation.d.ts +108 -0
  6. package/dist/src/Cache/ObjectsCache.d.ts +19 -0
  7. package/dist/src/Cache/index.d.ts +1 -0
  8. package/dist/src/Constants/headers.d.ts +1 -0
  9. package/dist/src/Constants/index.d.ts +22 -0
  10. package/dist/src/Constants/viewpoints.d.ts +7 -0
  11. package/dist/src/Controls/index.d.ts +14 -0
  12. package/dist/src/Interface/animation.d.ts +10 -0
  13. package/dist/src/Interface/base.d.ts +63 -0
  14. package/dist/src/Interface/controls.d.ts +94 -0
  15. package/dist/src/Interface/events.d.ts +40 -0
  16. package/dist/src/Interface/gmlToJson.d.ts +189 -0
  17. package/dist/src/Interface/index.d.ts +13 -0
  18. package/dist/src/Interface/manager.d.ts +177 -0
  19. package/dist/src/Interface/modelAnimation.d.ts +5 -0
  20. package/dist/src/Interface/plugin.d.ts +7 -0
  21. package/dist/src/Interface/poiMesh.d.ts +23 -0
  22. package/dist/src/Interface/sbmCache.d.ts +19 -0
  23. package/dist/src/Interface/sbmXmlToJson.d.ts +131 -0
  24. package/dist/src/Interface/signals.d.ts +47 -0
  25. package/dist/src/Interface/viewport.d.ts +208 -0
  26. package/dist/src/Library/BaseMesh.d.ts +19 -0
  27. package/dist/src/Library/BaseObject3D.d.ts +37 -0
  28. package/dist/src/Library/Canvas3D.d.ts +31 -0
  29. package/dist/src/Library/Circle.d.ts +21 -0
  30. package/dist/src/Library/Decal.d.ts +30 -0
  31. package/dist/src/Library/Ground.d.ts +8 -0
  32. package/dist/src/Library/Group.d.ts +9 -0
  33. package/dist/src/Library/Icon.d.ts +12 -0
  34. package/dist/src/Library/Line.d.ts +22 -0
  35. package/dist/src/Library/Link.d.ts +24 -0
  36. package/dist/src/Library/Model.d.ts +19 -0
  37. package/dist/src/Library/Node.d.ts +10 -0
  38. package/dist/src/Library/PluginObject.d.ts +7 -0
  39. package/dist/src/Library/Poi.d.ts +38 -0
  40. package/dist/src/Library/PoiMesh.d.ts +16 -0
  41. package/dist/src/Library/PoiNode.d.ts +31 -0
  42. package/dist/src/Library/Point.d.ts +21 -0
  43. package/dist/src/Library/Polygon.d.ts +23 -0
  44. package/dist/src/Library/PolygonPoiMesh.d.ts +13 -0
  45. package/dist/src/Library/Topology.d.ts +37 -0
  46. package/dist/src/Library/index.d.ts +20 -0
  47. package/dist/src/Loader/SbmLoader/SDataView.d.ts +11 -0
  48. package/dist/src/Loader/SbmLoader/SbkDecoder.d.ts +1 -0
  49. package/dist/src/Loader/SbmLoader/SbmLoader.d.ts +15 -0
  50. package/dist/src/Loader/SbmLoader/SbmObjectLoader.d.ts +25 -0
  51. package/dist/src/Loader/SbmLoader/SbmPrivateLoader.d.ts +39 -0
  52. package/dist/src/Loader/SbmLoader/SbmPublicLoader.d.ts +38 -0
  53. package/dist/src/Loader/SbmLoader/index.d.ts +2 -0
  54. package/dist/src/Loader/SbmLoader/utils/generateSbm.d.ts +26 -0
  55. package/dist/src/Manager/Canvas3DManage.d.ts +14 -0
  56. package/dist/src/Manager/DecalManage.d.ts +22 -0
  57. package/dist/src/Manager/DefaultManage.d.ts +19 -0
  58. package/dist/src/Manager/GroupManage.d.ts +9 -0
  59. package/dist/src/Manager/HelperManage.d.ts +23 -0
  60. package/dist/src/Manager/LightManage.d.ts +25 -0
  61. package/dist/src/Manager/ModelManage.d.ts +106 -0
  62. package/dist/src/Manager/PluginObjectManage.d.ts +13 -0
  63. package/dist/src/Manager/PoiManage.d.ts +25 -0
  64. package/dist/src/Manager/PoiNodeManage.d.ts +14 -0
  65. package/dist/src/Manager/TopologyManage.d.ts +68 -0
  66. package/dist/src/Manager/index.d.ts +83 -0
  67. package/dist/src/Math/dijkstra/DijkstraWorker.d.ts +13 -0
  68. package/dist/src/Math/dijkstra/dijkstra.worker.d.ts +2 -0
  69. package/dist/src/Math/dijkstra/index.d.ts +54 -0
  70. package/dist/src/Math/index.d.ts +2 -0
  71. package/dist/src/Renderer/CSS2DRenderer.d.ts +25 -0
  72. package/dist/src/Renderer/CSS3DRenderer.d.ts +28 -0
  73. package/dist/src/Renderer/index.d.ts +2 -0
  74. package/dist/src/Shared/MinHeap.d.ts +22 -0
  75. package/dist/src/Shared/buffer.d.ts +2 -0
  76. package/dist/src/Shared/cloneDeep.d.ts +2 -0
  77. package/dist/src/Shared/ctx.d.ts +5 -0
  78. package/dist/src/Shared/index.d.ts +47 -0
  79. package/dist/src/Shared/log.d.ts +4 -0
  80. package/dist/src/Shared/map.d.ts +11 -0
  81. package/dist/src/Shared/material.d.ts +3 -0
  82. package/dist/src/Shared/network.d.ts +7 -0
  83. package/dist/src/Shared/occlude.d.ts +5 -0
  84. package/dist/src/Shared/path.d.ts +1 -0
  85. package/dist/src/Shared/task.d.ts +1 -0
  86. package/dist/src/Shared/viewport.d.ts +40 -0
  87. package/dist/src/Shared/xml.d.ts +2 -0
  88. package/dist/src/Signals/index.d.ts +3 -0
  89. package/dist/src/Viewport/Bvh/GenerateMeshBVHWorker.d.ts +11 -0
  90. package/dist/src/Viewport/Bvh/generateBVH.worker.d.ts +1 -0
  91. package/dist/src/Viewport/Bvh/index.d.ts +18 -0
  92. package/dist/src/Viewport/CameraManager.d.ts +34 -0
  93. package/dist/src/Viewport/EffectManager.d.ts +45 -0
  94. package/dist/src/Viewport/EventHandler.d.ts +50 -0
  95. package/dist/src/Viewport/Info.d.ts +17 -0
  96. package/dist/src/Viewport/RendererManager.d.ts +26 -0
  97. package/dist/src/Viewport/Scener.d.ts +43 -0
  98. package/dist/src/Viewport/ViewHelper.d.ts +15 -0
  99. package/dist/src/Viewport/index.d.ts +131 -0
  100. package/dist/src/exporters/index.d.ts +6 -0
  101. package/dist/src/index.d.ts +1286 -0
  102. package/dist/src/three-patches.d.ts +1 -0
  103. package/dist/src/tools/find-objects.d.ts +47 -0
  104. package/dist/src/tools/index.d.ts +2 -0
  105. package/dist/src/tools/units.d.ts +48 -0
  106. package/package.json +2 -2
  107. package/types/Interface/signals.d.ts +1 -0
  108. package/types/Shared/ctx.d.ts +5 -0
  109. package/types/Shared/index.d.ts +1 -0
  110. package/types/Viewport/index.d.ts +0 -1
  111. package/types/index.d.ts +3 -0
@@ -0,0 +1,61 @@
1
+ import { CreateCurveAnimationClipOptions, BonePathAnimationOptions, AnimationOperate, BonePathAnimationInfo as CreateBonePathAnimationResult, CreateChainSkeletalModelOptions, CreateCurveAnimationClipForBonesOptions } from '@three3d/animation';
2
+ import type { Camera, Curve, Object3D, Skeleton } from 'three';
3
+ import { Vector3 } from 'three';
4
+ import type { IVector3 } from '../Interface';
5
+ import { Topology } from '../Library';
6
+ import { VectorMembersToIVectors } from '@three3d/tools';
7
+ import SoonSpace from '../index';
8
+ /**
9
+ * 动画的路径
10
+ * @remarks
11
+ * 可以是一组点,或者一个曲线 Curve,或者拓扑路径 Topology
12
+ */
13
+ export type AnimationPath = IVector3[] | Curve<Vector3> | Topology;
14
+ /**
15
+ * 格式化动画路径信息
16
+ * @param path
17
+ * @returns
18
+ */
19
+ export declare function formatAnimationPath(path: AnimationPath): {
20
+ curve?: Curve<Vector3> | undefined;
21
+ points?: Vector3[] | undefined;
22
+ };
23
+ export type CreatePathAnimationOptions = VectorMembersToIVectors<Omit<CreateCurveAnimationClipOptions, 'target' | 'curve' | 'points'>>;
24
+ export declare function createPathAnimation(target: Object3D, path: AnimationPath, ssp: SoonSpace, options?: CreatePathAnimationOptions): AnimationOperate;
25
+ export interface CreatePathAnimationActionForCameraOptions_Base {
26
+ /**
27
+ * 眼睛高度
28
+ */
29
+ eyeHeight?: number;
30
+ }
31
+ export type CreatePathAnimationActionForCameraOptions = CreatePathAnimationActionForCameraOptions_Base & CreatePathAnimationOptions;
32
+ export declare function createPathAnimationActionForCamera(camera: Camera, path: IVector3[] | Curve<Vector3> | Topology, ssp: SoonSpace, options?: CreatePathAnimationActionForCameraOptions): AnimationOperate;
33
+ export type CreateBonePathAnimationOptions = VectorMembersToIVectors<Omit<BonePathAnimationOptions, 'mixer' | 'model'>>;
34
+ export type BonePathAnimationInfo = Omit<CreateBonePathAnimationResult, 'action'> & {
35
+ action: AnimationOperate;
36
+ };
37
+ /**
38
+ * 创建骨骼路径动画
39
+ * @param options
40
+ * @returns
41
+ */
42
+ export declare function createBonePathAnimation(model: Object3D, path: AnimationPath, ssp: SoonSpace, options: CreateBonePathAnimationOptions): BonePathAnimationInfo;
43
+ /**
44
+ * 为指定的 模型 创建其对应的链式骨骼模型
45
+ * @param model
46
+ * @param options
47
+ * @returns
48
+ */
49
+ export declare function createChainSkeletalModel(model: Object3D, options: Omit<CreateChainSkeletalModelOptions, 'target'>): {
50
+ skeletalModel: Object3D<import("three").Event<string, unknown>>;
51
+ skeleton: Skeleton;
52
+ };
53
+ /**
54
+ * 创建骨骼沿曲线路径运动的动画
55
+ * @remarks
56
+ * 纯 Bone 动画方案,不会在 target 上生成动画数据
57
+ *
58
+ * @param options
59
+ * @returns
60
+ */
61
+ export declare function createPathAnimationForBones(model: Object3D, skeleton: Skeleton, ssp: SoonSpace, options: Omit<CreateCurveAnimationClipForBonesOptions, 'target'>): AnimationOperate | undefined;
@@ -0,0 +1,4 @@
1
+ import { Tween } from 'three/examples/jsm/libs/tween.module.js';
2
+ import { AnimationOptions } from '../Interface';
3
+ declare function Animation<PropType extends Record<string, any>>(source: PropType, target: PropType, options?: AnimationOptions, onUpdate?: (source: PropType, tween: Tween<PropType>) => void, onStart?: (tween: Tween<PropType>) => void): Promise<void>;
4
+ export default Animation;
@@ -0,0 +1,108 @@
1
+ import { Vector3 } from 'three';
2
+ import type { Object3D } from 'three';
3
+ import type { Tween } from 'three/examples/jsm/libs/tween.module.js';
4
+ import { IVector3 } from '../Interface';
5
+ /**
6
+ * 路径动画选项
7
+ */
8
+ export interface PathAnimationOptions {
9
+ /**
10
+ * 移动速度
11
+ */
12
+ speed?: number;
13
+ /**
14
+ * 反向播放
15
+ */
16
+ reverse?: boolean;
17
+ /**
18
+ * 是否需要旋转
19
+ */
20
+ needsRotate?: boolean;
21
+ /**
22
+ * 位置更新回调
23
+ * @remarks
24
+ * 每当目标位置有更新时会触发
25
+ */
26
+ onUpdate?: (position: Vector3, tween: Tween<Vector3>) => void;
27
+ /**
28
+ * 动画开始时回调
29
+ */
30
+ onStart?: (tween: Tween<Vector3>) => void;
31
+ /**
32
+ * 每段 tween 动画开始时回调
33
+ * @param tween
34
+ */
35
+ onEveryStart?: (tween: Tween<Vector3>) => void;
36
+ /**
37
+ * 当到达一个点时回调
38
+ */
39
+ onPoint?: (index: number, point: Vector3) => void;
40
+ }
41
+ /**
42
+ * 路径动画
43
+ */
44
+ export declare class PathAnimation implements PathAnimationOptions {
45
+ target: Object3D;
46
+ points: IVector3[];
47
+ /**
48
+ *
49
+ * @param target - 被动画的目标对象
50
+ * @param points - 路径点列表
51
+ * @param options - 选项
52
+ */
53
+ constructor(target: Object3D, points: IVector3[], options?: PathAnimationOptions);
54
+ /**
55
+ * 移动速度
56
+ */
57
+ speed: number;
58
+ /**
59
+ * 反向播放
60
+ */
61
+ reverse: boolean;
62
+ /**
63
+ * 是否需要旋转
64
+ */
65
+ needsRotate: boolean;
66
+ /**
67
+ * 位置更新回调
68
+ * @remarks
69
+ * 每当目标位置有更新时会触发
70
+ */
71
+ onUpdate?: (position: Vector3, tween: Tween<Vector3>) => void;
72
+ /**
73
+ * 动画开始时回调
74
+ */
75
+ onStart?: (tween: Tween<Vector3>) => void;
76
+ /**
77
+ * 每段 tween 动画开始时回调
78
+ * @param tween
79
+ */
80
+ onEveryStart?: (tween: Tween<Vector3>) => void;
81
+ /**
82
+ * 当到达一个点时回调
83
+ */
84
+ onPoint?: (index: number, point: Vector3) => void;
85
+ /**
86
+ * 当前目标点的索引
87
+ */
88
+ index: number;
89
+ /**
90
+ * 是否正在播放
91
+ */
92
+ get isPlaying(): boolean;
93
+ protected _tween?: Tween<any> | null;
94
+ /**
95
+ * 播放
96
+ */
97
+ play(): Promise<boolean | undefined>;
98
+ protected _play(points: IVector3[]): Promise<true | undefined>;
99
+ /**
100
+ * 暂停
101
+ */
102
+ pause(): void;
103
+ resume(): void;
104
+ /**
105
+ * 停止
106
+ */
107
+ stop(): void;
108
+ }
@@ -0,0 +1,19 @@
1
+ import { Group, Light, Object3D } from 'three';
2
+ import { BaseObject3D, Canvas3D, Decal, Model, PluginObject, Poi, PoiNode, Topology } from '../Library';
3
+ declare class ObjectsCache {
4
+ objects: Map<BaseObject3D['sid'], Object3D>;
5
+ classified: {
6
+ Group: Set<Group<import("three").Object3DEventMap>>;
7
+ Light: Set<Light<import("three").LightShadow<import("three").Camera> | undefined>>;
8
+ Model: Set<Model>;
9
+ Poi: Set<Poi>;
10
+ PoiNode: Set<PoiNode>;
11
+ Canvas3D: Set<Canvas3D>;
12
+ Topology: Set<Topology>;
13
+ Helper: Set<Object3D<import("three").Object3DEventMap>>;
14
+ Decal: Set<Decal>;
15
+ PluginObject: Set<PluginObject>;
16
+ };
17
+ dispose(): void;
18
+ }
19
+ export { ObjectsCache, };
@@ -0,0 +1 @@
1
+ export { ObjectsCache, } from './ObjectsCache';
@@ -0,0 +1 @@
1
+ export declare const FileRequestHeaders: {};
@@ -0,0 +1,22 @@
1
+ export declare const INNER_ID = "[soonspacejs]: ";
2
+ export declare enum ObjecType {
3
+ Group = "Group",
4
+ Light = "Light",
5
+ Model = "Model",
6
+ Poi = "Poi",
7
+ PoiNode = "PoiNode",
8
+ Canvas3D = "Canvas3D",
9
+ Topology = "Topology",
10
+ Helper = "Helper",
11
+ Decal = "Decal",
12
+ PluginObject = "PluginObject"
13
+ }
14
+ export declare enum ModelFormat {
15
+ sbm = "SBM",
16
+ sbmx = "SBMX",
17
+ glb = "GLB",
18
+ gltf = "GLTF",
19
+ fbx = "FBX",
20
+ obj = "OBJ",
21
+ stl = "STL"
22
+ }
@@ -0,0 +1,7 @@
1
+ import { Euler, Spherical } from 'three';
2
+ export declare const viewpoints: {
3
+ [viewpoint: string]: Euler;
4
+ };
5
+ export declare const viewpointsSpherical: {
6
+ [viewpoint: string]: Spherical;
7
+ };
@@ -0,0 +1,14 @@
1
+ import Viewport from '../Viewport';
2
+ import CameraControls from 'camera-controls';
3
+ import { ControlsOptions } from '../Interface';
4
+ declare class Controls extends CameraControls {
5
+ readonly viewport: Viewport;
6
+ dollySpeed: number;
7
+ azimuthRotateSpeed: number;
8
+ polarRotateSpeed: number;
9
+ truckSpeed: number;
10
+ draggingSmoothTime: number;
11
+ constructor(viewport: Viewport);
12
+ setOptions(options: ControlsOptions): void;
13
+ }
14
+ export default Controls;
@@ -0,0 +1,10 @@
1
+ type AnimationModeType = 'Linear.None' | 'Quadratic.In' | 'Quadratic.Out' | 'Quadratic.InOut' | 'Cubic.In' | 'Cubic.Out' | 'Cubic.InOut' | 'Quartic.In' | 'Quartic.Out' | 'Quartic.InOut' | 'Quintic.In' | 'Quintic.Out' | 'Quintic.InOut' | 'Sinusoidal.In' | 'Sinusoidal.Out' | 'Sinusoidal.InOut' | 'Exponential.In' | 'Exponential.Out' | 'Exponential.InOut' | 'Circular.In' | 'Circular.Out' | 'Circular.InOut' | 'Elastic.In' | 'Elastic.Out' | 'Elastic.InOut' | 'Back.In' | 'Back.Out' | 'Back.InOut' | 'Bounce.In' | 'Bounce.Out' | 'Bounce.InOut';
2
+ type AnimationModeValueType = (amount: number) => number;
3
+ interface AnimationOptions {
4
+ duration?: number;
5
+ delay?: number;
6
+ repeat?: number | boolean;
7
+ mode?: AnimationModeType;
8
+ yoyo?: boolean;
9
+ }
10
+ export { AnimationModeType, AnimationModeValueType, AnimationOptions, };
@@ -0,0 +1,63 @@
1
+ import { ColorRepresentation, Object3D } from 'three';
2
+ interface Interpolate {
3
+ t: number;
4
+ }
5
+ interface IVector2 {
6
+ x: number;
7
+ y: number;
8
+ }
9
+ interface PlaneIVector2 {
10
+ x: number;
11
+ z: number;
12
+ }
13
+ interface IVector3 extends IVector2 {
14
+ z: number;
15
+ }
16
+ interface IVector3 extends IVector2 {
17
+ z: number;
18
+ }
19
+ type Position = IVector3;
20
+ type Rotation = IVector3;
21
+ type Scale = IVector3;
22
+ type IColor = ColorRepresentation;
23
+ interface Level {
24
+ max: number | null;
25
+ min: number | null;
26
+ }
27
+ interface OffsetPoint {
28
+ offsetX: number;
29
+ offsetY: number;
30
+ }
31
+ type FlyToViewpoint = 'current' | 'top' | 'bottom' | 'front' | 'back' | 'left' | 'right' | 'frontTop' | 'backTop' | 'leftTop' | 'rightTop' | 'leftFrontTop' | 'rightFrontTop' | 'leftBackTop' | 'rightBackTop';
32
+ type AxisType = 'x' | 'y' | 'z';
33
+ type SceneEventType = 'hover' | 'click' | 'rightClick' | 'dblClick';
34
+ type SceneEventTypeUppercase = 'Hover' | 'Click' | 'RightClick' | 'DblClick';
35
+ type PoiType = '2d' | '2D' | '2.5d' | '2.5D' | '3d' | '3D';
36
+ type PoiNodeType = PoiType;
37
+ interface BaseSelectOptions {
38
+ color?: IColor;
39
+ opacity?: number;
40
+ }
41
+ interface BaseObjectInfo {
42
+ id: string;
43
+ name?: string;
44
+ level?: Level;
45
+ visible?: boolean;
46
+ position?: Position;
47
+ rotation?: Rotation;
48
+ scale?: Scale;
49
+ userData?: any;
50
+ extraIds?: string[];
51
+ }
52
+ interface BaseObject3DInfo extends BaseObjectInfo {
53
+ onLoad?: ((object: Object3D) => void) | null;
54
+ onClick?: ((object: Object3D) => void) | null;
55
+ onDblClick?: ((object: Object3D) => void) | null;
56
+ onRightClick?: ((object: Object3D) => void) | null;
57
+ }
58
+ interface ScaleFixed {
59
+ originScale: number;
60
+ fixedScale: number;
61
+ distance: number;
62
+ }
63
+ export { Interpolate, IVector2, IVector3, Position, Rotation, Scale, IColor, PlaneIVector2, Level, OffsetPoint, FlyToViewpoint, AxisType, SceneEventType, SceneEventTypeUppercase, PoiType, PoiNodeType, BaseSelectOptions, BaseObject3DInfo, BaseObjectInfo, ScaleFixed, };
@@ -0,0 +1,94 @@
1
+ import { Object3D, Vector3 } from 'three';
2
+ export type FreeControlsType = 'free';
3
+ export type OrbitControlsType = 'orbit';
4
+ export type ControlsType = FreeControlsType | OrbitControlsType;
5
+ export interface FreeControlsOptions {
6
+ type: FreeControlsType;
7
+ enabled?: boolean;
8
+ enabledMousePointInteractive?: boolean;
9
+ fallbackInteractivePosition?: Vector3 | null;
10
+ enableZoom?: boolean;
11
+ zoomSpeed?: number;
12
+ zoomMinDistance?: number;
13
+ zoomMaxDistance?: number;
14
+ zoomMinStepDistance?: number;
15
+ zoomMaxStepDistance?: number;
16
+ enableRotate?: boolean;
17
+ enableRotateX?: boolean;
18
+ enableRotateY?: boolean;
19
+ rotateSpeed?: number;
20
+ rotateTiltRange?: {
21
+ max: number;
22
+ min: number;
23
+ };
24
+ enableAutoRotate?: boolean;
25
+ autoRotateSpeed?: number;
26
+ autoRotateClockwise?: boolean;
27
+ enableOutOfScene?: boolean;
28
+ unOffsetOfScene?: number;
29
+ enablePan?: boolean;
30
+ enablePanX?: boolean;
31
+ enablePanY?: boolean;
32
+ enablePanAxisX?: boolean;
33
+ enablePanAxisY?: boolean;
34
+ enablePanAxisZ?: boolean;
35
+ panSpeed?: number;
36
+ }
37
+ export type FreeControlsProperties = Required<Omit<FreeControlsOptions, 'type'>>;
38
+ export interface OrbitControlsOptions {
39
+ type: OrbitControlsType;
40
+ enableAutoRotate?: boolean;
41
+ autoRotateSpeed?: number;
42
+ dampingFactor?: number;
43
+ enabled?: boolean;
44
+ enableDamping?: boolean;
45
+ enablePan?: boolean;
46
+ enableRotate?: boolean;
47
+ enableZoom?: boolean;
48
+ maxAzimuthAngle?: number;
49
+ maxDistance?: number;
50
+ maxPolarAngle?: number;
51
+ maxZoom?: number;
52
+ minAzimuthAngle?: number;
53
+ minDistance?: number;
54
+ minPolarAngle?: number;
55
+ minZoom?: number;
56
+ panSpeed?: number;
57
+ rotateSpeed?: number;
58
+ screenSpacePanning?: boolean;
59
+ target?: Vector3;
60
+ zoomSpeed?: number;
61
+ }
62
+ export type OrbitControlsProperties = Required<Omit<OrbitControlsOptions, 'type'>>;
63
+ export interface ControlsOptions {
64
+ enabled?: boolean;
65
+ minDistance?: number;
66
+ maxDistance?: number;
67
+ minZoom?: number;
68
+ maxZoom?: number;
69
+ minPolarAngle?: number;
70
+ maxPolarAngle?: number;
71
+ minAzimuthAngle?: number;
72
+ maxAzimuthAngle?: number;
73
+ boundaryFriction?: number;
74
+ boundaryEnclosesCamera?: boolean;
75
+ smoothTime?: number;
76
+ draggingSmoothTime?: number;
77
+ azimuthRotateSpeed?: number;
78
+ polarRotateSpeed?: number;
79
+ dollySpeed?: number;
80
+ truckSpeed?: number;
81
+ maxSpeed?: number;
82
+ verticalDragToForward?: boolean;
83
+ dollyToCursor?: boolean;
84
+ dollyDragInverted?: boolean;
85
+ interactiveArea?: DOMRect | {
86
+ x: number;
87
+ y: number;
88
+ width: number;
89
+ height: number;
90
+ };
91
+ colliderMeshes?: Object3D[];
92
+ infinityDolly?: boolean;
93
+ restThreshold?: number;
94
+ }
@@ -0,0 +1,40 @@
1
+ import { Mesh, Intersection } from 'three';
2
+ import { Poi, Model } from '../Library';
3
+ import { Position, SceneEventType } from './base';
4
+ interface ScenePoiIntersect {
5
+ poi: Poi;
6
+ sourceData: Intersection;
7
+ }
8
+ interface SceneModelIntersect {
9
+ model: Model;
10
+ sourceData: Intersection;
11
+ }
12
+ interface ModelEventParams {
13
+ target: Model;
14
+ currentTarget: Mesh;
15
+ intersects: SceneModelIntersect[];
16
+ event: MouseEvent | TouchEvent;
17
+ }
18
+ interface PoiEventParams {
19
+ target: Poi;
20
+ event: MouseEvent | TouchEvent;
21
+ }
22
+ interface SceneClickParam {
23
+ type: SceneEventType;
24
+ event: MouseEvent | TouchEvent;
25
+ }
26
+ interface SceneGlobalEvents {
27
+ modelHover?: (param: ModelEventParams) => void;
28
+ modelUnHover?: (model: Model) => void;
29
+ modelClick?: (param: ModelEventParams) => void;
30
+ modelRightClick?: (param: ModelEventParams) => void;
31
+ modelDblClick?: (param: ModelEventParams) => void;
32
+ poiHover?: (poi: PoiEventParams) => void;
33
+ poiUnHover?: (poi: Poi) => void;
34
+ poiClick?: (poi: PoiEventParams) => void;
35
+ poiRightClick?: (poi: PoiEventParams) => void;
36
+ poiDblClick?: (poi: PoiEventParams) => void;
37
+ selectPosition?: (position: Position) => void;
38
+ sceneClick?: (param: SceneClickParam) => void;
39
+ }
40
+ export { ScenePoiIntersect, SceneModelIntersect, ModelEventParams, SceneClickParam, SceneGlobalEvents, };
@@ -0,0 +1,189 @@
1
+ interface State {
2
+ State: {
3
+ _attributes: {
4
+ 'gml:id': string;
5
+ serialid: string;
6
+ };
7
+ topoNode: {
8
+ 'gml:Node': {
9
+ _attributes: {
10
+ 'gml:id': string;
11
+ serialid: string;
12
+ };
13
+ 'gml:pointProperty': {
14
+ 'gml:Point': {
15
+ 'gml:Pos': string;
16
+ };
17
+ };
18
+ floor: {
19
+ _attributes: {
20
+ type: string;
21
+ };
22
+ '#text': string;
23
+ };
24
+ floor_name: {
25
+ _attributes: {
26
+ type: string;
27
+ };
28
+ '#text': string;
29
+ };
30
+ node_name: string;
31
+ type: {
32
+ _attributes: {
33
+ type: string;
34
+ };
35
+ '#text': string;
36
+ };
37
+ xcoord: {
38
+ _attributes: {
39
+ type: string;
40
+ };
41
+ '#text': string;
42
+ };
43
+ ycoord: {
44
+ _attributes: {
45
+ type: string;
46
+ };
47
+ '#text': string;
48
+ };
49
+ zcoord: {
50
+ _attributes: {
51
+ type: string;
52
+ };
53
+ '#text': string;
54
+ };
55
+ link_cnt: {
56
+ _attributes: {
57
+ type: string;
58
+ };
59
+ '#text': string;
60
+ };
61
+ adjacency_link: {
62
+ _attributes: {
63
+ type: string;
64
+ };
65
+ '#text': string;
66
+ };
67
+ };
68
+ };
69
+ };
70
+ }
71
+ interface Transition {
72
+ Transition: {
73
+ _attributes: {
74
+ 'gml:id': string;
75
+ serialid: string;
76
+ };
77
+ topoEdge: {
78
+ 'gml:Edge': {
79
+ 'gml:directedNode': {
80
+ _attributes: {
81
+ 'xlink:href': string;
82
+ };
83
+ }[];
84
+ 'gml:curveProperty': {
85
+ 'gml:LineString': {
86
+ 'gml:posList': string;
87
+ };
88
+ };
89
+ link_name: {
90
+ _attributes: {
91
+ type: string;
92
+ };
93
+ '#text': string;
94
+ };
95
+ snode: {
96
+ _attributes: {
97
+ type: string;
98
+ };
99
+ '#text': string;
100
+ };
101
+ enode: {
102
+ _attributes: {
103
+ type: string;
104
+ };
105
+ '#text': string;
106
+ };
107
+ length: {
108
+ _attributes: {
109
+ type: string;
110
+ };
111
+ '#text': string;
112
+ };
113
+ type: {
114
+ _attributes: {
115
+ type: string;
116
+ };
117
+ '#text': string;
118
+ };
119
+ move_type: {
120
+ _attributes: {
121
+ type: string;
122
+ };
123
+ '#text': string;
124
+ };
125
+ passable: {
126
+ _attributes: {
127
+ type: string;
128
+ };
129
+ '#text': string;
130
+ };
131
+ restrict: {
132
+ _attributes: {
133
+ type: string;
134
+ };
135
+ '#text': string;
136
+ };
137
+ Width: {
138
+ _attributes: {
139
+ type: string;
140
+ };
141
+ };
142
+ };
143
+ };
144
+ };
145
+ }
146
+ interface X_floor {
147
+ _attributes: {
148
+ id: string;
149
+ number: string;
150
+ level: string;
151
+ displayname: string;
152
+ index: string;
153
+ lefttop: string;
154
+ rightbottom: string;
155
+ };
156
+ state: State[];
157
+ transition: Transition[];
158
+ }
159
+ interface GmlJson {
160
+ MultiLayeredGraph: {
161
+ _attributes: {
162
+ version: string;
163
+ xmlns: string;
164
+ 'xmlns:gml': string;
165
+ 'xmlns:xlink': string;
166
+ 'xmlns:xsi': string;
167
+ 'xsi:schemaLocation': string;
168
+ };
169
+ X_definition: {
170
+ zcoord: {
171
+ apply_floorheight: string;
172
+ };
173
+ restrict: {
174
+ restrict_bit: string;
175
+ };
176
+ };
177
+ SpaceLayerMember: {
178
+ SpaceLayer: {
179
+ _attributes: {
180
+ northbound: string;
181
+ };
182
+ class: string;
183
+ 'gml:name': string;
184
+ X_floor: X_floor | X_floor[];
185
+ };
186
+ };
187
+ };
188
+ }
189
+ export { State, Transition, X_floor, GmlJson, };
@@ -0,0 +1,13 @@
1
+ export * from './base';
2
+ export * from './events';
3
+ export * from './animation';
4
+ export * from './modelAnimation';
5
+ export * from './manager';
6
+ export * from './plugin';
7
+ export * from './signals';
8
+ export * from './viewport';
9
+ export * from './controls';
10
+ export * from './sbmCache';
11
+ export * from './sbmXmlToJson';
12
+ export * from './gmlToJson';
13
+ export * from './poiMesh';